Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/cloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@executor/env": "workspace:*",
"@executor/execution": "workspace:*",
"@executor/host-mcp": "workspace:*",
"@executor/host-plugins": "workspace:*",
"@executor/plugin-google-discovery": "workspace:*",
"@executor/plugin-graphql": "workspace:*",
"@executor/plugin-mcp": "workspace:*",
Expand Down
27 changes: 5 additions & 22 deletions apps/cloud/src/api/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ import { Effect, Layer } from "effect";

import { CoreExecutorApi } from "@executor/api";
import { CoreHandlers } from "@executor/api/server";
import { OpenApiGroup, OpenApiHandlers } from "@executor/plugin-openapi/api";
import { McpGroup, McpHandlers } from "@executor/plugin-mcp/api";
import {
GoogleDiscoveryGroup,
GoogleDiscoveryHandlers,
} from "@executor/plugin-google-discovery/api";
import { GraphqlGroup, GraphqlHandlers } from "@executor/plugin-graphql/api";

import { OrgAuth } from "../auth/middleware";
import { OrgAuthLive, SessionAuthLive } from "../auth/middleware-live";
Expand All @@ -24,12 +17,9 @@ import { AutumnService } from "../services/autumn";
import { DbService } from "../services/db";
import { OrgHttpApi } from "../org/compose";
import { OrgHandlers } from "../org/handlers";
import { addCloudPluginGroups, CloudPluginHandlers } from "../server/plugin-registry";

const ProtectedCloudApi = CoreExecutorApi.add(OpenApiGroup)
.add(McpGroup)
.add(GoogleDiscoveryGroup)
.add(GraphqlGroup)
.middleware(OrgAuth);
const ProtectedCloudApi = addCloudPluginGroups(CoreExecutorApi).middleware(OrgAuth);

const DbLive = DbService.Live;
const UserStoreLive = UserStoreService.Live.pipe(Layer.provide(DbLive));
Expand All @@ -45,16 +35,9 @@ export const SharedServices = Layer.mergeAll(
export const RouterConfig = HttpRouter.setRouterConfig({ maxParamLength: 1000 });

export const ProtectedCloudApiLive = HttpApiBuilder.api(ProtectedCloudApi).pipe(
Layer.provide(
Layer.mergeAll(
CoreHandlers,
OpenApiHandlers,
McpHandlers,
GoogleDiscoveryHandlers,
GraphqlHandlers,
OrgAuthLive,
),
),
Layer.provide(CoreHandlers),
Layer.provide(CloudPluginHandlers),
Layer.provideMerge(OrgAuthLive),
);

const NonProtectedApiLive = HttpApiBuilder.api(NonProtectedApi).pipe(
Expand Down
10 changes: 2 additions & 8 deletions apps/cloud/src/api/protected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import { Effect, Layer } from "effect";
import { ExecutorService, ExecutionEngineService } from "@executor/api/server";
import { createExecutionEngine } from "@executor/execution";
import { makeDynamicWorkerExecutor } from "@executor/runtime-dynamic-worker";
import { OpenApiExtensionService } from "@executor/plugin-openapi/api";
import { McpExtensionService } from "@executor/plugin-mcp/api";
import { GoogleDiscoveryExtensionService } from "@executor/plugin-google-discovery/api";
import { GraphqlExtensionService } from "@executor/plugin-graphql/api";

import { UserStoreService } from "../auth/context";
import { WorkOSAuth } from "../auth/workos";
Expand All @@ -19,6 +15,7 @@ import { makeTrackExecutionUsage } from "./autumn";
import { HttpResponseError, isServerError, toErrorServerResponse } from "./error-response";
import { withExecutionUsageTracking } from "./execution-usage";
import { ProtectedCloudApiLive, RouterConfig, SharedServices } from "./layers";
import { createCloudPluginExtensions } from "../server/plugin-registry";

const lookupOrgForRequest = (request: HttpServerRequest.HttpServerRequest) =>
Effect.gen(function* () {
Expand Down Expand Up @@ -57,10 +54,7 @@ const createProtectedApp = (organizationId: string, organizationName: string) =>
const requestServices = Layer.mergeAll(
Layer.succeed(ExecutorService, executor),
Layer.succeed(ExecutionEngineService, engine),
Layer.succeed(OpenApiExtensionService, executor.openapi),
Layer.succeed(McpExtensionService, executor.mcp),
Layer.succeed(GoogleDiscoveryExtensionService, executor.googleDiscovery),
Layer.succeed(GraphqlExtensionService, executor.graphql),
createCloudPluginExtensions(executor),
);

return yield* HttpApiBuilder.httpApp.pipe(
Expand Down
6 changes: 6 additions & 0 deletions apps/cloud/src/plugin-catalog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { SecretProviderPlugin } from "@executor/react/plugins/secret-provider-plugin";
import { firstPartySourcePlugins } from "@executor/host-plugins/ui";

export const cloudSourcePlugins = firstPartySourcePlugins;

export const cloudSecretProviderPlugins = [] as const satisfies readonly SecretProviderPlugin[];
6 changes: 5 additions & 1 deletion apps/cloud/src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AuthProvider, useAuth } from "../web/auth";
import { LoginPage } from "../web/pages/login";
import { Shell } from "../web/shell";
import appCss from "@executor/react/globals.css?url";
import { cloudSecretProviderPlugins, cloudSourcePlugins } from "../plugin-catalog";

if (typeof window !== "undefined" && import.meta.env.VITE_PUBLIC_SENTRY_DSN) {
Sentry.init({
Expand Down Expand Up @@ -80,7 +81,10 @@ function AuthGate() {

return (
<AutumnProvider pathPrefix="/api/autumn">
<ExecutorProvider>
<ExecutorProvider
sourcePlugins={cloudSourcePlugins}
secretProviderPlugins={cloudSecretProviderPlugins}
>
<Shell />
<Toaster />
</ExecutorProvider>
Expand Down
13 changes: 1 addition & 12 deletions apps/cloud/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import { createFileRoute } from "@tanstack/react-router";
import { SourcesPage } from "@executor/react/pages/sources";
import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";

const sourcePlugins = [
openApiSourcePlugin,
mcpSourcePlugin,
googleDiscoverySourcePlugin,
graphqlSourcePlugin,
];

export const Route = createFileRoute("/")({
component: () => <SourcesPage sourcePlugins={sourcePlugins} />,
component: () => <SourcesPage />,
});
2 changes: 1 addition & 1 deletion apps/cloud/src/routes/secrets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { createFileRoute } from "@tanstack/react-router";
import { SecretsPage } from "@executor/react/pages/secrets";

export const Route = createFileRoute("/secrets")({
component: () => <SecretsPage secretProviderPlugins={[]} />,
component: () => <SecretsPage />,
});
13 changes: 1 addition & 12 deletions apps/cloud/src/routes/sources.$namespace.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
import { createFileRoute } from "@tanstack/react-router";
import { SourceDetailPage } from "@executor/react/pages/source-detail";
import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";

const sourcePlugins = [
openApiSourcePlugin,
mcpSourcePlugin,
googleDiscoverySourcePlugin,
graphqlSourcePlugin,
];

export const Route = createFileRoute("/sources/$namespace")({
component: () => {
const { namespace } = Route.useParams();
return <SourceDetailPage namespace={namespace} sourcePlugins={sourcePlugins} />;
return <SourceDetailPage namespace={namespace} />;
},
});
12 changes: 0 additions & 12 deletions apps/cloud/src/routes/sources.add.$pluginKey.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import { Schema } from "effect";
import { createFileRoute } from "@tanstack/react-router";
import { SourcesAddPage } from "@executor/react/pages/sources-add";
import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";

const sourcePlugins = [
openApiSourcePlugin,
mcpSourcePlugin,
googleDiscoverySourcePlugin,
graphqlSourcePlugin,
];

const SearchParams = Schema.standardSchemaV1(
Schema.Struct({
Expand All @@ -32,7 +21,6 @@ export const Route = createFileRoute("/sources/add/$pluginKey")({
url={url}
preset={preset}
namespace={namespace}
sourcePlugins={sourcePlugins}
/>
);
},
Expand Down
32 changes: 32 additions & 0 deletions apps/cloud/src/server/plugin-registry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {
addFirstPartyPluginGroups,
createFirstPartyPluginExtensions,
FirstPartyPluginHandlers,
} from "@executor/host-plugins/server";
import { googleDiscoveryPlugin, makeKvBindingStore as makeKvGoogleDiscoveryBindingStore } from "@executor/plugin-google-discovery";
import { graphqlPlugin, makeKvOperationStore as makeKvGraphqlOperationStore } from "@executor/plugin-graphql";
import { mcpPlugin, makeKvBindingStore } from "@executor/plugin-mcp";
import { openApiPlugin, makeKvOperationStore } from "@executor/plugin-openapi";
import type { Kv } from "@executor/sdk";

export const createCloudRuntimePlugins = (kv: Kv) =>
[
openApiPlugin({
operationStore: makeKvOperationStore(kv, "openapi"),
}),
mcpPlugin({
bindingStore: makeKvBindingStore(kv, "mcp"),
}),
googleDiscoveryPlugin({
bindingStore: makeKvGoogleDiscoveryBindingStore(kv, "google-discovery"),
}),
graphqlPlugin({
operationStore: makeKvGraphqlOperationStore(kv, "graphql"),
}),
] as const;

export const addCloudPluginGroups = addFirstPartyPluginGroups;

export const CloudPluginHandlers = FirstPartyPluginHandlers;

export const createCloudPluginExtensions = createFirstPartyPluginExtensions;
26 changes: 2 additions & 24 deletions apps/cloud/src/services/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,8 @@ import { Effect } from "effect";

import { createExecutor } from "@executor/sdk";
import { makePgConfig, makePgKv } from "@executor/storage-postgres";
import { openApiPlugin, makeKvOperationStore } from "@executor/plugin-openapi";
import { mcpPlugin, makeKvBindingStore } from "@executor/plugin-mcp";
import {
googleDiscoveryPlugin,
makeKvBindingStore as makeKvGoogleDiscoveryBindingStore,
} from "@executor/plugin-google-discovery";
import {
graphqlPlugin,
makeKvOperationStore as makeKvGraphqlOperationStore,
} from "@executor/plugin-graphql";
import { DbService } from "./db";
import { createCloudRuntimePlugins } from "../server/plugin-registry";

// ---------------------------------------------------------------------------
// Create a fresh executor for an organization (stateless, per-request)
Expand All @@ -34,20 +25,7 @@ export const createOrgExecutor = (
organizationId,
organizationName,
encryptionKey,
plugins: [
openApiPlugin({
operationStore: makeKvOperationStore(kv, "openapi"),
}),
mcpPlugin({
bindingStore: makeKvBindingStore(kv, "mcp"),
}),
googleDiscoveryPlugin({
bindingStore: makeKvGoogleDiscoveryBindingStore(kv, "google-discovery"),
}),
graphqlPlugin({
operationStore: makeKvGraphqlOperationStore(kv, "graphql"),
}),
] as const,
plugins: createCloudRuntimePlugins(kv),
});

return yield* createExecutor(config);
Expand Down
13 changes: 1 addition & 12 deletions apps/cloud/src/web/shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,9 @@ import { useScope } from "@executor/react/api/scope-context";
import { Button } from "@executor/react/components/button";
import { SourceFavicon } from "@executor/react/components/source-favicon";
import { CommandPalette } from "@executor/react/components/command-palette";
import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";
import { AUTH_PATHS } from "../auth/api";
import { useAuth } from "./auth";

const sourcePlugins = [
openApiSourcePlugin,
mcpSourcePlugin,
googleDiscoverySourcePlugin,
graphqlSourcePlugin,
];

// ── NavItem ──────────────────────────────────────────────────────────────

function NavItem(props: { to: string; label: string; active: boolean; onNavigate?: () => void }) {
Expand Down Expand Up @@ -206,7 +195,7 @@ export function Shell() {

return (
<div className="flex h-screen overflow-hidden">
<CommandPalette sourcePlugins={sourcePlugins} />
<CommandPalette />
{/* Desktop sidebar */}
<aside className="hidden w-52 shrink-0 border-r border-sidebar-border bg-sidebar md:flex md:flex-col lg:w-56">
<SidebarContent pathname={pathname} />
Expand Down
1 change: 1 addition & 0 deletions apps/local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@executor/config": "workspace:*",
"@executor/execution": "workspace:*",
"@executor/host-mcp": "workspace:*",
"@executor/host-plugins": "workspace:*",
"@executor/plugin-file-secrets": "workspace:*",
"@executor/plugin-google-discovery": "workspace:*",
"@executor/plugin-graphql": "workspace:*",
Expand Down
9 changes: 9 additions & 0 deletions apps/local/src/plugin-catalog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { SecretProviderPlugin } from "@executor/react/plugins/secret-provider-plugin";
import { firstPartySourcePlugins } from "@executor/host-plugins/ui";
import { onePasswordSecretProviderPlugin } from "@executor/plugin-onepassword/react";

export const localSourcePlugins = firstPartySourcePlugins;

export const localSecretProviderPlugins = [
onePasswordSecretProviderPlugin,
] as const satisfies readonly SecretProviderPlugin[];
6 changes: 5 additions & 1 deletion apps/local/src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import React from "react";
import { createRootRoute } from "@tanstack/react-router";
import { ExecutorProvider } from "@executor/react/api/provider";
import { Shell } from "../web/shell";
import { localSecretProviderPlugins, localSourcePlugins } from "../plugin-catalog";

export const Route = createRootRoute({
component: RootComponent,
});

function RootComponent() {
return (
<ExecutorProvider>
<ExecutorProvider
sourcePlugins={localSourcePlugins}
secretProviderPlugins={localSecretProviderPlugins}
>
<Shell />
</ExecutorProvider>
);
Expand Down
13 changes: 1 addition & 12 deletions apps/local/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import { createFileRoute } from "@tanstack/react-router";
import { SourcesPage } from "@executor/react/pages/sources";
import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";

const sourcePlugins = [
openApiSourcePlugin,
mcpSourcePlugin,
googleDiscoverySourcePlugin,
graphqlSourcePlugin,
];

export const Route = createFileRoute("/")({
component: () => <SourcesPage sourcePlugins={sourcePlugins} />,
component: () => <SourcesPage />,
});
5 changes: 1 addition & 4 deletions apps/local/src/routes/secrets.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { createFileRoute } from "@tanstack/react-router";
import { SecretsPage } from "@executor/react/pages/secrets";
import { onePasswordSecretProviderPlugin } from "@executor/plugin-onepassword/react";

const secretProviderPlugins = [onePasswordSecretProviderPlugin];

export const Route = createFileRoute("/secrets")({
component: () => <SecretsPage secretProviderPlugins={secretProviderPlugins} />,
component: () => <SecretsPage />,
});
13 changes: 1 addition & 12 deletions apps/local/src/routes/sources.$namespace.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
import { createFileRoute } from "@tanstack/react-router";
import { SourceDetailPage } from "@executor/react/pages/source-detail";
import { openApiSourcePlugin } from "@executor/plugin-openapi/react";
import { mcpSourcePlugin } from "@executor/plugin-mcp/react";
import { googleDiscoverySourcePlugin } from "@executor/plugin-google-discovery/react";
import { graphqlSourcePlugin } from "@executor/plugin-graphql/react";

const sourcePlugins = [
openApiSourcePlugin,
mcpSourcePlugin,
googleDiscoverySourcePlugin,
graphqlSourcePlugin,
];

export const Route = createFileRoute("/sources/$namespace")({
component: () => {
const { namespace } = Route.useParams();
return <SourceDetailPage namespace={namespace} sourcePlugins={sourcePlugins} />;
return <SourceDetailPage namespace={namespace} />;
},
});
Loading
Loading