├── .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 |
--------------------------------------------------------------------------------
/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 ;
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
25 | )}
26 | {showResultsExplorer && (
27 |
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