├── .cursor └── rules │ └── keep-comments.mdc ├── .editorconfig ├── .eslintrc.js ├── .gitattributes ├── .github ├── CONTRIBUTING.md └── workflows │ ├── supabase.yml │ ├── supabase_prod.yml │ └── supabase_staging.yml ├── .gitignore ├── .npmrc ├── .rtx.toml ├── .vscode ├── extensions.json └── settings.json ├── README.md ├── apps ├── marketing │ ├── .env.template │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── next-env.d.ts │ ├── next.config.js │ ├── package.json │ ├── postcss.config.mjs │ ├── public │ │ ├── 3og.svg │ │ ├── anything_screenshot.png │ │ ├── anything_web.png │ │ ├── circles.svg │ │ ├── fonts │ │ │ └── DMSans-SemiBold.ttf │ │ ├── images │ │ │ ├── build_and_test_workflows.png │ │ │ ├── build_test_deploy.png │ │ │ ├── create_function_calls.png │ │ │ ├── monitor.png │ │ │ ├── monitor_workflows.png │ │ │ ├── reuse.png │ │ │ ├── reuse_actions_between_workflows.png │ │ │ ├── share.png │ │ │ ├── share_actions_with_team.png │ │ │ └── test_and_deploy.png │ │ ├── llamascreenshot.png │ │ └── magic_3po.webp │ ├── src │ │ ├── app │ │ │ ├── (marketing) │ │ │ │ ├── [username] │ │ │ │ │ ├── not-found.tsx │ │ │ │ │ └── page.tsx │ │ │ │ ├── blog │ │ │ │ │ ├── [slug] │ │ │ │ │ │ └── page.tsx │ │ │ │ │ ├── blog.css │ │ │ │ │ ├── category │ │ │ │ │ │ └── [slug] │ │ │ │ │ │ │ └── page.tsx │ │ │ │ │ ├── page.tsx │ │ │ │ │ └── tag │ │ │ │ │ │ └── [slug] │ │ │ │ │ │ └── page.tsx │ │ │ │ ├── layout.tsx │ │ │ │ ├── local │ │ │ │ │ └── page.tsx │ │ │ │ ├── og │ │ │ │ │ └── page.tsx │ │ │ │ ├── page.tsx │ │ │ │ ├── platform │ │ │ │ │ └── page.tsx │ │ │ │ ├── templates │ │ │ │ │ ├── [slug] │ │ │ │ │ │ ├── opengraph-image.tsx │ │ │ │ │ │ ├── page.tsx │ │ │ │ │ │ └── twitter-image.tsx │ │ │ │ │ ├── actions │ │ │ │ │ │ └── page.tsx │ │ │ │ │ ├── category │ │ │ │ │ │ └── [category_slug] │ │ │ │ │ │ │ └── page.tsx │ │ │ │ │ └── workflows │ │ │ │ │ │ └── page.tsx │ │ │ │ └── triggers │ │ │ │ │ └── [slug] │ │ │ │ │ └── page.tsx │ │ │ ├── apple-icon.png │ │ │ ├── favicon.ico │ │ │ ├── icon.png │ │ │ ├── layout.tsx │ │ │ ├── opengraph-image.tsx │ │ │ ├── privacy │ │ │ │ └── page.tsx │ │ │ ├── robots.ts │ │ │ ├── sitemap.ts │ │ │ ├── terms │ │ │ │ └── page.tsx │ │ │ └── twitter-image.tsx │ │ ├── components │ │ │ ├── Footer.tsx │ │ │ ├── LocalFaq.tsx │ │ │ ├── LocalFeatures.tsx │ │ │ ├── PlatformFaq.tsx │ │ │ ├── PlatformFeatures.tsx │ │ │ ├── avatar.tsx │ │ │ ├── baseCard.tsx │ │ │ ├── blog │ │ │ │ ├── ArticleCard.tsx │ │ │ │ ├── HighlightCode.tsx │ │ │ │ ├── NotFound.tsx │ │ │ │ └── Pagination.tsx │ │ │ ├── deepLink.tsx │ │ │ ├── errorBoundary.tsx │ │ │ ├── marketing │ │ │ │ ├── Header.tsx │ │ │ │ ├── LandingSignIn.tsx │ │ │ │ ├── LandingSignUp.tsx │ │ │ │ └── pricing │ │ │ │ │ ├── LandingSignUp.tsx │ │ │ │ │ └── pricing-group.tsx │ │ │ ├── og │ │ │ │ ├── baseOg.tsx │ │ │ │ ├── template_css.tsx │ │ │ │ └── template_tailwind.tsx │ │ │ └── ui │ │ │ │ ├── Bgpattern.tsx │ │ │ │ ├── Button.tsx │ │ │ │ ├── Stargazer.tsx │ │ │ │ └── skeleton.tsx │ │ ├── config │ │ │ └── site.ts │ │ ├── lib │ │ │ ├── fonts.ts │ │ │ ├── supabaseImageLoader.ts │ │ │ └── utils.ts │ │ ├── posthog │ │ │ ├── PosthogPageView.tsx │ │ │ ├── events.ts │ │ │ ├── posthog.ts │ │ │ └── provider.tsx │ │ ├── public │ │ │ ├── icon.png │ │ │ ├── next.svg │ │ │ └── vercel.svg │ │ └── types │ │ │ ├── flow.ts │ │ │ └── next-auth.d.ts │ ├── tailwind.config.ts │ └── tsconfig.json └── web │ ├── .env.example │ ├── .eslintrc.js │ ├── .github │ └── workflows │ │ ├── setup-testing.sql │ │ └── tests.yml │ ├── .gitignore │ ├── README.md │ ├── loose_code_delete_eventually │ └── [accountId] │ │ ├── page.tsx │ │ └── settings │ │ ├── billing │ │ └── page.tsx │ │ ├── layout.tsx │ │ └── page.tsx │ ├── next.config.js │ ├── package.json │ ├── postcss.config.mjs │ ├── public │ └── images │ │ └── icon.png │ ├── src │ ├── app │ │ ├── (application-context) │ │ │ ├── (dashboard) │ │ │ │ ├── agents │ │ │ │ │ ├── [agent_id] │ │ │ │ │ │ └── page.tsx │ │ │ │ │ └── page.tsx │ │ │ │ ├── inbox │ │ │ │ │ └── page.tsx │ │ │ │ ├── layout.tsx │ │ │ │ ├── page.tsx │ │ │ │ ├── settings │ │ │ │ │ ├── billing │ │ │ │ │ │ └── page.tsx │ │ │ │ │ ├── files │ │ │ │ │ │ └── page.tsx │ │ │ │ │ ├── keys │ │ │ │ │ │ └── page.tsx │ │ │ │ │ ├── layout.tsx │ │ │ │ │ ├── members │ │ │ │ │ │ └── page.tsx │ │ │ │ │ ├── page.tsx │ │ │ │ │ ├── profile │ │ │ │ │ │ └── page.tsx │ │ │ │ │ ├── secrets │ │ │ │ │ │ └── page.tsx │ │ │ │ │ └── teams │ │ │ │ │ │ └── page.tsx │ │ │ │ ├── templates │ │ │ │ │ ├── [templateId] │ │ │ │ │ │ └── page.tsx │ │ │ │ │ └── page.tsx │ │ │ │ ├── workflow │ │ │ │ │ └── [id] │ │ │ │ │ │ └── page.tsx │ │ │ │ └── workflows │ │ │ │ │ ├── [workflowId] │ │ │ │ │ └── page.tsx │ │ │ │ │ └── page.tsx │ │ │ ├── (studio) │ │ │ │ └── workflows │ │ │ │ │ └── [workflowId] │ │ │ │ │ └── [workflowVersionId] │ │ │ │ │ └── editor │ │ │ │ │ └── page.tsx │ │ │ └── layout.tsx │ │ ├── auth │ │ │ └── callback │ │ │ │ └── route.ts │ │ ├── favicon.ico │ │ ├── invitation │ │ │ └── page.tsx │ │ ├── layout.tsx │ │ ├── login │ │ │ └── page.tsx │ │ └── signup │ │ │ └── page.tsx │ ├── components │ │ ├── agents │ │ │ ├── add-phone-number-dialog.tsx │ │ │ ├── add-tool-dialog.tsx │ │ │ ├── delete-agent-dialog.tsx │ │ │ ├── new-agent-dialog.tsx │ │ │ ├── new-tool-dialog.tsx │ │ │ ├── remove-phone-number-dialog.tsx │ │ │ ├── remove-tool-dialog.tsx │ │ │ ├── tools-tab.tsx │ │ │ └── welcome-to-agents.tsx │ │ ├── auth │ │ │ └── login-component.tsx │ │ ├── basejump │ │ │ ├── accept-team-invitation.tsx │ │ │ ├── account-billing-status.tsx │ │ │ ├── account-selector.tsx │ │ │ ├── create-team-invitation-button.tsx │ │ │ ├── delete-team-invitation-button.tsx │ │ │ ├── delete-team-member-form.tsx │ │ │ ├── edit-personal-account-name.tsx │ │ │ ├── edit-team-member-role-form.tsx │ │ │ ├── edit-team-name.tsx │ │ │ ├── edit-team-slug.tsx │ │ │ ├── manage-team-invitations.tsx │ │ │ ├── manage-team-members.tsx │ │ │ ├── manage-teams.tsx │ │ │ ├── new-invitation-form.tsx │ │ │ ├── new-team-form.tsx │ │ │ ├── team-member-options.tsx │ │ │ └── user-account-button.tsx │ │ ├── dashboard │ │ │ ├── dashboard-header.tsx │ │ │ ├── dashboard-title.tsx │ │ │ ├── navigation-account-selector.tsx │ │ │ ├── new-workflow-dialog.tsx │ │ │ └── settings-navigation.tsx │ │ ├── free-trial-badge.tsx │ │ ├── logo.tsx │ │ ├── secrets │ │ │ ├── api-key-input.tsx │ │ │ ├── new-account-dialog.tsx │ │ │ └── secret-input.tsx │ │ ├── studio │ │ │ ├── action-sheet │ │ │ │ ├── left-panel-navigation.tsx │ │ │ │ └── studio-actions-sheet.tsx │ │ │ ├── edges │ │ │ │ └── workflow-edge.tsx │ │ │ ├── forms │ │ │ │ ├── action-settings-form.tsx │ │ │ │ ├── configuration-form.tsx │ │ │ │ ├── display │ │ │ │ │ ├── action-display-form.tsx │ │ │ │ │ ├── action-display-tab.tsx │ │ │ │ │ └── edit-display-schema.tsx │ │ │ │ ├── fields │ │ │ │ │ ├── codemirror-utils.tsx │ │ │ │ │ ├── field-boolean.tsx │ │ │ │ │ ├── field-html.tsx │ │ │ │ │ ├── field-js.tsx │ │ │ │ │ ├── field-json.tsx │ │ │ │ │ ├── field-number.tsx │ │ │ │ │ ├── field-text-new.tsx │ │ │ │ │ ├── field-text.tsx │ │ │ │ │ ├── field-xml.tsx │ │ │ │ │ └── form-fields.tsx │ │ │ │ ├── icons.tsx │ │ │ │ ├── json-schema-form.tsx │ │ │ │ ├── no-node-selected.tsx │ │ │ │ ├── right-panel-form-editor.tsx │ │ │ │ ├── settings │ │ │ │ │ ├── delete-flow-dialog.tsx │ │ │ │ │ ├── flow-settings-schema.ts │ │ │ │ │ ├── flow-settings-tab.tsx │ │ │ │ │ └── workflow-settings-form.tsx │ │ │ │ ├── testing │ │ │ │ │ ├── action-testing.tsx │ │ │ │ │ ├── task-card.tsx │ │ │ │ │ ├── task-status-badges.tsx │ │ │ │ │ ├── task-status.tsx │ │ │ │ │ ├── testing-tab.tsx │ │ │ │ │ └── workflow-testing.tsx │ │ │ │ ├── variables │ │ │ │ │ ├── create-variable-form.tsx │ │ │ │ │ ├── create-variable-schema.ts │ │ │ │ │ ├── delete-input-dialog.tsx │ │ │ │ │ ├── edit-variables-form.tsx │ │ │ │ │ ├── input-variables-form.tsx │ │ │ │ │ └── variables-form-layout.tsx │ │ │ │ └── versions │ │ │ │ │ └── versions-tab.tsx │ │ │ ├── nodes │ │ │ │ ├── node-icon.tsx │ │ │ │ └── workflow-node.tsx │ │ │ ├── publish-action-dialog.tsx │ │ │ ├── share-dialog.tsx │ │ │ ├── studio-header.tsx │ │ │ ├── studio-workflow-editor.tsx │ │ │ └── variable-explorers │ │ │ │ ├── explorer-panel.tsx │ │ │ │ ├── files-explorer.tsx │ │ │ │ ├── inputs-explorer.tsx │ │ │ │ ├── json-explorer.tsx │ │ │ │ ├── results-explorer.tsx │ │ │ │ ├── secrets-explorer.tsx │ │ │ │ ├── system-variables-explorer.tsx │ │ │ │ └── variable-editing-explorer-layout.tsx │ │ ├── submit-button.tsx │ │ ├── tasks │ │ │ ├── task-chart.tsx │ │ │ └── task-table.tsx │ │ └── workflows │ │ │ ├── dahsbloard-title-with-navigation.tsx │ │ │ ├── dashboard-title-with-action.tsx │ │ │ ├── manage-workflows.tsx │ │ │ ├── workflow-status.tsx │ │ │ └── workflow-toggle.tsx │ ├── context │ │ ├── AccountsContext.tsx │ │ ├── AnythingContext.tsx │ │ ├── SubscriptionContext.tsx │ │ ├── VariablesContext.tsx │ │ ├── VariablesExplorerContext.tsx │ │ ├── WorkflowTestingProvider.tsx │ │ ├── WorkflowVersionControlContext.tsx │ │ └── WorkflowVersionProvider.tsx │ ├── hooks │ │ └── use-debounce.ts │ ├── lib │ │ ├── actions │ │ │ ├── billing.ts │ │ │ ├── invitations.ts │ │ │ ├── members.ts │ │ │ ├── personal-account.ts │ │ │ └── teams.ts │ │ ├── full-invitation-url.ts │ │ ├── hooks │ │ │ └── use-accounts.ts │ │ ├── json-schema-utils.ts │ │ ├── studio │ │ │ └── helpers.ts │ │ ├── supabase │ │ │ ├── client.ts │ │ │ ├── handle-edge-error.ts │ │ │ ├── middleware.ts │ │ │ └── server.ts │ │ └── utils.ts │ ├── middleware.ts │ ├── posthog │ │ ├── PosthogPageView.tsx │ │ ├── events.ts │ │ ├── posthog.ts │ │ └── provider.tsx │ └── types │ │ ├── generated │ │ ├── supabase-anything-generated.ts │ │ └── supabase-marketplace-generated.ts │ │ ├── prismjs.d.ts │ │ └── workflows.ts │ ├── tailwind.config.ts │ └── tsconfig.json ├── architecture.excalidraw ├── architecture.png ├── assets ├── agent_library.png ├── anything_aug_10.gif ├── anything_dnd_sept_11.gif ├── anything_screenshot.png └── anything_sept_11.gif ├── core ├── .gitignore └── anything-server │ ├── .cargo │ └── config.toml │ ├── .dockerignore │ ├── .env.template │ ├── Cargo.lock │ ├── Cargo.toml │ ├── Dockerfile │ ├── OldDockerfile │ ├── _nixpacks.toml │ ├── src │ ├── account_auth_middleware.rs │ ├── actions.rs │ ├── actor_processor │ │ ├── ACTOR_RUSTYSCRIPT_OPTIMIZATION.md │ │ ├── README.md │ │ ├── RUSTYSCRIPT_OPTIMIZATION.md │ │ ├── WORKER_INTEGRATION.md │ │ ├── actor_pool.rs │ │ ├── actor_system.rs │ │ ├── dependency_resolver.rs │ │ ├── messages.rs │ │ ├── mod.rs │ │ ├── processor.rs │ │ ├── task_actor.rs │ │ ├── tests.rs │ │ └── workflow_actor.rs │ ├── agents │ │ ├── channels.rs │ │ ├── create.rs │ │ ├── delete.rs │ │ ├── get.rs │ │ ├── mod.rs │ │ ├── tools.rs │ │ ├── twilio.rs │ │ ├── update.rs │ │ └── vapi.rs │ ├── api_key_middleware.rs │ ├── auth │ │ ├── accounts.rs │ │ ├── init.rs │ │ ├── mod.rs │ │ ├── providers.rs │ │ ├── refresh.rs │ │ └── utils.rs │ ├── billing │ │ ├── accounts.rs │ │ ├── billing_usage_engine.rs │ │ ├── create_links.rs │ │ ├── mod.rs │ │ ├── stripe_webhooks.rs │ │ └── usage.rs │ ├── bundler │ │ ├── accounts │ │ │ ├── accounts_cache.rs │ │ │ └── mod.rs │ │ ├── bundler.rs │ │ ├── mod.rs │ │ └── secrets │ │ │ ├── mod.rs │ │ │ └── secrets_cache.rs │ ├── charts.rs │ ├── email.rs │ ├── files │ │ ├── mod.rs │ │ ├── r2_client.rs │ │ ├── routes.rs │ │ └── utils.rs │ ├── main.rs │ ├── marketplace │ │ ├── actions.rs │ │ ├── mod.rs │ │ ├── profiles.rs │ │ ├── scanning.rs │ │ └── workflows.rs │ ├── metrics.rs │ ├── old_parallel_processor │ │ ├── db_calls.rs │ │ ├── execute_task.rs │ │ ├── flow_session_cache.rs │ │ ├── hydrate_processor.rs │ │ ├── mod.rs │ │ ├── parallelizer.rs │ │ ├── path_processor.rs │ │ ├── process_trigger_utils.rs │ │ ├── processor.rs │ │ ├── processor_utils.rs │ │ └── utils.rs │ ├── otel_setup.rs │ ├── processor │ │ ├── components.rs │ │ ├── db_calls.rs │ │ ├── enhanced_processor.rs │ │ ├── execute_task.rs │ │ ├── flow_session_cache.rs │ │ ├── hydrate_processor.rs │ │ ├── mod.rs │ │ ├── parallelizer.rs │ │ ├── path_processor.rs │ │ ├── process_trigger_utils.rs │ │ ├── processor.rs │ │ ├── processor_utils.rs │ │ ├── tests │ │ │ ├── mod.rs │ │ │ ├── parallelizer_tests.rs │ │ │ ├── path_processor_tests.rs │ │ │ └── processor_utils_tests.rs │ │ └── utils.rs │ ├── secrets.rs │ ├── status_updater │ │ └── mod.rs │ ├── supabase_jwt_middleware.rs │ ├── system_plugins │ │ ├── agent_tool_trigger │ │ │ ├── mod.rs │ │ │ └── utils.rs │ │ ├── agent_tool_trigger_response │ │ │ └── mod.rs │ │ ├── filter │ │ │ └── mod.rs │ │ ├── formatter_actions │ │ │ ├── date_formatter.rs │ │ │ ├── mod.rs │ │ │ ├── number_formatter.rs │ │ │ └── text_formatter.rs │ │ ├── http │ │ │ ├── http_plugin.rs │ │ │ ├── legacy_schemas.json │ │ │ ├── mod.rs │ │ │ └── schema.txt │ │ ├── input │ │ │ └── mod.rs │ │ ├── javascript │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── output │ │ │ └── mod.rs │ │ ├── registry │ │ │ ├── mod.rs │ │ │ └── schemas │ │ │ │ ├── agent_tool_call_response_schema.json │ │ │ │ ├── agent_tool_call_schema.json │ │ │ │ ├── cron_schema.json │ │ │ │ ├── filter_schema.json │ │ │ │ ├── http_schema.json │ │ │ │ ├── input_action_schema.json │ │ │ │ ├── javascript_schema.json │ │ │ │ ├── output_action_schema.json │ │ │ │ ├── webhook_response_schema.json │ │ │ │ └── webhook_trigger_schema.json │ │ ├── webhook_response │ │ │ └── mod.rs │ │ └── webhook_trigger │ │ │ ├── mod.rs │ │ │ ├── webhook_trigger.rs │ │ │ └── webhook_trigger_utils.rs │ ├── system_variables.rs │ ├── system_workflows │ │ └── mod.rs │ ├── tasks.rs │ ├── templater │ │ ├── mod.rs │ │ └── utils.rs │ ├── testing.rs │ ├── testing_helpers.rs │ ├── trigger_engine.rs │ ├── types │ │ ├── action_types.rs │ │ ├── json_schema.rs │ │ ├── mod.rs │ │ ├── plugin_types.rs │ │ ├── react_flow_types.rs │ │ ├── task_types.rs │ │ └── workflow_types.rs │ ├── variables.rs │ ├── vault │ │ └── mod.rs │ └── workflows.rs │ └── template_db │ ├── action_template_stash.json │ ├── action_templates.json │ └── workflow_boilerplates.json ├── package.json ├── packages ├── anything-api │ ├── .eslintrc.js │ ├── package.json │ ├── src │ │ ├── accounts.ts │ │ ├── action-templates.ts │ │ ├── agents.ts │ │ ├── auth.ts │ │ ├── billing.ts │ │ ├── charts.ts │ │ ├── files.ts │ │ ├── flows.ts │ │ ├── index.ts │ │ ├── marketplace.ts │ │ ├── profiles.ts │ │ ├── secrets.ts │ │ ├── tasks.ts │ │ ├── testing.ts │ │ ├── types │ │ │ └── workflows.ts │ │ └── variable-explorer.ts │ └── tsconfig.json ├── eslint-config │ ├── README.md │ ├── library.js │ ├── next.js │ ├── package.json │ └── react-internal.js ├── typescript-config │ ├── base.json │ ├── nextjs.json │ ├── package.json │ └── react-library.json └── ui │ ├── .eslintrc.js │ ├── README.md │ ├── components.json │ ├── package.json │ ├── postcss.config.mjs │ ├── src │ ├── components │ │ ├── action-grid.tsx │ │ ├── avatarAndUsername.tsx │ │ ├── baseNodeIcons.tsx │ │ ├── baseNodeWeb.tsx │ │ ├── card.tsx │ │ ├── commonTypes.ts │ │ ├── magicui │ │ │ ├── hero-video-dialog.tsx │ │ │ ├── orbiting-circles-integrations.tsx │ │ │ ├── orbiting-circles.tsx │ │ │ ├── shimmer-button.tsx │ │ │ └── shiny-button.tsx │ │ ├── profileLinks.tsx │ │ ├── profileView.tsx │ │ ├── tags.tsx │ │ ├── templateCard.tsx │ │ ├── templateGrid.tsx │ │ ├── templateView.tsx │ │ └── ui │ │ │ ├── alert-dialog.tsx │ │ │ ├── alert.tsx │ │ │ ├── badge.tsx │ │ │ ├── button.tsx │ │ │ ├── card.tsx │ │ │ ├── chart.tsx │ │ │ ├── checkbox.tsx │ │ │ ├── collapsible.tsx │ │ │ ├── command.tsx │ │ │ ├── dialog.tsx │ │ │ ├── dropdown-menu.tsx │ │ │ ├── expandable-input.tsx │ │ │ ├── form.tsx │ │ │ ├── input.tsx │ │ │ ├── label.tsx │ │ │ ├── popover.tsx │ │ │ ├── progress.tsx │ │ │ ├── radio-group.tsx │ │ │ ├── resizable.tsx │ │ │ ├── scroll-area.tsx │ │ │ ├── select.tsx │ │ │ ├── separator.tsx │ │ │ ├── sheet.tsx │ │ │ ├── switch.tsx │ │ │ ├── table.tsx │ │ │ ├── tabs.tsx │ │ │ ├── textarea.tsx │ │ │ └── tooltip.tsx │ ├── globals.css │ ├── helpers │ │ └── helpers.ts │ ├── lib │ │ └── utils.ts │ └── types │ │ └── flow.ts │ ├── tailwind.config.ts │ └── tsconfig.json ├── plugin-core ├── .gitignore ├── Justfile └── crates │ ├── pdk-mock-host-functions │ ├── .cargo │ │ └── config.toml │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── lib.rs │ ├── pdk-mock-plugin │ ├── .cargo │ │ └── config.toml │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── pdk-mock-simple-host │ ├── Cargo.toml │ ├── README.md │ └── src │ │ └── main.rs │ ├── pdk-mock-trigger-plugin │ ├── .cargo │ │ └── config.toml │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── pdk-test-runner │ ├── .cargo │ │ └── config.toml │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── pdk │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── plugin.rs │ └── plugins │ ├── anything-cron-plugin │ ├── .cargo │ │ └── config.toml │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ ├── anything-http-plugin │ ├── .cargo │ │ └── config.toml │ ├── Cargo.toml │ └── src │ │ └── lib.rs │ └── anything-loop-plugin │ ├── .cargo │ └── config.toml │ ├── Cargo.toml │ └── src │ └── lib.rs ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── prettier.config.mjs ├── supabase ├── .gitignore ├── config.toml ├── functions │ ├── .env.example │ ├── billing-functions │ │ └── index.ts │ └── billing-webhooks │ │ └── index.ts ├── migrations │ ├── 20240414161707_basejump-setup.sql │ ├── 20240414161708_anything-setup.sql │ ├── 20240414161947_basejump-accounts.sql │ ├── 20240414161948_anything-marketplace-profiles.sql │ ├── 20240414161949_basejump-anything-new-user-functions.sql │ ├── 20240414162100_basejump-invitations.sql │ ├── 20240414162131_basejump-billing.sql │ ├── 20240531141028_basejump-configure.sql │ ├── 20240531141029_setup-testing.sql │ ├── 20240601161929_anything-marketplace-tags.sql │ ├── 20240601161944_anything-marketplace-flow-templates.sql │ ├── 20240601161956_anything-marketplace-flow-template-versions.sql │ ├── 20240601161957_anything-marketplace-action-templates.sql │ ├── 20240601162005_anything-marketplace-flow-template-tags.sql │ ├── 20240601175048_anything-app-flows.sql │ ├── 20240601175049_anything-app-auth-providers.sql │ ├── 20240601175050_anything-app-account-auth-provider-accounts.sql │ ├── 20240601175054_anything-app-flow-versions.sql │ ├── 20240601175101_anything-app-tasks.sql │ ├── 20240704003143_anything-app-action-templates.sql │ ├── 20240704150529_anything-app-secrets.sql │ ├── 20240704150530_anything-app-usage-tasks-billing.sql │ ├── 20240704150531_anything-app-usage-accounts_billing.sql │ ├── 20240704150533_anything-app-payments-webhooks.sql │ ├── 20240704150543_anything-update-secrets-for-api-keys.sql │ ├── 20240704150553_anything-update-account-auth-provider-accounts-for-failure.sql │ ├── 20240704150563_anything-update-tasks-with-errors.sql │ ├── 20240704150573_anything-update-tasks-with-new_plugin_style.sql │ ├── 20240704150583_anything-update-flow_versions-for-new-plugin-style.sql │ ├── 20240704150593_anything-update-flow_versions-for-new-input_names.sql │ ├── 20240704150603_anything-update-flow_versions-for-new-variables-access.sql │ ├── 20240704150613_anything-app-phone-numbers.sql │ ├── 20240704150623_anything-app-agents.sql │ ├── 20240704150633_anything-app-contacts.sql │ ├── 20240704150643_anything-app-calls.sql │ ├── 20240704150653_anything-app-agent-tools.sql │ ├── 20240704150663_anything-app-agent-communication-channels.sql │ ├── 20240704150673_basejump-new-team.sql │ └── 20240704150683_anything-app-files.sql ├── seed.sql ├── stashed_migrations_unused │ ├── 20240704150535_anything-app-webhook_endpoints.sql │ ├── 20240704150537_anything-app-webhooks_inbox.sql │ ├── 20240704150539_anything-app-webhook_workflow_sessions.sql │ └── 20240704150563_anything-postoffice.sql └── tests │ └── database │ ├── 01-basejump-schema-tests.sql │ ├── 02-personal-accounts.sql │ ├── 04-team-accounts.sql │ ├── 05-team-accounts-disabled.sql │ ├── 06-invitations.sql │ ├── 07-inviting-team-member.sql │ ├── 08-inviting-team-owner.sql │ ├── 09-removing-team-members.sql │ ├── 10-account-roles.sql │ ├── 11-public-account-functions.sql │ ├── 12-created-by-tracking.sql │ ├── 14-public-billing-functions.sql │ └── 15-billing-disabled-functions.sql └── turbo.json /.cursor/rules/keep-comments.mdc: -------------------------------------------------------------------------------- 1 | --- 2 | description: 3 | globs: 4 | alwaysApply: true 5 | --- 6 | Do not delete comments in code when you make updates. I like my comments! -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | // This configuration only applies to the package manager root. 2 | /** @type {import("eslint").Linter.Config} */ 3 | module.exports = { 4 | ignorePatterns: ["apps/**", "packages/**"], 5 | extends: ["@repo/eslint-config/library.js"], 6 | parser: "@typescript-eslint/parser", 7 | parserOptions: { 8 | project: true, 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | target filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /.github/workflows/supabase.yml: -------------------------------------------------------------------------------- 1 | name: Supabase CI 2 | 3 | on: 4 | pull_request: 5 | workflow_dispatch: 6 | 7 | jobs: 8 | test: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v3 13 | 14 | - uses: supabase/setup-cli@v1 15 | with: 16 | version: latest 17 | 18 | - name: Start Supabase local development setup 19 | run: supabase db start 20 | 21 | - name: Verify generated types are checked in 22 | run: | 23 | supabase gen types typescript --local > types.gen.ts 24 | if ! git diff --ignore-space-at-eol --exit-code --quiet types.gen.ts; then 25 | echo "Detected uncommitted changes after build. See status below:" 26 | git diff 27 | exit 1 28 | fi -------------------------------------------------------------------------------- /.github/workflows/supabase_prod.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Migrations to Production 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | jobs: 10 | deploy: 11 | runs-on: ubuntu-latest 12 | 13 | environment: 14 | name: production 15 | 16 | env: 17 | SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }} 18 | SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }} 19 | SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }} 20 | 21 | steps: 22 | - uses: actions/checkout@v3 23 | 24 | - uses: supabase/setup-cli@v1 25 | with: 26 | version: latest 27 | 28 | - run: supabase link --project-ref $SUPABASE_PROJECT_ID 29 | - run: supabase db push 30 | -------------------------------------------------------------------------------- /.github/workflows/supabase_staging.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Migrations to Anything Dev 2 | on: 3 | push: 4 | branches: 5 | - staging 6 | workflow_dispatch: 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | 12 | environment: 13 | name: staging 14 | 15 | env: 16 | SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }} 17 | SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }} 18 | SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }} 19 | 20 | steps: 21 | - uses: actions/checkout@v3 22 | 23 | - uses: supabase/setup-cli@v1 24 | with: 25 | version: latest 26 | 27 | - run: supabase link --project-ref $SUPABASE_PROJECT_ID 28 | - run: supabase db push 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | .pnp 6 | .pnp.js 7 | 8 | # testing 9 | coverage 10 | 11 | # next.js 12 | .next/ 13 | out/ 14 | build 15 | .swc/ 16 | 17 | # misc 18 | .DS_Store 19 | *.pem 20 | 21 | # debug 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | 26 | 27 | # local env files 28 | **/*.env 29 | **/*.env.local 30 | **/*.env.development.local 31 | **/*.env.test.local 32 | **/*.env.production.local 33 | 34 | # turbo 35 | .turbo 36 | 37 | # ui 38 | dist/ 39 | 40 | core/target 41 | core/crate/*/target 42 | core/crates/plugins/artifacts/* 43 | 44 | node_modules 45 | dist 46 | dist-ssr 47 | *.local 48 | 49 | # Editor directories and files 50 | .vscode/* 51 | !.vscode/extensions.json 52 | .idea 53 | .DS_Store 54 | *.suo 55 | *.ntvs* 56 | *.njsproj 57 | *.sln 58 | *.sw? 59 | 60 | .next 61 | **/.env 62 | .sentryclirc 63 | .envrc 64 | 65 | **/tsconfig.tsbuildinfo 66 | 67 | .history -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | auto-install-peers = true 2 | enable-pre-post-scripts=true # Enable pre/post scripts (for postui:add) -------------------------------------------------------------------------------- /.rtx.toml: -------------------------------------------------------------------------------- 1 | [tools] 2 | rust = "stable" 3 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["rust-lang.rust-analyzer"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.linkedProjects": ["core/anything-server/Cargo.toml"], 3 | } 4 | -------------------------------------------------------------------------------- /apps/marketing/.env.template: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_HOSTED_URL="https://tryanything.xyz" 2 | NEXT_PUBLIC_POSTHOG_KEY="--" 3 | NEXT_PUBLIC_POSTHOG_HOST="--" 4 | TRIGGER_API_KEY="--" 5 | TRIGGER_API_URL="--" 6 | NEXT_PUBLIC_TRIGGER_PUBLIC_API_KEY="--" 7 | NEXT_PUBLIC_SEOBOT_API_KEY="==" -------------------------------------------------------------------------------- /apps/marketing/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import("eslint").Linter.Config} */ 2 | module.exports = { 3 | root: true, 4 | extends: ["@repo/eslint-config/next.js"], 5 | parser: "@typescript-eslint/parser", 6 | parserOptions: { 7 | project: true, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /apps/marketing/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env.local 29 | .env.development.local 30 | .env.test.local 31 | .env.production.local 32 | 33 | # vercel 34 | .vercel 35 | -------------------------------------------------------------------------------- /apps/marketing/README.md: -------------------------------------------------------------------------------- 1 | ## Getting Started 2 | 3 | First, run the development server: 4 | 5 | ```bash 6 | yarn dev 7 | ``` 8 | 9 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 10 | 11 | You can start editing the page by modifying `src/app/page.tsx`. The page auto-updates as you edit the file. 12 | 13 | To create [API routes](https://nextjs.org/docs/app/building-your-application/routing/router-handlers) add an `api/` directory to the `app/` directory with a `route.ts` file. For individual endpoints, create a subfolder in the `api` directory, like `api/hello/route.ts` would map to [http://localhost:3000/api/hello](http://localhost:3000/api/hello). 14 | 15 | ## Learn More 16 | 17 | To learn more about Next.js, take a look at the following resources: 18 | 19 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 20 | - [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial. 21 | 22 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 23 | 24 | ## Deploy on Vercel 25 | 26 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. 27 | 28 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 29 | -------------------------------------------------------------------------------- /apps/marketing/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. 6 | -------------------------------------------------------------------------------- /apps/marketing/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | images: { 3 | loader: "custom", 4 | loaderFile: "./src/lib/supabaseImageLoader.ts", 5 | }, 6 | transpilePackages: ["@repo/ui"], 7 | //https://turbo.build/repo/docs/handbook/sharing-code/internal-packages 8 | }; 9 | -------------------------------------------------------------------------------- /apps/marketing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marketing", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@headlessui/react": "^2.1.5", 13 | "@heroicons/react": "^2.1.5", 14 | "@repo/anything-api": "workspace:*", 15 | "@repo/ui": "workspace:*", 16 | "class-variance-authority": "^0.7.0", 17 | "clsx": "^2.1.1", 18 | "highlight.js": "^11.11.1", 19 | "next": "^14", 20 | "next-themes": "^0.3.0", 21 | "posthog-js": "^1.200.1", 22 | "posthog-node": "^3.1.3", 23 | "react": "^18.2.0", 24 | "react-dom": "^18.2.0", 25 | "react-icons": "^4.11.0", 26 | "seobot": "^1.3.0", 27 | "sharp": "^0.32.6", 28 | "slugify": "^1.6.6", 29 | "tailwind-merge": "^1.14.0", 30 | "zod": "^3.22.4" 31 | }, 32 | "devDependencies": { 33 | "@next/eslint-plugin-next": "14.2.4", 34 | "@repo/eslint-config": "workspace:*", 35 | "@repo/typescript-config": "workspace:*", 36 | "@types/node": "^20", 37 | "@types/react": "^18.2.0", 38 | "@types/react-dom": "^18.2.0", 39 | "autoprefixer": "^10.4.19", 40 | "postcss": "^8.4.20", 41 | "tailwindcss": "^3.4.4", 42 | "typescript": "^5.4.5" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /apps/marketing/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | export { default } from "@repo/ui/postcss.config"; -------------------------------------------------------------------------------- /apps/marketing/public/anything_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/anything_screenshot.png -------------------------------------------------------------------------------- /apps/marketing/public/anything_web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/anything_web.png -------------------------------------------------------------------------------- /apps/marketing/public/circles.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /apps/marketing/public/fonts/DMSans-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/fonts/DMSans-SemiBold.ttf -------------------------------------------------------------------------------- /apps/marketing/public/images/build_and_test_workflows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/build_and_test_workflows.png -------------------------------------------------------------------------------- /apps/marketing/public/images/build_test_deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/build_test_deploy.png -------------------------------------------------------------------------------- /apps/marketing/public/images/create_function_calls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/create_function_calls.png -------------------------------------------------------------------------------- /apps/marketing/public/images/monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/monitor.png -------------------------------------------------------------------------------- /apps/marketing/public/images/monitor_workflows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/monitor_workflows.png -------------------------------------------------------------------------------- /apps/marketing/public/images/reuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/reuse.png -------------------------------------------------------------------------------- /apps/marketing/public/images/reuse_actions_between_workflows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/reuse_actions_between_workflows.png -------------------------------------------------------------------------------- /apps/marketing/public/images/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/share.png -------------------------------------------------------------------------------- /apps/marketing/public/images/share_actions_with_team.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/share_actions_with_team.png -------------------------------------------------------------------------------- /apps/marketing/public/images/test_and_deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/images/test_and_deploy.png -------------------------------------------------------------------------------- /apps/marketing/public/llamascreenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/llamascreenshot.png -------------------------------------------------------------------------------- /apps/marketing/public/magic_3po.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/public/magic_3po.webp -------------------------------------------------------------------------------- /apps/marketing/src/app/(marketing)/[username]/not-found.tsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link"; 2 | 3 | export default function NotFound() { 4 | return ( 5 |
6 |

Not Found

7 |

Could not find requested resource

8 | Return Home 9 |
10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /apps/marketing/src/app/(marketing)/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import React from "react"; 3 | 4 | import { Footer } from "@/components/Footer"; 5 | import { Header } from "@/components/marketing/Header"; 6 | 7 | interface MarketingLayoutProps { 8 | children: React.ReactNode; 9 | } 10 | 11 | export const metadata: Metadata = { 12 | // title: "Anything", 13 | // description: "Automate", 14 | }; 15 | 16 | export default async function MarketingLayout({ 17 | children, 18 | }: MarketingLayoutProps) { 19 | let stargazers_count: number | null = null; 20 | 21 | try { 22 | // Fetch GitHub stars with a daily revalidation 23 | const res = await fetch( 24 | "https://api.github.com/repos/tryanything-ai/anything", 25 | { 26 | method: "GET", 27 | // Cache for 24 hours (86400 seconds) 28 | next: { revalidate: 86400 }, 29 | headers: { 30 | "User-Agent": "Anything-Marketing-Website", 31 | }, 32 | }, 33 | ); 34 | 35 | // Check if the response was successful 36 | if (!res.ok) { 37 | const errorData = await res.json().catch(() => ({})); 38 | console.error(`GitHub API error (${res.status}):`, errorData); 39 | throw new Error(`GitHub API returned ${res.status}`); 40 | } 41 | 42 | const data = await res.json(); 43 | 44 | if (data && typeof data.stargazers_count === "number") { 45 | stargazers_count = data.stargazers_count; 46 | } 47 | } catch (error) { 48 | console.error("Failed to fetch stargazers count:", error); 49 | // If we have an error, we'll pass null to the Header component 50 | } 51 | 52 | return ( 53 |
54 |
55 |
{children}
56 |
57 |
58 | ); 59 | } 60 | -------------------------------------------------------------------------------- /apps/marketing/src/app/(marketing)/templates/actions/page.tsx: -------------------------------------------------------------------------------- 1 | import { ActionTemplateGrid } from "@repo/ui/components/action-grid"; 2 | import api from "@repo/anything-api"; 3 | 4 | export default async function TemplatePage() { 5 | let actionTemplates = []; 6 | let error = null; 7 | `` 8 | try { 9 | const templates = await api.marketplace.getActionTemplatesForMarketplace(); 10 | if (templates && templates.length > 0) { 11 | actionTemplates = templates; 12 | } else { 13 | console.log("No templates found"); 14 | } 15 | } catch (err) { 16 | const errorMessage = 17 | err instanceof Error ? err.message : "An unknown error occurred"; 18 | console.error("Error fetching action templates:", errorMessage); 19 | error = errorMessage; 20 | } 21 | 22 | return ( 23 | <> 24 | {/* Hero Copy */} 25 |
26 |

27 | Unleash the Power of Automation by Integrating your existing tools 28 |

29 | {/*

30 | Transform Your Workflow: Discover, Customize, and Automate with Our 31 | Pre Built Integrations and Action Templates 32 |

*/} 33 |
34 | 35 | {/* Grid */} 36 |
37 | {actionTemplates.length > 0 && ( 38 | 39 | )} 40 | {error &&

Error loading templates: {error}

} 41 |
42 | 43 | ); 44 | } 45 | -------------------------------------------------------------------------------- /apps/marketing/src/app/(marketing)/templates/category/[category_slug]/page.tsx: -------------------------------------------------------------------------------- 1 | export default async function CategoryPage() { 2 | return
Show CATEGORIES
; 3 | } 4 | -------------------------------------------------------------------------------- /apps/marketing/src/app/(marketing)/triggers/[slug]/page.tsx: -------------------------------------------------------------------------------- 1 | export default async function TriggerPage() { 2 | return ( 3 |
4 | TRIGGER. A place to show all templates with this trigger and lead to docs 5 | with that trigger 6 |
7 | ); 8 | } 9 | -------------------------------------------------------------------------------- /apps/marketing/src/app/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/src/app/apple-icon.png -------------------------------------------------------------------------------- /apps/marketing/src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/src/app/favicon.ico -------------------------------------------------------------------------------- /apps/marketing/src/app/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/src/app/icon.png -------------------------------------------------------------------------------- /apps/marketing/src/app/robots.ts: -------------------------------------------------------------------------------- 1 | import { MetadataRoute } from 'next' 2 | 3 | const base_url = process.env.NEXT_PUBLIC_HOSTED_URL; 4 | 5 | export default function robots(): MetadataRoute.Robots { 6 | return { 7 | rules: { 8 | userAgent: '*', 9 | allow: '/', 10 | }, 11 | sitemap: `${base_url}/sitemap.xml`, 12 | } 13 | } -------------------------------------------------------------------------------- /apps/marketing/src/components/avatar.tsx: -------------------------------------------------------------------------------- 1 | import Image from "next/image"; 2 | 3 | export const Avatar = ({ 4 | avatar_url, 5 | profile_name, 6 | }: { 7 | avatar_url: string; 8 | profile_name: string; 9 | }) => { 10 | return {profile_name}; 11 | }; 12 | -------------------------------------------------------------------------------- /apps/marketing/src/components/baseCard.tsx: -------------------------------------------------------------------------------- 1 | import clsx from "clsx"; 2 | import React, { ComponentType, FC, HTMLAttributes, ReactNode } from "react"; 3 | 4 | interface LinkProps { 5 | href: string; 6 | } 7 | 8 | type ConditionalProps = T extends { to: string } ? LinkProps : {}; 9 | 10 | interface BaseCardProps extends HTMLAttributes { 11 | as?: React.ElementType; 12 | image?: ReactNode, 13 | className?: string; 14 | } 15 | 16 | const BaseCard: FC> = ({ 17 | as: Component = "div", 18 | children, 19 | image, 20 | className, 21 | ...props 22 | }) => { 23 | const baseStyles = "card bg-base-300 shadow-xl my-2"; 24 | 25 | const combinedStyles = clsx(baseStyles, className); 26 | 27 | return ( 28 | 29 | {image} 30 |
{children}
31 |
32 | ); 33 | }; 34 | 35 | export default BaseCard; 36 | -------------------------------------------------------------------------------- /apps/marketing/src/components/blog/HighlightCode.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useEffect } from "react"; 4 | import hljs from "highlight.js"; 5 | import "highlight.js/styles/vs2015.min.css"; 6 | 7 | export default function HighlightCode() { 8 | useEffect(() => { 9 | hljs.highlightAll(); 10 | }, []); 11 | return null; 12 | } 13 | -------------------------------------------------------------------------------- /apps/marketing/src/components/blog/NotFound.tsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link"; 2 | 3 | export default async function NotFound() { 4 | return ( 5 |
6 |
7 |
8 |

9 | 404 Error 10 |

11 |

12 | Page not found 13 |

14 |

15 | Sorry, the page you are looking for could not be found or has been 16 | removed. 17 |

18 | 22 | Go back 23 | 29 | 34 | 35 | 36 |
37 |
38 |
39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /apps/marketing/src/components/blog/Pagination.tsx: -------------------------------------------------------------------------------- 1 | interface PaginationProps { 2 | slug: string; 3 | pageNumber: number; 4 | lastPage: number; 5 | } 6 | 7 | const Pagination: React.FC = ({ 8 | slug, 9 | pageNumber, 10 | lastPage, 11 | }) => { 12 | return ( 13 | 36 | ); 37 | }; 38 | 39 | export default Pagination; 40 | -------------------------------------------------------------------------------- /apps/marketing/src/components/deepLink.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React, { FC, MouseEvent } from "react"; 4 | 5 | interface DeepLinkProps { 6 | href: string; 7 | fallbackUrl?: string; 8 | children: React.ReactNode; 9 | } 10 | 11 | const DeepLink: FC = ({ href, fallbackUrl, children }) => { 12 | // if (typeof window === "undefined") { 13 | // console.log("returning normal link"); 14 | // return {children}; 15 | // } 16 | 17 | const handleDeepLinkClick = (e: MouseEvent): void => { 18 | e.preventDefault(); 19 | 20 | // Try opening the deep link 21 | const opened = window.open(href); 22 | 23 | if (!opened) { 24 | if (fallbackUrl) { 25 | // If fallbackUrl is provided, navigate t o it 26 | window.location.href = fallbackUrl; 27 | } else { 28 | // Otherwise, show an alert 29 | alert( 30 | "Failed to open the link. Please ensure you have the required app installed." 31 | ); 32 | } 33 | } 34 | }; 35 | 36 | return ( 37 | 38 | {children} 39 | 40 | ); 41 | }; 42 | 43 | export default DeepLink; 44 | -------------------------------------------------------------------------------- /apps/marketing/src/components/errorBoundary.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { Component, ReactNode } from 'react'; 4 | 5 | interface Props { 6 | children: ReactNode; 7 | } 8 | 9 | interface State { 10 | hasError: boolean; 11 | } 12 | 13 | export class ErrorBoundary extends Component { 14 | constructor(props: Props) { 15 | super(props); 16 | this.state = { hasError: false }; 17 | } 18 | 19 | static getDerivedStateFromError() { 20 | return { hasError: true }; 21 | } 22 | 23 | render() { 24 | if (this.state.hasError) { 25 | return ( 26 |
27 |

Something went wrong.

28 | 34 |
35 | ); 36 | } 37 | 38 | return this.props.children; 39 | } 40 | } -------------------------------------------------------------------------------- /apps/marketing/src/components/marketing/LandingSignIn.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | // import { signIn } from "next-auth/react"; 4 | 5 | import { Button } from "@repo/ui/components/ui/button"; 6 | 7 | export function SignInButton({ className }: { className: string }) { 8 | async function handleGithub() { 9 | // signIn("github", { callbackUrl: "/generate" }); 10 | } 11 | 12 | return ( 13 |
14 | {/* */} 24 |
25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /apps/marketing/src/components/marketing/LandingSignUp.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | // import { signIn } from "next-auth/react"; 4 | 5 | import { Button } from "@repo/ui/components/ui/button"; 6 | 7 | export function SignUpButton({ className }: { className: string }) { 8 | async function handleGithub() { 9 | // signIn("github", { callbackUrl: "/generate" }); 10 | } 11 | 12 | return ( 13 |
14 | {/* */} 24 |
25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /apps/marketing/src/components/marketing/pricing/LandingSignUp.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import type { VariantProps } from "class-variance-authority"; 4 | import type { ReactNode } from "react"; 5 | 6 | import { Button, buttonVariants } from "@repo/ui/components/ui/button"; 7 | 8 | export function SignUpButton({ 9 | type, 10 | children, 11 | }: { 12 | type: VariantProps["variant"]; 13 | children: any; 14 | }) { 15 | async function handleGithub() { 16 | // signIn("github", { callbackUrl: "/billing" }); 17 | } 18 | 19 | return ( 20 | 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /apps/marketing/src/components/og/baseOg.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from "react"; 2 | import { ImageResponse } from "next/og"; 3 | 4 | const this_url = "http://" + process.env.VERCEL_PROJECT_PRODUCTION_URL; 5 | 6 | // Route segment config 7 | export const runtime = "edge"; 8 | 9 | // Image metadata 10 | export const alt = "Anything Og Template"; 11 | 12 | export const size = { 13 | width: 1200, 14 | height: 628, 15 | }; 16 | 17 | export const contentType = "image/png"; 18 | 19 | //always need display: flex on all components for "sartori" and open image 20 | // https://github.com/vercel/satori#css 21 | //https://github.com/vercel/next.js/issues/48238 22 | export const OgDiv: React.FC<{ 23 | children: ReactNode; 24 | style?: React.CSSProperties; 25 | }> = ({ children, style }) => { 26 | return ( 27 |
28 | {children} 29 |
30 | ); 31 | }; 32 | 33 | // Image generation 34 | export default async function Image({ params }: { params: { slug: string } }) { 35 | console.log( 36 | "params in TemplatePageOgImage Generation", 37 | JSON.stringify(params), 38 | ); 39 | 40 | const boldFontData = await fetch( 41 | this_url + "/fonts/DMSans-SemiBold.ttf", 42 | ).then((res) => res.arrayBuffer()); 43 | 44 | return new ImageResponse( 45 | ( 46 |
55 | Template Og Image 56 |
57 | ), 58 | { 59 | ...size, 60 | fonts: [ 61 | { 62 | name: "Dm_Sans", 63 | data: boldFontData, 64 | weight: 700, 65 | }, 66 | ], 67 | }, 68 | ); 69 | } 70 | -------------------------------------------------------------------------------- /apps/marketing/src/components/ui/Bgpattern.tsx: -------------------------------------------------------------------------------- 1 | export const BgPattern = () => { 2 | return ( 3 |
4 |
5 |
6 |
7 |
8 | ); 9 | }; 10 | -------------------------------------------------------------------------------- /apps/marketing/src/components/ui/Button.tsx: -------------------------------------------------------------------------------- 1 | import { cva, VariantProps } from "class-variance-authority"; 2 | import Link from "next/link"; 3 | import React, { ComponentProps } from "react"; 4 | 5 | import { cn } from "@/lib/utils"; 6 | 7 | // https://cva.style/docs 8 | export const buttonVariants = cva("", { 9 | variants: { 10 | variant: { 11 | daisy_primary: 12 | "btn btn-block md:w-56 rounded-[4px] bg-crimson-9 py-1 px-3 text-white hover:bg-crimson-10", 13 | daisy_outline: 14 | "btn btn-block md:w-56 rounded-[4px] py-1 px-3 bg-slate-2 ring-1 ring-inset ring-slate-6 text-slate-11 hover:bg-slate-3 hover:text-slate-12", 15 | 16 | primary: 17 | "rounded-[4px] bg-crimson-9 py-1 px-3 text-white hover:bg-crimson-10", 18 | secondary: 19 | "rounded-[4px] bg-crimson-3 py-1 px-3 text-crimson-11 hover:bg-crimson-4 ring-1 ring-inset ring-crimson-6", 20 | outline: 21 | "rounded-[4px] py-1 px-3 bg-slate-2 ring-1 ring-inset ring-slate-6 text-slate-11 hover:bg-slate-3 hover:text-slate-12", 22 | text: "text-crimson-9 hover:text-crimson-10", 23 | }, 24 | }, 25 | defaultVariants: { 26 | variant: "primary", 27 | }, 28 | }); 29 | 30 | type ButtonOrLinkProps = ComponentProps<"button"> & ComponentProps<"a">; 31 | 32 | export interface ButtonProps 33 | extends ButtonOrLinkProps, 34 | VariantProps {} 35 | 36 | export const Button = ({ 37 | variant, 38 | className, 39 | children, 40 | ...props 41 | }: ButtonProps) => { 42 | let Component: any = props.href ? Link : "button"; 43 | 44 | return ( 45 | 49 | {children} 50 | 51 | ); 52 | }; 53 | -------------------------------------------------------------------------------- /apps/marketing/src/components/ui/skeleton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import { cn } from "@/lib/utils"; 4 | 5 | function Skeleton({ 6 | className, 7 | ...props 8 | }: React.HTMLAttributes) { 9 | return ( 10 |
14 | ); 15 | } 16 | 17 | export { Skeleton }; 18 | -------------------------------------------------------------------------------- /apps/marketing/src/config/site.ts: -------------------------------------------------------------------------------- 1 | type SiteConfig = { 2 | name: string; 3 | description: string; 4 | url: string; 5 | ogImage: string; 6 | links: { 7 | twitter: string; 8 | github: string; 9 | }; 10 | }; 11 | 12 | export const siteConfig: SiteConfig = { 13 | name: "Anything AI", 14 | description: "The easiest way to automate your business", 15 | url: `${process.env.NEXT_PUBLIC_HOSTED_URL}`, 16 | ogImage: `${process.env.NEXT_PUBLIC_HOSTED_URL}/og.jpg`, 17 | links: { 18 | twitter: "https://x.com/_anything_ai", 19 | github: "https://github.com/tryanything-ai/anything", 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /apps/marketing/src/lib/fonts.ts: -------------------------------------------------------------------------------- 1 | import { DM_Sans, Inter } from "next/font/google"; 2 | 3 | export const inter = Inter({ 4 | subsets: ["latin"], 5 | display: "swap", 6 | variable: "--font-inter", 7 | }); 8 | 9 | export const dm_sans = DM_Sans({ 10 | weight: ["400", "500", "700"], 11 | subsets: ["latin"], 12 | display: "swap", 13 | variable: "--font-dm-sans", 14 | }); 15 | -------------------------------------------------------------------------------- /apps/marketing/src/lib/supabaseImageLoader.ts: -------------------------------------------------------------------------------- 1 | // Docs: https://supabase.com/docs/guides/storage/image-transformations#nextjs-loader 2 | export function isRelativeUrl(url: string): boolean { 3 | return url.startsWith('/'); 4 | } 5 | 6 | export default function supabaseLoader({ src, width, quality }: any) { 7 | if(isRelativeUrl(src)) return src; 8 | let url = new URL(src); 9 | //TODO: readd this check 10 | // if (url.protocol + "//" + url.hostname !== process.env.NEXT_PUBLIC_SUPABASE_URL) { 11 | // console.log(url.hostname); 12 | // console.log(url.protocol); 13 | // console.log(process.env.NEXT_PUBLIC_SUPABASE_URL); 14 | // throw new Error("Hostname does not match .env variable"); 15 | // } 16 | 17 | url.searchParams.set("width", width.toString()); 18 | url.searchParams.set("quality", (quality || 75).toString()); 19 | return url.href; 20 | } 21 | -------------------------------------------------------------------------------- /apps/marketing/src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { ClassValue, clsx } from "clsx"; 2 | import { twMerge } from "tailwind-merge"; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | -------------------------------------------------------------------------------- /apps/marketing/src/posthog/PosthogPageView.tsx: -------------------------------------------------------------------------------- 1 | // app/PostHogPageView.tsx 2 | 'use client' 3 | 4 | import { usePathname, useSearchParams } from "next/navigation" 5 | import { useEffect, Suspense } from "react" 6 | import { usePostHog } from 'posthog-js/react' 7 | 8 | function PostHogPageView() : null { 9 | const pathname = usePathname() 10 | const searchParams = useSearchParams() 11 | const posthog = usePostHog() 12 | 13 | // Track pageviews 14 | useEffect(() => { 15 | if (pathname && posthog) { 16 | let url = window.origin + pathname 17 | if (searchParams.toString()) { 18 | url = url + `?${searchParams.toString()}` 19 | } 20 | 21 | posthog.capture('$pageview', { '$current_url': url }) 22 | } 23 | }, [pathname, searchParams, posthog]) 24 | 25 | return null 26 | } 27 | 28 | // Wrap this in Suspense to avoid the `useSearchParams` usage above 29 | // from de-opting the whole app into client-side rendering 30 | // See: https://nextjs.org/docs/messages/deopted-into-client-rendering 31 | export default function SuspendedPostHogPageView() { 32 | return 33 | 34 | 35 | } -------------------------------------------------------------------------------- /apps/marketing/src/posthog/events.ts: -------------------------------------------------------------------------------- 1 | export const MARKETING_EVENTS = { 2 | HOME_VIEW: "marketing_home_view", 3 | LOGIN_CLICK: "marketing_login_click", 4 | SIGNUP_CLICK: "marketing_signup_click", 5 | TEMPLATE_VIEW: "marketing_template_view", 6 | INTEGRATION_VIEW: "marketing_integration_view", 7 | GITHUB_CLICK: "marketing_github_click" 8 | } as const; -------------------------------------------------------------------------------- /apps/marketing/src/posthog/posthog.ts: -------------------------------------------------------------------------------- 1 | import { PostHog } from 'posthog-node' 2 | 3 | export default function PostHogClient() { 4 | const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { 5 | host: process.env.NEXT_PUBLIC_POSTHOG_HOST, 6 | flushAt: 1, 7 | flushInterval: 0 8 | }) 9 | return posthogClient 10 | } -------------------------------------------------------------------------------- /apps/marketing/src/posthog/provider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import posthog from "posthog-js"; 4 | import { PostHogProvider as PHProvider } from "posthog-js/react"; 5 | import { useEffect } from "react"; 6 | import PostHogPageView from "./PosthogPageView"; 7 | 8 | export function PostHogProvider({ children }: { children: React.ReactNode }) { 9 | useEffect(() => { 10 | posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { 11 | api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, 12 | capture_pageview: false, // Disable automatic pageview capture, as we capture manually 13 | capture_pageleave: true, 14 | }); 15 | }, []); 16 | 17 | return ( 18 | 19 | 20 | {children} 21 | 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /apps/marketing/src/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/marketing/src/public/icon.png -------------------------------------------------------------------------------- /apps/marketing/src/public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/marketing/src/public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/marketing/src/types/next-auth.d.ts: -------------------------------------------------------------------------------- 1 | import { User } from "next-auth"; 2 | import { JWT } from "next-auth/jwt"; 3 | 4 | declare module "next-auth/jwt" { 5 | interface JWT { 6 | id: string; 7 | } 8 | } 9 | 10 | declare module "next-auth" { 11 | interface Session { 12 | user: User & { 13 | id: string; 14 | address: string; 15 | }; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /apps/marketing/tailwind.config.ts: -------------------------------------------------------------------------------- 1 | export * from "@repo/ui/tailwind.config"; -------------------------------------------------------------------------------- /apps/marketing/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@repo/typescript-config/nextjs.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "plugins": [ 6 | { 7 | "name": "next" 8 | } 9 | ], 10 | "paths": { 11 | "@/*": [ 12 | "./src/*" 13 | ] 14 | } 15 | }, 16 | "include": [ 17 | "next-env.d.ts", 18 | "next.config.mjs", 19 | "postcss.config.mjs", 20 | "**/*.ts", 21 | "**/*.tsx", 22 | ".next/types/**/*.ts" 23 | ], 24 | "exclude": [ 25 | "node_modules" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /apps/web/.env.example: -------------------------------------------------------------------------------- 1 | # Update these with your Supabase details from your project settings > API 2 | # https://app.supabase.com/project/_/settings/api 3 | NEXT_PUBLIC_SUPABASE_URL=your-project-url 4 | NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key 5 | 6 | # The NEXT_PUBLIC_HOSTED_URL is used to generate invitation links and billing return URLs 7 | # It should be the hostname of your application with protocol (e.g. https://tryanything.xyz) 8 | NEXT_PUBLIC_ANYTHING_API_URL=http://localhost:3001 9 | NEXT_PUBLIC_APP_URL=http://localhost:3000 10 | 11 | # VAPI_PUBLIC_KEY is used to authenticate with VAPI to do web chats 12 | NEXT_PUBLIC_VAPI_PUBLIC_KEY=your-vapi-public-key 13 | -------------------------------------------------------------------------------- /apps/web/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import("eslint").Linter.Config} */ 2 | module.exports = { 3 | root: true, 4 | extends: ["@repo/eslint-config/next.js"], 5 | parser: "@typescript-eslint/parser", 6 | parserOptions: { 7 | project: true, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /apps/web/.github/workflows/setup-testing.sql: -------------------------------------------------------------------------------- 1 | create extension pgtap with schema extensions; 2 | 3 | /*--------------------- 4 | ---- install dbdev ---- 5 | ---------------------- 6 | Requires: 7 | - pg_tle: https://github.com/aws/pg_tle 8 | - pgsql-http: https://github.com/pramsey/pgsql-http 9 | */ 10 | create extension if not exists http with schema extensions; 11 | create extension if not exists pg_tle; 12 | drop extension if exists "supabase-dbdev"; 13 | select pgtle.uninstall_extension_if_exists('supabase-dbdev'); 14 | select 15 | pgtle.install_extension( 16 | 'supabase-dbdev', 17 | resp.contents ->> 'version', 18 | 'PostgreSQL package manager', 19 | resp.contents ->> 'sql' 20 | ) 21 | from http( 22 | ( 23 | 'GET', 24 | 'https://api.database.dev/rest/v1/' 25 | || 'package_versions?select=sql,version' 26 | || '&package_name=eq.supabase-dbdev' 27 | || '&order=version.desc' 28 | || '&limit=1', 29 | array[ 30 | ( 31 | 'apiKey', 32 | 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJp' 33 | || 'c3MiOiJzdXBhYmFzZSIsInJlZiI6InhtdXB0cHBsZnZpaWZyY' 34 | || 'ndtbXR2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODAxMDczNzI' 35 | || 'sImV4cCI6MTk5NTY4MzM3Mn0.z2CN0mvO2No8wSi46Gw59DFGCTJ' 36 | || 'rzM0AQKsu_5k134s' 37 | )::http_header 38 | ], 39 | null, 40 | null 41 | ) 42 | ) x, 43 | lateral ( 44 | select 45 | ((row_to_json(x) -> 'content') #>> '{}')::json -> 0 46 | ) resp(contents); 47 | create extension "supabase-dbdev"; 48 | select dbdev.install('supabase-dbdev'); 49 | drop extension if exists "supabase-dbdev"; 50 | create extension "supabase-dbdev"; 51 | 52 | select dbdev.install('basejump-supabase_test_helpers'); 53 | -------------------------------------------------------------------------------- /apps/web/.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | on: 3 | pull_request: 4 | branches: [ main ] 5 | jobs: 6 | pg_tap_tests: 7 | name: PGTap Tests 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | - uses: supabase/setup-cli@v1 12 | with: 13 | version: latest 14 | - name: Supabase Start 15 | run: supabase start 16 | - name: Setup supabase testing 17 | run: | 18 | psql -v ON_ERROR_STOP=1 -U postgres -d postgres -h localhost -p 54322 -f .github/workflows/setup-testing.sql 19 | env: 20 | PGPASSWORD: postgres 21 | - name: Run Tests 22 | run: supabase test db -------------------------------------------------------------------------------- /apps/web/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | 38 | # supabase for testing 39 | supabase/.branches 40 | supabase/.temp 41 | supabase/**/*.env 42 | 43 | # Sentry Config File 44 | .env.sentry-build-plugin 45 | -------------------------------------------------------------------------------- /apps/web/README.md: -------------------------------------------------------------------------------- 1 | # How to start 2 | 3 | ```bash 4 | supabase start 5 | cd ... 6 | pnpm dev --filter=web 7 | ``` 8 | 9 | # How to reset supabase db 10 | 11 | ```bash 12 | supabase db reset 13 | ``` 14 | 15 | # Supabase guide on local development 16 | 17 | https://supabase.com/docs/guides/cli/local-development 18 | 19 | Supabase CLI Reference 20 | https://supabase.com/docs/reference/cli/supabase-stop?queryGroups=example&example=supabase-stop-clean-up 21 | 22 | Supabase Local Dashboard URL 23 | http://127.0.0.1:54323/project/default 24 | 25 | # How we dev migrations for DB. 26 | 27 | -> Locally. We do Supabase DB Reset on Dev Locally a bunch 28 | -> When ready -> Staging -> Github actions deploy DB migrations 29 | -> When good -> Main -> Github actions deploy db migrations again to main project 30 | 31 | # Vercel Setup 32 | 33 | Previews all run with "Staging Supabase Variables" 34 | Production runs with "Real Supabase Variables" and Railway Server Prod also 35 | 36 | # Reset Supabase Staging DB Command 37 | 38 | ```bash 39 | npx supabase db reset --linked 40 | ``` 41 | 42 | # How to set Auth Providers Secrets in Supabase Vault 43 | 44 | ```bash 45 | curl -X POST 'http://localhost:3001/auth/providers/airtable/client_id/set' \ 46 | -H 'Content-Type: application/json' \ 47 | -d '{ 48 | "client_id": "test-vault-secret-id-for-airtable", 49 | "cli_secret": "carls-secret" 50 | }' 51 | ``` 52 | -------------------------------------------------------------------------------- /apps/web/loose_code_delete_eventually/[accountId]/page.tsx: -------------------------------------------------------------------------------- 1 | import { PartyPopper } from "lucide-react"; 2 | 3 | 4 | export default function PersonalAccountPage(): JSX.Element { 5 | return ( 6 |
7 | 8 |

Team Account

9 |

Here's where you'll put all your awesome team dashboard items

10 |
11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /apps/web/loose_code_delete_eventually/[accountId]/settings/billing/page.tsx: -------------------------------------------------------------------------------- 1 | import AccountBillingStatus from "@/components/basejump/account-billing-status"; 2 | import { createClient } from "@/lib/supabase/server"; 3 | import { Alert } from "@repo/ui/components/ui/alert"; 4 | 5 | export default async function TeamBillingPage({ 6 | params: { accountSlug }, 7 | }: { 8 | params: { accountSlug: string }; 9 | }): Promise { 10 | const supabaseClient = await createClient(); 11 | const { data: teamAccount }: any = await supabaseClient.rpc( 12 | "get_account_by_slug", 13 | // @ts-ignore 14 | { 15 | slug: accountSlug, 16 | }, 17 | ); 18 | 19 | if (teamAccount.account_role !== "owner") { 20 | return ( 21 | 22 | You do not have permission to access this page 23 | 24 | ); 25 | } 26 | 27 | return ( 28 |
29 | 33 |
34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /apps/web/loose_code_delete_eventually/[accountId]/settings/layout.tsx: -------------------------------------------------------------------------------- 1 | import SettingsNavigation from "@/components/dashboard/settings-navigation"; 2 | import DashboardTitle from "@/components/dashboard/dashboard-title"; 3 | import { Separator } from "@repo/ui/components/ui/separator"; 4 | 5 | export default function TeamSettingsPage({ 6 | children, 7 | params: { accountSlug }, 8 | }: { 9 | children: React.ReactNode; 10 | params: { accountSlug: string }; 11 | }): JSX.Element { 12 | const items = [ 13 | { name: "Account", href: `/dashboard/${accountSlug}/settings` }, 14 | { name: "Members", href: `/dashboard/${accountSlug}/settings/members` }, 15 | { name: "Billing", href: `/dashboard/${accountSlug}/settings/billing` }, 16 | ]; 17 | return ( 18 |
19 | 23 | 24 |
25 | 28 |
{children}
29 |
30 |
31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /apps/web/loose_code_delete_eventually/[accountId]/settings/page.tsx: -------------------------------------------------------------------------------- 1 | import EditTeamName from "@/components/basejump/edit-team-name"; 2 | import EditTeamSlug from "@/components/basejump/edit-team-slug"; 3 | import { createClient } from "@/lib/supabase/server"; 4 | 5 | export default async function TeamSettingsPage({ 6 | params: { accountSlug }, 7 | }: { 8 | params: { accountSlug: string }; 9 | }): Promise { 10 | const supabaseClient = await createClient(); 11 | const { data: teamAccount }: any = await supabaseClient.rpc( 12 | "get_account_by_slug", 13 | // @ts-ignore 14 | { 15 | slug: accountSlug, 16 | } as any, 17 | ); 18 | 19 | return ( 20 |
21 | 22 | 23 |
24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /apps/web/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | transpilePackages: ["@repo/ui"], 3 | }; 4 | -------------------------------------------------------------------------------- /apps/web/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | export { default } from "@repo/ui/postcss.config"; -------------------------------------------------------------------------------- /apps/web/public/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/web/public/images/icon.png -------------------------------------------------------------------------------- /apps/web/src/app/(application-context)/(dashboard)/layout.tsx: -------------------------------------------------------------------------------- 1 | import { createClient } from "@/lib/supabase/server"; 2 | import DashboardHeader from "@/components/dashboard/dashboard-header"; 3 | 4 | export default async function PersonalAccountDashboard({ 5 | children, 6 | }: { 7 | children: React.ReactNode; 8 | }): Promise { 9 | const supabaseClient = await createClient(); 10 | 11 | const { data: personalAccount, error }: any = await supabaseClient.rpc( 12 | "get_personal_account", 13 | ); 14 | 15 | const navigation = [ 16 | // { 17 | // name: "Dashboard", 18 | // href: "/", 19 | // }, 20 | { 21 | name: "Agents", 22 | href: "/agents", 23 | }, 24 | { 25 | name: "Automations", 26 | href: "/workflows", 27 | }, 28 | // { 29 | // name: "Templates", 30 | // href: "/templates", 31 | // }, 32 | // { 33 | { 34 | name: "Calls", 35 | href: "/inbox", 36 | }, 37 | { 38 | name: "Settings", 39 | href: "/settings", 40 | }, 41 | ]; 42 | 43 | return ( 44 | <> 45 | 49 |
{children}
50 | 51 | ); 52 | } 53 | -------------------------------------------------------------------------------- /apps/web/src/app/(application-context)/(dashboard)/settings/billing/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import AccountBillingStatus from "@/components/basejump/account-billing-status"; 4 | 5 | 6 | export default function PersonalAccountBillingPage(): JSX.Element { 7 | return ; 8 | } 9 | -------------------------------------------------------------------------------- /apps/web/src/app/(application-context)/(dashboard)/settings/layout.tsx: -------------------------------------------------------------------------------- 1 | import SettingsNavigation from "@/components/dashboard/settings-navigation"; 2 | import DashboardTitle from "@/components/dashboard/dashboard-title"; 3 | import { Separator } from "@repo/ui/components/ui/separator"; 4 | 5 | export default function PersonalAccountSettingsPage({ 6 | children, 7 | }: { 8 | children: React.ReactNode; 9 | }): JSX.Element { 10 | const items = [ 11 | { name: "Linked Services", href: "/settings" }, 12 | { name: "Secrets", href: "/settings/secrets" }, 13 | { name: "Files", href: "/settings/files" }, 14 | { name: "API Keys", href: "/settings/keys" }, 15 | { name: "Your Profile", href: "/settings/profile" }, 16 | // { name: "Teams", href: "/settings/teams" }, 17 | { name: "Members", href: "/settings/members" }, 18 | { name: "Billing", href: "/settings/billing" }, 19 | 20 | ]; 21 | return ( 22 |
23 | 27 | 28 |
29 | 32 |
{children}
33 |
34 |
35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /apps/web/src/app/(application-context)/(dashboard)/settings/profile/page.tsx: -------------------------------------------------------------------------------- 1 | import EditPersonalAccountName from "@/components/basejump/edit-personal-account-name"; 2 | import {createClient} from "@/lib/supabase/server"; 3 | 4 | export default async function PersonalAccountSettingsPage(): Promise { 5 | const supabaseClient = await createClient(); 6 | const {data: personalAccount}: any = await supabaseClient.rpc('get_personal_account'); 7 | 8 | return ( 9 |
10 | 11 |
12 | ) 13 | } -------------------------------------------------------------------------------- /apps/web/src/app/(application-context)/(dashboard)/settings/teams/page.tsx: -------------------------------------------------------------------------------- 1 | import ManageTeams from "@/components/basejump/manage-teams"; 2 | 3 | export default async function PersonalAccountTeamsPage(): Promise { 4 | return ( 5 |
6 | 7 |
8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /apps/web/src/app/(application-context)/(dashboard)/templates/page.tsx: -------------------------------------------------------------------------------- 1 | import { PartyPopper } from "lucide-react"; 2 | 3 | export default function TemplatesPage(): JSX.Element { 4 | return ( 5 |
6 |

Templates

7 |
8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /apps/web/src/app/(application-context)/layout.tsx: -------------------------------------------------------------------------------- 1 | import { AnythingProvider } from "@/context/AnythingContext"; 2 | 3 | interface ProtectedLayoutProps { 4 | children: React.ReactNode; 5 | } 6 | 7 | export default function ApplicationContextLayout({ children }: ProtectedLayoutProps): JSX.Element { 8 | return ( 9 | 10 | {children} 11 | 12 | ); 13 | } -------------------------------------------------------------------------------- /apps/web/src/app/auth/callback/route.ts: -------------------------------------------------------------------------------- 1 | import { createClient } from "@/lib/supabase/server"; 2 | import { NextResponse } from "next/server"; 3 | 4 | export async function GET(request: Request) { 5 | // The `/auth/callback` route is required for the server-side auth flow implemented 6 | // by the SSR package. It exchanges an auth code for the user's session. 7 | // https://supabase.com/docs/guides/auth/server-side/nextjs 8 | const requestUrl = new URL(request.url); 9 | const code = requestUrl.searchParams.get("code"); 10 | const returnUrl = requestUrl.searchParams.get("returnUrl"); 11 | const origin = requestUrl.origin; 12 | 13 | console.log("hitting auth/callback route"); 14 | 15 | if (code) { 16 | console.log("We have code in exchangeCodeForSession for Supabas Auth"); 17 | const supabase = await createClient(); 18 | await supabase.auth.exchangeCodeForSession(code); 19 | } 20 | 21 | // URL to redirect to after sign up process completes 22 | return NextResponse.redirect([origin, returnUrl || '/'].join('')); 23 | } 24 | -------------------------------------------------------------------------------- /apps/web/src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/web/src/app/favicon.ico -------------------------------------------------------------------------------- /apps/web/src/app/invitation/page.tsx: -------------------------------------------------------------------------------- 1 | import AcceptTeamInvitation from "@/components/basejump/accept-team-invitation"; 2 | import { redirect } from "next/navigation"; 3 | 4 | export default async function AcceptInvitationPage({ 5 | searchParams, 6 | }: { 7 | searchParams: any; 8 | }) { 9 | if (!searchParams.token) { 10 | redirect("/"); 11 | } 12 | 13 | return ( 14 |
15 | 16 |
17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /apps/web/src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import { Inter as FontSans } from "next/font/google"; 2 | import "@repo/ui/globals.css"; 3 | import { cn } from "@/lib/utils"; 4 | import { PostHogProvider } from "../posthog/provider"; 5 | 6 | const defaultUrl: string = process.env.NEXT_PUBLIC_HOSTED_URL!; 7 | 8 | const fontSans = FontSans({ 9 | subsets: ["latin"], 10 | variable: "--font-sans", 11 | }); 12 | 13 | export const metadata = { 14 | metadataBase: new URL(defaultUrl), 15 | title: "Anything AI", 16 | description: "Use tomorrows AI in your business today", 17 | }; 18 | 19 | interface RootLayoutProps { 20 | children: React.ReactNode; 21 | } 22 | 23 | export default function RootLayout({ children }: RootLayoutProps): JSX.Element { 24 | return ( 25 | 32 | 33 |
34 | {children} 35 |
36 | 37 | 38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /apps/web/src/app/login/page.tsx: -------------------------------------------------------------------------------- 1 | import { Suspense } from "react"; //https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout 2 | import LoginPage from "@/components/auth/login-component"; 3 | 4 | const Login = () => { 5 | return ( 6 | Loading...
}> 7 | 8 | 9 | ); 10 | }; 11 | 12 | export default Login; 13 | -------------------------------------------------------------------------------- /apps/web/src/app/signup/page.tsx: -------------------------------------------------------------------------------- 1 | import { Suspense } from "react"; //https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout 2 | import LoginPage from "@/components/auth/login-component"; 3 | 4 | const SignupPage = () => { 5 | return ( 6 | Loading...}> 7 | 8 | 9 | ); 10 | }; 11 | 12 | export default SignupPage; 13 | -------------------------------------------------------------------------------- /apps/web/src/components/agents/tools-tab.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { 4 | Card, 5 | CardContent, 6 | CardDescription, 7 | CardHeader, 8 | CardTitle, 9 | } from "@repo/ui/components/ui/card"; 10 | import { ScrollArea } from "@repo/ui/components/ui/scroll-area"; 11 | 12 | export default function ToolsTab() { 13 | return ( 14 | 15 | 16 | 17 | Agent Tools 18 | 19 | Configure the tools available to your agent 20 | 21 | 22 | 23 |
24 | Tools configuration coming soon 25 |
26 |
27 |
28 |
29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /apps/web/src/components/basejump/accept-team-invitation.tsx: -------------------------------------------------------------------------------- 1 | import { acceptInvitation } from "@/lib/actions/invitations"; 2 | import { createClient } from "@/lib/supabase/server"; 3 | import { Alert } from "@repo/ui/components/ui/alert"; 4 | import { Card, CardContent } from "@repo/ui/components/ui/card"; 5 | import { SubmitButton } from "@/components/submit-button"; 6 | 7 | type Props = { 8 | token: string; 9 | }; 10 | 11 | export default async function AcceptTeamInvitation({ 12 | token, 13 | }: Props): Promise { 14 | const supabaseClient = await createClient(); 15 | const { data: invitation }: any = await supabaseClient.rpc( 16 | "lookup_invitation", 17 | // @ts-ignore 18 | { 19 | lookup_invitation_token: token, 20 | } as any, 21 | ); 22 | 23 | return ( 24 | 25 | 26 |
27 |

You've been invited to join

28 |

{invitation.account_name}

29 |
30 | {Boolean(invitation.active) ? ( 31 |
32 | 33 | 37 | Accept invitation 38 | 39 |
40 | ) : ( 41 | 42 | This invitation has been deactivated. Please contact the account 43 | owner for a new invitation. 44 | 45 | )} 46 |
47 |
48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /apps/web/src/components/basejump/create-team-invitation-button.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { Button } from "@repo/ui/components/ui/button"; 4 | import { 5 | Dialog, 6 | DialogContent, 7 | DialogDescription, 8 | DialogHeader, 9 | DialogTitle, 10 | DialogTrigger, 11 | } from "@repo/ui/components/ui/dialog"; 12 | import NewInvitationForm from "./new-invitation-form"; 13 | 14 | type Props = { 15 | accountId: string; 16 | }; 17 | 18 | export default function CreateTeamInvitationButton({ accountId }: Props): JSX.Element { 19 | return ( 20 | 21 | 22 | 23 | 24 | 25 | 26 | Create a new invitation 27 | 28 | Invitation links can be given to anyone to join your team 29 | 30 | 31 | 32 | 33 | 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /apps/web/src/components/basejump/delete-team-invitation-button.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { Button } from "@repo/ui/components/ui/button"; 4 | import { 5 | Dialog, 6 | DialogContent, 7 | DialogDescription, 8 | DialogHeader, 9 | DialogTitle, 10 | DialogTrigger, 11 | } from "@repo/ui/components/ui/dialog"; 12 | import { useState } from "react"; 13 | import { Trash } from "lucide-react"; 14 | import { SubmitButton } from "@/components/submit-button"; 15 | import { deleteInvitation } from "@/lib/actions/invitations"; 16 | import { usePathname } from "next/navigation"; 17 | 18 | type Props = { 19 | invitationId: string; 20 | }; 21 | 22 | export default function DeleteTeamInvitationButton({ 23 | invitationId, 24 | }: Props): JSX.Element { 25 | const [open, setOpen] = useState(false); 26 | const returnPath = usePathname(); 27 | return ( 28 | 29 | 30 | 33 | 34 | 35 | 36 | Cancel pending invitation 37 | 38 | Are you sure? This cannot be undone 39 | 40 | 41 |
42 | 43 | 44 | 49 | Cancel invitation 50 | 51 |
52 |
53 |
54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /apps/web/src/components/basejump/delete-team-member-form.tsx: -------------------------------------------------------------------------------- 1 | import { SubmitButton } from "@/components/submit-button"; 2 | import { removeTeamMember } from "@/lib/actions/members"; 3 | import { GetAccountMembersResponse } from "@usebasejump/shared"; 4 | import { usePathname } from "next/navigation"; 5 | 6 | type Props = { 7 | accountId: string; 8 | teamMember: GetAccountMembersResponse[0]; 9 | }; 10 | 11 | export default function DeleteTeamMemberForm({ 12 | accountId, 13 | teamMember, 14 | }: Props): JSX.Element { 15 | const pathName = usePathname(); 16 | 17 | return ( 18 |
19 | 20 | 21 | 22 | 23 | 28 | Remove member 29 | 30 |
31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /apps/web/src/components/basejump/edit-personal-account-name.tsx: -------------------------------------------------------------------------------- 1 | import { Input } from "@repo/ui/components/ui/input"; 2 | import { SubmitButton } from "@/components/submit-button"; 3 | import { Label } from "@repo/ui/components/ui/label"; 4 | import { GetAccountResponse } from "@usebasejump/shared"; 5 | import { 6 | Card, 7 | CardContent, 8 | CardDescription, 9 | CardFooter, 10 | CardHeader, 11 | CardTitle, 12 | } from "@repo/ui/components/ui/card"; 13 | import { editPersonalAccountName } from "@/lib/actions/personal-account"; 14 | 15 | type Props = { 16 | account: GetAccountResponse; 17 | }; 18 | 19 | export default function EditPersonalAccountName({ 20 | account, 21 | }: Props): JSX.Element { 22 | return ( 23 | 24 | 25 | Your info 26 | 27 | Your name is used on your personal profile as well as in your teams 28 | 29 | 30 |
31 | 32 | 33 |
34 | 35 | 41 |
42 |
43 | 44 | 48 | Save 49 | 50 | 51 |
52 |
53 | ); 54 | } 55 | -------------------------------------------------------------------------------- /apps/web/src/components/basejump/edit-team-name.tsx: -------------------------------------------------------------------------------- 1 | import { Input } from "@repo/ui/components/ui/input"; 2 | import { SubmitButton } from "@/components/submit-button"; 3 | import { editTeamName } from "@/lib/actions/teams"; 4 | import { Label } from "@repo/ui/components/ui/label"; 5 | import { GetAccountResponse } from "@usebasejump/shared"; 6 | import { 7 | Card, 8 | CardContent, 9 | CardDescription, 10 | CardFooter, 11 | CardHeader, 12 | CardTitle, 13 | } from "@repo/ui/components/ui/card"; 14 | 15 | type Props = { 16 | account: GetAccountResponse; 17 | }; 18 | 19 | export default function EditTeamName({ account }: Props): JSX.Element { 20 | return ( 21 | 22 | 23 | Team Info 24 | 25 | Your team name and identifier are unique for your team 26 | 27 | 28 |
29 | 30 | 31 |
32 | 33 | 39 |
40 |
41 | 42 | 43 | Save 44 | 45 | 46 |
47 |
48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /apps/web/src/components/basejump/edit-team-slug.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { Input } from "@repo/ui/components/ui/input"; 4 | import { SubmitButton } from "@/components/submit-button"; 5 | import { editTeamSlug } from "@/lib/actions/teams"; 6 | import { Label } from "@repo/ui/components/ui/label"; 7 | import { GetAccountResponse } from "@usebasejump/shared"; 8 | import { 9 | Card, 10 | CardContent, 11 | CardDescription, 12 | CardFooter, 13 | CardHeader, 14 | CardTitle, 15 | } from "@repo/ui/components/ui/card"; 16 | 17 | type Props = { 18 | account: GetAccountResponse; 19 | }; 20 | 21 | export default function EditTeamSlug({ account }: Props): JSX.Element { 22 | return ( 23 | 24 | 25 | Team Identifier 26 | Your team identifier must be unique 27 | 28 |
29 | 30 | 31 |
32 | 33 |
34 | 35 | https://your-app.com/ 36 | 37 | 43 |
44 |
45 |
46 | 47 | 48 | Save 49 | 50 | 51 |
52 |
53 | ); 54 | } 55 | -------------------------------------------------------------------------------- /apps/web/src/components/basejump/new-team-form.tsx: -------------------------------------------------------------------------------- 1 | import { Input } from "@repo/ui/components/ui/input"; 2 | import { SubmitButton } from "@/components/submit-button"; 3 | import { createTeam } from "@/lib/actions/teams"; 4 | import { Label } from "@repo/ui/components/ui/label"; 5 | 6 | export default function NewTeamForm(): JSX.Element { 7 | return ( 8 |
9 |
10 | 11 | 12 |
13 |
14 | 15 |
16 | 17 | https://tryanything.xyz/ 18 | 19 | 20 |
21 |
22 | 23 | Create team 24 | 25 |
26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /apps/web/src/components/dashboard/dashboard-title.tsx: -------------------------------------------------------------------------------- 1 | interface Props { 2 | title: string; 3 | description: string; 4 | } 5 | export default function DashboardTitle({ 6 | title, 7 | description, 8 | }: Props): JSX.Element { 9 | return ( 10 |
11 |

{title}

12 |

{description}

13 |
14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /apps/web/src/components/dashboard/navigation-account-selector.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useRouter } from "next/navigation"; 4 | import AccountSelector from "@/components/basejump/account-selector"; 5 | 6 | interface Props { 7 | accountId: string; 8 | } 9 | export default function NavigatingAccountSelector({ 10 | accountId, 11 | }: Props): JSX.Element { 12 | const router = useRouter(); 13 | 14 | return ; 15 | } 16 | -------------------------------------------------------------------------------- /apps/web/src/components/dashboard/settings-navigation.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import Link from "next/link"; 4 | import { usePathname } from "next/navigation"; 5 | 6 | import { cn } from "@/lib/utils"; 7 | import { buttonVariants } from "@repo/ui/components/ui/button"; 8 | 9 | interface SidebarNavProps extends React.HTMLAttributes { 10 | items: { 11 | href: string; 12 | name: string; 13 | }[]; 14 | } 15 | 16 | export default function SettingsNavigation({ 17 | className, 18 | items, 19 | ...props 20 | }: SidebarNavProps): JSX.Element { 21 | const pathname = usePathname(); 22 | 23 | return ( 24 | 47 | ); 48 | } 49 | -------------------------------------------------------------------------------- /apps/web/src/components/free-trial-badge.tsx: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from "react"; 2 | import { useAnything } from "@/context/AnythingContext"; 3 | import Link from "next/link"; 4 | 5 | export default function FreeTrialBadge() { 6 | const { subscription } = useAnything(); 7 | const [daysLeft, setDaysLeft] = useState(0); 8 | const [isOnFreeTrial, setIsOnFreeTrial] = useState(false); 9 | 10 | useEffect(() => { 11 | const calculateDaysLeft = () => { 12 | if (!subscription?.free_trial_ends_at) return 0; 13 | const endDate = new Date(subscription.free_trial_ends_at); 14 | const today = new Date(); 15 | const diffTime = endDate.getTime() - today.getTime(); 16 | return Math.ceil(diffTime / (1000 * 3600 * 24)); 17 | }; 18 | 19 | const calculatedDaysLeft = calculateDaysLeft(); 20 | setDaysLeft(calculatedDaysLeft); 21 | setIsOnFreeTrial(calculatedDaysLeft > 0 && !subscription?.paying_customer); 22 | }, [subscription?.free_trial_ends_at, subscription?.paying_customer]); 23 | 24 | if (!isOnFreeTrial) { 25 | return null; 26 | } 27 | 28 | return ( 29 | 30 |
31 | Free Trial Tasks Used: {subscription?.free_trial_task_usage}/ 32 | {subscription?.free_trial_task_limit} tasks • {daysLeft} days left 33 |
34 | 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /apps/web/src/components/logo.tsx: -------------------------------------------------------------------------------- 1 | /* istanbul ignore file */ 2 | import Image from "next/image"; 3 | import { cn } from "@/lib/utils"; 4 | 5 | type Props = { 6 | size?: "sm" | "lg"; 7 | className?: string; 8 | logoOnly?: boolean; 9 | }; 10 | 11 | const Logo = ({ 12 | size = "sm", 13 | className, 14 | logoOnly = false, 15 | }: Props): JSX.Element => { 16 | const height = size === "sm" ? 40 : 150; 17 | const width = size === "sm" ? 40 : 150; 18 | return ( 19 |
29 |
35 | Anything Logo 41 |
42 | {!logoOnly && ( 43 |

49 | Anything 50 |

51 | )} 52 |
53 | ); 54 | }; 55 | 56 | export default Logo; 57 | -------------------------------------------------------------------------------- /apps/web/src/components/studio/edges/workflow-edge.tsx: -------------------------------------------------------------------------------- 1 | import { useAnything } from "@/context/AnythingContext"; 2 | import { 3 | BaseEdge, 4 | EdgeLabelRenderer, 5 | getSimpleBezierPath, 6 | getSmoothStepPath, 7 | getStraightPath, 8 | useReactFlow, 9 | Edge, 10 | EdgeProps, 11 | } from "reactflow"; 12 | 13 | export default function CustomEdge({ 14 | id, 15 | sourceX, 16 | sourceY, 17 | targetX, 18 | targetY, 19 | }: EdgeProps): JSX.Element { 20 | const { setEdges } = useReactFlow(); 21 | const { workflow } = useAnything(); 22 | 23 | const [edgePath, labelX, labelY] = getSimpleBezierPath({ 24 | sourceX, 25 | sourceY, 26 | targetX, 27 | targetY, 28 | }); 29 | 30 | return ( 31 | <> 32 | 33 | 34 | 48 | 49 | 50 | ); 51 | } 52 | -------------------------------------------------------------------------------- /apps/web/src/components/studio/forms/action-settings-form.tsx: -------------------------------------------------------------------------------- 1 | import { useAnything } from "@/context/AnythingContext"; 2 | import ConfigurationForm from "./configuration-form"; 3 | import { InputsFormLayout } from "./variables/variables-form-layout"; 4 | import { Play } from "lucide-react"; 5 | import { Button } from "@repo/ui/components/ui/button"; 6 | import NoNodeSelected from "./no-node-selected"; 7 | 8 | export default function ActionSettingsForm(): JSX.Element { 9 | const { workflow, testing } = useAnything(); 10 | 11 | const testWorkflow = async () => { 12 | try { 13 | testing.testWorkflow(); 14 | } catch { 15 | console.error("Error testing workflow"); 16 | } 17 | }; 18 | 19 | console.log("[RENDERING ACTION & VARIABLES FORMS]"); 20 | 21 | return ( 22 |
23 | {workflow.selected_node_data && workflow.selected_action_id ? ( 24 |
25 |
26 | 27 | 28 |
29 |
30 | ) : ( 31 | 32 | )} 33 |
34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /apps/web/src/components/studio/forms/display/action-display-tab.tsx: -------------------------------------------------------------------------------- 1 | import { useAnything } from "@/context/AnythingContext"; 2 | import ActionDisplayForm from "./action-display-form"; 3 | import NoNodeSelected from "../no-node-selected"; 4 | 5 | export default function ActionDisplayTab(): JSX.Element { 6 | const { workflow } = useAnything(); 7 | 8 | return ( 9 |
10 | {workflow.selected_node_data && workflow.selected_action_id ? ( 11 |
12 |
13 | 14 |
15 |
16 | ) : ( 17 | 18 | )} 19 |
20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /apps/web/src/components/studio/forms/display/edit-display-schema.tsx: -------------------------------------------------------------------------------- 1 | export let EDIT_ACTION_DISPLAY_SCHEMA: any = { 2 | type: "object", 3 | properties: { 4 | label: { 5 | title: "Label", 6 | description: "Short name of Action.", 7 | type: "string", 8 | "x-jsf-presentation": { 9 | inputType: "simple_text", 10 | }, 11 | "x-any-validation": { 12 | type: "string", 13 | }, 14 | }, 15 | description: { 16 | title: "Description", 17 | description: 18 | "Longer description of what the action does for extra clarity.", 19 | type: "string", 20 | "x-jsf-presentation": { 21 | inputType: "simple_text", 22 | }, 23 | "x-any-validation": { 24 | type: "string", 25 | }, 26 | }, 27 | icon: { 28 | title: "Icon", 29 | description: "SVG icon to represent the action. Often a company logo.", 30 | type: "string", 31 | "x-jsf-presentation": { 32 | inputType: "simple_text", 33 | }, 34 | "x-any-validation": { 35 | type: "string", 36 | }, 37 | }, 38 | }, 39 | "x-jsf-order": ["label", "description", "icon"], 40 | required: ["label", "icon"], 41 | additionalProperties: false, 42 | }; 43 | -------------------------------------------------------------------------------- /apps/web/src/components/studio/forms/no-node-selected.tsx: -------------------------------------------------------------------------------- 1 | import { ArrowBigLeft, Play } from "lucide-react"; 2 | 3 | const NoNodeSelected = (): JSX.Element => { 4 | return ( 5 |
6 |
7 |
8 | 9 |
10 |
11 |
Select an Action
12 |
to configure
13 |
14 |
15 |
16 | ); 17 | }; 18 | 19 | export default NoNodeSelected; 20 | -------------------------------------------------------------------------------- /apps/web/src/components/studio/forms/settings/flow-settings-schema.ts: -------------------------------------------------------------------------------- 1 | export let EDIT_FLOW_SCHEMA: any = { 2 | type: "object", 3 | properties: { 4 | "flow_name": { 5 | "title": "Name", 6 | "description": "Short name of Workflow.", 7 | "type": "string", 8 | "x-jsf-presentation": { 9 | "inputType": "simple_text" 10 | }, 11 | "x-any-validation": { 12 | "type": "string" 13 | } 14 | }, 15 | "description": { 16 | "title": "Description", 17 | "description": "Longer description of what the flow does.", 18 | "type": "string", 19 | "x-jsf-presentation": { 20 | "inputType": "simple_text" 21 | }, 22 | "x-any-validation": { 23 | "type": "string" 24 | } 25 | } 26 | }, 27 | "x-jsf-order": ["flow_name", "description"], 28 | "required": ["flow_name", "description"], 29 | "additionalProperties": false 30 | } -------------------------------------------------------------------------------- /apps/web/src/components/studio/forms/settings/workflow-settings-form.tsx: -------------------------------------------------------------------------------- 1 | import { createHeadlessForm } from "@remoteoss/json-schema-form"; 2 | import { JsonSchemaForm } from "../json-schema-form"; 3 | import { useAnything } from "@/context/AnythingContext"; 4 | import { EDIT_FLOW_SCHEMA } from "./flow-settings-schema"; 5 | import { useMemo } from "react"; 6 | 7 | export default function WorkflowSettingsForm(): JSX.Element { 8 | const { 9 | workflow: { db_flow, updateWorkflow }, 10 | } = useAnything(); 11 | 12 | //TODO: Create input 13 | let input = { 14 | flow_name: db_flow?.flow_name, 15 | description: db_flow?.description, 16 | // active: db_flow?.active, 17 | }; 18 | 19 | console.log("input in worfklow-settings-form", input); 20 | 21 | const { fields, handleValidation } = useMemo(() => { 22 | let results = createHeadlessForm(EDIT_FLOW_SCHEMA, { 23 | initialValues: input, 24 | }); 25 | // //Used to add "strict" feature kinda sideloading jsonschema form or our validation needs 26 | // results.fields = results.fields.map((field: any) => ({ 27 | // ...field, 28 | // strict: EDIT_FLOW_SCHEMA.properties[field.name]?.["x-any-validation"]?.strict || true, 29 | // })); 30 | 31 | return results; 32 | }, [input]); 33 | async function handleOnSubmit(formValues: any) { 34 | await updateWorkflow(formValues); 35 | console.log("Submitted!", formValues); 36 | } 37 | 38 | return ( 39 |
40 | toggleStrictMode(fieldName, strict)} 47 | /> 48 |
49 | ); 50 | } 51 | -------------------------------------------------------------------------------- /apps/web/src/components/studio/forms/testing/action-testing.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/apps/web/src/components/studio/forms/testing/action-testing.tsx -------------------------------------------------------------------------------- /apps/web/src/components/studio/forms/testing/task-status.tsx: -------------------------------------------------------------------------------- 1 | // TaskStatus.tsx 2 | import React from "react"; 3 | import { DurationBadge, TaskStatusBadge } from "./task-status-badges"; 4 | 5 | const TaskStatusComponent = ({ 6 | status, 7 | started_at, 8 | ended_at, 9 | }: { 10 | status: string; 11 | started_at?: string; 12 | ended_at?: string; 13 | }) => { 14 | return ( 15 |
16 | 17 | 18 |
19 | ); 20 | }; 21 | 22 | export default TaskStatusComponent; 23 | -------------------------------------------------------------------------------- /apps/web/src/components/studio/forms/testing/workflow-testing.tsx: -------------------------------------------------------------------------------- 1 | 2 | import { useAnything } from "@/context/AnythingContext"; 3 | 4 | 5 | export default function WorkflowTestingWizard(): JSX.Element { 6 | const { workflow } = useAnything(); 7 | 8 | return ( 9 |
10 | Testing Wizard 11 |
12 | ) 13 | } -------------------------------------------------------------------------------- /apps/web/src/components/studio/studio-workflow-editor.tsx: -------------------------------------------------------------------------------- 1 | import ReactFlow, { Background, BackgroundVariant, Controls } from "reactflow"; 2 | 3 | import "reactflow/dist/style.css"; 4 | 5 | import BaseNode from "./nodes/workflow-node"; 6 | import { useAnything } from "@/context/AnythingContext"; 7 | import CustomEdge from "./edges/workflow-edge"; 8 | import { Button } from "@repo/ui/components/ui/button"; 9 | import { StudioActionsSheet } from "./action-sheet/studio-actions-sheet"; 10 | 11 | const nodeTypes = { 12 | anything: BaseNode, 13 | }; 14 | 15 | const edgeTypes = { 16 | anything: CustomEdge, 17 | }; 18 | 19 | export default function StudioWorkflowEditor(): JSX.Element { 20 | const { workflow } = useAnything(); 21 | 22 | return ( 23 |
24 | 36 | 37 | 38 | 39 | 53 | 54 | 55 |
56 | ); 57 | } 58 | -------------------------------------------------------------------------------- /apps/web/src/components/studio/variable-explorers/explorer-panel.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import { BaseInputsExplorer } from "@/components/studio/variable-explorers/inputs-explorer"; 4 | import { BaseVariableEditingExplorer } from "../variable-explorers/variable-editing-explorer-layout"; 5 | 6 | interface ExplorersPanelProps { 7 | showInputsExplorer?: boolean; 8 | showResultsExplorer?: boolean; 9 | } 10 | 11 | export function ExplorersPanel({ 12 | showInputsExplorer, 13 | showResultsExplorer, 14 | }: ExplorersPanelProps) { 15 | if (!showInputsExplorer && !showResultsExplorer) return null; 16 | 17 | return ( 18 |
19 | {showInputsExplorer && ( 20 |
21 |
22 | 23 |
24 |
25 | )} 26 | {showResultsExplorer && ( 27 |
28 |
29 | 30 |
31 |
32 | )} 33 |
34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /apps/web/src/components/submit-button.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useFormState, useFormStatus } from "react-dom"; 4 | import { type ComponentProps } from "react"; 5 | import { Button } from "@repo/ui/components/ui/button"; 6 | import { Alert, AlertDescription } from "@repo/ui/components/ui/alert"; 7 | import { AlertTriangle } from "lucide-react"; 8 | 9 | type Props = Omit, "formAction"> & { 10 | pendingText?: string; 11 | formAction: (prevState: any, formData: FormData) => Promise; 12 | errorMessage?: string; 13 | }; 14 | 15 | const initialState = { 16 | message: "", 17 | }; 18 | 19 | export function SubmitButton({ 20 | children, 21 | formAction, 22 | errorMessage, 23 | pendingText = "Submitting...", 24 | ...props 25 | }: Props) { 26 | const { pending, action } = useFormStatus(); 27 | const [state, internalFormAction] = useFormState(formAction, initialState); 28 | 29 | const isPending = pending && action === internalFormAction; 30 | 31 | return ( 32 |
33 | {Boolean(errorMessage || state?.message) && ( 34 | 35 | 36 | {errorMessage || state?.message} 37 | 38 | )} 39 |
40 | 48 |
49 |
50 | ); 51 | } 52 | -------------------------------------------------------------------------------- /apps/web/src/components/workflows/dahsbloard-title-with-navigation.tsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link"; 2 | import { Button } from "@repo/ui/components/ui/button"; 3 | 4 | interface Props { 5 | title: string; 6 | description: string; 7 | href: string; 8 | children?: React.ReactNode; 9 | } 10 | 11 | export default function DashboardTitleWithNavigation({ 12 | title, 13 | description, 14 | href, 15 | children, 16 | }: Props): JSX.Element { 17 | return ( 18 |
19 |
20 |

{title}

21 |

{description}

22 |
23 | {children} 24 |
25 | 26 | 27 | 28 |
29 |
30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /apps/web/src/components/workflows/dashboard-title-with-action.tsx: -------------------------------------------------------------------------------- 1 | import { Button } from "@repo/ui/components/ui/button"; 2 | 3 | interface Action { 4 | label: string; 5 | onClick: () => void; 6 | } 7 | 8 | interface Props { 9 | title: string; 10 | description: string; 11 | actions: Action[]; 12 | } 13 | 14 | export default function DashboardTitleWithAction({ 15 | title, 16 | description, 17 | actions, 18 | }: Props): JSX.Element { 19 | return ( 20 |
21 |
22 |

{title}

23 |

{description}

24 |
25 | 26 |
27 | {actions.map((action, index) => ( 28 | 31 | ))} 32 |
33 |
34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /apps/web/src/components/workflows/workflow-status.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import { Badge } from "@repo/ui/components/ui/badge"; 4 | 5 | const WorkflowStatusComponent = ({ 6 | active, 7 | draft, 8 | }: { 9 | active: boolean; 10 | draft: boolean; 11 | }) => { 12 | return ( 13 |
14 | {draft ? : } 15 |
16 | ); 17 | }; 18 | 19 | export default WorkflowStatusComponent; 20 | 21 | const statusStyles: Record = { 22 | true: "bg-green-200 text-green-800 hover:bg-green-200", 23 | false: "bg-red-200 text-red-800 hover:bg-red-200", 24 | }; 25 | 26 | export const WorfklowStatusBadge = ({ active }: { active: boolean }) => { 27 | return ( 28 |
31 | {active ? "ON" : "OFF"} 32 |
33 | ); 34 | }; 35 | 36 | export const DraftBadge = () => { 37 | return ( 38 |
41 | DRAFT 42 |
43 | ); 44 | }; 45 | -------------------------------------------------------------------------------- /apps/web/src/components/workflows/workflow-toggle.tsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import { useAnything } from "@/context/AnythingContext"; 3 | import { Switch } from "@repo/ui/components/ui/switch"; 4 | import { Label } from "@repo/ui/components/ui/label"; 5 | 6 | const WorkflowToggle = ({ 7 | active, 8 | workflow_id, 9 | }: { 10 | active: boolean; 11 | workflow_id: string; 12 | }): JSX.Element => { 13 | const { workflow } = useAnything(); 14 | 15 | const updateActive = async () => { 16 | try { 17 | await workflow.updateWorkflow({ active: !active }); 18 | } catch (error) { 19 | console.error("Error updating workflow:", error); 20 | } 21 | }; 22 | 23 | return ( 24 |
25 | 31 | 32 |
33 | ); 34 | }; 35 | 36 | export default WorkflowToggle; 37 | -------------------------------------------------------------------------------- /apps/web/src/hooks/use-debounce.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | 3 | export function useDebounce(value: T, delay: number): T { 4 | const [debouncedValue, setDebouncedValue] = useState(value); 5 | 6 | useEffect(() => { 7 | const timer = setTimeout(() => { 8 | setDebouncedValue(value); 9 | }, delay); 10 | 11 | return () => { 12 | clearTimeout(timer); 13 | }; 14 | }, [value, delay]); 15 | 16 | return debouncedValue; 17 | } -------------------------------------------------------------------------------- /apps/web/src/lib/actions/billing.ts: -------------------------------------------------------------------------------- 1 | import { redirect } from "next/navigation"; 2 | import { createClient } from "../supabase/server"; 3 | import handleEdgeFunctionError from "../supabase/handle-edge-error"; 4 | 5 | export async function setupNewSubscription(prevState: any, formData: FormData) { 6 | "use server"; 7 | 8 | const accountId = formData.get("accountId") as string; 9 | const returnUrl = formData.get("returnUrl") as string; 10 | const supabaseClient = await createClient(); 11 | 12 | const { data, error } = await supabaseClient.functions.invoke('billing-functions', { 13 | body: { 14 | action: "get_new_subscription_url", 15 | args: { 16 | account_id: accountId, 17 | success_url: returnUrl, 18 | cancel_url: returnUrl 19 | } 20 | } 21 | }); 22 | 23 | if (error) { 24 | return await handleEdgeFunctionError(error); 25 | } 26 | 27 | redirect(data.url); 28 | }; 29 | 30 | export async function manageSubscription(prevState: any, formData: FormData) { 31 | "use server"; 32 | 33 | const accountId = formData.get("accountId") as string; 34 | const returnUrl = formData.get("returnUrl") as string; 35 | const supabaseClient = await createClient(); 36 | 37 | const { data, error } = await supabaseClient.functions.invoke('billing-functions', { 38 | body: { 39 | action: "get_billing_portal_url", 40 | args: { 41 | account_id: accountId, 42 | return_url: returnUrl 43 | } 44 | } 45 | }); 46 | 47 | if (error) { 48 | return await handleEdgeFunctionError(error); 49 | } 50 | 51 | redirect(data.url); 52 | }; -------------------------------------------------------------------------------- /apps/web/src/lib/actions/members.ts: -------------------------------------------------------------------------------- 1 | 'use server' 2 | 3 | import { redirect } from "next/navigation"; 4 | import { createClient } from "../supabase/server"; 5 | 6 | export async function removeTeamMember(prevState: any, formData: FormData) { 7 | "use server"; 8 | 9 | const userId = formData.get("userId") as string; 10 | const accountId = formData.get("accountId") as string; 11 | const returnUrl = formData.get("returnUrl") as string; 12 | const supabase = await createClient(); 13 | 14 | const { error }: any = await supabase.rpc('remove_account_member', 15 | // @ts-ignore 16 | { 17 | user_id: userId, 18 | account_id: accountId 19 | } as any); 20 | 21 | if (error) { 22 | return { 23 | message: error.message 24 | }; 25 | } 26 | 27 | redirect(returnUrl); 28 | }; 29 | 30 | 31 | export async function updateTeamMemberRole(prevState: any, formData: FormData) { 32 | "use server"; 33 | 34 | const userId = formData.get("userId") as string; 35 | const accountId = formData.get("accountId") as string; 36 | const newAccountRole = formData.get("accountRole") as string; 37 | const returnUrl = formData.get("returnUrl") as string; 38 | const makePrimaryOwner = formData.get("makePrimaryOwner"); 39 | 40 | const supabase = await createClient(); 41 | 42 | const { error }: any = await supabase.rpc('update_account_user_role', 43 | // @ts-ignore 44 | { 45 | user_id: userId, 46 | account_id: accountId, 47 | new_account_role: newAccountRole, 48 | make_primary_owner: makePrimaryOwner 49 | } as any); 50 | 51 | if (error) { 52 | return { 53 | message: error.message 54 | }; 55 | } 56 | 57 | redirect(returnUrl); 58 | }; 59 | -------------------------------------------------------------------------------- /apps/web/src/lib/actions/personal-account.ts: -------------------------------------------------------------------------------- 1 | import { createClient } from "../supabase/server"; 2 | 3 | export async function editPersonalAccountName(prevState: any, formData: FormData) { 4 | "use server"; 5 | 6 | const name = formData.get("name") as string; 7 | const accountId = formData.get("accountId") as string; 8 | const supabase = await createClient(); 9 | 10 | const { error }: any = await supabase.rpc('update_account', 11 | // @ts-ignore 12 | { 13 | name, 14 | account_id: accountId 15 | } as any); 16 | 17 | if (error) { 18 | return { 19 | message: error.message 20 | }; 21 | } 22 | }; -------------------------------------------------------------------------------- /apps/web/src/lib/full-invitation-url.ts: -------------------------------------------------------------------------------- 1 | const defaultUrl: string = process.env.NEXT_PUBLIC_APP_URL || ""; 2 | 3 | export default function fullInvitationUrl(token: string) { 4 | return `${defaultUrl}/invitation?token=${token}`; 5 | } -------------------------------------------------------------------------------- /apps/web/src/lib/hooks/use-accounts.ts: -------------------------------------------------------------------------------- 1 | import useSWR, {SWRConfiguration} from "swr"; 2 | import { createClient } from "../supabase/client"; 3 | import { GetAccountsResponse } from "@usebasejump/shared"; 4 | 5 | export const useAccounts = (options?: SWRConfiguration) => { 6 | const supabaseClient = createClient(); 7 | return useSWR( 8 | !!supabaseClient && ["accounts"], 9 | async () => { 10 | const {data, error} = await supabaseClient.rpc("get_accounts"); 11 | 12 | if (error) { 13 | throw new Error(error.message); 14 | } 15 | 16 | return data; 17 | }, 18 | options 19 | ); 20 | }; -------------------------------------------------------------------------------- /apps/web/src/lib/supabase/client.ts: -------------------------------------------------------------------------------- 1 | import { createBrowserClient } from '@supabase/ssr' 2 | 3 | export function createClient() { 4 | return createBrowserClient( 5 | process.env.NEXT_PUBLIC_SUPABASE_URL!, 6 | process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY! 7 | ) 8 | } -------------------------------------------------------------------------------- /apps/web/src/lib/supabase/handle-edge-error.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | import { FunctionsFetchError, FunctionsHttpError, FunctionsRelayError } from "@supabase/supabase-js" 3 | 4 | export default async function handleEdgeFunctionError(error: any) { 5 | if (error instanceof FunctionsHttpError) { 6 | const errorMessage = await error.context.json() 7 | return { 8 | message: Boolean(errorMessage.error) ? errorMessage.error : JSON.stringify(errorMessage) 9 | } 10 | } else if (error instanceof FunctionsRelayError) { 11 | return { 12 | message: error.message 13 | } 14 | } else if (error instanceof FunctionsFetchError) { 15 | return { 16 | message: error.message 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /apps/web/src/lib/supabase/server.ts: -------------------------------------------------------------------------------- 1 | import { createServerClient, type CookieOptions } from '@supabase/ssr' 2 | import { cookies } from 'next/headers' 3 | 4 | export async function createClient() { 5 | const cookieStore = await cookies() 6 | 7 | return createServerClient( 8 | process.env.NEXT_PUBLIC_SUPABASE_URL!, 9 | process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, 10 | { 11 | cookies: { 12 | getAll() { 13 | return cookieStore.getAll() 14 | }, 15 | setAll(cookiesToSet) { 16 | try { 17 | cookiesToSet.forEach(({ name, value, options }) => 18 | cookieStore.set(name, value, options) 19 | ) 20 | } catch { 21 | // The `setAll` method was called from a Server Component. 22 | // This can be ignored if you have middleware refreshing 23 | // user sessions. 24 | } 25 | }, 26 | }, 27 | } 28 | ) 29 | } -------------------------------------------------------------------------------- /apps/web/src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | import { parseISO, differenceInMilliseconds, formatDuration, intervalToDuration } from 'date-fns'; 4 | 5 | export function cn(...inputs: ClassValue[]) { 6 | return twMerge(clsx(inputs)) 7 | } 8 | 9 | export function formatTimeDifference(startTime: string, endTime: string): string { 10 | // Parse the timestamps 11 | const start = parseISO(startTime); 12 | const end = parseISO(endTime); 13 | 14 | // Calculate the difference in milliseconds 15 | const diffInMs = differenceInMilliseconds(end, start); 16 | 17 | // Format the difference 18 | let formattedDiff: string; 19 | 20 | if (diffInMs < 60000) { 21 | const diffInSeconds = diffInMs / 1000; 22 | formattedDiff = `${diffInSeconds.toFixed(2)} seconds`; 23 | } else { 24 | const duration = intervalToDuration({ start, end }); 25 | formattedDiff = formatDuration(duration, { format: ['minutes', 'seconds'] }); 26 | } 27 | 28 | return formattedDiff; 29 | } 30 | -------------------------------------------------------------------------------- /apps/web/src/middleware.ts: -------------------------------------------------------------------------------- 1 | import { type NextRequest } from "next/server"; 2 | // import { validateSession } from "@/lib/supabase/middleware"; 3 | import { updateSession } from "./lib/supabase/middleware"; 4 | import { NextResponse } from 'next/server' 5 | 6 | export async function middleware(request: NextRequest) { 7 | //Skip if the request is for the oauth integrations callbacks 8 | //TODO BRING BACK 9 | // if (request.nextUrl.pathname.startsWith('/auth/') && request.nextUrl.pathname.endsWith('/callback')) { 10 | // console.log('Skipping session update for auth callback route'); 11 | // return NextResponse.next(); 12 | // } 13 | 14 | return await updateSession(request); 15 | } 16 | 17 | export const config = { 18 | matcher: [ 19 | /* 20 | * Match all request paths except for the ones starting with: 21 | * - _next/static (static files) 22 | * - _next/image (image optimization files) 23 | * - favicon.ico (favicon file) 24 | * Feel free to modify this pattern to include more paths. 25 | */ 26 | '/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)', 27 | ], 28 | }; 29 | -------------------------------------------------------------------------------- /apps/web/src/posthog/PosthogPageView.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | 3 | import { usePathname, useSearchParams } from "next/navigation" 4 | import { useEffect, Suspense } from "react" 5 | import { usePostHog } from 'posthog-js/react' 6 | 7 | function PostHogPageView() : null { 8 | const pathname = usePathname() 9 | const searchParams = useSearchParams() 10 | const posthog = usePostHog() 11 | 12 | // Track pageviews 13 | useEffect(() => { 14 | if (pathname && posthog) { 15 | let url = window.origin + pathname 16 | if (searchParams.toString()) { 17 | url = url + `?${searchParams.toString()}` 18 | } 19 | 20 | posthog.capture('$pageview', { '$current_url': url }) 21 | } 22 | }, [pathname, searchParams, posthog]) 23 | 24 | return null 25 | } 26 | 27 | // Wrap this in Suspense to avoid the `useSearchParams` usage above 28 | // from deopting the whole app into client-side rendering 29 | // See https://nextjs.org/docs/messages/deopted-into-client-rendering 30 | export default function SuspendedPostHogPageView() { 31 | return 32 | 33 | 34 | } -------------------------------------------------------------------------------- /apps/web/src/posthog/events.ts: -------------------------------------------------------------------------------- 1 | export const AUTH_EVENTS = { 2 | LOGIN_ATTEMPT: "login_attempt", 3 | LOGIN_SUCCESS: "login_success", 4 | LOGIN_ERROR: "login_error", 5 | SIGNUP_ATTEMPT: "signup_attempt", 6 | SIGNUP_SUCCESS: "signup_success", 7 | SIGNUP_ERROR: "signup_error", 8 | EMAIL_VERIFICATION_SENT: "email_verification_sent", 9 | MARKETING_LOGIN_CLICK: "marketing_login_click", 10 | MARKETING_SIGNUP_CLICK: "marketing_signup_click", 11 | MARKETING_TEMPLATE_VIEW: "marketing_template_view", 12 | MARKETING_INTEGRATION_VIEW: "marketing_integration_view", 13 | MARKETING_DISCORD_CLICK: "marketing_discord_click" 14 | } as const; -------------------------------------------------------------------------------- /apps/web/src/posthog/posthog.ts: -------------------------------------------------------------------------------- 1 | import { PostHog } from 'posthog-node' 2 | 3 | export default function PostHogClient() { 4 | const posthogClient = new PostHog(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { 5 | host: process.env.NEXT_PUBLIC_POSTHOG_HOST, 6 | flushAt: 1, 7 | flushInterval: 0 8 | }) 9 | return posthogClient 10 | } -------------------------------------------------------------------------------- /apps/web/src/posthog/provider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import posthog from "posthog-js"; 4 | import { PostHogProvider as PHProvider } from "posthog-js/react"; 5 | import { useEffect } from "react"; 6 | import PostHogPageView from "./PosthogPageView"; 7 | 8 | export function PostHogProvider({ children }: { children: React.ReactNode }) { 9 | useEffect(() => { 10 | posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { 11 | api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, 12 | person_profiles: "identified_only", 13 | capture_pageview: false, // Disable automatic pageview capture, as we capture manually 14 | capture_pageleave: true, 15 | }); 16 | }, []); 17 | 18 | return ( 19 | 20 | 21 | {children} 22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /apps/web/src/types/prismjs.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'prismjs/components/prism-core' { 2 | const Prism: { 3 | highlight: (code: string, grammar: any, language: string) => string; 4 | languages: any; 5 | }; 6 | export const highlight: (code: string, grammar: any, language: string) => string; 7 | export const languages: any; 8 | export default Prism; 9 | } -------------------------------------------------------------------------------- /apps/web/src/types/workflows.ts: -------------------------------------------------------------------------------- 1 | import { HandleProps, Edge, NodeProps } from "reactflow"; 2 | 3 | //Configuration needed to display and run a Flow 4 | export interface Workflow { 5 | actions: Action[]; //Processing 6 | edges: Edge[]; //Needed for BFS traversal and flow rendering 7 | } 8 | 9 | //Guessing to what the total list of 10 | export enum ActionType { 11 | Input = "input", 12 | Trigger = "trigger", 13 | Action = "action", 14 | Loop = "loop", 15 | Decision = "decision", 16 | Filter = "filter", 17 | Output = "output" 18 | } 19 | 20 | //Node Configuration needed to display and run a Node 21 | export interface Action { 22 | anything_action_version: string; //defines compatability so in future we can upgrade actions 23 | type: ActionType; 24 | plugin_name: string; 25 | plugin_version: string; //TODO: so we can manage upgrade of plugins 26 | action_id: string; //unique id for react flow. probably generated based on action_id or plugin_id or slug of label 27 | label: string; 28 | description?: string; 29 | icon: string; 30 | inputs: Variable; 31 | inputs_locked: boolean; 32 | inputs_schema: Variable; //Action Variables. Almost like node level .env 33 | inputs_schema_locked: boolean; 34 | plugin_config: Variable; 35 | plugin_config_locked: boolean; 36 | plugin_config_schema: Variable; 37 | plugin_config_schema_locked: boolean; 38 | presentation?: NodePresentation; 39 | handles?: HandleProps[]; 40 | } 41 | 42 | // Presentation data only needed for react flow but we need all of it 43 | interface NodePresentation { 44 | 45 | position: { 46 | x: number; 47 | y: number; 48 | } 49 | } 50 | 51 | interface Variable { 52 | [key: string]: any; // Using an index signature since the keys can vary. 53 | } 54 | 55 | export type AnythingNodeProps = NodeProps; 56 | -------------------------------------------------------------------------------- /apps/web/tailwind.config.ts: -------------------------------------------------------------------------------- 1 | export * from "@repo/ui/tailwind.config"; -------------------------------------------------------------------------------- /apps/web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@repo/typescript-config/nextjs.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "plugins": [ 6 | { 7 | "name": "next" 8 | } 9 | ], 10 | "paths": { 11 | "@/*": [ 12 | "./src/*" 13 | ] 14 | }, 15 | }, 16 | "include": [ 17 | "next-env.d.ts", 18 | "next.config.mjs", 19 | "postcss.config.mjs", 20 | "**/*.ts", 21 | "**/*.tsx", 22 | ".next/types/**/*.ts" 23 | ], 24 | "exclude": [ 25 | "node_modules" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/architecture.png -------------------------------------------------------------------------------- /assets/agent_library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/assets/agent_library.png -------------------------------------------------------------------------------- /assets/anything_aug_10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/assets/anything_aug_10.gif -------------------------------------------------------------------------------- /assets/anything_dnd_sept_11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/assets/anything_dnd_sept_11.gif -------------------------------------------------------------------------------- /assets/anything_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/assets/anything_screenshot.png -------------------------------------------------------------------------------- /assets/anything_sept_11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/assets/anything_sept_11.gif -------------------------------------------------------------------------------- /core/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and tests 2 | /target/ 3 | 4 | # If you have the `Cargo.lock` file in your project directory, 5 | # include it if your project is an application, not a library. 6 | # See https://doc.rust-lang.org/cargo/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries 7 | # Cargo.lock 8 | 9 | # These are backup files generated by Rustfmt 10 | **/*.rs.bk`` 11 | 12 | # Editor and IDE files 13 | /.vscode/ 14 | /.idea/ 15 | /*.swp 16 | /.DS_Store 17 | Thumbs.db 18 | 19 | # WebAssembly generated files 20 | /pkg/ 21 | *.wasm 22 | 23 | # Extism plugin build artifacts 24 | target/ 25 | 26 | # Log files 27 | /logs/ 28 | *.log 29 | 30 | # Temporary files 31 | /tmp/ 32 | -------------------------------------------------------------------------------- /core/anything-server/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | rustflags = ["--cfg", "tokio_unstable"] -------------------------------------------------------------------------------- /core/anything-server/.dockerignore: -------------------------------------------------------------------------------- 1 | **/target/ 2 | **/.git/ 3 | **/node_modules/ 4 | .env -------------------------------------------------------------------------------- /core/anything-server/.env.template: -------------------------------------------------------------------------------- 1 | SUPABASE_URL=http://127.0.0.1:54321/rest/v1 2 | SUPABASE_SERVICE_ROLE_API_KEY= 3 | SUPABASE_API_KEY= 4 | SUPABASE_JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long 5 | ANYTHING_BASE_URL=http://localhost:3000 6 | LOOPS_API_KEY=your_loops_api_key_here 7 | VAPI_API_KEY=your_vapi_api_key_here 8 | TWILIO_ACCOUNT_SID= 9 | TWILIO_AUTH_TOKEN= 10 | R2_BUCKET= 11 | R2_ACCOUNT_ID= 12 | R2_ACCESS_KEY_ID= 13 | R2_SECRET_ACCESS_KEY= 14 | R2_PUBLIC_DOMAIN= 15 | -------------------------------------------------------------------------------- /core/anything-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef 2 | 3 | # Create and change to the app directory. 4 | WORKDIR /app 5 | 6 | FROM chef AS planner 7 | COPY . ./ 8 | RUN cargo chef prepare --recipe-path recipe.json 9 | 10 | FROM chef AS builder 11 | COPY --from=planner /app/recipe.json recipe.json 12 | 13 | # Build dependencies - this is the caching Docker layer! 14 | RUN cargo chef cook --release --recipe-path recipe.json 15 | 16 | # Build application 17 | COPY . ./ 18 | RUN cargo build --release 19 | 20 | CMD ["./target/release/anything-server"] 21 | 22 | 23 | EXPOSE 3001 -------------------------------------------------------------------------------- /core/anything-server/OldDockerfile: -------------------------------------------------------------------------------- 1 | FROM rust:1.83.0-bookworm as builder 2 | 3 | # Set environment variables for build 4 | ENV RUST_LOG=info 5 | ENV RUST_BACKTRACE=1 6 | # ENV RUSTFLAGS="-C target-cpu=native -C opt-level=3" 7 | # ENV CARGO_PROFILE_RELEASE_LTO=true 8 | # ENV CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 9 | # ENV RUST_MIN_STACK=8388608 10 | # 1MB ram 11 | ENV RUST_MIN_STACK=1048576 12 | 13 | 14 | WORKDIR /app 15 | 16 | # Copy only the dependency files first 17 | COPY Cargo.toml Cargo.lock ./ 18 | 19 | # Create a dummy main.rs to build dependencies 20 | RUN mkdir src && \ 21 | echo "fn main() {}" > src/main.rs && \ 22 | cargo build --release && \ 23 | rm -rf src 24 | 25 | # Now copy the real source code 26 | COPY ./src ./src 27 | 28 | # Clean and rebuild with actual source 29 | RUN cargo clean && cargo build --release 30 | 31 | FROM debian:bookworm-slim 32 | 33 | # Set runtime environment variables 34 | ENV RUST_LOG=info 35 | ENV RUST_BACKTRACE=1 36 | ENV RUST_MIN_STACK=8388608 37 | 38 | # Install required packages 39 | RUN apt-get update && apt-get install -y \ 40 | tini \ 41 | libssl3 \ 42 | ca-certificates \ 43 | libpthread-stubs0-dev \ 44 | curl \ 45 | && rm -rf /var/lib/apt/lists/* 46 | 47 | WORKDIR /app 48 | 49 | # Copy the binary from builder 50 | COPY --from=builder /app/target/release/anything-server ./anything-server 51 | 52 | # Copy the src directory structure to maintain the expected path 53 | COPY ./src/system_plugins/registry/schemas ./src/system_plugins/registry/schemas 54 | 55 | # Add healthcheck 56 | # HEALTHCHECK --interval=30s --timeout=3s \ 57 | # CMD curl -f http://localhost:3001/health || exit 1 58 | 59 | # Use tini as entrypoint 60 | ENTRYPOINT ["/usr/bin/tini", "--"] 61 | CMD ["./anything-server"] 62 | 63 | EXPOSE 3001 -------------------------------------------------------------------------------- /core/anything-server/_nixpacks.toml: -------------------------------------------------------------------------------- 1 | [phases.setup] 2 | # https://nixpacks.com/docs/configuration/file#nixpkgs-archive 3 | # Replace the commit hash below with one that provides a newer glibc. 4 | nixpkgsArchive = "0c19708cf035f50d28eb4b2b8e7a79d4dc52f6bb" 5 | providers = ["...", "rust", "python"] 6 | 7 | [phases.build] 8 | cmds = ["cargo build --release"] 9 | 10 | [start] 11 | cmd = "./target/release/anything-server" 12 | -------------------------------------------------------------------------------- /core/anything-server/src/actor_processor/messages.rs: -------------------------------------------------------------------------------- 1 | use crate::processor::components::{ProcessorError, WorkflowExecutionContext}; 2 | use crate::processor::execute_task::TaskResult; 3 | use crate::processor::processor::ProcessorMessage; 4 | use crate::types::task_types::Task; 5 | use std::collections::HashMap; 6 | use tokio::sync::oneshot; 7 | use uuid::Uuid; 8 | 9 | /// Messages that can be sent to actors 10 | #[derive(Debug)] 11 | pub enum ActorMessage { 12 | /// Execute a single task 13 | // ExecuteTask { 14 | // task: Task, 15 | // respond_to: oneshot::Sender, 16 | // context: WorkflowExecutionContext, 17 | // }, 18 | ExecuteTask { 19 | task: Task, 20 | respond_to: oneshot::Sender, 21 | context: WorkflowExecutionContext, 22 | in_memory_tasks: Option>, 23 | }, 24 | /// Execute a workflow (collection of tasks) 25 | ExecuteWorkflow { 26 | message: ProcessorMessage, 27 | respond_to: oneshot::Sender>, 28 | }, 29 | /// Shutdown the actor 30 | Shutdown, 31 | } 32 | -------------------------------------------------------------------------------- /core/anything-server/src/actor_processor/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod actor_pool; 2 | pub mod actor_system; 3 | pub mod dependency_resolver; 4 | pub mod messages; 5 | pub mod processor; 6 | pub mod task_actor; 7 | pub mod tests; 8 | pub mod workflow_actor; 9 | 10 | pub use actor_system::ActorProcessor; 11 | pub use messages::ActorMessage; 12 | pub use processor::actor_processor; 13 | -------------------------------------------------------------------------------- /core/anything-server/src/agents/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod channels; 2 | pub mod create; 3 | pub mod delete; 4 | pub mod get; 5 | pub mod tools; 6 | pub mod twilio; 7 | pub mod update; 8 | pub mod vapi; 9 | -------------------------------------------------------------------------------- /core/anything-server/src/api_key_middleware.rs: -------------------------------------------------------------------------------- 1 | use axum::{ 2 | extract::Request, 3 | http::{HeaderMap, StatusCode}, 4 | middleware::Next, 5 | response::Response, 6 | }; 7 | use serde::{Deserialize, Serialize}; 8 | use std::sync::Arc; 9 | 10 | use crate::secrets; 11 | 12 | #[derive(Clone, Debug, Serialize, Deserialize)] 13 | pub struct ApiKeyUser { 14 | pub account_id: String, 15 | } 16 | 17 | pub async fn api_key_middleware( 18 | headers: HeaderMap, 19 | mut request: Request, 20 | next: Next, 21 | ) -> Result { 22 | // Get the API key from the Authorization header 23 | let api_key = match headers.get("Authorization").and_then(|h| h.to_str().ok()) { 24 | Some(header) if header.starts_with("Bearer ") => header[7..].to_string(), 25 | _ => return Err(StatusCode::UNAUTHORIZED), 26 | }; 27 | 28 | // Get the state from the request extensions 29 | let state = request 30 | .extensions() 31 | .get::>() 32 | .ok_or(StatusCode::INTERNAL_SERVER_ERROR)?; 33 | 34 | // Check if the API key exists and is valid in the database 35 | let secret = match secrets::get_secret_by_secret_value(state.clone(), api_key).await { 36 | Ok(secret) => secret, 37 | Err(_) => return Err(StatusCode::UNAUTHORIZED), 38 | }; 39 | 40 | // Verify this is an API key secret 41 | if !secret.anything_api_key { 42 | return Err(StatusCode::UNAUTHORIZED); 43 | } 44 | 45 | // Add the user info to request extensions 46 | let api_key_user = ApiKeyUser { 47 | account_id: secret.account_id, 48 | }; 49 | request.extensions_mut().insert(api_key_user); 50 | 51 | Ok(next.run(request).await) 52 | } 53 | -------------------------------------------------------------------------------- /core/anything-server/src/auth/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod accounts; 2 | pub mod init; 3 | pub mod providers; 4 | pub mod refresh; 5 | pub mod utils; 6 | -------------------------------------------------------------------------------- /core/anything-server/src/billing/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod accounts; 2 | pub mod billing_usage_engine; 3 | pub mod usage; 4 | pub mod stripe_webhooks; 5 | pub mod create_links; -------------------------------------------------------------------------------- /core/anything-server/src/billing/usage.rs: -------------------------------------------------------------------------------- 1 | use crate::AppState; 2 | use axum::extract::{Extension, Path, State}; 3 | use axum::http::StatusCode; 4 | use axum::response::IntoResponse; 5 | use axum::Json; 6 | use serde_json::Value; 7 | use std::sync::Arc; 8 | 9 | use crate::supabase_jwt_middleware::User; 10 | 11 | pub async fn get_account_billing_status( 12 | State(state): State>, 13 | Extension(user): Extension, 14 | Path(account_id): Path, 15 | ) -> impl IntoResponse { 16 | let client = &state.anything_client; 17 | 18 | let response = match client 19 | .from("accounts_billing") 20 | .auth(&user.jwt) // Pass a reference to the JWT 21 | .select("*") 22 | .eq("account_id", account_id) 23 | .single() 24 | .execute() 25 | .await 26 | { 27 | Ok(response) => response, 28 | Err(_) => { 29 | return ( 30 | StatusCode::INTERNAL_SERVER_ERROR, 31 | "Failed to execute request", 32 | ) 33 | .into_response() 34 | } 35 | }; 36 | 37 | let body = match response.text().await { 38 | Ok(body) => body, 39 | Err(_) => { 40 | return ( 41 | StatusCode::INTERNAL_SERVER_ERROR, 42 | "Failed to read response body", 43 | ) 44 | .into_response() 45 | } 46 | }; 47 | 48 | let item: Value = match serde_json::from_str(&body) { 49 | Ok(item) => item, 50 | Err(_) => { 51 | return (StatusCode::INTERNAL_SERVER_ERROR, "Failed to parse JSON").into_response() 52 | } 53 | }; 54 | 55 | Json(item).into_response() 56 | } 57 | -------------------------------------------------------------------------------- /core/anything-server/src/bundler/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod accounts; 2 | pub mod bundler; 3 | pub mod secrets; 4 | 5 | use std::{sync::Arc, time::Duration}; 6 | 7 | pub use bundler::*; 8 | 9 | use crate::AppState; 10 | 11 | pub async fn cleanup_bundler_caches(state: Arc) { 12 | let cleanup_interval = Duration::from_secs(86400); // Run cleanup every day 13 | println!("[BUNDLER] Starting periodic cache cleanup task"); 14 | loop { 15 | tokio::time::sleep(cleanup_interval).await; 16 | println!("[BUNDLER] Running scheduled cache cleanup"); 17 | 18 | // Cleanup secrets caches for all accounts 19 | for cache_entry in state.bundler_secrets_cache.iter_mut() { 20 | cache_entry.cleanup(); 21 | } 22 | 23 | // Cleanup accounts caches for all accounts 24 | for cache_entry in state.bundler_accounts_cache.iter_mut() { 25 | cache_entry.cleanup(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /core/anything-server/src/files/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod r2_client; 2 | pub mod routes; 3 | pub mod utils; 4 | -------------------------------------------------------------------------------- /core/anything-server/src/files/r2_client.rs: -------------------------------------------------------------------------------- 1 | use aws_sdk_s3::config::{Credentials, Region}; 2 | use aws_sdk_s3::Client as S3Client; 3 | 4 | // Initialize R2 client 5 | pub async fn get_r2_client() -> S3Client { 6 | println!("[FILES] Initializing R2 client"); 7 | let r2_account_id = std::env::var("R2_ACCOUNT_ID").expect("R2_ACCOUNT_ID must be set"); 8 | let r2_access_key_id = std::env::var("R2_ACCESS_KEY_ID").expect("R2_ACCESS_KEY_ID must be set"); 9 | let r2_secret_access_key = 10 | std::env::var("R2_SECRET_ACCESS_KEY").expect("R2_SECRET_ACCESS_KEY must be set"); 11 | 12 | let credentials = Credentials::new( 13 | r2_access_key_id, 14 | r2_secret_access_key, 15 | None, 16 | None, 17 | "anything-r2", 18 | ); 19 | 20 | let config = aws_sdk_s3::Config::builder() 21 | .behavior_version_latest() 22 | .region(Region::new("auto")) 23 | .endpoint_url(format!( 24 | "https://{}.r2.cloudflarestorage.com", 25 | r2_account_id 26 | )) 27 | .credentials_provider(credentials) 28 | .build(); 29 | 30 | println!("[FILES] R2 client initialized successfully"); 31 | S3Client::from_conf(config) 32 | } 33 | -------------------------------------------------------------------------------- /core/anything-server/src/marketplace/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod actions; 2 | pub mod profiles; 3 | pub mod scanning; 4 | pub mod workflows; 5 | -------------------------------------------------------------------------------- /core/anything-server/src/old_parallel_processor/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod db_calls; 2 | pub mod execute_task; 3 | pub mod flow_session_cache; 4 | pub mod hydrate_processor; 5 | pub mod parallelizer; 6 | pub mod path_processor; 7 | pub mod process_trigger_utils; 8 | pub mod processor; 9 | pub mod processor_utils; 10 | pub mod utils; 11 | 12 | pub use processor::*; 13 | -------------------------------------------------------------------------------- /core/anything-server/src/old_parallel_processor/process_trigger_utils.rs: -------------------------------------------------------------------------------- 1 | use serde_json::Value; 2 | 3 | use crate::types::task_types::Task; 4 | 5 | pub fn process_trigger_task( 6 | task: &Task, 7 | ) -> Result, Box> { 8 | println!("[PROCESS TRIGGER TASK] Processing trigger task"); 9 | 10 | //Return the result we created in the trigger 11 | Ok(task.result.clone()) 12 | } 13 | -------------------------------------------------------------------------------- /core/anything-server/src/processor/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod components; 2 | pub mod db_calls; 3 | pub mod enhanced_processor; 4 | pub mod execute_task; 5 | pub mod flow_session_cache; 6 | pub mod hydrate_processor; 7 | pub mod parallelizer; 8 | pub mod path_processor; 9 | pub mod process_trigger_utils; 10 | pub mod processor; 11 | pub mod processor_utils; 12 | pub mod utils; 13 | 14 | #[cfg(test)] 15 | pub mod tests; 16 | -------------------------------------------------------------------------------- /core/anything-server/src/processor/process_trigger_utils.rs: -------------------------------------------------------------------------------- 1 | use serde_json::Value; 2 | 3 | use crate::types::task_types::Task; 4 | 5 | pub fn process_trigger_task( 6 | task: &Task, 7 | ) -> Result, Box> { 8 | println!("[PROCESS TRIGGER TASK] Processing trigger task"); 9 | 10 | //Return the result we created in the trigger 11 | Ok(task.result.clone()) 12 | } 13 | -------------------------------------------------------------------------------- /core/anything-server/src/processor/processor.rs: -------------------------------------------------------------------------------- 1 | use crate::types::task_types::Task; 2 | use crate::types::workflow_types::{DatabaseFlowVersion, WorkflowVersionDefinition}; 3 | use std::collections::HashMap; 4 | use uuid::Uuid; 5 | 6 | #[derive(Debug, Clone)] 7 | pub struct ProcessorMessage { 8 | pub workflow_id: Uuid, 9 | pub workflow_version: DatabaseFlowVersion, 10 | pub workflow_definition: WorkflowVersionDefinition, 11 | pub flow_session_id: Uuid, 12 | pub trigger_session_id: Uuid, 13 | pub trigger_task: Option, 14 | pub task_id: Option, // Add task_id for tracing 15 | pub existing_tasks: HashMap, // Add any existing tasks from hydration 16 | // pub workflow_graph: HashMap>, // Pre-computed workflow graph 17 | } 18 | -------------------------------------------------------------------------------- /core/anything-server/src/processor/tests/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod parallelizer_tests; 2 | pub mod path_processor_tests; 3 | pub mod processor_utils_tests; 4 | 5 | // Re-export test utilities 6 | pub use parallelizer_tests::*; 7 | pub use path_processor_tests::*; 8 | pub use processor_utils_tests::*; 9 | -------------------------------------------------------------------------------- /core/anything-server/src/processor/tests/path_processor_tests.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | use super::*; 4 | use crate::processor::path_processor::*; 5 | 6 | #[test] 7 | fn test_path_processor_placeholder() { 8 | // Placeholder test to resolve module import 9 | assert!(true); 10 | } 11 | 12 | // TODO: Add comprehensive tests for path_processor functions: 13 | // - EnhancedBranchProcessor::new() 14 | // - process_task_and_branches_parallel() 15 | // - process_branches_parallel() 16 | // - spawn_parallel_branch_direct() 17 | // - process_task_and_branches() (legacy wrapper) 18 | } 19 | -------------------------------------------------------------------------------- /core/anything-server/src/processor/tests/processor_utils_tests.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | use super::*; 4 | use crate::processor::processor_utils::*; 5 | 6 | #[test] 7 | fn test_processor_utils_placeholder() { 8 | // Placeholder test to resolve module import 9 | assert!(true); 10 | } 11 | 12 | // TODO: Add comprehensive tests for processor_utils functions: 13 | // - create_task() 14 | // - create_task_for_action() 15 | // - find_next_actions() 16 | // - update_completed_task_with_result() 17 | // - handle_task_error() 18 | // - process_task() 19 | } 20 | -------------------------------------------------------------------------------- /core/anything-server/src/system_plugins/formatter_actions/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod date_formatter; 2 | pub mod number_formatter; 3 | pub mod text_formatter; 4 | -------------------------------------------------------------------------------- /core/anything-server/src/system_plugins/formatter_actions/number_formatter.rs: -------------------------------------------------------------------------------- 1 | use chrono::{DateTime, Duration, NaiveDateTime, Offset, Utc}; 2 | use chrono_tz::Tz; 3 | use html2md::parse_html; 4 | use pulldown_cmark::{html, Options, Parser}; 5 | use rand::Rng; 6 | use regex::Regex; 7 | use serde_json::{json, Value}; 8 | 9 | pub async fn process_number_task( 10 | bundled_context: &Value, 11 | ) -> Result> { 12 | let input = bundled_context 13 | .get("input") 14 | .and_then(|v| v.as_str()) 15 | .unwrap_or(""); 16 | 17 | let operation = bundled_context 18 | .get("operation") 19 | .and_then(|v| v.as_str()) 20 | .unwrap_or(""); 21 | 22 | let min = bundled_context 23 | .get("min") 24 | .and_then(|v| v.as_f64()) 25 | .unwrap_or(0.0); 26 | 27 | let max = bundled_context 28 | .get("max") 29 | .and_then(|v| v.as_f64()) 30 | .unwrap_or(100.0); 31 | 32 | let result = match operation { 33 | "random_number" => { 34 | let mut rng = rand::thread_rng(); 35 | rng.gen_range(min..=max).to_string() 36 | } 37 | _ => input.to_string(), 38 | }; 39 | 40 | Ok(json!({ "result": result })) 41 | } 42 | -------------------------------------------------------------------------------- /core/anything-server/src/system_plugins/http/legacy_schemas.json: -------------------------------------------------------------------------------- 1 | use serde_json::Value; 2 | 3 | const SCHEMA_VERSIONS: &[Value] = &[ 4 | serde_json::json!({ 5 | "version": "0.1.0", 6 | "schema": { 7 | "type": "object", 8 | "properties": { 9 | "method": { 10 | "title": "Method", 11 | "description": "HTTP Method for request", 12 | "type": "string", 13 | "oneOf": [ 14 | {"value": "GET", "title": "GET"}, 15 | {"value": "POST", "title": "POST"}, 16 | {"value": "PUT", "title": "PUT"}, 17 | {"value": "DELETE", "title": "DELETE"}, 18 | {"value": "HEAD", "title": "HEAD"}, 19 | {"value": "OPTIONS", "title": "OPTIONS"}, 20 | {"value": "PATCH", "title": "PATCH"} 21 | ], 22 | "default": "GET" 23 | }, 24 | "url": { 25 | "title": "URL", 26 | "description": "URL for request", 27 | "type": "string" 28 | }, 29 | "headers": { 30 | "title": "Headers", 31 | "description": "Headers for request", 32 | "type": "object", 33 | "default": {} 34 | }, 35 | "body": { 36 | "title": "Body", 37 | "description": "Body for request", 38 | "type": "object", 39 | "default": {} 40 | } 41 | }, 42 | "required": ["method", "url"] 43 | } 44 | }) 45 | ]; 46 | 47 | -------------------------------------------------------------------------------- /core/anything-server/src/system_plugins/http/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod http_plugin; 2 | -------------------------------------------------------------------------------- /core/anything-server/src/system_plugins/input/mod.rs: -------------------------------------------------------------------------------- 1 | use serde_json::Value; 2 | 3 | //This is meant to be used for function calls if we do agents and voice call type thing 4 | //And to be how we do reusable flows or sublfows 5 | 6 | pub fn process_input_task( 7 | bundled_context: &Value, 8 | ) -> Result, Box> { 9 | println!("[INPUT] Starting input task processing"); 10 | println!("[INPUT] Bundled context: {:?}", bundled_context); 11 | 12 | return Ok(Some(bundled_context.clone())); 13 | } 14 | -------------------------------------------------------------------------------- /core/anything-server/src/system_plugins/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod formatter_actions; 2 | pub mod http; 3 | pub mod input; 4 | pub mod javascript; 5 | pub mod output; 6 | pub mod registry; 7 | pub mod webhook_response; 8 | pub mod webhook_trigger; 9 | pub mod agent_tool_trigger; 10 | pub mod agent_tool_trigger_response; 11 | pub mod filter; -------------------------------------------------------------------------------- /core/anything-server/src/system_plugins/registry/mod.rs: -------------------------------------------------------------------------------- 1 | use serde_json::Value; 2 | use std::env; 3 | use std::fs; 4 | use std::fs::File; 5 | use std::io::BufReader; 6 | 7 | pub fn load_schema_templates() -> Result, Box> { 8 | let mut templates = Vec::new(); 9 | 10 | // Get current directory 11 | let current_dir = env::current_dir()?; 12 | let schemas_dir = current_dir.join("src/system_plugins/registry/schemas"); 13 | 14 | // Check if schemas directory exists 15 | if !schemas_dir.exists() { 16 | return Err("Schemas directory not found".into()); 17 | } 18 | 19 | // Iterate through files in schemas directory 20 | for entry in fs::read_dir(schemas_dir)? { 21 | let entry = entry?; 22 | let path = entry.path(); 23 | 24 | // Only process .json files 25 | if path.extension().and_then(|ext| ext.to_str()) == Some("json") { 26 | let file = File::open(&path)?; 27 | let reader = BufReader::new(file); 28 | 29 | // Parse JSON file 30 | let json: Value = serde_json::from_reader(reader)?; 31 | 32 | // Add the JSON object to our templates vector 33 | templates.push(json); 34 | } 35 | } 36 | 37 | Ok(templates) 38 | } 39 | -------------------------------------------------------------------------------- /core/anything-server/src/system_plugins/registry/schemas/agent_tool_call_schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "trigger", 3 | "featured": false, 4 | "action_template_definition": 5 | { 6 | "anything_action_version": "0.1.0", 7 | "type": "trigger", 8 | "plugin_name": "@anything/agent_tool_call", 9 | "plugin_version": "0.1.0", 10 | "action_id": "agent_tool_call", 11 | "label": "Agent Tool Call", 12 | "description": "A tool call from an agent", 13 | "icon": "", 14 | "inputs_locked": false, 15 | "inputs_schema": {}, 16 | "inputs_schema_locked": false, 17 | "plugin_config": {}, 18 | "plugin_config_locked": true, 19 | "plugin_config_schema": {}, 20 | "plugin_config_schema_locked": true, 21 | "presentation": { 22 | "position": { 23 | "x": 300, 24 | "y": 100 25 | } 26 | }, 27 | "handles": [ 28 | { 29 | "id": "b", 30 | "type": "source", 31 | "position": "bottom" 32 | } 33 | ] 34 | } 35 | } -------------------------------------------------------------------------------- /core/anything-server/src/system_plugins/webhook_trigger/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod webhook_trigger; 2 | pub use webhook_trigger::*; 3 | pub mod webhook_trigger_utils; 4 | -------------------------------------------------------------------------------- /core/anything-server/src/types/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod action_types; 2 | pub mod json_schema; 3 | pub mod plugin_types; 4 | pub mod react_flow_types; 5 | pub mod task_types; 6 | pub mod workflow_types; 7 | -------------------------------------------------------------------------------- /core/anything-server/src/types/plugin_types.rs: -------------------------------------------------------------------------------- 1 | use super::react_flow_types::{HandleProps, NodePresentation}; 2 | use node_semver::Version; 3 | 4 | use serde::{Deserialize, Serialize}; 5 | use serde_json::Value; 6 | 7 | use crate::types::action_types::ActionType; 8 | use crate::types::json_schema::JsonSchema; 9 | 10 | #[derive(Serialize, Deserialize, Debug, Clone)] 11 | pub struct Plugin { 12 | pub r#type: ActionType, 13 | pub featured: bool, 14 | pub action_template_definition: ActionTemplateDefinition, 15 | } 16 | 17 | #[derive(Serialize, Deserialize, Debug, Clone)] 18 | pub struct ActionTemplateDefinition { 19 | pub anything_action_version: Version, 20 | pub r#type: ActionType, 21 | pub plugin_name: String, 22 | pub plugin_version: Version, 23 | pub action_id: String, 24 | pub label: String, 25 | pub description: Option, 26 | pub icon: String, 27 | pub inputs: Option, 28 | pub inputs_locked: bool, 29 | pub inputs_schema: Option, 30 | pub inputs_schema_locked: bool, 31 | pub plugin_config: Value, 32 | pub plugin_config_locked: bool, 33 | // pub plugin_config_schema: JsonSchema, 34 | pub plugin_config_schema_locked: bool, 35 | pub presentation: Option, 36 | pub handles: Option>, 37 | } 38 | -------------------------------------------------------------------------------- /core/anything-server/src/types/react_flow_types.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | 3 | 4 | #[derive(Serialize, Deserialize, Debug, Clone)] 5 | pub struct NodePresentation { 6 | pub position: Position, 7 | } 8 | 9 | #[derive(Serialize, Deserialize, Debug, Clone)] 10 | pub struct Position { 11 | pub x: f64, 12 | pub y: f64, 13 | } 14 | 15 | #[derive(Serialize, Deserialize, Debug, Clone)] 16 | pub struct HandleProps { 17 | pub id: String, 18 | pub r#type: String, 19 | pub position: String, 20 | } 21 | 22 | #[derive(Serialize, Deserialize, Debug, Clone)] 23 | pub struct Edge { 24 | pub id: String, 25 | pub source: String, 26 | pub source_handle: Option, 27 | pub target: String, 28 | pub target_handle: Option, 29 | pub r#type: String, 30 | } 31 | -------------------------------------------------------------------------------- /core/anything-server/template_db/workflow_boilerplates.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tryanything-ai/anything/c59e5230e12da2bbf6e8741a18c0189a84c44ed8/core/anything-server/template_db/workflow_boilerplates.json -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "anything", 3 | "private": true, 4 | "version": "0.1.0", 5 | "scripts": { 6 | "build": "turbo build", 7 | "dev": "turbo dev", 8 | "lint": "turbo lint", 9 | "format": "prettier --write \"**/*.{ts,tsx,md}\"", 10 | "ui:add": "pnpm --filter @repo/ui ui:add" 11 | }, 12 | "devDependencies": { 13 | "@repo/eslint-config": "workspace:*", 14 | "@repo/typescript-config": "workspace:*", 15 | "prettier": "^3.3.2", 16 | "turbo": "2.0.6" 17 | }, 18 | "packageManager": "pnpm@8.9.0", 19 | "engines": { 20 | "node": ">=18" 21 | } 22 | } -------------------------------------------------------------------------------- /packages/anything-api/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import("eslint").Linter.Config} */ 2 | module.exports = { 3 | root: true, 4 | extends: ['@repo/eslint-config/react-internal.js'], 5 | parser: '@typescript-eslint/parser', 6 | rules: { 7 | 'no-redeclare': 'off', 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /packages/anything-api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@repo/anything-api", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "ui:add": "pnpm dlx shadcn-ui@latest add", 7 | "lint": "eslint ." 8 | }, 9 | "peerDependencies": { 10 | "react": "^18.2.0" 11 | }, 12 | "devDependencies": { 13 | "@repo/eslint-config": "workspace:*", 14 | "@repo/typescript-config": "workspace:*", 15 | "@types/dotenv": "^8.2.0", 16 | "@types/node": "^20", 17 | "@types/uuid": "^9.0.8", 18 | "typescript": "^5.4.5" 19 | }, 20 | "dependencies": { 21 | "@supabase/supabase-js": "^2.47.7", 22 | "reactflow": "^11.11.3", 23 | "slugify": "^1.6.6", 24 | "uuid": "^9.0.0" 25 | }, 26 | "exports": "./src/index.ts" 27 | } 28 | -------------------------------------------------------------------------------- /packages/anything-api/src/index.ts: -------------------------------------------------------------------------------- 1 | import * as flows from './flows'; 2 | import * as action_templates from './action-templates'; 3 | import * as secrets from './secrets'; 4 | import * as testing from './testing'; 5 | import * as tasks from './tasks'; 6 | import * as charts from './charts'; 7 | import * as auth from './auth'; 8 | import * as billing from './billing'; 9 | import * as marketplace from './marketplace'; 10 | import * as profiles from './profiles'; 11 | import * as variables from './variable-explorer'; 12 | import * as agents from './agents'; 13 | import * as accounts from './accounts'; 14 | import * as files from './files'; 15 | 16 | const api = { 17 | flows, 18 | testing, 19 | tasks, 20 | action_templates, 21 | secrets, 22 | charts, 23 | auth, 24 | billing, 25 | marketplace, 26 | profiles, 27 | variables, 28 | agents, 29 | accounts, 30 | files 31 | }; 32 | 33 | export default api; 34 | 35 | // Re-export types 36 | export * from './testing'; 37 | export * from './tasks'; 38 | export * from './charts'; 39 | export * from "./types/workflows"; -------------------------------------------------------------------------------- /packages/anything-api/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@repo/typescript-config/nextjs.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "noEmit": true, 6 | "paths": { 7 | "@repo/anything-api/*": ["./src/*"] 8 | } 9 | }, 10 | "include": ["src"], 11 | "exclude": ["node_modules"] 12 | } 13 | -------------------------------------------------------------------------------- /packages/eslint-config/README.md: -------------------------------------------------------------------------------- 1 | # `@turbo/eslint-config` 2 | 3 | Collection of internal eslint configurations. 4 | -------------------------------------------------------------------------------- /packages/eslint-config/library.js: -------------------------------------------------------------------------------- 1 | const { resolve } = require("node:path"); 2 | 3 | const project = resolve(process.cwd(), "tsconfig.json"); 4 | 5 | /** @type {import("eslint").Linter.Config} */ 6 | module.exports = { 7 | extends: ["eslint:recommended", "turbo"], 8 | plugins: ["only-warn"], 9 | globals: { 10 | React: true, 11 | JSX: true, 12 | }, 13 | env: { 14 | node: true, 15 | }, 16 | settings: { 17 | "import/resolver": { 18 | typescript: { 19 | project, 20 | }, 21 | }, 22 | }, 23 | ignorePatterns: [ 24 | // Ignore dotfiles 25 | ".*.js", 26 | "node_modules/", 27 | "dist/", 28 | ], 29 | overrides: [ 30 | { 31 | files: ["*.js?(x)", "*.ts?(x)"], 32 | }, 33 | ], 34 | }; 35 | -------------------------------------------------------------------------------- /packages/eslint-config/next.js: -------------------------------------------------------------------------------- 1 | const { resolve } = require("node:path"); 2 | 3 | const project = resolve(process.cwd(), "tsconfig.json"); 4 | 5 | /** @type {import("eslint").Linter.Config} */ 6 | module.exports = { 7 | extends: [ 8 | "eslint:recommended", 9 | require.resolve("@vercel/style-guide/eslint/next"), 10 | "turbo", 11 | ], 12 | globals: { 13 | React: true, 14 | JSX: true, 15 | }, 16 | env: { 17 | node: true, 18 | browser: true, 19 | }, 20 | plugins: ["only-warn"], 21 | settings: { 22 | "import/resolver": { 23 | typescript: { 24 | project, 25 | }, 26 | }, 27 | }, 28 | ignorePatterns: [ 29 | // Ignore dotfiles 30 | ".*.js", 31 | "node_modules/", 32 | ], 33 | overrides: [{ files: ["*.js?(x)", "*.ts?(x)"] }], 34 | }; 35 | -------------------------------------------------------------------------------- /packages/eslint-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@repo/eslint-config", 3 | "version": "0.0.0", 4 | "private": true, 5 | "files": [ 6 | "library.js", 7 | "next.js", 8 | "react-internal.js" 9 | ], 10 | "devDependencies": { 11 | "@vercel/style-guide": "^6.0.0", 12 | "eslint-config-turbo": "2.0.6", 13 | "eslint-plugin-only-warn": "^1.1.0", 14 | "@typescript-eslint/parser": "^7.13.1", 15 | "@typescript-eslint/eslint-plugin": "^7.13.1", 16 | "typescript": "^5.4.5" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/eslint-config/react-internal.js: -------------------------------------------------------------------------------- 1 | const { resolve } = require("node:path"); 2 | 3 | const project = resolve(process.cwd(), "tsconfig.json"); 4 | 5 | /* 6 | * This is a custom ESLint configuration for use with 7 | * internal (bundled by their consumer) libraries 8 | * that utilize React. 9 | */ 10 | 11 | /** @type {import("eslint").Linter.Config} */ 12 | module.exports = { 13 | extends: ["eslint:recommended", "turbo"], 14 | plugins: ["only-warn"], 15 | globals: { 16 | React: true, 17 | JSX: true, 18 | }, 19 | env: { 20 | browser: true, 21 | }, 22 | settings: { 23 | "import/resolver": { 24 | typescript: { 25 | project, 26 | }, 27 | }, 28 | }, 29 | ignorePatterns: [ 30 | // Ignore dotfiles 31 | ".*.js", 32 | "node_modules/", 33 | "dist/", 34 | ], 35 | overrides: [ 36 | // Force ESLint to detect .tsx files 37 | { files: ["*.js?(x)", "*.ts?(x)"] }, 38 | ], 39 | }; 40 | -------------------------------------------------------------------------------- /packages/typescript-config/base.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "display": "Default", 4 | "compilerOptions": { 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "incremental": false, 9 | "isolatedModules": true, 10 | "lib": ["es2022", "DOM", "DOM.Iterable"], 11 | "module": "NodeNext", 12 | "moduleDetection": "force", 13 | "moduleResolution": "NodeNext", 14 | "noUncheckedIndexedAccess": true, 15 | "resolveJsonModule": true, 16 | "skipLibCheck": true, 17 | "strict": true, 18 | "target": "ES2022" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/typescript-config/nextjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "display": "Next.js", 4 | "extends": "./base.json", 5 | "compilerOptions": { 6 | "plugins": [{ "name": "next" }], 7 | "module": "ESNext", 8 | "moduleResolution": "Bundler", 9 | "allowJs": true, 10 | "jsx": "preserve", 11 | "noEmit": true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/typescript-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@repo/typescript-config", 3 | "version": "0.0.0", 4 | "private": true, 5 | "license": "MIT", 6 | "publishConfig": { 7 | "access": "public" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/typescript-config/react-library.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "display": "React Library", 4 | "extends": "./base.json", 5 | "compilerOptions": { 6 | "jsx": "react-jsx", 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/ui/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import("eslint").Linter.Config} */ 2 | module.exports = { 3 | root: true, 4 | extends: ['@repo/eslint-config/react-internal.js'], 5 | parser: '@typescript-eslint/parser', 6 | rules: { 7 | 'no-redeclare': 'off', 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /packages/ui/README.md: -------------------------------------------------------------------------------- 1 | # `@repo/ui` 2 | -------------------------------------------------------------------------------- /packages/ui/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "src/globals.css", 9 | "baseColor": "slate", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@repo/ui/components", 15 | "utils": "@repo/ui/lib/utils", 16 | "ui": "@repo/ui/components/ui", 17 | "magicui": "@repo/ui/components/magicui" 18 | } 19 | } -------------------------------------------------------------------------------- /packages/ui/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | autoprefixer: {}, 6 | }, 7 | }; 8 | 9 | export default config; 10 | -------------------------------------------------------------------------------- /packages/ui/src/components/avatarAndUsername.tsx: -------------------------------------------------------------------------------- 1 | import { ComponentType} from "react"; 2 | 3 | export const AvatarAndUsername = ({ 4 | profile_name, 5 | username, 6 | Link, 7 | AvatarComponent, 8 | link = true, 9 | }: { 10 | profile_name: string; 11 | username: string; 12 | Link: ComponentType; 13 | AvatarComponent: ComponentType; 14 | link?: boolean; 15 | }) => { 16 | const Component = () => { 17 | return ( 18 |
19 |
20 |
21 | 22 |
23 |
24 |
25 |
{profile_name}
26 |
27 |
28 | ); 29 | }; 30 | 31 | if (link) { 32 | return ( 33 | 34 | 35 | 36 | ); 37 | } else { 38 | return ; 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /packages/ui/src/components/baseNodeWeb.tsx: -------------------------------------------------------------------------------- 1 | import { Node } from "../types/flow"; 2 | 3 | import { BaseNodeIcon } from "./baseNodeIcons"; 4 | 5 | export const BaseNodeWeb = ({ node }: { node: any }) => { 6 | return ( 7 |
8 | 12 |

{null}

13 |
14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /packages/ui/src/components/card.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | export function Card({ 4 | title, 5 | children, 6 | href, 7 | }: { 8 | title: string; 9 | children: React.ReactNode; 10 | href: string; 11 | }): JSX.Element { 12 | return ( 13 | 19 |

20 | {title} 21 | WTF 22 | 23 | -> 24 | 25 |

26 |

27 | {children} 28 |

29 |
30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /packages/ui/src/components/commonTypes.ts: -------------------------------------------------------------------------------- 1 | import type { JSX, ComponentType } from "react"; 2 | 3 | export type AvatarComponentProps = { 4 | avatar_url: string; 5 | profile_name: string; 6 | }; 7 | 8 | // export type LinkComponentProps = { 9 | // href: string; 10 | // children: ReactNode; 11 | // }; 12 | 13 | export type CommonProps = { 14 | Avatar: (props: AvatarComponentProps) => JSX.Element; 15 | // Link: (props: LinkComponentProps) => JSX.Element; 16 | Link: ComponentType; 17 | }; 18 | -------------------------------------------------------------------------------- /packages/ui/src/components/magicui/orbiting-circles.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from "../../lib/utils"; 2 | 3 | export interface OrbitingCirclesProps { 4 | className?: string; 5 | children?: React.ReactNode; 6 | reverse?: boolean; 7 | duration?: number; 8 | delay?: number; 9 | radius?: number; 10 | path?: boolean; 11 | } 12 | 13 | export default function OrbitingCircles({ 14 | className, 15 | children, 16 | reverse, 17 | duration = 20, 18 | delay = 10, 19 | radius = 50, 20 | path = true, 21 | }: OrbitingCirclesProps) { 22 | return ( 23 | <> 24 | {path && ( 25 | 30 | 37 | 38 | )} 39 | 40 |
54 | {children} 55 |
56 | 57 | ); 58 | } 59 | -------------------------------------------------------------------------------- /packages/ui/src/components/tags.tsx: -------------------------------------------------------------------------------- 1 | // import { Tag } from "../types/flow"; 2 | 3 | export const Tags = ({ tags }: { tags: any[] }) => { 4 | return ( 5 |
6 | {tags.map((tag, index) => { 7 | return ( 8 |
9 | {tag.tag_label} 10 |
11 | ); 12 | })} 13 |
14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /packages/ui/src/components/templateGrid.tsx: -------------------------------------------------------------------------------- 1 | // import type { BigFlow} from "utils"; 2 | import { flowJsonFromBigFlow } from "../helpers/helpers"; 3 | import type { ComponentType, JSX } from "react"; 4 | import TemplateCard from "./templateCard"; 5 | import { DBFlowTemplate } from "@repo/anything-api"; 6 | 7 | export const TemplateGrid = ({ 8 | templates, 9 | AvatarComponent, 10 | LinkComponent, 11 | profile = true, 12 | }: { 13 | templates: DBFlowTemplate[]; 14 | AvatarComponent: (props: { 15 | avatar_url: string; 16 | profile_name: string; 17 | }) => JSX.Element; 18 | LinkComponent: ComponentType; 19 | profile?: boolean; 20 | }) => { 21 | return ( 22 |
23 | {templates.map((template: any) => { 24 | // const flowJson = flowJsonFromBigFlow(template); 25 | // console.log("Flow JSON:", flowJson); 26 | 27 | return ( 28 | 30 | AvatarComponent({ 31 | avatar_url: template?.profiles?.avatar_url || "", 32 | profile_name: template?.profiles?.full_name || "", 33 | }) 34 | } 35 | Link={LinkComponent} 36 | description={ 37 | template.flow_template_description 38 | ? template.flow_template_description 39 | : "" 40 | } 41 | flowName={template.flow_template_name} 42 | template={template} 43 | key={template.flow_template_id} 44 | profile={profile} 45 | profileName={template?.profiles?.full_name || ""} 46 | slug={template.slug} 47 | username={template?.profiles?.username || ""} 48 | /> 49 | ); 50 | })} 51 |
52 | ); 53 | }; 54 | -------------------------------------------------------------------------------- /packages/ui/src/components/ui/alert.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import { cva, type VariantProps } from "class-variance-authority" 3 | 4 | import { cn } from "@repo/ui/lib/utils" 5 | 6 | const alertVariants = cva( 7 | "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", 8 | { 9 | variants: { 10 | variant: { 11 | default: "bg-background text-foreground", 12 | destructive: 13 | "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", 14 | }, 15 | }, 16 | defaultVariants: { 17 | variant: "default", 18 | }, 19 | } 20 | ) 21 | 22 | const Alert = React.forwardRef< 23 | HTMLDivElement, 24 | React.HTMLAttributes & VariantProps 25 | >(({ className, variant, ...props }, ref) => ( 26 |
32 | )) 33 | Alert.displayName = "Alert" 34 | 35 | const AlertTitle = React.forwardRef< 36 | HTMLParagraphElement, 37 | React.HTMLAttributes 38 | >(({ className, ...props }, ref) => ( 39 |
44 | )) 45 | AlertTitle.displayName = "AlertTitle" 46 | 47 | const AlertDescription = React.forwardRef< 48 | HTMLParagraphElement, 49 | React.HTMLAttributes 50 | >(({ className, ...props }, ref) => ( 51 |
56 | )) 57 | AlertDescription.displayName = "AlertDescription" 58 | 59 | export { Alert, AlertTitle, AlertDescription } 60 | -------------------------------------------------------------------------------- /packages/ui/src/components/ui/badge.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import { cva, type VariantProps } from "class-variance-authority" 3 | 4 | import { cn } from "@repo/ui/lib/utils" 5 | 6 | const badgeVariants = cva( 7 | "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", 8 | { 9 | variants: { 10 | variant: { 11 | default: 12 | "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", 13 | secondary: 14 | "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", 15 | destructive: 16 | "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", 17 | outline: "text-foreground", 18 | }, 19 | }, 20 | defaultVariants: { 21 | variant: "default", 22 | }, 23 | } 24 | ) 25 | 26 | export interface BadgeProps 27 | extends React.HTMLAttributes, 28 | VariantProps {} 29 | 30 | function Badge({ className, variant, ...props }: BadgeProps) { 31 | return ( 32 |
33 | ) 34 | } 35 | 36 | export { Badge, badgeVariants } 37 | -------------------------------------------------------------------------------- /packages/ui/src/components/ui/checkbox.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as CheckboxPrimitive from "@radix-ui/react-checkbox" 5 | import { Check } from "lucide-react" 6 | 7 | import { cn } from "@repo/ui/lib/utils" 8 | 9 | const Checkbox = React.forwardRef< 10 | React.ElementRef, 11 | React.ComponentPropsWithoutRef 12 | >(({ className, ...props }, ref) => ( 13 | 21 | 24 | 25 | 26 | 27 | )) 28 | Checkbox.displayName = CheckboxPrimitive.Root.displayName 29 | 30 | export { Checkbox } 31 | -------------------------------------------------------------------------------- /packages/ui/src/components/ui/collapsible.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as CollapsiblePrimitive from "@radix-ui/react-collapsible" 4 | 5 | const Collapsible = CollapsiblePrimitive.Root 6 | 7 | const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger 8 | 9 | const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent 10 | 11 | export { Collapsible, CollapsibleTrigger, CollapsibleContent } 12 | -------------------------------------------------------------------------------- /packages/ui/src/components/ui/expandable-input.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { cn } from "@repo/ui/lib/utils"; 3 | 4 | export interface InputProps 5 | extends React.InputHTMLAttributes {} 6 | 7 | const ExpandableInput = React.forwardRef( 8 | ({ className, ...props }, ref) => { 9 | return ( 10 |
11 |