Unified · Split
| @@ -183,10 +183,14 @@ bun run typecheck:executor · 182 unmodified lines | ||
| 183 | 183 | ```text |
| 184 | 184 | executor/ |
| 185 | 185 | |- apps/web/ # Next.js operator UI |
| 186 | +| `- src/components/{approvals,dashboard,organization,tasks,tools,ui} | |
| 186 | 187 | |- packages/convex/ # Convex functions, schema, auth, HTTP routes |
| 188 | +| `- runtime/ # task execution/runtime internals | |
| 187 | 189 | |- packages/runner-sandbox-host/ # Cloudflare worker sandbox runtime |
| 188 | 190 | |- packages/core/src/ # shared executor runtime/tooling core package code |
| 189 | −|- scripts/build-release.ts # release artifact builder | |
| 191 | +|- scripts/dev/ # local/dev-only helpers | |
| 192 | +|- scripts/prod/ # production setup and deploy scripts | |
| 193 | +|- scripts/release/ # release artifact builder | |
| 190 | 194 | |- executor.ts # CLI entrypoint (compiled into binary) |
| 191 | 195 | |- install # curl install script |
| 192 | 196 | `- uninstall # uninstall script |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -4,7 +4,7 @@ import { ArrowRight, ChevronRight, Globe, Server, Wrench } from "lucide-react"; · 3 unmodified lines | ||
| 4 | 4 | import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; |
| 5 | 5 | import { Button } from "@/components/ui/button"; |
| 6 | 6 | import type { ToolDescriptor } from "@/lib/types"; |
| 7 | −import { groupToolsBySource } from "@/components/dashboard-view-helpers"; | |
| 7 | +import { groupToolsBySource } from "@/components/dashboard/view-helpers"; | |
| 8 | 8 | |
| 9 | 9 | export function DashboardToolsSummaryCard({ tools }: { tools: ToolDescriptor[] }) { |
| 10 | 10 | const navigate = useNavigate(); |
File renamed without changes.
| @@ -3,11 +3,11 @@ · 2 unmodified lines | ||
| 3 | 3 | import { CheckCircle2, Play, ShieldCheck, XCircle } from "lucide-react"; |
| 4 | 4 | import { Skeleton } from "@/components/ui/skeleton"; |
| 5 | 5 | import { PageHeader } from "@/components/page-header"; |
| 6 | −import { DashboardSetupCard } from "@/components/dashboard-setup-card"; | |
| 7 | −import { DashboardStatCard } from "@/components/dashboard-stat-card"; | |
| 8 | −import { DashboardPendingApprovalsCard } from "@/components/dashboard-pending-approvals-card"; | |
| 9 | −import { DashboardRecentTasksCard } from "@/components/dashboard-recent-tasks-card"; | |
| 10 | −import { DashboardToolsSummaryCard } from "@/components/dashboard-tools-summary-card"; | |
| 6 | +import { DashboardSetupCard } from "@/components/dashboard/setup-card"; | |
| 7 | +import { DashboardStatCard } from "@/components/dashboard/stat-card"; | |
| 8 | +import { DashboardPendingApprovalsCard } from "@/components/dashboard/pending-approvals-card"; | |
| 9 | +import { DashboardRecentTasksCard } from "@/components/dashboard/recent-tasks-card"; | |
| 10 | +import { DashboardToolsSummaryCard } from "@/components/dashboard/tools-summary-card"; | |
| 11 | 11 | import { useSession } from "@/lib/session-context"; |
| 12 | 12 | import { useWorkspaceTools } from "@/hooks/use-workspace-tools"; |
| 13 | 13 | import { useQuery } from "convex/react"; |
| @@ -17,7 +17,7 @@ import { · 3 unmodified lines | ||
| 17 | 17 | getRecentTasks, |
| 18 | 18 | getSetupSteps, |
| 19 | 19 | getTaskStats, |
| 20 | −} from "@/components/dashboard-view-helpers"; | |
| 20 | +} from "@/components/dashboard/view-helpers"; | |
| 21 | 21 | import { workspaceQueryArgs } from "@/lib/workspace-query-args"; |
| 22 | 22 | |
| 23 | 23 | export function DashboardView() { |
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -3,8 +3,8 @@ · 2 unmodified lines | ||
| 3 | 3 | import { useMemo } from "react"; |
| 4 | 4 | import { useLocation, useNavigate, useSearchParams } from "react-router"; |
| 5 | 5 | import { CreditCard, Users } from "lucide-react"; |
| 6 | −import { BillingView } from "@/components/billing-view"; | |
| 7 | −import { MembersView } from "@/components/members-view"; | |
| 6 | +import { BillingView } from "@/components/organization/billing-view"; | |
| 7 | +import { MembersView } from "@/components/organization/members-view"; | |
| 8 | 8 | import { PageHeader } from "@/components/page-header"; |
| 9 | 9 | import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; |
| 10 | 10 | |
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -15,7 +15,7 @@ import { · 14 unmodified lines | ||
| 15 | 15 | SelectTrigger, |
| 16 | 16 | SelectValue, |
| 17 | 17 | } from "@/components/ui/select"; |
| 18 | −import { CodeEditor } from "@/components/code-editor"; | |
| 18 | +import { CodeEditor } from "@/components/tasks/code-editor"; | |
| 19 | 19 | import { convexApi } from "@/lib/convex-api"; |
| 20 | 20 | import { useSession } from "@/lib/session-context"; |
| 21 | 21 | import type { RuntimeTargetDescriptor } from "@/lib/types"; |
File renamed without changes.
File renamed without changes.
| @@ -8,9 +8,9 @@ import { Button } from "@/components/ui/button"; · 7 unmodified lines | ||
| 8 | 8 | import { Skeleton } from "@/components/ui/skeleton"; |
| 9 | 9 | import { PageHeader } from "@/components/page-header"; |
| 10 | 10 | import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; |
| 11 | −import { TaskDetail } from "@/components/task-detail"; | |
| 12 | −import { TaskComposer } from "@/components/task-composer"; | |
| 13 | −import { TaskListItem } from "@/components/task-list-item"; | |
| 11 | +import { TaskDetail } from "@/components/tasks/task-detail"; | |
| 12 | +import { TaskComposer } from "@/components/tasks/task-composer"; | |
| 13 | +import { TaskListItem } from "@/components/tasks/task-list-item"; | |
| 14 | 14 | import { useSession } from "@/lib/session-context"; |
| 15 | 15 | import { useQuery } from "convex/react"; |
| 16 | 16 | import { convexApi } from "@/lib/convex-api"; |
| @@ -1,2 +0,0 @@ | ||
| 1 | −export { AddSourceDialog } from "./tools-view-add-source-dialog"; | |
| 2 | −export { SourceCard } from "./tools-view-source-card"; | |
File renamed without changes.
| @@ -18,7 +18,7 @@ import { · 17 unmodified lines | ||
| 18 | 18 | endpointPlaceholderForType, |
| 19 | 19 | type SourceCatalogSort, |
| 20 | 20 | type SourceType, |
| 21 | −} from "./tools-view-add-source-dialog-helpers"; | |
| 21 | +} from "./add-source-dialog-helpers"; | |
| 22 | 22 | |
| 23 | 23 | export function CatalogViewSection({ |
| 24 | 24 | catalogQuery, |
| @@ -29,11 +29,11 @@ import { · 28 unmodified lines | ||
| 29 | 29 | getVisibleCatalogItems, |
| 30 | 30 | type SourceCatalogSort, |
| 31 | 31 | type SourceType, |
| 32 | −} from "./tools-view-add-source-dialog-helpers"; | |
| 32 | +} from "./add-source-dialog-helpers"; | |
| 33 | 33 | import { |
| 34 | 34 | CatalogViewSection, |
| 35 | 35 | CustomViewSection, |
| 36 | −} from "./tools-view-add-source-dialog-sections"; | |
| 36 | +} from "./add-source-dialog-sections"; | |
| 37 | 37 | |
| 38 | 38 | export function AddSourceDialog({ |
| 39 | 39 | existingSourceNames, |
| @@ -3,7 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | import { Input } from "@/components/ui/input"; |
| 4 | 4 | import { Label } from "@/components/ui/label"; |
| 5 | 5 | import type { SourceAuthType } from "@/lib/types"; |
| 6 | −import type { ConnectionMode } from "./tools-view-connection-form-dialog-state"; | |
| 6 | +import type { ConnectionMode } from "./connection-form-dialog-state"; | |
| 7 | 7 | |
| 8 | 8 | type SelectedAuth = { |
| 9 | 9 | type: SourceAuthType; |
| @@ -15,7 +15,7 @@ import { · 14 unmodified lines | ||
| 15 | 15 | compatibleConnections, |
| 16 | 16 | selectedAuthBadge, |
| 17 | 17 | type ConnectionMode, |
| 18 | −} from "./tools-view-connection-form-dialog-state"; | |
| 18 | +} from "./connection-form-dialog-state"; | |
| 19 | 19 | |
| 20 | 20 | type UseConnectionFormDialogFormParams = { |
| 21 | 21 | open: boolean; |
File renamed without changes.
| @@ -33,14 +33,14 @@ import { · 32 unmodified lines | ||
| 33 | 33 | connectionDisplayName, |
| 34 | 34 | parseHeaderOverrides, |
| 35 | 35 | } from "@/lib/credentials-source-helpers"; |
| 36 | −import { ConnectionAuthFields } from "./tools-view-connection-auth-fields"; | |
| 37 | −import { type ConnectionMode } from "./tools-view-connection-form-dialog-state"; | |
| 38 | −import { useConnectionFormDialogForm } from "./tools-view-connection-form-dialog-form"; | |
| 36 | +import { ConnectionAuthFields } from "./connection-auth-fields"; | |
| 37 | +import { type ConnectionMode } from "./connection-form-dialog-state"; | |
| 38 | +import { useConnectionFormDialogForm } from "./connection-form-dialog-form"; | |
| 39 | 39 | import { |
| 40 | 40 | buildSecretJson, |
| 41 | 41 | connectionSubmitCopy, |
| 42 | 42 | connectionSuccessCopy, |
| 43 | −} from "./tools-view-connection-form-save"; | |
| 43 | +} from "./connection-form-save"; | |
| 44 | 44 | |
| 45 | 45 | export function ConnectionFormDialog({ |
| 46 | 46 | open, |
File renamed without changes.
| @@ -22,7 +22,7 @@ import { · 21 unmodified lines | ||
| 22 | 22 | getSourceFavicon, |
| 23 | 23 | sourceForCredentialKey, |
| 24 | 24 | } from "@/lib/tools-source-helpers"; |
| 25 | −import { ConnectionFormDialog } from "@/components/tools-view-connection-form-dialog"; | |
| 25 | +import { ConnectionFormDialog } from "@/components/tools/connection-form-dialog"; | |
| 26 | 26 | |
| 27 | 27 | export function CredentialsPanel({ |
| 28 | 28 | sources, |
File renamed without changes.
| @@ -7,7 +7,7 @@ import { · 6 unmodified lines | ||
| 7 | 7 | } from "@/lib/tool-explorer-grouping"; |
| 8 | 8 | import { sourceLabel } from "@/lib/tool-source-utils"; |
| 9 | 9 | import type { ToolDescriptor } from "@/lib/types"; |
| 10 | −import type { GroupBy, ViewMode } from "./tool-explorer-toolbar"; | |
| 10 | +import type { GroupBy, ViewMode } from "./explorer-toolbar"; | |
| 11 | 11 | |
| 12 | 12 | export type FilterApproval = "all" | "required" | "auto"; |
| 13 | 13 | |
| @@ -19,7 +19,7 @@ import { cn } from "@/lib/utils"; · 18 unmodified lines | ||
| 19 | 19 | import { sourceLabel, sourceType } from "@/lib/tool-source-utils"; |
| 20 | 20 | import { toolOperation, type ToolGroup } from "@/lib/tool-explorer-grouping"; |
| 21 | 21 | import type { ToolDescriptor } from "@/lib/types"; |
| 22 | −import { SelectableToolRow } from "./tool-explorer-rows"; | |
| 22 | +import { SelectableToolRow } from "./explorer-rows"; | |
| 23 | 23 | |
| 24 | 24 | export function GroupNode({ |
| 25 | 25 | group, |
File renamed without changes.
File renamed without changes.
| @@ -12,8 +12,8 @@ import { · 11 unmodified lines | ||
| 12 | 12 | import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; |
| 13 | 13 | import { cn } from "@/lib/utils"; |
| 14 | 14 | import type { ToolDescriptor } from "@/lib/types"; |
| 15 | −import { CopyButton } from "./tool-explorer-copy-button"; | |
| 16 | −import { ToolDetail } from "./tool-explorer-tool-detail"; | |
| 15 | +import { CopyButton } from "./explorer-copy-button"; | |
| 16 | +import { ToolDetail } from "./explorer-tool-detail"; | |
| 17 | 17 | |
| 18 | 18 | const ToolRow = memo(function ToolRow({ |
| 19 | 19 | tool, |
| @@ -3,7 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | import { Streamdown } from "streamdown"; |
| 4 | 4 | import { createCodePlugin } from "@streamdown/code"; |
| 5 | 5 | import type { ToolDescriptor } from "@/lib/types"; |
| 6 | −import { TypeSignature } from "./tool-explorer-type-signature"; | |
| 6 | +import { TypeSignature } from "./explorer-type-signature"; | |
| 7 | 7 | |
| 8 | 8 | const codePlugin = createCodePlugin({ |
| 9 | 9 | themes: ["github-light", "github-dark"], |
File renamed without changes.
File renamed without changes.
| @@ -6,7 +6,7 @@ import { · 5 unmodified lines | ||
| 6 | 6 | collectGroupKeys, |
| 7 | 7 | } from "@/lib/tool-explorer-grouping"; |
| 8 | 8 | import type { ToolDescriptor, ToolSourceRecord } from "@/lib/types"; |
| 9 | −import { findToolsInGroupByKey } from "./tool-explorer-helpers"; | |
| 9 | +import { findToolsInGroupByKey } from "./explorer-helpers"; | |
| 10 | 10 | import { |
| 11 | 11 | autoExpandedKeysForSearch, |
| 12 | 12 | countSelectedTools, |
| @@ -17,18 +17,18 @@ import { · 4 unmodified lines | ||
| 17 | 17 | sourceOptionsFromTools, |
| 18 | 18 | treeGroupsForView, |
| 19 | 19 | type FilterApproval, |
| 20 | −} from "./tool-explorer-derived"; | |
| 21 | −import { ToolExplorerLoading } from "./tool-explorer-loading"; | |
| 20 | +} from "./explorer-derived"; | |
| 21 | +import { ToolExplorerLoading } from "./explorer-loading"; | |
| 22 | 22 | import { |
| 23 | 23 | EmptyState, |
| 24 | 24 | VirtualFlatList, |
| 25 | −} from "./tool-explorer-rows"; | |
| 26 | −import { GroupNode, SourceSidebar } from "./tool-explorer-groups"; | |
| 25 | +} from "./explorer-rows"; | |
| 26 | +import { GroupNode, SourceSidebar } from "./explorer-groups"; | |
| 27 | 27 | import { |
| 28 | 28 | ToolExplorerToolbar, |
| 29 | 29 | type GroupBy, |
| 30 | 30 | type ViewMode, |
| 31 | −} from "./tool-explorer-toolbar"; | |
| 31 | +} from "./explorer-toolbar"; | |
| 32 | 32 | |
| 33 | 33 | // ── Main Explorer ── |
| 34 | 34 | |
File renamed without changes.
| @@ -13,7 +13,7 @@ import { · 12 unmodified lines | ||
| 13 | 13 | SelectTrigger, |
| 14 | 14 | SelectValue, |
| 15 | 15 | } from "@/components/ui/select"; |
| 16 | −import { MCP_PROVIDERS } from "@/components/mcp-install-configs"; | |
| 16 | +import { MCP_PROVIDERS } from "@/components/tools/install-configs"; | |
| 17 | 17 | |
| 18 | 18 | function inferServerName(workspaceId?: string): string { |
| 19 | 19 | if (!workspaceId) return "executor"; |
File renamed without changes.
| @@ -24,11 +24,11 @@ import { · 23 unmodified lines | ||
| 24 | 24 | sourceEndpointLabel, |
| 25 | 25 | sourceKeyForSource, |
| 26 | 26 | } from "@/lib/tools-source-helpers"; |
| 27 | −import { ConfigureSourceAuthDialog } from "./tools-view-source-auth-dialog"; | |
| 27 | +import { ConfigureSourceAuthDialog } from "./source-auth-dialog"; | |
| 28 | 28 | import { |
| 29 | 29 | OpenApiQualityDetails, |
| 30 | 30 | SourceQualitySummary, |
| 31 | −} from "./tools-view-source-quality-details"; | |
| 31 | +} from "./source-quality-details"; | |
| 32 | 32 | |
| 33 | 33 | export function SourceCard({ |
| 34 | 34 | source, |
File renamed without changes.
| @@ -0,0 +1,2 @@ | ||
| 1 | +export { AddSourceDialog } from "./add-source-dialog"; | |
| 2 | +export { SourceCard } from "./source-card"; | |
| @@ -10,10 +10,10 @@ import { Button } from "@/components/ui/button"; · 9 unmodified lines | ||
| 10 | 10 | import { Skeleton } from "@/components/ui/skeleton"; |
| 11 | 11 | import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; |
| 12 | 12 | import { PageHeader } from "@/components/page-header"; |
| 13 | −import { McpSetupCard } from "@/components/mcp-setup-card"; | |
| 14 | −import { ToolExplorer } from "@/components/tool-explorer"; | |
| 15 | −import { AddSourceDialog, SourceCard } from "@/components/tools-view-sources"; | |
| 16 | −import { CredentialsPanel } from "@/components/tools-view-credentials"; | |
| 13 | +import { McpSetupCard } from "@/components/tools/setup-card"; | |
| 14 | +import { ToolExplorer } from "@/components/tools/explorer"; | |
| 15 | +import { AddSourceDialog, SourceCard } from "@/components/tools/sources"; | |
| 16 | +import { CredentialsPanel } from "@/components/tools/credentials"; | |
| 17 | 17 | import { useSession } from "@/lib/session-context"; |
| 18 | 18 | import { useWorkspaceTools } from "@/hooks/use-workspace-tools"; |
| 19 | 19 | import { useQuery } from "convex/react"; |
| @@ -2,12 +2,12 @@ · 1 unmodified line | ||
| 2 | 2 | |
| 3 | 3 | import { Navigate, Outlet, Route, Routes, BrowserRouter, useSearchParams } from "react-router"; |
| 4 | 4 | import { AppShell } from "@/components/app-shell"; |
| 5 | −import { ApprovalsView } from "@/components/approvals-view"; | |
| 6 | −import { DashboardView } from "@/components/dashboard-view"; | |
| 7 | −import { OnboardingView } from "@/components/onboarding-view"; | |
| 8 | −import { OrganizationSettingsView } from "@/components/organization-settings-view"; | |
| 9 | −import { TasksView } from "@/components/tasks-view"; | |
| 10 | −import { ToolsView } from "@/components/tools-view"; | |
| 5 | +import { ApprovalsView } from "@/components/approvals/approvals-view"; | |
| 6 | +import { DashboardView } from "@/components/dashboard/view"; | |
| 7 | +import { OnboardingView } from "@/components/organization/onboarding-view"; | |
| 8 | +import { OrganizationSettingsView } from "@/components/organization/organization-settings-view"; | |
| 9 | +import { TasksView } from "@/components/tasks/tasks-view"; | |
| 10 | +import { ToolsView } from "@/components/tools/view"; | |
| 11 | 11 | |
| 12 | 12 | function ToolsRoute() { |
| 13 | 13 | const [searchParams] = useSearchParams(); |
| @@ -9,10 +9,10 @@ · 8 unmodified lines | ||
| 9 | 9 | "private": true, |
| 10 | 10 | "scripts": { |
| 11 | 11 | "doctor": "bun run executor.ts doctor", |
| 12 | − "doctor:prod": "bun run scripts/doctor-prod.ts", | |
| 13 | − "deploy:prod": "bun run scripts/deploy-prod.ts", | |
| 14 | − "setup:prod:env": "bun run scripts/setup-prod-env.ts --from-env", | |
| 15 | − "setup:prod:cloudflare": "bun run scripts/setup-prod-cloudflare.ts", | |
| 12 | + "doctor:prod": "bun run scripts/prod/doctor-prod.ts", | |
| 13 | + "deploy:prod": "bun run scripts/prod/deploy-prod.ts", | |
| 14 | + "setup:prod:env": "bun run scripts/prod/setup-prod-env.ts --from-env", | |
| 15 | + "setup:prod:cloudflare": "bun run scripts/prod/setup-prod-cloudflare.ts", | |
| 16 | 16 | "setup:prod:all": "bun run setup:prod:cloudflare --deploy && bun run setup:prod:env && bun run doctor:prod", |
| 17 | 17 | "iac:install": "bun install --cwd infra", |
| 18 | 18 | "iac:deploy": "bun run --cwd infra deploy", |
| @@ -25,7 +25,7 @@ · 6 unmodified lines | ||
| 25 | 25 | "deploy": "bunx convex deploy", |
| 26 | 26 | "codegen": "bunx convex codegen", |
| 27 | 27 | "build:binary": "bun build executor.ts --compile --outfile dist/executor", |
| 28 | − "build:release": "bun run scripts/build-release.ts" | |
| 28 | + "build:release": "bun run scripts/release/build-release.ts" | |
| 29 | 29 | }, |
| 30 | 30 | "type": "module" |
| 31 | 31 | } |
| @@ -854,6 +854,320 @@ export declare const internal: { · 853 unmodified lines | ||
| 854 | 854 | any |
| 855 | 855 | >; |
| 856 | 856 | }; |
| 857 | + database_anonymous_session: { | |
| 858 | + bootstrapAnonymousSession: FunctionReference< | |
| 859 | + "mutation", | |
| 860 | + "internal", | |
| 861 | + { sessionId?: string }, | |
| 862 | + any | |
| 863 | + >; | |
| 864 | + }; | |
| 865 | + database_approvals: { | |
| 866 | + createApproval: FunctionReference< | |
| 867 | + "mutation", | |
| 868 | + "internal", | |
| 869 | + { id: string; input?: any; taskId: string; toolPath: string }, | |
| 870 | + any | |
| 871 | + >; | |
| 872 | + getApproval: FunctionReference< | |
| 873 | + "query", | |
| 874 | + "internal", | |
| 875 | + { approvalId: string }, | |
| 876 | + any | |
| 877 | + >; | |
| 878 | + getApprovalInWorkspace: FunctionReference< | |
| 879 | + "query", | |
| 880 | + "internal", | |
| 881 | + { approvalId: string; workspaceId: Id<"workspaces"> }, | |
| 882 | + any | |
| 883 | + >; | |
| 884 | + listApprovals: FunctionReference< | |
| 885 | + "query", | |
| 886 | + "internal", | |
| 887 | + { | |
| 888 | + status?: "pending" | "approved" | "denied"; | |
| 889 | + workspaceId: Id<"workspaces">; | |
| 890 | + }, | |
| 891 | + any | |
| 892 | + >; | |
| 893 | + listPendingApprovals: FunctionReference< | |
| 894 | + "query", | |
| 895 | + "internal", | |
| 896 | + { workspaceId: Id<"workspaces"> }, | |
| 897 | + any | |
| 898 | + >; | |
| 899 | + resolveApproval: FunctionReference< | |
| 900 | + "mutation", | |
| 901 | + "internal", | |
| 902 | + { | |
| 903 | + approvalId: string; | |
| 904 | + decision: "approved" | "denied"; | |
| 905 | + reason?: string; | |
| 906 | + reviewerId?: string; | |
| 907 | + }, | |
| 908 | + any | |
| 909 | + >; | |
| 910 | + }; | |
| 911 | + database_credentials: { | |
| 912 | + listCredentialProviders: FunctionReference<"query", "internal", {}, any>; | |
| 913 | + listCredentials: FunctionReference< | |
| 914 | + "query", | |
| 915 | + "internal", | |
| 916 | + { workspaceId: Id<"workspaces"> }, | |
| 917 | + any | |
| 918 | + >; | |
| 919 | + resolveCredential: FunctionReference< | |
| 920 | + "query", | |
| 921 | + "internal", | |
| 922 | + { | |
| 923 | + actorId?: string; | |
| 924 | + scope: "workspace" | "actor"; | |
| 925 | + sourceKey: string; | |
| 926 | + workspaceId: Id<"workspaces">; | |
| 927 | + }, | |
| 928 | + any | |
| 929 | + >; | |
| 930 | + upsertCredential: FunctionReference< | |
| 931 | + "mutation", | |
| 932 | + "internal", | |
| 933 | + { | |
| 934 | + actorId?: string; | |
| 935 | + id?: string; | |
| 936 | + overridesJson?: any; | |
| 937 | + provider?: "local-convex" | "workos-vault"; | |
| 938 | + scope: "workspace" | "actor"; | |
| 939 | + secretJson: any; | |
| 940 | + sourceKey: string; | |
| 941 | + workspaceId: Id<"workspaces">; | |
| 942 | + }, | |
| 943 | + any | |
| 944 | + >; | |
| 945 | + }; | |
| 946 | + database_oauth: { | |
| 947 | + consumeAnonymousOauthAuthorizationCode: FunctionReference< | |
| 948 | + "mutation", | |
| 949 | + "internal", | |
| 950 | + { code: string }, | |
| 951 | + any | |
| 952 | + >; | |
| 953 | + countAnonymousOauthAuthorizationCodes: FunctionReference< | |
| 954 | + "query", | |
| 955 | + "internal", | |
| 956 | + {}, | |
| 957 | + any | |
| 958 | + >; | |
| 959 | + getActiveAnonymousOauthSigningKey: FunctionReference< | |
| 960 | + "query", | |
| 961 | + "internal", | |
| 962 | + {}, | |
| 963 | + any | |
| 964 | + >; | |
| 965 | + getAnonymousOauthClient: FunctionReference< | |
| 966 | + "query", | |
| 967 | + "internal", | |
| 968 | + { clientId: string }, | |
| 969 | + any | |
| 970 | + >; | |
| 971 | + purgeExpiredAnonymousOauthAuthorizationCodes: FunctionReference< | |
| 972 | + "mutation", | |
| 973 | + "internal", | |
| 974 | + { now: number }, | |
| 975 | + any | |
| 976 | + >; | |
| 977 | + registerAnonymousOauthClient: FunctionReference< | |
| 978 | + "mutation", | |
| 979 | + "internal", | |
| 980 | + { clientId: string; clientName?: string; redirectUris: Array<string> }, | |
| 981 | + any | |
| 982 | + >; | |
| 983 | + storeAnonymousOauthAuthorizationCode: FunctionReference< | |
| 984 | + "mutation", | |
| 985 | + "internal", | |
| 986 | + { | |
| 987 | + actorId: string; | |
| 988 | + clientId: string; | |
| 989 | + code: string; | |
| 990 | + codeChallenge: string; | |
| 991 | + codeChallengeMethod: string; | |
| 992 | + createdAt: number; | |
| 993 | + expiresAt: number; | |
| 994 | + redirectUri: string; | |
| 995 | + tokenClaims?: any; | |
| 996 | + }, | |
| 997 | + any | |
| 998 | + >; | |
| 999 | + storeAnonymousOauthSigningKey: FunctionReference< | |
| 1000 | + "mutation", | |
| 1001 | + "internal", | |
| 1002 | + { | |
| 1003 | + algorithm: string; | |
| 1004 | + keyId: string; | |
| 1005 | + privateKeyJwk: any; | |
| 1006 | + publicKeyJwk: any; | |
| 1007 | + }, | |
| 1008 | + any | |
| 1009 | + >; | |
| 1010 | + }; | |
| 1011 | + database_policies: { | |
| 1012 | + listAccessPolicies: FunctionReference< | |
| 1013 | + "query", | |
| 1014 | + "internal", | |
| 1015 | + { workspaceId: Id<"workspaces"> }, | |
| 1016 | + any | |
| 1017 | + >; | |
| 1018 | + listRuntimeTargets: FunctionReference<"query", "internal", {}, any>; | |
| 1019 | + upsertAccessPolicy: FunctionReference< | |
| 1020 | + "mutation", | |
| 1021 | + "internal", | |
| 1022 | + { | |
| 1023 | + actorId?: string; | |
| 1024 | + clientId?: string; | |
| 1025 | + decision: "allow" | "require_approval" | "deny"; | |
| 1026 | + id?: string; | |
| 1027 | + priority?: number; | |
| 1028 | + toolPathPattern: string; | |
| 1029 | + workspaceId: Id<"workspaces">; | |
| 1030 | + }, | |
| 1031 | + any | |
| 1032 | + >; | |
| 1033 | + }; | |
| 1034 | + database_task_events: { | |
| 1035 | + createTaskEvent: FunctionReference< | |
| 1036 | + "mutation", | |
| 1037 | + "internal", | |
| 1038 | + { eventName: string; payload: any; taskId: string; type: string }, | |
| 1039 | + any | |
| 1040 | + >; | |
| 1041 | + listTaskEvents: FunctionReference< | |
| 1042 | + "query", | |
| 1043 | + "internal", | |
| 1044 | + { taskId: string }, | |
| 1045 | + any | |
| 1046 | + >; | |
| 1047 | + }; | |
| 1048 | + database_tasks: { | |
| 1049 | + createTask: FunctionReference< | |
| 1050 | + "mutation", | |
| 1051 | + "internal", | |
| 1052 | + { | |
| 1053 | + actorId: string; | |
| 1054 | + clientId?: string; | |
| 1055 | + code: string; | |
| 1056 | + id: string; | |
| 1057 | + metadata?: any; | |
| 1058 | + runtimeId: string; | |
| 1059 | + timeoutMs?: number; | |
| 1060 | + workspaceId: Id<"workspaces">; | |
| 1061 | + }, | |
| 1062 | + any | |
| 1063 | + >; | |
| 1064 | + getTask: FunctionReference<"query", "internal", { taskId: string }, any>; | |
| 1065 | + getTaskInWorkspace: FunctionReference< | |
| 1066 | + "query", | |
| 1067 | + "internal", | |
| 1068 | + { taskId: string; workspaceId: Id<"workspaces"> }, | |
| 1069 | + any | |
| 1070 | + >; | |
| 1071 | + listQueuedTaskIds: FunctionReference< | |
| 1072 | + "query", | |
| 1073 | + "internal", | |
| 1074 | + { limit?: number }, | |
| 1075 | + any | |
| 1076 | + >; | |
| 1077 | + listTasks: FunctionReference< | |
| 1078 | + "query", | |
| 1079 | + "internal", | |
| 1080 | + { workspaceId: Id<"workspaces"> }, | |
| 1081 | + any | |
| 1082 | + >; | |
| 1083 | + markTaskFinished: FunctionReference< | |
| 1084 | + "mutation", | |
| 1085 | + "internal", | |
| 1086 | + { | |
| 1087 | + error?: string; | |
| 1088 | + exitCode?: number; | |
| 1089 | + result?: any; | |
| 1090 | + status: "completed" | "failed" | "timed_out" | "denied"; | |
| 1091 | + taskId: string; | |
| 1092 | + }, | |
| 1093 | + any | |
| 1094 | + >; | |
| 1095 | + markTaskRunning: FunctionReference< | |
| 1096 | + "mutation", | |
| 1097 | + "internal", | |
| 1098 | + { taskId: string }, | |
| 1099 | + any | |
| 1100 | + >; | |
| 1101 | + }; | |
| 1102 | + database_tool_calls: { | |
| 1103 | + finishToolCall: FunctionReference< | |
| 1104 | + "mutation", | |
| 1105 | + "internal", | |
| 1106 | + { | |
| 1107 | + callId: string; | |
| 1108 | + error?: string; | |
| 1109 | + status: "completed" | "failed" | "denied"; | |
| 1110 | + taskId: string; | |
| 1111 | + }, | |
| 1112 | + any | |
| 1113 | + >; | |
| 1114 | + getToolCall: FunctionReference< | |
| 1115 | + "query", | |
| 1116 | + "internal", | |
| 1117 | + { callId: string; taskId: string }, | |
| 1118 | + any | |
| 1119 | + >; | |
| 1120 | + listToolCalls: FunctionReference< | |
| 1121 | + "query", | |
| 1122 | + "internal", | |
| 1123 | + { taskId: string }, | |
| 1124 | + any | |
| 1125 | + >; | |
| 1126 | + setToolCallPendingApproval: FunctionReference< | |
| 1127 | + "mutation", | |
| 1128 | + "internal", | |
| 1129 | + { approvalId: string; callId: string; taskId: string }, | |
| 1130 | + any | |
| 1131 | + >; | |
| 1132 | + upsertToolCallRequested: FunctionReference< | |
| 1133 | + "mutation", | |
| 1134 | + "internal", | |
| 1135 | + { | |
| 1136 | + callId: string; | |
| 1137 | + taskId: string; | |
| 1138 | + toolPath: string; | |
| 1139 | + workspaceId: Id<"workspaces">; | |
| 1140 | + }, | |
| 1141 | + any | |
| 1142 | + >; | |
| 1143 | + }; | |
| 1144 | + database_tool_sources: { | |
| 1145 | + deleteToolSource: FunctionReference< | |
| 1146 | + "mutation", | |
| 1147 | + "internal", | |
| 1148 | + { sourceId: string; workspaceId: Id<"workspaces"> }, | |
| 1149 | + any | |
| 1150 | + >; | |
| 1151 | + listToolSources: FunctionReference< | |
| 1152 | + "query", | |
| 1153 | + "internal", | |
| 1154 | + { workspaceId: Id<"workspaces"> }, | |
| 1155 | + any | |
| 1156 | + >; | |
| 1157 | + upsertToolSource: FunctionReference< | |
| 1158 | + "mutation", | |
| 1159 | + "internal", | |
| 1160 | + { | |
| 1161 | + config: any; | |
| 1162 | + enabled?: boolean; | |
| 1163 | + id?: string; | |
| 1164 | + name: string; | |
| 1165 | + type: "mcp" | "openapi" | "graphql"; | |
| 1166 | + workspaceId: Id<"workspaces">; | |
| 1167 | + }, | |
| 1168 | + any | |
| 1169 | + >; | |
| 1170 | + }; | |
| 857 | 1171 | executor: { |
| 858 | 1172 | completeRuntimeRun: FunctionReference< |
| 859 | 1173 | "mutation", |
| @@ -2,8 +2,8 @@ import { AuthKit, type AuthFunctions } from "@convex-dev/workos-authkit"; · 1 unmodified line | ||
| 2 | 2 | import { components, internal } from "./_generated/api"; |
| 3 | 3 | import type { DataModel } from "./_generated/dataModel"; |
| 4 | 4 | import { internalMutation, mutation } from "./_generated/server"; |
| 5 | −import { bootstrapCurrentWorkosAccountImpl } from "./auth-bootstrap"; | |
| 6 | −import { workosEventHandlers } from "./auth-event-handlers"; | |
| 5 | +import { bootstrapCurrentWorkosAccountImpl } from "./auth/bootstrap"; | |
| 6 | +import { workosEventHandlers } from "./auth/event_handlers"; | |
| 7 | 7 | |
| 8 | 8 | const workosEnabled = Boolean( |
| 9 | 9 | process.env.WORKOS_CLIENT_ID && process.env.WORKOS_API_KEY && process.env.WORKOS_WEBHOOK_SECRET, |
| @@ -1,5 +1,5 @@ | ||
| 1 | −import { getAccountByWorkosId } from "./auth-db-queries"; | |
| 2 | −import type { DbCtx } from "./auth-types"; | |
| 1 | +import { getAccountByWorkosId } from "./db_queries"; | |
| 2 | +import type { DbCtx } from "./types"; | |
| 3 | 3 | |
| 4 | 4 | type UpsertWorkosAccountArgs = { |
| 5 | 5 | workosUserId: string; |
| @@ -1,15 +1,15 @@ | ||
| 1 | −import type { MutationCtx } from "./_generated/server"; | |
| 2 | −import { upsertWorkosAccount } from "./auth-accounts"; | |
| 3 | −import { getOrganizationByWorkosOrgId } from "./auth-db-queries"; | |
| 4 | −import { getAuthKitUserProfile, resolveIdentityProfile } from "./auth-identity"; | |
| 1 | +import type { MutationCtx } from "../_generated/server"; | |
| 2 | +import { upsertWorkosAccount } from "./accounts"; | |
| 3 | +import { getOrganizationByWorkosOrgId } from "./db_queries"; | |
| 4 | +import { getAuthKitUserProfile, resolveIdentityProfile } from "./identity"; | |
| 5 | 5 | import { |
| 6 | 6 | ensureWorkspaceMembership, |
| 7 | 7 | mapOrganizationRoleToWorkspaceRole, |
| 8 | 8 | markPendingInvitesAcceptedByEmail, |
| 9 | 9 | upsertOrganizationMembership, |
| 10 | −} from "./auth-memberships"; | |
| 11 | −import { ensurePersonalWorkspace, refreshGeneratedPersonalWorkspaceNames } from "./auth-personal-workspace"; | |
| 12 | −import type { AccountId } from "./auth-types"; | |
| 10 | +} from "./memberships"; | |
| 11 | +import { ensurePersonalWorkspace, refreshGeneratedPersonalWorkspaceNames } from "./personal_workspace"; | |
| 12 | +import type { AccountId } from "./types"; | |
| 13 | 13 | |
| 14 | 14 | async function seedHintedOrganizationMembership( |
| 15 | 15 | ctx: MutationCtx, |
| @@ -1,5 +1,5 @@ | ||
| 1 | −import type { Doc } from "./_generated/dataModel"; | |
| 2 | −import type { AccountId, DbCtx, OrganizationId } from "./auth-types"; | |
| 1 | +import type { Doc } from "../_generated/dataModel"; | |
| 2 | +import type { AccountId, DbCtx, OrganizationId } from "./types"; | |
| 3 | 3 | |
| 4 | 4 | export async function getAccountByWorkosId(ctx: DbCtx, workosUserId: string) { |
| 5 | 5 | return await ctx.db |
| @@ -1,20 +1,20 @@ | ||
| 1 | 1 | import { type AuthKit } from "@convex-dev/workos-authkit"; |
| 2 | −import type { DataModel, Doc } from "./_generated/dataModel"; | |
| 3 | −import type { MutationCtx } from "./_generated/server"; | |
| 4 | −import { upsertWorkosAccount } from "./auth-accounts"; | |
| 2 | +import type { DataModel, Doc } from "../_generated/dataModel"; | |
| 3 | +import type { MutationCtx } from "../_generated/server"; | |
| 4 | +import { upsertWorkosAccount } from "./accounts"; | |
| 5 | 5 | import { |
| 6 | 6 | getAccountByWorkosId, |
| 7 | 7 | getFirstWorkspaceByOrganizationId, |
| 8 | 8 | getOrganizationByWorkosOrgId, |
| 9 | 9 | getWorkspaceByWorkosOrgId, |
| 10 | −} from "./auth-db-queries"; | |
| 10 | +} from "./db_queries"; | |
| 11 | 11 | import { |
| 12 | 12 | deriveOrganizationMembershipState, |
| 13 | 13 | deriveWorkspaceMembershipRole, |
| 14 | 14 | markPendingInvitesAcceptedByEmail, |
| 15 | 15 | upsertOrganizationMembership, |
| 16 | −} from "./auth-memberships"; | |
| 17 | −import { ensureUniqueOrganizationSlug } from "./auth-naming"; | |
| 16 | +} from "./memberships"; | |
| 17 | +import { ensureUniqueOrganizationSlug } from "./naming"; | |
| 18 | 18 | |
| 19 | 19 | type WorkosMembershipEventData = { |
| 20 | 20 | id: string; |
| @@ -1,5 +1,5 @@ | ||
| 1 | −import { components } from "./_generated/api"; | |
| 2 | −import type { RunQueryCtx } from "./auth-types"; | |
| 1 | +import { components } from "../_generated/api"; | |
| 2 | +import type { RunQueryCtx } from "./types"; | |
| 3 | 3 | |
| 4 | 4 | type WorkosProfile = { |
| 5 | 5 | email?: string; |
| @@ -1,4 +1,4 @@ | ||
| 1 | −import type { Doc } from "./_generated/dataModel"; | |
| 1 | +import type { Doc } from "../_generated/dataModel"; | |
| 2 | 2 | import type { |
| 3 | 3 | AccountId, |
| 4 | 4 | DbCtx, |
| @@ -7,7 +7,7 @@ import type { · 2 unmodified lines | ||
| 7 | 7 | OrganizationRole, |
| 8 | 8 | WorkspaceId, |
| 9 | 9 | WorkspaceMemberRole, |
| 10 | −} from "./auth-types"; | |
| 10 | +} from "./types"; | |
| 11 | 11 | |
| 12 | 12 | export function mapOrganizationRoleToWorkspaceRole(role: OrganizationRole): WorkspaceMemberRole { |
| 13 | 13 | if (role === "owner") { |
| @@ -1,6 +1,6 @@ | ||
| 1 | −import { slugify } from "../core/src/identity"; | |
| 2 | −import { ensureUniqueSlug } from "../core/src/slug"; | |
| 3 | −import type { DbCtx } from "./auth-types"; | |
| 1 | +import { slugify } from "../../core/src/identity"; | |
| 2 | +import { ensureUniqueSlug } from "../../core/src/slug"; | |
| 3 | +import type { DbCtx } from "./types"; | |
| 4 | 4 | |
| 5 | 5 | function titleCaseWords(input: string): string { |
| 6 | 6 | return input |
| @@ -1,13 +1,13 @@ | ||
| 1 | −import type { Id } from "./_generated/dataModel"; | |
| 2 | −import { upsertOrganizationMembership } from "./auth-memberships"; | |
| 1 | +import type { Id } from "../_generated/dataModel"; | |
| 2 | +import { upsertOrganizationMembership } from "./memberships"; | |
| 3 | 3 | import { |
| 4 | 4 | buildPersonalWorkspaceSlugSeed, |
| 5 | 5 | derivePersonalNames, |
| 6 | 6 | ensureUniqueOrganizationSlug, |
| 7 | 7 | isGeneratedPersonalOrganizationName, |
| 8 | 8 | isGeneratedPersonalWorkspaceName, |
| 9 | −} from "./auth-naming"; | |
| 10 | −import type { AccountId, DbCtx } from "./auth-types"; | |
| 9 | +} from "./naming"; | |
| 10 | +import type { AccountId, DbCtx } from "./types"; | |
| 11 | 11 | |
| 12 | 12 | type PersonalWorkspaceOptions = { |
| 13 | 13 | email: string; |
| @@ -1,5 +1,5 @@ | ||
| 1 | −import type { Doc, Id } from "./_generated/dataModel"; | |
| 2 | −import type { MutationCtx } from "./_generated/server"; | |
| 1 | +import type { Doc, Id } from "../_generated/dataModel"; | |
| 2 | +import type { MutationCtx } from "../_generated/server"; | |
| 3 | 3 | |
| 4 | 4 | export type DbCtx = Pick<MutationCtx, "db">; |
| 5 | 5 | export type RunQueryCtx = Pick<MutationCtx, "runQuery">; |
| @@ -6,7 +6,7 @@ export { · 5 unmodified lines | ||
| 6 | 6 | getTaskInWorkspace, |
| 7 | 7 | markTaskRunning, |
| 8 | 8 | markTaskFinished, |
| 9 | −} from "./database-tasks"; | |
| 9 | +} from "./database/tasks"; | |
| 10 | 10 | export { |
| 11 | 11 | createApproval, |
| 12 | 12 | getApproval, |
| @@ -14,32 +14,32 @@ export { · 1 unmodified line | ||
| 14 | 14 | listPendingApprovals, |
| 15 | 15 | resolveApproval, |
| 16 | 16 | getApprovalInWorkspace, |
| 17 | −} from "./database-approvals"; | |
| 17 | +} from "./database/approvals"; | |
| 18 | 18 | export { |
| 19 | 19 | upsertToolCallRequested, |
| 20 | 20 | getToolCall, |
| 21 | 21 | setToolCallPendingApproval, |
| 22 | 22 | finishToolCall, |
| 23 | 23 | listToolCalls, |
| 24 | −} from "./database-tool-calls"; | |
| 25 | −export { bootstrapAnonymousSession } from "./database-anonymous-session"; | |
| 24 | +} from "./database/tool_calls"; | |
| 25 | +export { bootstrapAnonymousSession } from "./database/anonymous_session"; | |
| 26 | 26 | export { |
| 27 | 27 | listRuntimeTargets, |
| 28 | 28 | upsertAccessPolicy, |
| 29 | 29 | listAccessPolicies, |
| 30 | −} from "./database-policies"; | |
| 30 | +} from "./database/policies"; | |
| 31 | 31 | export { |
| 32 | 32 | upsertCredential, |
| 33 | 33 | listCredentials, |
| 34 | 34 | listCredentialProviders, |
| 35 | 35 | resolveCredential, |
| 36 | −} from "./database-credentials"; | |
| 36 | +} from "./database/credentials"; | |
| 37 | 37 | export { |
| 38 | 38 | upsertToolSource, |
| 39 | 39 | listToolSources, |
| 40 | 40 | deleteToolSource, |
| 41 | −} from "./database-tool-sources"; | |
| 42 | −export { createTaskEvent, listTaskEvents } from "./database-task-events"; | |
| 41 | +} from "./database/tool_sources"; | |
| 42 | +export { createTaskEvent, listTaskEvents } from "./database/task_events"; | |
| 43 | 43 | export { |
| 44 | 44 | getActiveAnonymousOauthSigningKey, |
| 45 | 45 | storeAnonymousOauthSigningKey, |
| @@ -49,4 +49,4 @@ export { · 3 unmodified lines | ||
| 49 | 49 | consumeAnonymousOauthAuthorizationCode, |
| 50 | 50 | purgeExpiredAnonymousOauthAuthorizationCodes, |
| 51 | 51 | countAnonymousOauthAuthorizationCodes, |
| 52 | −} from "./database-oauth"; | |
| 52 | +} from "./database/oauth"; | |
| @@ -1,7 +1,7 @@ | ||
| 1 | −import type { Doc } from "./_generated/dataModel"; | |
| 2 | −import type { MutationCtx } from "./_generated/server"; | |
| 3 | −import { slugify } from "../core/src/identity"; | |
| 4 | −import { ensureUniqueSlug } from "../core/src/slug"; | |
| 1 | +import type { Doc } from "../_generated/dataModel"; | |
| 2 | +import type { MutationCtx } from "../_generated/server"; | |
| 3 | +import { slugify } from "../../core/src/identity"; | |
| 4 | +import { ensureUniqueSlug } from "../../core/src/slug"; | |
| 5 | 5 | |
| 6 | 6 | type OrganizationRole = "owner" | "admin" | "member" | "billing_admin"; |
| 7 | 7 | type OrganizationMemberStatus = "active" | "pending" | "removed"; |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | import { v } from "convex/values"; |
| 2 | −import { internalMutation } from "./_generated/server"; | |
| 3 | −import { ensureAnonymousIdentity } from "./database-anonymous"; | |
| 4 | −import { mapAnonymousContext } from "./database-readers"; | |
| 2 | +import { internalMutation } from "../_generated/server"; | |
| 3 | +import { ensureAnonymousIdentity } from "./anonymous"; | |
| 4 | +import { mapAnonymousContext } from "./readers"; | |
| 5 | 5 | |
| 6 | 6 | export const bootstrapAnonymousSession = internalMutation({ |
| 7 | 7 | args: { sessionId: v.optional(v.string()) }, |
| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | import { v } from "convex/values"; |
| 2 | −import { internalMutation, internalQuery } from "./_generated/server"; | |
| 3 | −import { mapApproval } from "./database-mappers"; | |
| 4 | −import { getApprovalDoc, getTaskDoc } from "./database-readers"; | |
| 5 | −import { approvalStatusValidator } from "./database-validators"; | |
| 6 | −import type { TaskStatus } from "../core/src/types"; | |
| 2 | +import { internalMutation, internalQuery } from "../_generated/server"; | |
| 3 | +import { mapApproval } from "./mappers"; | |
| 4 | +import { getApprovalDoc, getTaskDoc } from "./readers"; | |
| 5 | +import { approvalStatusValidator } from "./validators"; | |
| 6 | +import type { TaskStatus } from "../../core/src/types"; | |
| 7 | 7 | |
| 8 | 8 | export const createApproval = internalMutation({ |
| 9 | 9 | args: { |
| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | import { v } from "convex/values"; |
| 2 | −import { internalMutation, internalQuery } from "./_generated/server"; | |
| 3 | −import { mapCredential } from "./database-mappers"; | |
| 4 | −import { computeBoundAuthFingerprint } from "./database-readers"; | |
| 2 | +import { internalMutation, internalQuery } from "../_generated/server"; | |
| 3 | +import { mapCredential } from "./mappers"; | |
| 4 | +import { computeBoundAuthFingerprint } from "./readers"; | |
| 5 | 5 | import { |
| 6 | 6 | credentialProviderValidator, |
| 7 | 7 | credentialScopeValidator, |
| 8 | −} from "./database-validators"; | |
| 9 | −import { asRecord } from "./lib/object"; | |
| 8 | +} from "./validators"; | |
| 9 | +import { asRecord } from "../lib/object"; | |
| 10 | 10 | |
| 11 | 11 | export const upsertCredential = internalMutation({ |
| 12 | 12 | args: { |
| @@ -1,6 +1,6 @@ | ||
| 1 | −import type { Doc } from "./_generated/dataModel"; | |
| 2 | −import { asRecord } from "./lib/object"; | |
| 3 | −import { DEFAULT_TASK_TIMEOUT_MS } from "./task-constants"; | |
| 1 | +import type { Doc } from "../_generated/dataModel"; | |
| 2 | +import { asRecord } from "../lib/object"; | |
| 3 | +import { DEFAULT_TASK_TIMEOUT_MS } from "../task/constants"; | |
| 4 | 4 | |
| 5 | 5 | export function stableStringify(value: unknown): string { |
| 6 | 6 | if (Array.isArray(value)) { |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import { v } from "convex/values"; |
| 2 | −import { internalMutation, internalQuery } from "./_generated/server"; | |
| 2 | +import { internalMutation, internalQuery } from "../_generated/server"; | |
| 3 | 3 | |
| 4 | 4 | export const getActiveAnonymousOauthSigningKey = internalQuery({ |
| 5 | 5 | args: {}, |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | import { v } from "convex/values"; |
| 2 | −import { internalMutation, internalQuery } from "./_generated/server"; | |
| 3 | −import { mapPolicy } from "./database-mappers"; | |
| 4 | −import { policyDecisionValidator } from "./database-validators"; | |
| 2 | +import { internalMutation, internalQuery } from "../_generated/server"; | |
| 3 | +import { mapPolicy } from "./mappers"; | |
| 4 | +import { policyDecisionValidator } from "./validators"; | |
| 5 | 5 | |
| 6 | 6 | export const listRuntimeTargets = internalQuery({ |
| 7 | 7 | args: {}, |
| @@ -1,7 +1,7 @@ | ||
| 1 | −import type { Doc } from "./_generated/dataModel"; | |
| 2 | −import type { QueryCtx } from "./_generated/server"; | |
| 3 | −import { normalizeSourceAuthFingerprint } from "./database-mappers"; | |
| 4 | −import { asRecord } from "./lib/object"; | |
| 1 | +import type { Doc } from "../_generated/dataModel"; | |
| 2 | +import type { QueryCtx } from "../_generated/server"; | |
| 3 | +import { normalizeSourceAuthFingerprint } from "./mappers"; | |
| 4 | +import { asRecord } from "../lib/object"; | |
| 5 | 5 | |
| 6 | 6 | export function mapAnonymousContext(doc: Doc<"anonymousSessions">) { |
| 7 | 7 | return { |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | import { v } from "convex/values"; |
| 2 | −import { internalMutation, internalQuery } from "./_generated/server"; | |
| 3 | −import { getTaskDoc, mapTaskEvent } from "./database-readers"; | |
| 4 | −import { asRecord } from "./lib/object"; | |
| 2 | +import { internalMutation, internalQuery } from "../_generated/server"; | |
| 3 | +import { getTaskDoc, mapTaskEvent } from "./readers"; | |
| 4 | +import { asRecord } from "../lib/object"; | |
| 5 | 5 | |
| 6 | 6 | export const createTaskEvent = internalMutation({ |
| 7 | 7 | args: { |
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | import { v } from "convex/values"; |
| 2 | −import { internalMutation, internalQuery } from "./_generated/server"; | |
| 3 | −import { mapTask } from "./database-mappers"; | |
| 4 | −import { getTaskDoc } from "./database-readers"; | |
| 5 | −import { completedTaskStatusValidator } from "./database-validators"; | |
| 6 | −import { asRecord } from "./lib/object"; | |
| 7 | −import { DEFAULT_TASK_TIMEOUT_MS } from "./task-constants"; | |
| 8 | −import { isTerminalTaskStatus } from "./task-status"; | |
| 2 | +import { internalMutation, internalQuery } from "../_generated/server"; | |
| 3 | +import { mapTask } from "./mappers"; | |
| 4 | +import { getTaskDoc } from "./readers"; | |
| 5 | +import { completedTaskStatusValidator } from "./validators"; | |
| 6 | +import { asRecord } from "../lib/object"; | |
| 7 | +import { DEFAULT_TASK_TIMEOUT_MS } from "../task/constants"; | |
| 8 | +import { isTerminalTaskStatus } from "../task/status"; | |
| 9 | 9 | |
| 10 | 10 | export const createTask = internalMutation({ |
| 11 | 11 | args: { |
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | import { v } from "convex/values"; |
| 2 | −import { internalMutation, internalQuery } from "./_generated/server"; | |
| 3 | −import { mapToolCall } from "./database-mappers"; | |
| 4 | −import { getToolCallDoc } from "./database-readers"; | |
| 5 | −import { terminalToolCallStatusValidator } from "./database-validators"; | |
| 2 | +import { internalMutation, internalQuery } from "../_generated/server"; | |
| 3 | +import { mapToolCall } from "./mappers"; | |
| 4 | +import { getToolCallDoc } from "./readers"; | |
| 5 | +import { terminalToolCallStatusValidator } from "./validators"; | |
| 6 | 6 | |
| 7 | 7 | export const upsertToolCallRequested = internalMutation({ |
| 8 | 8 | args: { |
| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | import { v } from "convex/values"; |
| 2 | −import { internalMutation, internalQuery } from "./_generated/server"; | |
| 2 | +import { internalMutation, internalQuery } from "../_generated/server"; | |
| 3 | 3 | import { |
| 4 | 4 | computeSourceSpecHash, |
| 5 | 5 | mapSource, |
| 6 | 6 | normalizeSourceAuthFingerprint, |
| 7 | −} from "./database-mappers"; | |
| 8 | −import { toolSourceTypeValidator } from "./database-validators"; | |
| 9 | −import { asRecord } from "./lib/object"; | |
| 7 | +} from "./mappers"; | |
| 8 | +import { toolSourceTypeValidator } from "./validators"; | |
| 9 | +import { asRecord } from "../lib/object"; | |
| 10 | 10 | |
| 11 | 11 | export const upsertToolSource = internalMutation({ |
| 12 | 12 | args: { |
File renamed without changes.
| @@ -7,10 +7,10 @@ import { workspaceMutation } from "../core/src/function-builders"; · 6 unmodified lines | ||
| 7 | 7 | import { actorIdForAccount } from "../core/src/identity"; |
| 8 | 8 | import { isKnownRuntimeId } from "../core/src/runtimes/runtime-catalog"; |
| 9 | 9 | import type { ApprovalRecord, TaskRecord } from "../core/src/types"; |
| 10 | −import { isTerminalTaskStatus, taskTerminalEventType } from "./task-status"; | |
| 11 | −import { DEFAULT_TASK_TIMEOUT_MS } from "./task-constants"; | |
| 12 | −import { createTaskEvent } from "./task-events"; | |
| 13 | −import { markTaskFinished } from "./task-finish"; | |
| 10 | +import { isTerminalTaskStatus, taskTerminalEventType } from "./task/status"; | |
| 11 | +import { DEFAULT_TASK_TIMEOUT_MS } from "./task/constants"; | |
| 12 | +import { createTaskEvent } from "./task/events"; | |
| 13 | +import { markTaskFinished } from "./task/finish"; | |
| 14 | 14 | |
| 15 | 15 | async function createTaskRecord( |
| 16 | 16 | ctx: MutationCtx, |
| @@ -8,15 +8,15 @@ import type { · 7 unmodified lines | ||
| 8 | 8 | OpenApiSourceQuality, |
| 9 | 9 | SourceAuthProfile, |
| 10 | 10 | } from "../core/src/types"; |
| 11 | −import { requireCanonicalActor } from "./executor_node/actor_auth"; | |
| 11 | +import { requireCanonicalActor } from "./runtime/actor_auth"; | |
| 12 | 12 | import { |
| 13 | 13 | listToolsForContext, |
| 14 | 14 | listToolsWithWarningsForContext, |
| 15 | 15 | loadDtsUrls, |
| 16 | 16 | loadWorkspaceDtsStorageIds, |
| 17 | −} from "./executor_node/workspace_tools"; | |
| 18 | −import { runQueuedTask } from "./executor_node/task_runner"; | |
| 19 | −import { handleExternalToolCallRequest } from "./executor_node/external_tool_call"; | |
| 17 | +} from "./runtime/workspace_tools"; | |
| 18 | +import { runQueuedTask } from "./runtime/task_runner"; | |
| 19 | +import { handleExternalToolCallRequest } from "./runtime/external_tool_call"; | |
| 20 | 20 | |
| 21 | 21 | export const listToolsWithWarnings = action({ |
| 22 | 22 | args: { |
| @@ -10,7 +10,7 @@ import { · 9 unmodified lines | ||
| 10 | 10 | sendWorkosInvitation, |
| 11 | 11 | updateWorkosOrganizationName, |
| 12 | 12 | workosEnabled, |
| 13 | −} from "./invites-workos"; | |
| 13 | +} from "./invites/workos"; | |
| 14 | 14 | |
| 15 | 15 | const organizationRoleValidator = v.union( |
| 16 | 16 | v.literal("owner"), |
File renamed without changes.
File renamed without changes.
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | "use node"; |
| 2 | 2 | |
| 3 | 3 | import type { ActionCtx } from "../_generated/server"; |
| 4 | −import { createTaskEvent, type TaskEventName } from "../task-events"; | |
| 4 | +import { createTaskEvent, type TaskEventName } from "../task/events"; | |
| 5 | 5 | |
| 6 | 6 | export async function publishTaskEvent( |
| 7 | 7 | ctx: ActionCtx, |
File renamed without changes.
File renamed without changes.
| @@ -14,8 +14,8 @@ import { runCodeWithAdapter } from "../../core/src/runtimes/runtime-core"; · 13 unmodified lines | ||
| 14 | 14 | import type { TaskRecord } from "../../core/src/types"; |
| 15 | 15 | import { describeError } from "../../core/src/utils"; |
| 16 | 16 | import { publishTaskEvent } from "./events"; |
| 17 | −import { taskTerminalEventType } from "../task-status"; | |
| 18 | −import { markTaskFinished } from "../task-finish"; | |
| 17 | +import { taskTerminalEventType } from "../task/status"; | |
| 18 | +import { markTaskFinished } from "../task/finish"; | |
| 19 | 19 | import { invokeTool } from "./tool_invocation"; |
| 20 | 20 | |
| 21 | 21 | async function markTaskFailedAndPublish( |
| @@ -1,3 +1,5 @@ | ||
| 1 | +"use node"; | |
| 2 | + | |
| 1 | 3 | import type { ActionCtx } from "../_generated/server"; |
| 2 | 4 | import { internal } from "../_generated/api"; |
| 3 | 5 | import { resolveCredentialPayload } from "../../core/src/credential-providers"; |
File renamed without changes.
| @@ -1,3 +1,5 @@ | ||
| 1 | +"use node"; | |
| 2 | + | |
| 1 | 3 | import type { ActionCtx } from "../_generated/server"; |
| 2 | 4 | import { parseGraphqlOperationPaths } from "../../core/src/graphql-operation-paths"; |
| 3 | 5 | import type { AccessPolicyRecord, PolicyDecision, TaskRecord, ToolDefinition } from "../../core/src/types"; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -1,4 +1,4 @@ | ||
| 1 | −import { internal } from "./_generated/api"; | |
| 1 | +import { internal } from "../_generated/api"; | |
| 2 | 2 | |
| 3 | 3 | export type TaskEventName = "task" | "approval"; |
| 4 | 4 | |
| @@ -1,6 +1,6 @@ | ||
| 1 | −import { internal } from "./_generated/api"; | |
| 2 | −import type { ActionCtx, MutationCtx } from "./_generated/server"; | |
| 3 | −import type { TaskRecord, TaskStatus } from "../core/src/types"; | |
| 1 | +import { internal } from "../_generated/api"; | |
| 2 | +import type { ActionCtx, MutationCtx } from "../_generated/server"; | |
| 3 | +import type { TaskRecord, TaskStatus } from "../../core/src/types"; | |
| 4 | 4 | |
| 5 | 5 | type TerminalTaskStatus = Extract<TaskStatus, "completed" | "failed" | "timed_out" | "denied">; |
| 6 | 6 | type TaskFinishContext = Pick<ActionCtx, "runMutation"> | Pick<MutationCtx, "runMutation">; |
| @@ -1,4 +1,4 @@ | ||
| 1 | −import type { TaskStatus } from "../core/src/types"; | |
| 1 | +import type { TaskStatus } from "../../core/src/types"; | |
| 2 | 2 | |
| 3 | 3 | export type TerminalTaskStatus = Extract<TaskStatus, "completed" | "failed" | "timed_out" | "denied">; |
| 4 | 4 | |
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -33,7 +33,7 @@ interface DeployStep { · 32 unmodified lines | ||
| 33 | 33 | cwd?: string; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | −const EXECUTOR_ROOT = path.resolve(import.meta.dir, ".."); | |
| 36 | +const EXECUTOR_ROOT = path.resolve(import.meta.dir, "..", ".."); | |
| 37 | 37 | const RUNNER_HOST_DIR = path.join(EXECUTOR_ROOT, "packages", "runner-sandbox-host"); |
| 38 | 38 | |
| 39 | 39 | const ALL_STEPS: StepId[] = ["cloudflare", "env", "convex", "doctor"]; |
| @@ -52,7 +52,7 @@ function printHelp(): void { · 12 unmodified lines | ||
| 52 | 52 | console.log(`Guided production deploy for executor |
| 53 | 53 | |
| 54 | 54 | Usage: |
| 55 | − bun run scripts/deploy-prod.ts [options] | |
| 55 | + bun run scripts/prod/deploy-prod.ts [options] | |
| 56 | 56 | |
| 57 | 57 | Options: |
| 58 | 58 | --apply Execute steps (default is plan only) |
| @@ -69,10 +69,10 @@ Steps: · 10 unmodified lines | ||
| 69 | 69 | doctor Verify prod setup and print remediation |
| 70 | 70 | |
| 71 | 71 | Examples: |
| 72 | − bun run scripts/deploy-prod.ts | |
| 73 | − bun run scripts/deploy-prod.ts --apply | |
| 74 | − bun run scripts/deploy-prod.ts --apply --only cloudflare,doctor | |
| 75 | − bun run scripts/deploy-prod.ts --apply --skip convex --yes | |
| 72 | + bun run scripts/prod/deploy-prod.ts | |
| 73 | + bun run scripts/prod/deploy-prod.ts --apply | |
| 74 | + bun run scripts/prod/deploy-prod.ts --apply --only cloudflare,doctor | |
| 75 | + bun run scripts/prod/deploy-prod.ts --apply --skip convex --yes | |
| 76 | 76 | `); |
| 77 | 77 | } |
| 78 | 78 | |
| @@ -174,13 +174,13 @@ function buildSteps(selected: StepId[]): DeployStep[] { · 95 unmodified lines | ||
| 174 | 174 | cloudflare: { |
| 175 | 175 | id: "cloudflare", |
| 176 | 176 | name: "Cloudflare Runtime", |
| 177 | − command: ["bun", "run", "scripts/setup-prod-cloudflare.ts", "--deploy", "--no-doctor"], | |
| 177 | + command: ["bun", "run", "scripts/prod/setup-prod-cloudflare.ts", "--deploy", "--no-doctor"], | |
| 178 | 178 | cwd: EXECUTOR_ROOT, |
| 179 | 179 | }, |
| 180 | 180 | env: { |
| 181 | 181 | id: "env", |
| 182 | 182 | name: "Convex Env Sync", |
| 183 | − command: ["bun", "run", "scripts/setup-prod-env.ts", "--from-env", "--strict"], | |
| 183 | + command: ["bun", "run", "scripts/prod/setup-prod-env.ts", "--from-env", "--strict"], | |
| 184 | 184 | cwd: EXECUTOR_ROOT, |
| 185 | 185 | }, |
| 186 | 186 | convex: { |
| @@ -192,7 +192,7 @@ function buildSteps(selected: StepId[]): DeployStep[] { · 5 unmodified lines | ||
| 192 | 192 | doctor: { |
| 193 | 193 | id: "doctor", |
| 194 | 194 | name: "Production Doctor", |
| 195 | − command: ["bun", "run", "scripts/doctor-prod.ts"], | |
| 195 | + command: ["bun", "run", "scripts/prod/doctor-prod.ts"], | |
| 196 | 196 | cwd: EXECUTOR_ROOT, |
| 197 | 197 | }, |
| 198 | 198 | }; |
File renamed without changes.
| @@ -49,7 +49,7 @@ const AUTH_SERVER_ENV_KEYS = [ · 48 unmodified lines | ||
| 49 | 49 | "WORKOS_AUTHKIT_DOMAIN", |
| 50 | 50 | ] as const; |
| 51 | 51 | |
| 52 | −const EXECUTOR_ROOT = path.resolve(import.meta.dir, ".."); | |
| 52 | +const EXECUTOR_ROOT = path.resolve(import.meta.dir, "..", ".."); | |
| 53 | 53 | |
| 54 | 54 | function addCheck(report: ProductionDoctorReport, name: string, ok: boolean, detail: string): void { |
| 55 | 55 | report.checks.push({ name, ok, detail }); |
| @@ -18,14 +18,14 @@ interface CommandResult { · 17 unmodified lines | ||
| 18 | 18 | stderr: string; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | −const EXECUTOR_ROOT = path.resolve(import.meta.dir, ".."); | |
| 21 | +const EXECUTOR_ROOT = path.resolve(import.meta.dir, "..", ".."); | |
| 22 | 22 | const SANDBOX_HOST_DIR = path.join(EXECUTOR_ROOT, "packages", "runner-sandbox-host"); |
| 23 | 23 | |
| 24 | 24 | function printHelp(): void { |
| 25 | 25 | console.log(`Setup Cloudflare runtime for production |
| 26 | 26 | |
| 27 | 27 | Usage: |
| 28 | − bun run scripts/setup-prod-cloudflare.ts [options] | |
| 28 | + bun run scripts/prod/setup-prod-cloudflare.ts [options] | |
| 29 | 29 | |
| 30 | 30 | Options: |
| 31 | 31 | --run-url <url> Explicit sandbox run URL (e.g. https://.../v1/runs) |
| @@ -30,7 +30,7 @@ function printHelp(): void { · 29 unmodified lines | ||
| 30 | 30 | console.log(`Setup production Convex app env vars |
| 31 | 31 | |
| 32 | 32 | Usage: |
| 33 | − bun run scripts/setup-prod-env.ts --from-env [--strict] | |
| 33 | + bun run scripts/prod/setup-prod-env.ts --from-env [--strict] | |
| 34 | 34 | |
| 35 | 35 | Options: |
| 36 | 36 | --from-env Read values from current shell env and push to Convex prod |
| @@ -115,7 +115,7 @@ async function buildWebArtifact(rootDir: string, releaseDir: string, checksums: · 114 unmodified lines | ||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | async function main(): Promise<void> { |
| 118 | − const rootDir = path.resolve(import.meta.dir, ".."); | |
| 118 | + const rootDir = path.resolve(import.meta.dir, "..", ".."); | |
| 119 | 119 | const releaseDir = path.join(rootDir, "dist", "release"); |
| 120 | 120 | |
| 121 | 121 | await fs.rm(releaseDir, { recursive: true, force: true }); |
| @@ -20,7 +20,6 @@ · 19 unmodified lines | ||
| 20 | 20 | "packages/runner-node/**/*.ts", |
| 21 | 21 | "packages/core/src/**/*.ts", |
| 22 | 22 | "scripts/**/*.ts", |
| 23 | − "executor.ts", | |
| 24 | − "vscode-elicitation-server.ts" | |
| 23 | + "executor.ts" | |
| 25 | 24 | ] |
| 26 | 25 | } |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | "typecheck": "bun run typecheck:executor && bun run typecheck:assistant", |
| 29 | 29 | "typecheck:executor": "bunx tsc --noEmit -p executor/tsconfig.json", |
| 30 | 30 | "typecheck:assistant": "bunx tsc --noEmit -p assistant/packages/server/tsconfig.json && bunx tsc --noEmit -p assistant/packages/bot/tsconfig.json", |
| 31 | − "db:clear:executor": "bun with-env bun run executor/wipe-convex-db.ts", | |
| 31 | + "db:clear:executor": "bun with-env bun run executor/scripts/dev/wipe-convex-db.ts", | |
| 32 | 32 | "convex:codegen": "bunx --cwd executor convex codegen" |
| 33 | 33 | }, |
| 34 | 34 | "dependencies": { |