Merge pull request #118 from shumaiOne/docs/improve-shumai-docs
docs: improve and restructure shumai documentation
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 93 KiB |
@@ -0,0 +1,72 @@
|
||||
---
|
||||
title: Environment Variables
|
||||
description: Comprehensive configuration reference for Shumai.
|
||||
---
|
||||
|
||||
Shumai is configured via environment variables. You can define these variables in a `.env` file at the root of your application workspace, or pass them directly to your Docker containers.
|
||||
|
||||
---
|
||||
|
||||
## Database Config
|
||||
|
||||
| Variable | Description | Example / Default |
|
||||
| :------------- | :----------------------------------------------------------------------------------------- | :------------------------------------------------------- |
|
||||
| `DATABASE_URL` | PostgreSQL connection URL. Must target a database with the `pgvector` extension installed. | `postgresql://user:pass@localhost:5432/db?schema=public` |
|
||||
|
||||
---
|
||||
|
||||
## Authentication Config
|
||||
|
||||
| Variable | Description | Example / Default |
|
||||
| :------------------- | :--------------------------------------------------------------------- | :-------------------------------------- |
|
||||
| `BETTER_AUTH_SECRET` | A secure, random 32-byte secret used to sign session cookies and JWTs. | Generate with `openssl rand -base64 32` |
|
||||
| `BETTER_AUTH_URL` | The public URL of your Hono backend API. Used for redirect flows. | `http://localhost:3000` |
|
||||
|
||||
---
|
||||
|
||||
## Storage Config
|
||||
|
||||
Shumai supports storing files locally or on S3-compatible endpoints.
|
||||
|
||||
| Variable | Description | Example / Default |
|
||||
| :------------------------- | :------------------------------------------------------------------------------------------------ | :-------------------------------- |
|
||||
| `STORAGE_BACKEND` | Storage type. Use `local` for local file system storage, or `s3` for S3-compatible cloud storage. | `local` (default) or `s3` |
|
||||
| `AWS_ENDPOINT_URL_S3` | Custom endpoint for S3 storage. Must change to public domain/IP if deploying remotely. | `http://localhost:3000` (default) |
|
||||
| `S3_BUCKET` | S3 bucket name. | `shumai` (default) |
|
||||
| `S3_ACCESS_KEY_ID` | Access key credentials for S3. | `minioadmin` (default) |
|
||||
| `S3_SECRET_ACCESS_KEY` | Secret key credentials for S3. | `minioadmin` (default) |
|
||||
| `S3_REGION` | S3 storage region. | `auto` (default) |
|
||||
| `S3_USE_SSL` | Set to `true` to use HTTPS for S3 endpoints. | `false` (default) |
|
||||
| `PRESIGNED_URL_EXPIRES_IN` | Number of hours for which generated presigned download/upload links are valid. | `5` (default) |
|
||||
|
||||
---
|
||||
|
||||
## Workflow Config
|
||||
|
||||
Configures whether background transcoding and AI agents are executed locally or offloaded to a Temporal cluster.
|
||||
|
||||
| Variable | Description | Example / Default |
|
||||
| :------------------ | :------------------------------------------------------------------------------------------------- | :------------------------------ |
|
||||
| `WORKFLOW_EXECUTOR` | Engine choice. Use `local` for in-process database polling, or `temporal` for distributed workers. | `local` (default) or `temporal` |
|
||||
| `TEMPORAL_ADDRESS` | Host and port of the Temporal cluster gRPC service. | `localhost:7233` (default) |
|
||||
|
||||
---
|
||||
|
||||
## Logging Config
|
||||
|
||||
| Variable | Description | Example / Default |
|
||||
| :----------- | :--------------------------------------------------------------------------------------------------- | :---------------- |
|
||||
| `LOG_LEVEL` | Pino logging level. Options: `debug`, `info`, `warn`, `error`. | `info` (default) |
|
||||
| `LOG_FORMAT` | Log format style. Use `json` for production logging, or `pretty` for human-readable terminal output. | `json` (default) |
|
||||
|
||||
---
|
||||
|
||||
## LLM API Key
|
||||
|
||||
API keys to AI providers on startup.
|
||||
|
||||
| Variable | Description | Example / Default |
|
||||
| :------------------ | :---------------------------------- | :---------------- |
|
||||
| `GEMINI_API_KEY` | API key for Google Gemini provider. | `AIzaSy...` |
|
||||
| `OPENAI_API_KEY` | API key for OpenAI provider. | `sk-proj-...` |
|
||||
| `ANTHROPIC_API_KEY` | API key for Anthropic provider. | `sk-ant-...` |
|
||||
@@ -0,0 +1,82 @@
|
||||
---
|
||||
title: Deploy with Temporal
|
||||
description: Configure a high-scale production deployment using Temporal and S3-compatible storage.
|
||||
---
|
||||
|
||||
For production environments or workloads with high-volume video processing and heavy AI agent usage, running background tasks on a single server can cause bottlenecks. Shumai resolves this by offloading task queue management, retries, and background executions to **Temporal**.
|
||||
|
||||
This allows you to decouple workloads and run specialized worker nodes on separate, dedicated machines.
|
||||
|
||||
---
|
||||
|
||||
## How it Works
|
||||
|
||||
When configured for Temporal, the core Shumai web application does not process background jobs itself. Instead, it publishes tasks to a Temporal Cluster queue.
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
UserUpload[User Uploads Video] --> WebApp[Shumai Web UI / API]
|
||||
WebApp -->|Register Task| Temporal[Temporal Cluster]
|
||||
Temporal -->|Queue: Transcoding| TranscodeWorker[Transcode Worker Machine]
|
||||
Temporal -->|Queue: AI Agents| AgentWorker[Agent Worker Machine]
|
||||
```
|
||||
|
||||
- **Transcoding Workers**: Can be run on GPU-accelerated or high-CPU compute instances.
|
||||
- **AI Agent Workers**: Can be run on isolated, sandboxed hosts to safely execute automation scripts.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> **Storage Requirement**: Because the core application and the background workers run on separate machines in a distributed setup, **you must configure an S3-compatible storage backend** (such as AWS S3, Cloudflare R2, or MinIO). Local storage (`STORAGE_BACKEND=local`) is not supported in this mode because the workers and the web application do not share a common filesystem.
|
||||
|
||||
---
|
||||
|
||||
## Step 1: Deploy the Core Stack
|
||||
|
||||
On your primary host machine, spin up the database, Temporal cluster services, and the main Shumai web application:
|
||||
|
||||
1. **Download the Temporal Stack Configuration**:
|
||||
```bash
|
||||
curl -o docker-compose.yaml https://raw.githubusercontent.com/shumaiOne/shumai/main/docker-compose/temporal/docker-compose.yaml
|
||||
```
|
||||
2. **Configure S3 Settings**:
|
||||
Open the `docker-compose.yaml` file and set your S3 credentials and endpoint environment variables under the `shumai` service.
|
||||
3. **Start the Services**:
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
This exposes the web application on port `3000`, the database on `5432`, the Temporal gRPC service on `7233`, and the Temporal management dashboard on `8080`.
|
||||
|
||||
---
|
||||
|
||||
## Step 2: Configure & Run Workers
|
||||
|
||||
On your specialized worker machines, you will run the dedicated background worker services. Each worker requires a `.env` file referencing the database, S3 storage, and the Temporal cluster:
|
||||
|
||||
```env
|
||||
DATABASE_URL=postgresql://shumai:shumai_password@<primary-host-ip>:5432/shumai_db?schema=public
|
||||
WORKFLOW_EXECUTOR=temporal
|
||||
TEMPORAL_ADDRESS=<primary-host-ip>:7233
|
||||
STORAGE_BACKEND=s3
|
||||
AWS_ENDPOINT_URL_S3=https://your-s3-endpoint.com
|
||||
S3_BUCKET=shumai
|
||||
S3_REGION=us-east-1
|
||||
S3_ACCESS_KEY_ID=your-access-key-id
|
||||
S3_SECRET_ACCESS_KEY=your-secret-access-key
|
||||
```
|
||||
|
||||
### Media Transcoding Worker
|
||||
|
||||
Run this on your media processing nodes (requires system installations of `ffmpeg` and `ffprobe`):
|
||||
|
||||
```bash
|
||||
npm install -g @shumai-one/shumai-transcode
|
||||
shumai-transcode
|
||||
```
|
||||
|
||||
### AI Agent Worker
|
||||
|
||||
Run this on your sandboxed agent execution nodes (requires sandbox dependencies like `bubblewrap` or `sandbox-exec`):
|
||||
|
||||
```bash
|
||||
npm install -g @shumai-one/shumai-agent
|
||||
shumai-agent
|
||||
```
|
||||
@@ -16,7 +16,43 @@
|
||||
"groups": [
|
||||
{
|
||||
"group": "Getting Started",
|
||||
"pages": ["introduction", "getting-started/docker"]
|
||||
"pages": ["getting-started/overview", "getting-started/quickstart"]
|
||||
},
|
||||
{
|
||||
"group": "Using Shumai",
|
||||
"pages": [
|
||||
"using-shumai/asset-management",
|
||||
"using-shumai/comments",
|
||||
"using-shumai/version-stack",
|
||||
"using-shumai/sort-and-search",
|
||||
"using-shumai/semantic-search",
|
||||
"using-shumai/team-project-management",
|
||||
"using-shumai/notifications",
|
||||
"using-shumai/metadata",
|
||||
"using-shumai/collections",
|
||||
"using-shumai/share-links"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Shumai Agent Settings",
|
||||
"pages": [
|
||||
"using-shumai/agent-providers",
|
||||
"using-shumai/agents",
|
||||
"using-shumai/agent-skills",
|
||||
"using-shumai/agent-sandbox"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Media Transcoding Settings",
|
||||
"pages": ["using-shumai/transcode-settings"]
|
||||
},
|
||||
{
|
||||
"group": "Configuration",
|
||||
"pages": ["configuration/env-variables"]
|
||||
},
|
||||
{
|
||||
"group": "Temporal Deployment",
|
||||
"pages": ["configuration/temporal"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 94 KiB |
@@ -1,98 +0,0 @@
|
||||
---
|
||||
title: Get Started with Docker
|
||||
description: Learn how to spin up the Shumai stack using Docker Compose.
|
||||
---
|
||||
|
||||
We support two Docker Compose setups depending on your environment and use case:
|
||||
|
||||
1. **Local Pre-built Stack**: A lightweight setup to run the core API and frontend using pre-built images.
|
||||
2. **Temporal Stack**: A production-like environment with full background worker orchestration (Agent and Transcode workers) and Temporal services, built from your local source code.
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before starting, ensure you have the following installed on your machine:
|
||||
|
||||
- **Docker**: [Install Docker Desktop](https://docs.docker.com/get-docker/) or Docker Engine.
|
||||
- **Docker Compose**: Included in Docker Desktop, or [installed separately](https://docs.docker.com/compose/install/).
|
||||
- **Git**: To clone and manage the repository.
|
||||
|
||||
---
|
||||
|
||||
## 1. Local Pre-built Stack
|
||||
|
||||
This setup runs a PostgreSQL database (with `pgvector`) and the Shumai application container.
|
||||
|
||||
### Step 1: Navigate to the local docker-compose folder
|
||||
|
||||
From the root of your Shumai workspace, run:
|
||||
|
||||
```bash
|
||||
cd docker-compose/local
|
||||
```
|
||||
|
||||
### Step 2: Start the services
|
||||
|
||||
Spin up the containers in detached mode:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Step 3: Access the application
|
||||
|
||||
Once all containers are running and healthy:
|
||||
|
||||
- Open your browser and navigate to **`http://localhost:3000`** to access the Shumai Web UI.
|
||||
|
||||
### Step 4: Tear down
|
||||
|
||||
To stop and remove the containers, run:
|
||||
|
||||
```bash
|
||||
docker compose down
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Temporal Stack (Recommended for Development)
|
||||
|
||||
This setup builds the containers from your local workspace source code and starts the API, workers, and Temporal scheduler.
|
||||
|
||||
### Step 1: Navigate to the temporal docker-compose folder
|
||||
|
||||
From the root of your Shumai workspace, run:
|
||||
|
||||
```bash
|
||||
cd docker-compose/temporal
|
||||
```
|
||||
|
||||
### Step 2: Start the services
|
||||
|
||||
Build the images and run the full stack:
|
||||
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
### Step 3: Access the services
|
||||
|
||||
- **Web UI**: Access the Shumai application at **`http://localhost:3000`**.
|
||||
- **Temporal Dashboard**: View active workflows and orchestration logs at **`http://localhost:8080`**.
|
||||
|
||||
### Step 4: Tear down
|
||||
|
||||
To stop the services and clean up volumes, run:
|
||||
|
||||
```bash
|
||||
docker compose down -v
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Port Conflicts
|
||||
|
||||
If you receive port conflict errors, ensure that port `3000` (Web UI), `5432` (PostgreSQL), `7233` (Temporal), or `8080` (Temporal UI) are not currently being used by other processes on your machine.
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: Overview
|
||||
description: Learn about Shumai, a modern collaboration and media review platform.
|
||||
---
|
||||
|
||||
## What is Shumai?
|
||||
|
||||
**Shumai** is a self-hosted media collaboration platform designed for creative teams, video editors, designers, and clients. It provides a centralized workspace where you can upload, organize, and review assets (video, audio, images, and documents) in real-time. With built-in AI capabilities and background transcoding, Shumai helps streamline asset organization and feedback workflows.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Core Features
|
||||
|
||||
- **Secure Storage**: Host your creative assets locally on your server or connect directly to any S3-compatible cloud storage provider (like AWS S3, Cloudflare R2, or MinIO).
|
||||
- **Media Commenting & Drawing**: Speed up review cycles with frame-level comments and drawing tools that let you sketch directly onto video frames or images.
|
||||
- **Version Control**: Stack multiple versions of the same file into a single entry to keep your workspace organized and track revision history.
|
||||
- **AI-Powered Tags & Search**: Automatically tag your files on upload using Google Gemini, and find assets based on visual or conceptual meaning.
|
||||
- **Custom Automations**: Build tailored background workflows using custom scripts to automate repetitive team actions.
|
||||
- **Proxy Transcoding**: Automatically convert heavy camera and design files in the background into web-friendly streaming formats for smooth playback.
|
||||
|
||||
---
|
||||
|
||||
## Deployment Scales
|
||||
|
||||
Depending on your team size and production volume, Shumai can be configured to run in one of two modes:
|
||||
|
||||
### 1. Single-Server Deployment (Default)
|
||||
|
||||
Ideal for small teams, local development, or low-volume workflows. In this setup, the main web server, database, and background tasks (like transcoding and AI tagging) all run on a single machine.
|
||||
|
||||
### 2. High-Scale Distributed Deployment
|
||||
|
||||
Recommended for production environments with high-volume video uploads. In this setup, background tasks are managed via a centralized queue (Temporal). This allows you to offload heavy workloads to specialized worker machines (for example, putting video transcoding tasks on high-CPU/GPU machines and AI agents on separate sandboxed environments).
|
||||
|
||||
_Note: S3-compatible cloud storage is required for distributed deployments so that all workers can access the uploaded files._
|
||||
@@ -0,0 +1,106 @@
|
||||
---
|
||||
title: Quickstart
|
||||
description: Get Shumai up and running using Docker, NPM, or from source.
|
||||
---
|
||||
|
||||
We support three installation options. For most administrators, **Docker Compose** is the fastest and easiest way to deploy Shumai.
|
||||
|
||||
---
|
||||
|
||||
## Option 1: Docker Compose (Recommended)
|
||||
|
||||
Docker Compose automatically configures and spins up all required services (the web application, a database, and local storage).
|
||||
|
||||
1. **Download the Configuration**:
|
||||
```bash
|
||||
curl -o docker-compose.yaml https://raw.githubusercontent.com/shumaiOne/shumai/main/docker-compose/local/docker-compose.yaml
|
||||
```
|
||||
2. **Start the Services**:
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
3. **Access the Dashboard**:
|
||||
Open your browser and navigate to **`http://localhost:3000`** to access the Shumai Web UI.
|
||||
|
||||
### Production Deployments (Temporal)
|
||||
|
||||
If you are deploying Shumai for a production team with high-volume video uploads, we recommend setting up a distributed deployment using **Temporal** and an S3-compatible storage backend. This offloads resource-heavy video transcoding and AI agents to separate, dedicated worker nodes to keep your main dashboard fast and responsive. For setup instructions, see the [Deploy with Temporal](/configuration/temporal) guide.
|
||||
|
||||
---
|
||||
|
||||
## Option 2: Install via NPM
|
||||
|
||||
You can run Shumai as a global service using the Node Package Manager (NPM).
|
||||
|
||||
### System Prerequisites
|
||||
|
||||
To handle media processing and security isolation, the host machine must have the following system utilities installed:
|
||||
|
||||
- **FFmpeg & FFprobe**: Required for video transcoding and metadata extraction.
|
||||
- _macOS_: `brew install ffmpeg`
|
||||
- _Linux (Ubuntu/Debian)_: `sudo apt-get install ffmpeg`
|
||||
- **Agent Sandbox Utilities**: Used to run custom automation scripts securely.
|
||||
- _macOS_: `brew install ripgrep`
|
||||
- _Linux (Ubuntu/Debian)_: `sudo apt-get install bubblewrap socat ripgrep`
|
||||
|
||||
### Step-by-Step Setup
|
||||
|
||||
1. **Start a Database**:
|
||||
Shumai requires a PostgreSQL database with the `pgvector` extension. Start a database container:
|
||||
```bash
|
||||
docker run --name shumai_postgres \
|
||||
-e POSTGRES_USER=shumai \
|
||||
-e POSTGRES_PASSWORD=shumai_password \
|
||||
-e POSTGRES_DB=shumai_db \
|
||||
-p 5432:5432 \
|
||||
-d pgvector/pgvector:pg18
|
||||
```
|
||||
2. **Install Shumai**:
|
||||
```bash
|
||||
npm install -g @shumai-one/shumai
|
||||
```
|
||||
3. **Configure Environment Variables**:
|
||||
Create a new directory, navigate into it, and create a `.env` file:
|
||||
```bash
|
||||
mkdir shumai && cd shumai
|
||||
```
|
||||
Create a `.env` file with the following variables:
|
||||
```env
|
||||
DATABASE_URL=postgresql://shumai:shumai_password@localhost:5432/shumai_db?schema=public
|
||||
BETTER_AUTH_SECRET=your-random-32-character-secret-key
|
||||
STORAGE_BACKEND=local
|
||||
AWS_ENDPOINT_URL_S3=http://localhost:3000
|
||||
```
|
||||
4. **Start Shumai**:
|
||||
```bash
|
||||
shumai
|
||||
```
|
||||
Open your browser to `http://localhost:3000`.
|
||||
|
||||
---
|
||||
|
||||
## Option 3: Run from Source (For Developers)
|
||||
|
||||
If you wish to run Shumai locally to customize the platform or contribute:
|
||||
|
||||
1. **Clone the Repository**:
|
||||
```bash
|
||||
git clone https://github.com/shumaiOne/shumai.git
|
||||
cd shumai
|
||||
```
|
||||
2. **Install Dependencies**:
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
3. **Start a Database**:
|
||||
Launch a local database container (as described in the NPM section above).
|
||||
4. **Run Migrations**:
|
||||
Set up your `.env` file at the root, then apply database migrations:
|
||||
```bash
|
||||
bun run db:migrate
|
||||
```
|
||||
5. **Start the Dev Server**:
|
||||
```bash
|
||||
bun run dev
|
||||
```
|
||||
This spins up the web server on port `3000` with hot-reloading active.
|
||||
@@ -1,26 +0,0 @@
|
||||
---
|
||||
title: Introduction
|
||||
description: Welcome to Shumai, a modern AI agent and media processing platform.
|
||||
---
|
||||
|
||||
## What is Shumai?
|
||||
|
||||
**Shumai** is a highly decoupled, modular platform built with a layered monorepo architecture. It integrates a React-based frontend, a fast Hono API backend, business logic services, and background workflow engines (supporting both local and Temporal-based execution).
|
||||
|
||||
### Key Features
|
||||
|
||||
- **Decoupled Monorepo Structure**: Managed via Bun Workspaces, ensuring each domain or layer is its own self-contained package.
|
||||
- **Robust API & Core Service Layers**: Built on Bun and Hono, featuring strict end-to-end type safety with Zod schemas and DTOs.
|
||||
- **Workflow & Activity Engine**: An orchestration engine capable of polling-based execution locally and enterprise-grade execution via Temporal.
|
||||
- **Modern UI**: A responsive, clean React interface powered by Tailwind CSS and Shadcn UI.
|
||||
- **Database Resilience**: Prisma ORM with PostgreSQL and `pgvector` for vector similarity and search capabilities.
|
||||
|
||||
## Explore the Documentation
|
||||
|
||||
Start by setting up Shumai on your local machine using our step-by-step guides.
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Get Started with Docker" icon="docker" href="/getting-started/docker">
|
||||
Learn how to build and spin up the Shumai stack quickly using Docker Compose.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 32 KiB |
@@ -0,0 +1,49 @@
|
||||
---
|
||||
title: AI Providers
|
||||
description: Connect Shumai to OpenAI, Anthropic, Gemini, or custom LLM gateways.
|
||||
---
|
||||
|
||||
When creating agents for chat or metadata autofill, you must select an underlying AI model. The available models and providers are configured globally within your team settings.
|
||||
|
||||
> 🔒 **Access Control:** Only **Team Owner** can manage AI providers. To update these settings, click your avatar, navigate to **Settings**, and select **Providers** from the left sidebar.
|
||||
|
||||
---
|
||||
|
||||
## Built-In Providers
|
||||
|
||||
Shumai ships with pre-configured configurations for major LLM providers. Because Shumai uses [Pi](https://github.com/earendil-works/pi) as its core agent framework, the supported provider and model configurations are automatically synchronized with Pi's capabilities.
|
||||
|
||||
Team Owner can freely edit, delete, or add new providers. All configured provider and model settings are injected directly into the Pi framework at runtime.
|
||||
|
||||
---
|
||||
|
||||
## Configuration Reference
|
||||
|
||||
### Provider Settings
|
||||
|
||||
When configuring a provider, you will need to specify the following fields:
|
||||
|
||||
| Field | Description | Example / Notes |
|
||||
| :---------------- | :------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Provider Name** | A unique, human-readable label for the provider. | `Ollama-Local`, `Enterprise-Gateway` |
|
||||
| **Base URL** | The target API endpoint URL. | `http://localhost:11434/v1` |
|
||||
| **API Protocol** | The streaming and payload implementation format. | Most OpenAI-compatible gateways use `openai-completions`. |
|
||||
| **API Key** | The authentication token. Leave blank for unauthenticated or local setups. | Accepts a literal value (`sk-...`) or an environment variable name (`MY_API_KEY`) to load secrets securely from the host system. |
|
||||
|
||||
### Model Settings
|
||||
|
||||
Each provider can host multiple models. You can configure the following attributes per model:
|
||||
|
||||
| Field | Description | Example / Notes |
|
||||
| :-------------------- | :---------------------------------------------------------- | :------------------------------------------------- |
|
||||
| **Model ID** | The exact identifier string expected by the upstream API. | `gpt-4o`, `claude-3-5-sonnet-20240620` |
|
||||
| **Display Name** | An optional, friendly label shown to users in dropdowns. | `GPT-4 Omni`, `Claude 3.5` |
|
||||
| **Reasoning Support** | Toggle to enable extended thinking protocols. | Use for models with native reasoning capabilities. |
|
||||
| **Context Window** | The maximum total token capacity (input + output). | |
|
||||
| **Max Output Tokens** | The hard ceiling for generated response tokens per request. | |
|
||||
| **Input Cost** | Cost tracking specified per million input tokens. | Optional; used to calculate usage metrics. |
|
||||
| **Output Cost** | Cost tracking specified per million output tokens. | Optional; used to calculate usage metrics. |
|
||||
|
||||
---
|
||||
|
||||

|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: Agent Sandbox
|
||||
description: Secure execution environment and network domain restrictions for AI agent scripts.
|
||||
---
|
||||
|
||||
Running automated scripts poses security risks. Shumai resolves this by executing all agent skills inside a secure, isolated **Sandbox** environment.
|
||||
|
||||
---
|
||||
|
||||
## Sandbox Security
|
||||
|
||||
The sandbox restricts the execution process from accessing the host filesystem, system processes, and internal networks:
|
||||
|
||||
- **Isolation**: Scripts run in a virtualized workspace container that prevents them from modifying critical system files or reading other project data.
|
||||
- **Network Bridging**: External network calls from inside the sandbox are strictly monitored.
|
||||
|
||||
### File System Restrictions
|
||||
|
||||
To protect your workspace environments and sensitive data, the sandbox enforces strict file-level access controls:
|
||||
|
||||
- **Read Access**: The sandbox is allowed to read files within the workspace, with a strict exception for sensitive environment and certificate files. It cannot read: `['.env', '.env.*', '*.pem', '*.key']`.
|
||||
- **Write Access**: The sandbox is heavily restricted and may only write to the `.pi` folder located in the current working directory (cwd). Even within this allowed directory, the sandbox is explicitly blocked from writing or creating sensitive files matching: `['.env', '.env.*', '*.pem', '*.key']`.
|
||||
|
||||
---
|
||||
|
||||
## Domain Whitelisting
|
||||
|
||||
By default, sandboxed scripts cannot make network requests to the internet. Team Owners must explicitly authorize external APIs by managing domain access:
|
||||
|
||||
### Allowed Domains
|
||||
|
||||
A list of domains that sandboxed scripts are permitted to access.
|
||||
|
||||
- Default whitelisted domains include standard package registries (like npm or python package hosts) and repository hosts (like `github.com`).
|
||||
- If a script needs to call an external API (e.g. `api.slack.com`), the administrator must add it to the allowed list.
|
||||
|
||||
### Pending Domains
|
||||
|
||||
When an agent script attempts to reach a domain that is not currently authorized:
|
||||
|
||||
1. The network connection is blocked immediately.
|
||||
2. The target domain is logged and added to the **Pending Domains** list.
|
||||
3. Admins can review this list and click **Approve** to authorize the domain, or **Reject** to keep it blocked.
|
||||
|
||||

|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
title: Agent Skills
|
||||
description: Extend your agents' capabilities with custom automation tools.
|
||||
---
|
||||
|
||||
By default, AI models can only process text and image. In Shumai, you can extend both your **Chat Agents** and **Autofill Agents'** capabilities by registering **Skills**—custom scripts that the agent can run when solving a task.
|
||||
|
||||
---
|
||||
|
||||
## How Skills Work
|
||||
|
||||
Skills are actions that you define and make available to your AI agents.
|
||||
|
||||
- **Descriptions for the AI**: When you register a skill, the AI agent reads its metadata to understand exactly when and how it should use the tool to solve a problem.
|
||||
- **Execution & Local Caching**: When an agent decides it needs to use a skill, Shumai handles the execution. Newly added skill data is synced to the database first. Upon execution, the agent downloads and caches the skill locally from the database for fast, reliable access.
|
||||
|
||||
---
|
||||
|
||||
## Adding a Skill
|
||||
|
||||
To install a new skill into Shumai:
|
||||
|
||||
1. Navigate to the **Settings** page and open the **Skills** tab.
|
||||
2. Click the **Add Skill** button.
|
||||
3. In the dialog box, choose your installation method:
|
||||
- **Upload**: Select and upload a `.zip` file containing your skill.
|
||||
- **GitHub**: Provide a valid GitHub repository path.
|
||||
|
||||
> **Important:** Regardless of the installation method, the root folder of the skill must contain a `SKILL.md` file.
|
||||
|
||||
### Updating an Existing Skill
|
||||
|
||||
To update a skill, simply follow the steps above and install the new version using the exact same skill name. Shumai will automatically replace the older version.
|
||||
|
||||
---
|
||||
|
||||
## Configuring Environment Variables
|
||||
|
||||
If your custom skill requires environment variables (e.g., API keys, external tokens) to function:
|
||||
|
||||
1. Click on the installed **Skill Card** in the Skills tab to open the configuration dialog.
|
||||
2. Add the required environment variables.
|
||||
3. _(Optional)_ Set a default value for the variable. If no default value is provided, the skill will dynamically load the required value from the system environment at runtime.
|
||||
|
||||
---
|
||||
|
||||
## Enabling Skills for Agents
|
||||
|
||||
**All skills are disabled by default.** Merely installing a skill does not give agents access to it. To allow an agent to use an installed skill:
|
||||
|
||||
1. Navigate to your specific **Agent Settings**.
|
||||
2. Explicitly enable the skills you want to authorize for that particular agent.
|
||||
|
||||

|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: AI Agents
|
||||
description: Create and configure specialized AI agents for chat, metadata autofill, and vector embedding.
|
||||
---
|
||||
|
||||
Shumai uses specialized AI Agents to perform background automation, chat workflows, and semantic indexing. **Only Team Owner** can create, manage, and change agent settings.
|
||||
|
||||
---
|
||||
|
||||
## Agent Types
|
||||
|
||||
Shumai supports three types of agents:
|
||||
|
||||
### 1. Chat Agent
|
||||
|
||||
An interactive, conversational bot that appears in your project workspace.
|
||||
|
||||
- You can create as many chat agents as you want.
|
||||
- You can use "@" to mention chat agents directly in file comments.
|
||||
- The agent is context-aware: it can read files, search the project folder, inspect metadata, and read comment threads.
|
||||
- You can add "Skills" to a chat agent, enabling it to write files, run scripts, or interact with external APIs on your behalf.
|
||||
|
||||
### 2. Autofill Agent
|
||||
|
||||
A background agent that monitors file uploads. You can create **only one** Autofill Agent.
|
||||
|
||||
- Once created and enabled, Shumai automatically triggers the agent when a new file is uploaded, provided the file type is supported (image or video).
|
||||
- It analyzes the file's content (multimodal images, text descriptions) and populates any metadata fields flagged for "AI Autofill".
|
||||
|
||||
### 3. Embedding Agent
|
||||
|
||||
A specialized utility agent that processes assets to generate search indexes. You can create **only one** Embedding Agent.
|
||||
|
||||
- Once created and enabled, Shumai automatically runs embedding generation for new file uploads if the file type is supported (image or video).
|
||||
- These search indexes are saved to power Shumai's natural language semantic search capabilities.
|
||||
- **Note:** The Embedding Agent is hardcoded to use `google-embedding-2` as the LLM model. Because of this, you cannot choose a provider or model. Make sure you set the `GEMINI_API_KEY` environment variable to make it work.
|
||||
|
||||
---
|
||||
|
||||
## Configuring an Agent
|
||||
|
||||
To edit or create an agent, navigate to **Team Settings** > **Agents** (Note: Only Team Owners can change these settings):
|
||||
|
||||
- **Avatar**: Choose an avatar for the agent by picking from the predefined avatars.
|
||||
- **Enabled / Disabled Toggle**: Stop or start the agent. If the embedding agent is disabled, semantic search indexing is paused.
|
||||
- **System Prompt / Soul**: The core instructions that define the agent's behavior, guidelines, formatting requirements, and operational limits.
|
||||
- **Model Provider**: Select which registered provider and model the agent should use for execution. _(Note: This option is disabled for Embedding Agents)._
|
||||
- **Assigned Skills**: Select which custom skills this agent is permitted to execute.
|
||||
|
||||

|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
title: Asset Management
|
||||
description: Learn how to upload, organize, delete, and recover assets in your workspace.
|
||||
---
|
||||
|
||||
Shumai makes it easy to bring creative media into your workspace, organize them in folders, and manage their lifecycle from upload to deletion.
|
||||
|
||||
---
|
||||
|
||||
## Uploading Assets
|
||||
|
||||
You can upload files and folders into Shumai using three methods:
|
||||
|
||||
1. **Drag and Drop**: Drag files or entire folder directories directly from your computer's file explorer and drop them anywhere on the Shumai dashboard interface.
|
||||
2. **Upload Buttons**: Click the **Upload File** or **Upload Folder** buttons in the toolbar.
|
||||
3. **Copy and Paste**: Copy an image or file from another website, application, or your clipboard, and paste it directly (`Ctrl+V` or `Cmd+V`) into the Shumai browser window to upload it instantly.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Folder Organization
|
||||
|
||||
When you upload an entire folder, Shumai replicates your folder hierarchy exactly inside the project.
|
||||
|
||||
- All subfolders are created automatically.
|
||||
- Nested files remain in their respective subfolders.
|
||||
- There is no limit to the depth of nested folders you can upload.
|
||||
|
||||
---
|
||||
|
||||
## Upload and Processing States
|
||||
|
||||
Once an upload starts, your assets progress through the following states:
|
||||
|
||||
- **Uploading**: The file is transferring to your storage server. The UI displays an active progress percentage.
|
||||
- **Processing**: The file has successfully uploaded. Shumai is now extracting media parameters (such as resolution, video length, and audio codecs) and creating a web-friendly streaming preview (proxy).
|
||||
- **Ready**: Processing is complete. The asset is fully visible, playable, and ready for comments, metadata tagging, or search.
|
||||
|
||||
---
|
||||
|
||||
## Deleting and Restoring Assets
|
||||
|
||||
If you no longer need an asset, you can delete it to clean up your workspace:
|
||||
|
||||
### The Trash Bin (Recently Deleted)
|
||||
|
||||
- When you delete a file or folder, it is moved to the **Recently Deleted** tab in your project settings.
|
||||
- Deleted assets are kept in the Trash for **30 days**. During this window, you can select any asset and click **Recover** to restore it to its original location.
|
||||
- If you want to free up space immediately, you can open the Recently Deleted tab and click **Empty Trash** to permanently purge the files.
|
||||
|
||||
### Permanent Removal
|
||||
|
||||
After **30 days** in the Trash, assets are automatically and permanently purged. Once purged, the records are removed from the database, and the files are deleted from your storage backend (local file system or S3 bucket) and cannot be recovered.
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
title: Collections
|
||||
description: Build dynamic virtual folders using metadata filters and search criteria.
|
||||
---
|
||||
|
||||
Instead of copying files into static folders, Shumai uses **Collections**—dynamic, query-based virtual views. A collection automatically groups files that match specific criteria in real-time.
|
||||
|
||||
---
|
||||
|
||||
## What is a Collection?
|
||||
|
||||
A **Collection** does not duplicate files on disk. Instead, it runs a pre-defined filter query against your project assets database. Whenever a new file is uploaded or metadata is updated to match the collection's query, the file automatically appears inside the collection.
|
||||
|
||||
---
|
||||
|
||||
## Creating a Collection
|
||||
|
||||
You can create collections in two ways:
|
||||
|
||||
- **From the Sidebar**: Click the `+` icon next to **Collections** in the project sidebar to open the query builder, configure your search rules, and save it.
|
||||
- **From the Search Dialog**: When searching and filtering files within the Search Dialog, you can save your active search criteria by clicking the **Save as collection** button at the bottom of the dialog. This will create a dynamic collection that mirrors your search filters.
|
||||
|
||||
---
|
||||
|
||||
## Setting Up Collection Filters
|
||||
|
||||
When creating or editing a collection, you specify a name and set up a filter query in the builder interface:
|
||||
|
||||
### 1. Source Folder
|
||||
|
||||
Specify the starting folder directory. The collection will scan this folder and all its nested subfolders recursively.
|
||||
|
||||
### 2. Operators and Conditions
|
||||
|
||||
- **Logical Operators**: Combine conditions using **AND** (all conditions must be met) or **OR** (at least one condition must be met).
|
||||
- **Fields**: Filter on standard fields (name, type, size) or custom metadata fields (such as "Status" or "Approval").
|
||||
- **Comparison Rules**:
|
||||
- _Equals / Does Not Equal_: Match exact values.
|
||||
- _Contains / Does Not Contain_: Match parts of words.
|
||||
- _Greater Than / Less Than_: Set up numeric or date ranges (e.g., date uploaded is after yesterday).
|
||||
- _Is Empty / Is Not Empty_: Check if fields have values.
|
||||
|
||||
### 3. Collection Default Sorting
|
||||
|
||||
Define a custom sorting rule specific to the collection (e.g., sort by the custom field "Publication Date" ascending) to override the default project sort order.
|
||||
|
||||
---
|
||||
|
||||
## Example Use Cases
|
||||
|
||||
- **Review Dashboard**: A collection named "Pending Review" that displays assets where `Status` equals `In Review`.
|
||||
- **Daily Deliverables**: A collection filtering files uploaded in the last 24 hours.
|
||||
- **Approved Assets**: A collection filtering assets matching `Tag` contains `marketing` AND `Approved` is `Yes`.
|
||||
|
||||

|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: Comments & Annotations
|
||||
description: Collaborate on media assets using drawings and timestamped comments.
|
||||
---
|
||||
|
||||
Shumai provides a review workspace designed for video, audio, and image feedback. Instead of generic text comments, you can drop timestamped feedback and sketch directly onto the media.
|
||||
|
||||
---
|
||||
|
||||
## Timestamped Comments
|
||||
|
||||
When reviewing video or audio files, comments can be anchored to specific seconds on the timeline:
|
||||
|
||||
1. Play or scrub the video player to the exact frame or timestamp you want to review.
|
||||
2. Type your feedback in the comment box.
|
||||
3. Click **Submit**. Your comment will be saved with a timestamp marker shown on the video timeline.
|
||||
4. Collaborators can click your comment card in the sidebar to jump the video player to the exact moment you commented on.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Draw Annotations (Canvas)
|
||||
|
||||
To give clear visual feedback, you can draw directly onto image or video frames:
|
||||
|
||||
1. Pause the video on the frame you wish to annotate.
|
||||
2. Select a drawing tool (brush, rectangle, circle, arrow) from the annotation toolbar overlaying the player.
|
||||
3. Draw directly on the video screen.
|
||||
4. Type your comment and click **Submit**. Your drawing is saved along with your comment.
|
||||
5. When other users select your comment, your drawings will overlay on the player screen automatically at that frame.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Comment Threads (Replies)
|
||||
|
||||
Keep discussions organized by replying directly to feedback:
|
||||
|
||||
- Click **Reply** on any comment.
|
||||
- Replies are nested under the parent comment card, making it easy to track resolution conversations.
|
||||
|
||||
---
|
||||
|
||||
## Attachments
|
||||
|
||||
You can attach reference documents, style guides, or other assets to your comments:
|
||||
|
||||
- Click the **Paperclip** icon inside the comment input box.
|
||||
- Choose a file to upload. It will appear as a downloadable link directly on your comment card.
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: Asset Metadata
|
||||
description: Customize your assets with dynamic, scoped metadata fields and AI-driven autofill features.
|
||||
---
|
||||
|
||||
Standard file systems limit you to basic attributes like file name and modification date. Shumai lets you create structured metadata fields tailored to your creative pipeline—from tracking review statuses to capturing technical specs automatically.
|
||||
|
||||
---
|
||||
|
||||
## Metadata Scopes
|
||||
|
||||
Fields are grouped and displayed in the sidebar inspector by their scope:
|
||||
|
||||
- **Essentials (System Scope)**: Core fields built into Shumai that appear across all teams and projects. Many of these (like resolution, duration, and codec) are automatically extracted during file upload.
|
||||
- **Team Attributes (Team Scope)**: Custom fields defined at the team level, which are inherited by all projects under that team. Excellent for enforcing company-wide metadata guidelines.
|
||||
- **Custom Fields (Project Scope)**: Unique metadata fields defined specifically for a single project workspace.
|
||||
|
||||
---
|
||||
|
||||
## Custom Field Types
|
||||
|
||||
When building or editing your metadata schema, you can choose from these custom types:
|
||||
|
||||
- **Text**: A single-line input field for simple strings, codes, or labels.
|
||||
- **Long Text**: A paragraph input area for detailed descriptions, summaries, or notes.
|
||||
- **Dropdown (Select)**: A single-choice dropdown menu where options can be styled with custom background colors (e.g., Green for Approved, Yellow for In Progress).
|
||||
- **Tags (Multi-Select)**: A multi-choice tag field allowing you to assign multiple custom colored labels to a single asset.
|
||||
- **Star Rating**: An interactive star rating scale (supports configurations from 2 to 6 stars) for scoring and ranking.
|
||||
- **Number**: A numeric field supporting custom decimal precision (from 0 to 3 decimal places) for values like frame rates, counts, or scores.
|
||||
- **Checkbox (Toggle)**: A simple Yes/No switch for binary indicators (e.g., "VFX Required").
|
||||
- **Date**: A calendar date selector with support for custom display formats (Local, ISO, USA, Euro, Friendly) and optional time tracking.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Default Built-in Fields
|
||||
|
||||
Every project comes pre-configured with several essential fields populated automatically during upload or status changes:
|
||||
|
||||
- **Technical Specs**: File Size, Format, File Type (Video, Audio, Image, Document, File), Resolution Width/Height, Video/Audio Codecs, Duration, Frame Rate, and Audio Sample Rates.
|
||||
- **Collaborative Fields**:
|
||||
- **Status**: A dropdown select field containing `Needs Review` (Red), `In Progress` (Yellow), and `Approved` (Green).
|
||||
- **Rating**: A 5-star rating scale for quick review evaluations.
|
||||
- **Keywords**: A tags (multi-select) field to categorize assets.
|
||||
|
||||
---
|
||||
|
||||
## Field Settings & Controls
|
||||
|
||||
### Read-Only Fields
|
||||
|
||||
Marking a custom field as **Read-Only** prevents team members from editing its value directly. This is ideal for fields meant to be populated programmatically or by automated integrations.
|
||||
|
||||
### AI Autofill
|
||||
|
||||
When you enable **AI Autofill** on a metadata field, Shumai automatically analyzes uploaded assets using your team's default Gemini AI model. The AI will populate the field with extracted insights:
|
||||
|
||||
- For text/long text: AI generates summaries, descriptions, or shot logs.
|
||||
- For select/multi-select: AI automatically categorizes themes or applies matching tags.
|
||||
- For numbers: AI can output confidence scores or other metrics.
|
||||
|
||||
### Visibility & Ordering
|
||||
|
||||
In the metadata inspector:
|
||||
|
||||
- **Visibility**: Toggle fields on or off to clean up the sidebar and only show what is relevant to your current review process.
|
||||
- **Ordering**: Drag and drop fields in the builder to arrange their display order within the Custom Fields section.
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Notifications
|
||||
description: Stay updated on comment activity, uploads, and project updates.
|
||||
---
|
||||
|
||||
Shumai includes a built-in notification system to keep you informed of team activities, file statuses, and review comments. You can fully customize which events trigger notifications, check updates from your inbox, or toggle notifications for specific projects.
|
||||
|
||||
---
|
||||
|
||||
## Notification Settings
|
||||
|
||||
You can customize your notification preferences for each team to avoid unnecessary noise. To manage your notification events:
|
||||
|
||||
1. Click on **Team Settings** in the sidebar.
|
||||
2. Select the **Notifications** tab.
|
||||
3. Toggle the switches to enable or disable notifications for specific events:
|
||||
|
||||
### Comments & Replies
|
||||
|
||||
- **General Comments**: Notify me when someone comments on an asset I collaborate on.
|
||||
- **Comment Replies**: Notify me when someone replies to my comment threads.
|
||||
- **@Mentions**: Notify me when someone tags me (using `@username`) in any comment.
|
||||
|
||||
### Assets & Statuses
|
||||
|
||||
- **Your Uploads**: Notify me when files I upload finish transcoding and are ready for review.
|
||||
- **Other Uploads**: Notify me when other team members upload new assets.
|
||||
- **Status Updates**: Notify me when someone changes an asset's status (e.g., from "In Progress" to "Approved").
|
||||
|
||||
---
|
||||
|
||||
## Project-Level Notifications
|
||||
|
||||
If you want to mute a specific project entirely (except for direct `@mentions` which are always delivered):
|
||||
|
||||
1. Navigate to the **Project** dashboard.
|
||||
2. Open **Project Settings**.
|
||||
3. Toggle **Enable Notifications** on or off.
|
||||
|
||||
---
|
||||
|
||||
## The Notification Inbox
|
||||
|
||||
- The **Bell** icon in the navigation bar displays a red badge when you have unread notifications.
|
||||
- Click the bell to open your notification feed panel.
|
||||
- Click any notification card to mark it as read and jump directly to the relevant file and comment thread.
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: Semantic Search
|
||||
description: Find files based on visual and textual meaning using AI vector similarity.
|
||||
---
|
||||
|
||||
Traditional search relies on matching exact characters (e.g., searching "dog" will not find files named "golden_retriever.jpg"). Shumai resolves this with **Semantic Search**, which indexes the conceptual meaning of your files.
|
||||
|
||||
---
|
||||
|
||||
## How Semantic Search Works
|
||||
|
||||
Semantic search translates text queries and file contents into conceptual profiles. Similar ideas and visuals are mapped near each other.
|
||||
|
||||
1. **Index Generation**: When you upload an asset, Shumai's background agent scans the file's visual elements, text contents, or descriptions, translating them into a concept profile.
|
||||
2. **Concept Matching**: When you search with the "Semantic" toggle enabled, Shumai matches the conceptual meaning of your query against your assets.
|
||||
3. **Result**: Searching "sunset at the beach" will successfully find a video file of ocean waves at dusk, even if the filename is `IMG_4029.mp4`.
|
||||
|
||||
---
|
||||
|
||||
## Activating Semantic Search
|
||||
|
||||
To use semantic search:
|
||||
|
||||
1. Verify that your administrator has enabled the **Embedding Agent** under **Team Settings** > **Agents**.
|
||||
2. Once active, Shumai will automatically begin indexing new uploads.
|
||||
3. Toggle the **Semantic** button next to the search input in the file explorer to search by conceptual meaning.
|
||||
|
||||

|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: Share Links
|
||||
description: Share files and folders securely with external clients and stakeholders.
|
||||
---
|
||||
|
||||
Shumai allows you to collaborate with external stakeholders who do not have accounts in your workspace. Using **Share Links**, you can grant view and comment access to specific folders or assets.
|
||||
|
||||
---
|
||||
|
||||
## Creating a Share Link
|
||||
|
||||
1. Select the files or folders you want to share, then right-click and choose **Create New Share Link**.
|
||||
2. Click the newly created **Share Link** in the project sidebar to open its settings page.
|
||||
3. Configure the share link in the right sidebar. You can:
|
||||
- Add password protection
|
||||
- Set an expiration date
|
||||
- Configure which metadata fields are visible to recipients
|
||||
4. Click **Copy Link** at the bottom of the sidebar, then send the link to your client or stakeholder.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Adding Assets to an Existing Share Link
|
||||
|
||||
Once a share link is created, you can easily add more files or folders to it without generating a new link:
|
||||
|
||||
1. Select the files or folders you want to add from your file browser.
|
||||
2. Drag and drop them directly onto the share link item in the project sidebar.
|
||||
3. The share link will immediately update to include the newly added assets.
|
||||
|
||||
---
|
||||
|
||||
## Security and Settings
|
||||
|
||||
### Expiration Date
|
||||
|
||||
Set an optional date and time after which the link becomes inactive. Once the date passes, the link returns a `404 Not Found` page to anyone attempting to access it.
|
||||
|
||||
### Password Protection
|
||||
|
||||
Secure sensitive work by adding a password. External users visiting the link will be prompted to enter the correct password before they can view the assets.
|
||||
|
||||
### Default Sort Order
|
||||
|
||||
Set a default sorting rule for the shared page (e.g. sorting by name or version) to ensure the client views the files in the intended order.
|
||||
|
||||
### Column Visibility
|
||||
|
||||
To protect proprietary information, you can configure exactly which metadata columns are visible to external users. For example:
|
||||
|
||||
- **Visible**: `Asset Name`, `Resolution`, `Download Link`.
|
||||
- **Hidden**: `Internal Budget Code`, `Assignee Notes`, `Cost`.
|
||||
|
||||
### Disabling a Link
|
||||
|
||||
If you need to revoke access immediately, navigate to the **Share Links** tab under Project settings and toggle the **Disabled** switch. You can re-enable the link at any time.
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: Sort & Search
|
||||
description: Find assets using the search dialog and organize them with custom sort orders.
|
||||
---
|
||||
|
||||
As your projects grow, finding the right media files quickly is critical. Shumai provides a powerful search dialog and flexible sorting controls.
|
||||
|
||||
---
|
||||
|
||||
## Searching Assets
|
||||
|
||||
Searching is performed inside a dedicated **Search Dialog** that you can open by clicking the search icon in the toolbar.
|
||||
|
||||

|
||||
|
||||
### Search Dialog Features
|
||||
|
||||
- **Keyword Matches**: Type a keyword in the text input to instantly filter file and folder names.
|
||||
- **Advanced Filtering**: Click to expand the filters panel and build multi-conditional queries (e.g. searching for files where the custom field "Status" equals "In Progress" AND the file type is "Video").
|
||||
- **Semantic Search Toggle**: If enabled by your team administrator, toggle "Semantic" on to search by conceptual meaning (e.g. searching "sunny beach" to find clips of oceans even if the filenames do not contain those words).
|
||||
- **Save as Collection**: Easily convert your active search criteria into a dynamic folder. Click **Save as Collection** inside the dialog to create the collection and navigate to it instantly.
|
||||
- **Infinite Scroll Results**: Search results load dynamically in real-time as you type or adjust filters.
|
||||
|
||||
---
|
||||
|
||||
## Sorting and Reordering Assets
|
||||
|
||||
You can change the sorting order of the asset list using the sort dropdown or by clicking metadata column headers:
|
||||
|
||||
- **Custom Sort (Default)**: By default, the project file explorer is set to **Custom** sorting. In this mode, you can manually drag and drop files and folders to reorder them exactly as you wish.
|
||||
- **Standard Sort Options**: You can also sort files by:
|
||||
- _Newest Upload_: Displays recently uploaded assets first.
|
||||
- _Name_: Sorts alphabetically (A-Z or Z-A).
|
||||
- _Size_: Sorts by file size.
|
||||
- _Type_: Groups folders together at the top, followed by version stacks and individual files.
|
||||
- _Custom Columns_: Sorts by dynamic metadata fields (e.g., sorting by "Due Date" or "Priority").
|
||||
|
||||
> [!NOTE]
|
||||
> **Drag and Drop Reordering Limit**: Drag-and-drop manual reordering is **only** available when the sort order is set to **Custom**. If you select any other sort option (such as Name or Size), manual reordering is disabled.
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
title: Team & Project Management
|
||||
description: Organize your workspaces, define roles, and manage members.
|
||||
---
|
||||
|
||||
Shumai uses a two-tier organizational hierarchy—**Teams** and **Projects**—to manage file access and collaboration.
|
||||
|
||||
---
|
||||
|
||||
## Member Visibility & Scopes
|
||||
|
||||
Members added to a team belong to one of two permission scopes:
|
||||
|
||||
- **Team Scope**: Team-scoped members can view all projects inside the team by default.
|
||||
- **Project Scope**: Project-scoped members can only see and access the specific projects they have been explicitly granted permission to join.
|
||||
|
||||
---
|
||||
|
||||
## Member Roles
|
||||
|
||||
Shumai uses permission roles to control what actions team and project members can perform:
|
||||
|
||||
- **Owner**: Full administrative control. Team Owners can modify team settings, skills, and AI providers. Project Owners can edit project configurations, manage members, and generate invites.
|
||||
- **Editor**: Can upload files, edit custom metadata, create folders, and add comments or canvas annotations.
|
||||
- **Reviewer**: Read-only access. Can view media assets, toggle versions, and leave text comments or canvas drawings, but cannot upload/delete files or modify metadata.
|
||||
|
||||
---
|
||||
|
||||
## Project Role Overrides
|
||||
|
||||
Administrators can add existing team members to specific projects to override their permissions:
|
||||
|
||||
- Project-level roles take higher priority than team-level roles within that project.
|
||||
- _Example_: If Peter is a team member with an **Editor** role, an administrator can add Peter to _Project A_ with a **Reviewer** role. Peter will act as a Reviewer inside Project A, but maintain his Editor role across the rest of the team's projects.
|
||||
|
||||
---
|
||||
|
||||
## Managing Members
|
||||
|
||||
Member management is handled using a unified **Members Dialog** popup:
|
||||
|
||||
### 1. Managing Team Members
|
||||
|
||||
- **Access**: Open your **Team Dashboard** and click the members list or avatar group in the header.
|
||||
- **Settings**:
|
||||
- Change member roles between Editor and Reviewer.
|
||||
- Remove members from the team.
|
||||
- **Invite New Members**: Select a role (Editor or Reviewer) and click **Generate Link**. Copy the signup URL to invite new users to the team.
|
||||
|
||||
### 2. Managing Project Members
|
||||
|
||||
- **Access**: Open your project **File Browser** and click the members avatars or button in the top toolbar.
|
||||
- **Settings**:
|
||||
- Change project member roles or remove them from the project.
|
||||
- **Add Team Members**: The dialog displays a list of active team members who are not yet added to this project. Select their project role (which will override their team role inside this project) and click **Add** to add them instantly.
|
||||
- **Invite External Collaborators**: Select a role (Editor or Reviewer) and click **Generate Link** to invite new users directly into this specific project.
|
||||
|
||||

|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: Media Transcoding Settings
|
||||
description: Configure video transcode strategies and preview proxy generation.
|
||||
---
|
||||
|
||||
High-resolution camera formats and raw media files cannot be rendered natively in web browsers. Shumai transcodes these assets into web-friendly streaming formats in the background.
|
||||
|
||||
Regardless of the selected transcoding strategy, Shumai's pipeline will **always** generate at least one lightweight `180p` proxy version of the raw file to ensure fast scrubbing, thumbnail generation, and instant previews.
|
||||
|
||||
---
|
||||
|
||||
## Video Transcode Strategies
|
||||
|
||||
Team Owners can select how the transcoding engine handles uploaded files. Shumai evaluates the original file's dimensions against its standard target resolutions (2160p, 1080p, 720p, 540p, and 360p) to determine the output.
|
||||
|
||||
### 1. Best Match
|
||||
|
||||
- **Behavior**: Shumai checks the longest dimension (width or height) of the uploaded file. It then finds the highest standard resolution that is equal to or smaller than the original file, preventing unnecessary upscaling. If the original video is exceptionally small, it defaults to a minimum target of `360p`.
|
||||
- **Output**: Generates exactly two web-optimized files: the universal `180p` proxy and the single calculated "best match" resolution.
|
||||
- **Use Case**: This is the recommended option. It ensures web compatibility without wasting processing time and storage space on redundant lower-resolution versions.
|
||||
|
||||
### 2. Transcode All
|
||||
|
||||
- **Behavior**: Shumai calculates the "best match" resolution exactly as it does in the previous strategy. However, instead of stopping at one version, it processes the video into the best match _and_ every standard resolution smaller than it.
|
||||
- **Output**: Generates a full cascade of files. For example, if the best match for an upload is `1080p`, Shumai will generate the `180p` proxy, `1080p`, `720p`, `540p`, and `360p` versions.
|
||||
- **Use Case**: Ideal for environments requiring adaptive bitrate streaming, ensuring consistent playback performance across all client devices regardless of varying network conditions.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Processing Architecture
|
||||
|
||||
Transcoding is resource-intensive. Depending on your scaling needs, your administrator can run the transcode engine on the main server (Single-Server mode) or delegate tasks to specialized transcoding worker machines (Temporal Worker mode).
|
||||
|
||||
Note: In all modes, the processing machine must have the standard system media utilities (`ffmpeg` and `ffprobe`) installed.
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
title: File Version Stack
|
||||
description: Group multiple revisions of an asset under a single version-controlled stack.
|
||||
---
|
||||
|
||||
When collaborating on creative assets, files naturally go through multiple iterations (e.g. `draft_v1.mp4`, `draft_v2.mp4`, `draft_final.mp4`). To prevent workspace clutter, Shumai allows you to bundle these revisions into a **Version Stack**.
|
||||
|
||||
---
|
||||
|
||||
## What is a Version Stack?
|
||||
|
||||
A **Version Stack** groups multiple revisions of the same file into a single entry. Instead of cluttering your folder with several similar files, Shumai collapses them into one item with a version badge (e.g., "V3") and a dropdown list of older versions.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Creating & Adding to a Version Stack
|
||||
|
||||
You can create a version stack or add new versions to an existing stack using two interactive methods:
|
||||
|
||||
- **Drag and Drop**:
|
||||
- _To create a stack_: Drag one standalone file directly over another standalone file in your file explorer.
|
||||
- _To add a version_: Drag a standalone file directly onto an existing version stack.
|
||||
- **Context Menu (Right-Click)**:
|
||||
- Right-click any standalone file or existing version stack.
|
||||
- Choose **Create New Version** from the menu.
|
||||
- Select the revision file from your computer to upload it directly into the stack.
|
||||
|
||||
---
|
||||
|
||||
## Managing Versions
|
||||
|
||||
### Active Version
|
||||
|
||||
The file at the top of the stack is the **Active Version**. This is the version displayed on your project dashboard, search results, and metadata panels.
|
||||
|
||||
### Reordering and Reverting Versions
|
||||
|
||||
You can promote a past version or reorder your stack:
|
||||
|
||||
- Open the version stack details sidebar.
|
||||
- Drag and drop the versions in the list to change their order. The version you drag to the top automatically becomes the active version.
|
||||
- To remove a file from the stack, drag it out or select **Unstack**. This moves the file back to the parent folder as a standalone file.
|
||||
|
After Width: | Height: | Size: 83 KiB |
@@ -23,7 +23,7 @@ import type { DragState } from '../dnd-types'
|
||||
import FieldRenderer from '../field-renderer'
|
||||
import { FilePreview } from './file-preview'
|
||||
|
||||
import { type FieldInfo as MetadataFieldInfo, FieldType } from '@shumai/dtos'
|
||||
import { FieldType, type FieldInfo as MetadataFieldInfo } from '@shumai/dtos'
|
||||
import { FIELD_TYPE_ICONS } from '../fields-manager'
|
||||
|
||||
interface FileCardProps {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { ScrollArea } from '@/ui/components/ui/scroll-area'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/ui/components/ui/card'
|
||||
import { Switch } from '@/ui/components/ui/switch'
|
||||
import {
|
||||
@@ -65,163 +66,169 @@ export function NotificationSettings({ teamId }: { teamId: string }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="h-full overflow-y-auto space-y-6 pr-1">
|
||||
{/* Comments Settings */}
|
||||
<Card className="border border-slate-200 dark:border-slate-800">
|
||||
<CardHeader className="border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50">
|
||||
<div className="flex items-center gap-2">
|
||||
<MessageSquare className="w-5 h-5 text-blue-500" />
|
||||
<CardTitle className="text-lg">Comments & Replies</CardTitle>
|
||||
</div>
|
||||
<CardDescription>
|
||||
Control notification preferences when other users comment on assets you collaborate on
|
||||
or mention you.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="divide-y divide-slate-100 dark:divide-slate-800 p-0">
|
||||
{/* General Comments */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400">
|
||||
<MessageSquare className="w-4 h-4" />
|
||||
<ScrollArea className="h-full">
|
||||
<div className="space-y-6 pr-4 pb-8">
|
||||
{/* Comments Settings */}
|
||||
<Card className="border border-slate-200 dark:border-slate-800">
|
||||
<CardHeader className="border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50">
|
||||
<div className="flex items-center gap-2">
|
||||
<MessageSquare className="w-5 h-5 text-blue-500" />
|
||||
<CardTitle className="text-lg">Comments & Replies</CardTitle>
|
||||
</div>
|
||||
<CardDescription>
|
||||
Control notification preferences when other users comment on assets you collaborate on
|
||||
or mention you.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="divide-y divide-slate-100 dark:divide-slate-800 p-0">
|
||||
{/* General Comments */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400">
|
||||
<MessageSquare className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
General Comments
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When someone comments on an asset
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
General Comments
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When someone comments on an asset
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.comments ?? true}
|
||||
onCheckedChange={() => handleToggle('comments')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.comments ?? true}
|
||||
onCheckedChange={() => handleToggle('comments')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Comment Replies */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-purple-50 dark:bg-purple-900/20 text-purple-600 dark:text-purple-400">
|
||||
<MessageCircle className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
Comment Replies
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When someone replies to your comment
|
||||
</p>
|
||||
{/* Comment Replies */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-purple-50 dark:bg-purple-900/20 text-purple-600 dark:text-purple-400">
|
||||
<MessageCircle className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
Comment Replies
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When someone replies to your comment
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.replies ?? true}
|
||||
onCheckedChange={() => handleToggle('replies')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.replies ?? true}
|
||||
onCheckedChange={() => handleToggle('replies')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Mentions */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-pink-50 dark:bg-pink-900/20 text-pink-600 dark:text-pink-400">
|
||||
<AtSign className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">@Mentions</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When someone @mentions you in a comment
|
||||
</p>
|
||||
{/* Mentions */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-pink-50 dark:bg-pink-900/20 text-pink-600 dark:text-pink-400">
|
||||
<AtSign className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
@Mentions
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When someone @mentions you in a comment
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.mentions ?? true}
|
||||
onCheckedChange={() => handleToggle('mentions')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.mentions ?? true}
|
||||
onCheckedChange={() => handleToggle('mentions')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Assets Settings */}
|
||||
<Card className="border border-slate-200 dark:border-slate-800">
|
||||
<CardHeader className="border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50">
|
||||
<div className="flex items-center gap-2">
|
||||
<UploadCloud className="w-5 h-5 text-emerald-500" />
|
||||
<CardTitle className="text-lg">Assets & Statuses</CardTitle>
|
||||
</div>
|
||||
<CardDescription>
|
||||
Manage notifications related to file uploads and metadata field status updates.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="divide-y divide-slate-100 dark:divide-slate-800 p-0">
|
||||
{/* Your Uploads */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400">
|
||||
<Bell className="w-4 h-4" />
|
||||
{/* Assets Settings */}
|
||||
<Card className="border border-slate-200 dark:border-slate-800">
|
||||
<CardHeader className="border-b border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50">
|
||||
<div className="flex items-center gap-2">
|
||||
<UploadCloud className="w-5 h-5 text-emerald-500" />
|
||||
<CardTitle className="text-lg">Assets & Statuses</CardTitle>
|
||||
</div>
|
||||
<CardDescription>
|
||||
Manage notifications related to file uploads and metadata field status updates.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="divide-y divide-slate-100 dark:divide-slate-800 p-0">
|
||||
{/* Your Uploads */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400">
|
||||
<Bell className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
Your Uploads
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When you upload assets
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
Your Uploads
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">When you upload assets</p>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.yourUploads ?? false}
|
||||
onCheckedChange={() => handleToggle('yourUploads')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.yourUploads ?? false}
|
||||
onCheckedChange={() => handleToggle('yourUploads')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Other Uploads */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400">
|
||||
<UploadCloud className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
Other Uploads
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When other users upload assets
|
||||
</p>
|
||||
{/* Other Uploads */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400">
|
||||
<UploadCloud className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
Other Uploads
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When other users upload assets
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.otherUploads ?? true}
|
||||
onCheckedChange={() => handleToggle('otherUploads')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.otherUploads ?? true}
|
||||
onCheckedChange={() => handleToggle('otherUploads')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Status Updates */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400">
|
||||
<Activity className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
Status Updates
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When someone changes an asset’s status
|
||||
</p>
|
||||
{/* Status Updates */}
|
||||
<div className="flex items-center justify-between p-6">
|
||||
<div className="flex gap-4">
|
||||
<div className="mt-1 flex items-center justify-center w-8 h-8 rounded-lg bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400">
|
||||
<Activity className="w-4 h-4" />
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
<h4 className="text-sm font-semibold text-slate-900 dark:text-white">
|
||||
Status Updates
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||
When someone changes an asset’s status
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.statusUpdates ?? true}
|
||||
onCheckedChange={() => handleToggle('statusUpdates')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings?.statusUpdates ?? true}
|
||||
onCheckedChange={() => handleToggle('statusUpdates')}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,26 +1,5 @@
|
||||
import { client } from '@/ui/api/client'
|
||||
import { Card, CardContent } from '@/ui/components/ui/card'
|
||||
import { Button } from '@/ui/components/ui/button'
|
||||
import { Input } from '@/ui/components/ui/input'
|
||||
import { Label } from '@/ui/components/ui/label'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/ui/components/ui/dialog'
|
||||
import { Field, FieldLabel, FieldDescription, FieldError } from '@/ui/components/ui/field'
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/ui/components/ui/select'
|
||||
import { Switch } from '@/ui/components/ui/switch'
|
||||
import { Badge } from '@/ui/components/ui/badge'
|
||||
import { ScrollArea } from '@/ui/components/ui/scroll-area'
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
@@ -31,32 +10,54 @@ import {
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from '@/ui/components/ui/alert-dialog'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { useForm } from '@tanstack/react-form'
|
||||
import { Badge } from '@/ui/components/ui/badge'
|
||||
import { Button } from '@/ui/components/ui/button'
|
||||
import { Card, CardContent } from '@/ui/components/ui/card'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/ui/components/ui/dialog'
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/ui/components/ui/dropdown-menu'
|
||||
import { Field, FieldDescription, FieldError, FieldLabel } from '@/ui/components/ui/field'
|
||||
import { Input } from '@/ui/components/ui/input'
|
||||
import { Label } from '@/ui/components/ui/label'
|
||||
import {
|
||||
Loader2,
|
||||
Plus,
|
||||
Trash2,
|
||||
Cpu,
|
||||
Globe,
|
||||
ChevronRight,
|
||||
Info,
|
||||
DollarSign,
|
||||
Maximize2,
|
||||
Zap,
|
||||
Search,
|
||||
MoreVertical,
|
||||
} from 'lucide-react'
|
||||
import { useState, useMemo, useEffect } from 'react'
|
||||
import { toast } from 'sonner'
|
||||
import { InferResponseType } from 'hono/client'
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/ui/components/ui/select'
|
||||
import { Switch } from '@/ui/components/ui/switch'
|
||||
import { providerConfigSchema, providerModelSchema } from '@shumai/dtos'
|
||||
import { useForm } from '@tanstack/react-form'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { InferResponseType } from 'hono/client'
|
||||
import {
|
||||
ChevronRight,
|
||||
Cpu,
|
||||
DollarSign,
|
||||
Globe,
|
||||
Info,
|
||||
Loader2,
|
||||
Maximize2,
|
||||
MoreVertical,
|
||||
Plus,
|
||||
Search,
|
||||
Trash2,
|
||||
Zap,
|
||||
} from 'lucide-react'
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { toast } from 'sonner'
|
||||
import { z } from 'zod'
|
||||
|
||||
const providerFormSchemaBase = z.object({
|
||||
@@ -227,8 +228,8 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 overflow-y-auto pr-2 min-h-0 overflow-x-hidden">
|
||||
<div className="grid grid-cols-1 gap-4 py-2">
|
||||
<ScrollArea className="flex-1 min-h-0">
|
||||
<div className="pr-4 py-2 grid grid-cols-1 gap-4">
|
||||
{filteredProviders.map((provider) => (
|
||||
<Card
|
||||
key={provider.id}
|
||||
@@ -337,7 +338,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
|
||||
<ProviderFormDialog
|
||||
isOpen={isCreateDialogOpen}
|
||||
@@ -379,7 +380,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel onClick={() => setProviderToDelete(null)}>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
className="bg-destructive hover:bg-destructive/90 text-white"
|
||||
className="bg-destructive hover:bg-destructive/90 text-destructive-foreground"
|
||||
onClick={() => {
|
||||
if (providerToDelete) {
|
||||
deleteMutation.mutate(providerToDelete.id)
|
||||
@@ -505,392 +506,392 @@ function ProviderFormDialog({
|
||||
}}
|
||||
className="flex flex-col flex-1 overflow-hidden"
|
||||
>
|
||||
<div className="flex-1 overflow-y-auto p-6 pt-2 space-y-8">
|
||||
{/* Row 1: Basic Config */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 p-6 bg-slate-50 dark:bg-slate-900 rounded-2xl border border-slate-200 dark:border-slate-800">
|
||||
<form.Field
|
||||
name="name"
|
||||
children={(field) => {
|
||||
const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name}>Provider Name</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) => field.handleChange(e.target.value)}
|
||||
placeholder="e.g., My OpenAI"
|
||||
disabled={isBuiltin}
|
||||
aria-invalid={isInvalid}
|
||||
/>
|
||||
{isInvalid && <FieldError errors={mapErrors(field.state.meta.errors)} />}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
<form.Field
|
||||
name="config.api"
|
||||
children={(field) => {
|
||||
const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name}>Global API Protocol</FieldLabel>
|
||||
<Select
|
||||
onValueChange={field.handleChange}
|
||||
value={field.state.value}
|
||||
disabled={isBuiltin}
|
||||
>
|
||||
<SelectTrigger id={field.name} aria-invalid={isInvalid}>
|
||||
<SelectValue placeholder="Select API Protocol" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="openai-completions">OpenAI Completions</SelectItem>
|
||||
<SelectItem value="anthropic-messages">Anthropic Messages</SelectItem>
|
||||
<SelectItem value="google-genai">Google GenAI</SelectItem>
|
||||
<SelectItem value="bedrock-converse-stream">AWS Bedrock</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
{isInvalid && <FieldError errors={mapErrors(field.state.meta.errors)} />}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="md:col-span-2">
|
||||
<ScrollArea className="flex-1 min-h-0">
|
||||
<div className="p-6 pt-2 space-y-8 pr-4">
|
||||
{/* Row 1: Basic Config */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 p-6 rounded-2xl border">
|
||||
<form.Field
|
||||
name="config.baseUrl"
|
||||
name="name"
|
||||
children={(field) => {
|
||||
const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name}>Base URL (Optional)</FieldLabel>
|
||||
<FieldLabel htmlFor={field.name}>Provider Name</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
value={field.state.value || ''}
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) => field.handleChange(e.target.value)}
|
||||
placeholder="https://api.openai.com/v1"
|
||||
placeholder="e.g., My OpenAI"
|
||||
disabled={isBuiltin}
|
||||
aria-invalid={isInvalid}
|
||||
/>
|
||||
<FieldDescription>Override the default endpoint.</FieldDescription>
|
||||
{isInvalid && <FieldError errors={mapErrors(field.state.meta.errors)} />}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
<form.Field
|
||||
name="config.api"
|
||||
children={(field) => {
|
||||
const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name}>Global API Protocol</FieldLabel>
|
||||
<Select
|
||||
onValueChange={field.handleChange}
|
||||
value={field.state.value}
|
||||
disabled={isBuiltin}
|
||||
>
|
||||
<SelectTrigger id={field.name} aria-invalid={isInvalid}>
|
||||
<SelectValue placeholder="Select API Protocol" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="openai-completions">OpenAI Completions</SelectItem>
|
||||
<SelectItem value="anthropic-messages">Anthropic Messages</SelectItem>
|
||||
<SelectItem value="google-genai">Google GenAI</SelectItem>
|
||||
<SelectItem value="bedrock-converse-stream">AWS Bedrock</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
{isInvalid && <FieldError errors={mapErrors(field.state.meta.errors)} />}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="md:col-span-2">
|
||||
<form.Field
|
||||
name="config.baseUrl"
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name}>Base URL (Optional)</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
value={field.state.value || ''}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) => field.handleChange(e.target.value)}
|
||||
placeholder="https://api.openai.com/v1"
|
||||
aria-invalid={isInvalid}
|
||||
/>
|
||||
<FieldDescription>Override the default endpoint.</FieldDescription>
|
||||
{isInvalid && <FieldError errors={mapErrors(field.state.meta.errors)} />}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Row 2: API Key Card */}
|
||||
<Card className="rounded-2xl border bg-transparent">
|
||||
<CardContent className="p-6 pt-2">
|
||||
<form.Field
|
||||
name="config.apiKey"
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name} className="text-base font-semibold">
|
||||
API Key
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="text"
|
||||
value={field.state.value || ''}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) => field.handleChange(e.target.value)}
|
||||
placeholder="Enter API Key or Environment Variable"
|
||||
aria-invalid={isInvalid}
|
||||
/>
|
||||
<FieldDescription className="text-xs mt-2">
|
||||
You can provide a literal value (e.g.{' '}
|
||||
<code className="bg-muted px-1 rounded text-primary">sk-...</code>) or
|
||||
an Environment variable name (e.g.{' '}
|
||||
<code className="bg-muted px-1 rounded text-primary">MY_API_KEY</code>
|
||||
).
|
||||
</FieldDescription>
|
||||
{isInvalid && <FieldError errors={mapErrors(field.state.meta.errors)} />}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Models Section */}
|
||||
<div className="space-y-4">
|
||||
<form.Field
|
||||
name="models"
|
||||
mode="array"
|
||||
children={(modelsField) => (
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<Label className="text-lg font-bold">Models Configuration</Label>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
modelsField.pushValue({
|
||||
modelId: '',
|
||||
name: '',
|
||||
config: {
|
||||
api: form.getFieldValue('config.api'),
|
||||
reasoning: false,
|
||||
input: ['text'],
|
||||
contextWindow: 128000,
|
||||
maxTokens: 4096,
|
||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||
},
|
||||
})
|
||||
}
|
||||
className="gap-2"
|
||||
>
|
||||
<Plus className="w-4 h-4" />
|
||||
Add Model
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-6">
|
||||
{modelsField.state.value.map((_, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="group relative p-6 bg-transparent rounded-2xl border shadow-sm animate-in fade-in zoom-in-95 duration-300"
|
||||
>
|
||||
{/* Row 1: ID and Name */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<form.Field
|
||||
name={`models[${index}].modelId`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name}>Model ID</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) => field.handleChange(e.target.value)}
|
||||
placeholder="gpt-4o"
|
||||
aria-invalid={isInvalid}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<form.Field
|
||||
name={`models[${index}].name`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name}>
|
||||
Display Name (Optional)
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) => field.handleChange(e.target.value)}
|
||||
placeholder="e.g., GPT-4o"
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Row 2: Reasoning and Context Window */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
|
||||
<form.Field
|
||||
name={`models[${index}].config.reasoning`}
|
||||
children={(field) => (
|
||||
<Field
|
||||
orientation="horizontal"
|
||||
className="rounded-lg border border-border p-3 shadow-sm bg-muted/50 justify-between"
|
||||
>
|
||||
<FieldLabel htmlFor={field.name}>Reasoning Support</FieldLabel>
|
||||
<Switch
|
||||
id={field.name}
|
||||
checked={field.state.value}
|
||||
onCheckedChange={field.handleChange}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
</Field>
|
||||
)}
|
||||
/>
|
||||
<form.Field
|
||||
name={`models[${index}].config.contextWindow`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name} className="text-xs">
|
||||
Context Window (tokens)
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="number"
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) =>
|
||||
field.handleChange(parseInt(e.target.value) || 0)
|
||||
}
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Row 3: Constraints and Cost */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 mt-6">
|
||||
<form.Field
|
||||
name={`models[${index}].config.maxTokens`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name} className="text-xs">
|
||||
Max Output Tokens
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="number"
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) =>
|
||||
field.handleChange(parseInt(e.target.value) || 0)
|
||||
}
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<form.Field
|
||||
name={`models[${index}].config.cost.input`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel
|
||||
htmlFor={field.name}
|
||||
className="text-xs flex items-center gap-1"
|
||||
>
|
||||
<DollarSign className="w-3 h-3" /> Input Cost (1M)
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="number"
|
||||
step="0.01"
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) =>
|
||||
field.handleChange(parseFloat(e.target.value) || 0)
|
||||
}
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<form.Field
|
||||
name={`models[${index}].config.cost.output`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel
|
||||
htmlFor={field.name}
|
||||
className="text-xs flex items-center gap-1"
|
||||
>
|
||||
<DollarSign className="w-3 h-3" /> Output Cost (1M)
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="number"
|
||||
step="0.01"
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) =>
|
||||
field.handleChange(parseFloat(e.target.value) || 0)
|
||||
}
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{!isBuiltin && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="absolute -top-2 -right-2 h-8 w-8 rounded-full bg-background border border-border text-muted-foreground hover:text-destructive transition-colors shadow-sm"
|
||||
onClick={() => modelsField.removeValue(index)}
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
|
||||
{/* Row 2: API Key Card */}
|
||||
<Card className="bg-slate-50 dark:bg-slate-900 rounded-2xl border border-slate-200 dark:border-slate-800">
|
||||
<CardContent className="p-6">
|
||||
<form.Field
|
||||
name="config.apiKey"
|
||||
children={(field) => {
|
||||
const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name} className="text-base font-semibold">
|
||||
API Key
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="text"
|
||||
value={field.state.value || ''}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) => field.handleChange(e.target.value)}
|
||||
placeholder="Enter API Key or Environment Variable"
|
||||
aria-invalid={isInvalid}
|
||||
/>
|
||||
<FieldDescription className="text-xs mt-2">
|
||||
You can provide a literal value (e.g.{' '}
|
||||
<code className="bg-slate-200 dark:bg-slate-800 px-1 rounded text-blue-600 dark:text-blue-400">
|
||||
sk-...
|
||||
</code>
|
||||
) or an Environment variable name (e.g.{' '}
|
||||
<code className="bg-slate-200 dark:bg-slate-800 px-1 rounded text-blue-600 dark:text-blue-400">
|
||||
MY_API_KEY
|
||||
</code>
|
||||
).
|
||||
</FieldDescription>
|
||||
{isInvalid && <FieldError errors={mapErrors(field.state.meta.errors)} />}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Models Section */}
|
||||
<div className="space-y-4">
|
||||
<form.Field
|
||||
name="models"
|
||||
mode="array"
|
||||
children={(modelsField) => (
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<Label className="text-lg font-bold">Models Configuration</Label>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
modelsField.pushValue({
|
||||
modelId: '',
|
||||
name: '',
|
||||
config: {
|
||||
api: form.getFieldValue('config.api'),
|
||||
reasoning: false,
|
||||
input: ['text'],
|
||||
contextWindow: 128000,
|
||||
maxTokens: 4096,
|
||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||
},
|
||||
})
|
||||
}
|
||||
className="gap-2"
|
||||
>
|
||||
<Plus className="w-4 h-4" />
|
||||
Add Model
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-6">
|
||||
{modelsField.state.value.map((_, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="group relative p-6 bg-white dark:bg-slate-950 rounded-2xl border border-slate-200 dark:border-slate-800 shadow-sm animate-in fade-in zoom-in-95 duration-300"
|
||||
>
|
||||
{/* Row 1: ID and Name */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<form.Field
|
||||
name={`models[${index}].modelId`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name}>Model ID</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) => field.handleChange(e.target.value)}
|
||||
placeholder="gpt-4o"
|
||||
aria-invalid={isInvalid}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<form.Field
|
||||
name={`models[${index}].name`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name}>
|
||||
Display Name (Optional)
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) => field.handleChange(e.target.value)}
|
||||
placeholder="e.g., GPT-4o"
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Row 2: Reasoning and Context Window */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
|
||||
<form.Field
|
||||
name={`models[${index}].config.reasoning`}
|
||||
children={(field) => (
|
||||
<Field
|
||||
orientation="horizontal"
|
||||
className="rounded-lg border p-3 shadow-sm bg-slate-50 dark:bg-slate-900 justify-between"
|
||||
>
|
||||
<FieldLabel htmlFor={field.name}>Reasoning Support</FieldLabel>
|
||||
<Switch
|
||||
id={field.name}
|
||||
checked={field.state.value}
|
||||
onCheckedChange={field.handleChange}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
</Field>
|
||||
)}
|
||||
/>
|
||||
<form.Field
|
||||
name={`models[${index}].config.contextWindow`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name} className="text-xs">
|
||||
Context Window (tokens)
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="number"
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) =>
|
||||
field.handleChange(parseInt(e.target.value) || 0)
|
||||
}
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Row 3: Constraints and Cost */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 mt-6">
|
||||
<form.Field
|
||||
name={`models[${index}].config.maxTokens`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel htmlFor={field.name} className="text-xs">
|
||||
Max Output Tokens
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="number"
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) =>
|
||||
field.handleChange(parseInt(e.target.value) || 0)
|
||||
}
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<form.Field
|
||||
name={`models[${index}].config.cost.input`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel
|
||||
htmlFor={field.name}
|
||||
className="text-xs flex items-center gap-1"
|
||||
>
|
||||
<DollarSign className="w-3 h-3" /> Input Cost (1M)
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="number"
|
||||
step="0.01"
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) =>
|
||||
field.handleChange(parseFloat(e.target.value) || 0)
|
||||
}
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<form.Field
|
||||
name={`models[${index}].config.cost.output`}
|
||||
children={(field) => {
|
||||
const isInvalid =
|
||||
!!field.state.meta.errors.length && field.state.meta.isTouched
|
||||
return (
|
||||
<Field data-invalid={isInvalid}>
|
||||
<FieldLabel
|
||||
htmlFor={field.name}
|
||||
className="text-xs flex items-center gap-1"
|
||||
>
|
||||
<DollarSign className="w-3 h-3" /> Output Cost (1M)
|
||||
</FieldLabel>
|
||||
<Input
|
||||
id={field.name}
|
||||
name={field.name}
|
||||
type="number"
|
||||
step="0.01"
|
||||
value={field.state.value}
|
||||
onBlur={field.handleBlur}
|
||||
onChange={(e) =>
|
||||
field.handleChange(parseFloat(e.target.value) || 0)
|
||||
}
|
||||
aria-invalid={isInvalid}
|
||||
disabled={isBuiltin}
|
||||
/>
|
||||
{isInvalid && (
|
||||
<FieldError errors={mapErrors(field.state.meta.errors)} />
|
||||
)}
|
||||
</Field>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{!isBuiltin && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="absolute -top-2 -right-2 h-8 w-8 rounded-full bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 text-slate-400 hover:text-red-600 transition-colors shadow-sm"
|
||||
onClick={() => modelsField.removeValue(index)}
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DialogFooter className="p-6 pt-4 border-t dark:border-slate-800 gap-2">
|
||||
<DialogFooter className="p-6 pt-4 border-t border-border gap-2">
|
||||
<Button type="button" variant="outline" onClick={onClose} disabled={isLoading}>
|
||||
Cancel
|
||||
</Button>
|
||||
@@ -899,7 +900,7 @@ function ProviderFormDialog({
|
||||
children={([canSubmit, isSubmitting]) => (
|
||||
<Button
|
||||
type="submit"
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white min-w-[120px]"
|
||||
className="min-w-[120px]"
|
||||
disabled={!canSubmit || isSubmitting || isLoading}
|
||||
>
|
||||
{isSubmitting || isLoading ? (
|
||||
@@ -926,7 +927,7 @@ function ProviderFormDialog({
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
className="bg-red-600 hover:bg-red-700 text-white"
|
||||
className="bg-destructive hover:bg-destructive/90 text-destructive-foreground"
|
||||
onClick={() => {
|
||||
onDelete?.()
|
||||
setIsDeleteDialogOpen(false)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useState } from 'react'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { ScrollArea } from '@/ui/components/ui/scroll-area'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/ui/components/ui/card'
|
||||
import { Input } from '@/ui/components/ui/input'
|
||||
import { Button } from '@/ui/components/ui/button'
|
||||
@@ -79,129 +80,133 @@ export function SandboxSettings({ teamId }: { teamId: string }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="h-full overflow-y-auto space-y-6 pr-1">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<Globe className="w-5 h-5 text-blue-500" />
|
||||
<CardTitle>Network Sandbox</CardTitle>
|
||||
</div>
|
||||
<CardDescription>
|
||||
Configure allowed domains for the sandboxed agent. By default, only essential domains
|
||||
are allowed.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={handleAddDomain} className="flex gap-2 mb-6">
|
||||
<Input
|
||||
placeholder="e.g. api.openai.com"
|
||||
value={newDomain}
|
||||
onChange={(e) => setNewDomain(e.target.value)}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
<Button type="submit" disabled={isUpdating}>
|
||||
{isUpdating ? (
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
) : (
|
||||
<Plus className="w-4 h-4 mr-2" />
|
||||
)}
|
||||
Add Domain
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
<div className="space-y-2">
|
||||
<h4 className="text-sm font-medium text-slate-500 mb-3">Allowed Domains</h4>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{sandbox?.allowedDomains.map((domain) => (
|
||||
<div
|
||||
key={domain}
|
||||
className="flex items-center gap-1 px-3 py-1.5 bg-slate-100 dark:bg-slate-800 rounded-full text-sm border border-slate-200 dark:border-slate-700 transition-all hover:border-slate-300 dark:hover:border-slate-600"
|
||||
>
|
||||
<span className="font-medium text-slate-700 dark:text-slate-300">{domain}</span>
|
||||
<button
|
||||
onClick={() => handleRemoveDomain(domain)}
|
||||
className="ml-1 text-slate-400 hover:text-red-500 transition-colors"
|
||||
disabled={isUpdating}
|
||||
>
|
||||
<X className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
{sandbox?.allowedDomains.length === 0 && (
|
||||
<div className="text-sm text-slate-400 italic">No custom domains allowed</div>
|
||||
)}
|
||||
<ScrollArea className="h-full">
|
||||
<div className="space-y-6 pr-4 pb-8">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<Globe className="w-5 h-5 text-primary" />
|
||||
<CardTitle>Network Sandbox</CardTitle>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<CardDescription>
|
||||
Configure allowed domains for the sandboxed agent. By default, only essential domains
|
||||
are allowed.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={handleAddDomain} className="flex gap-2 mb-6">
|
||||
<Input
|
||||
placeholder="e.g. api.openai.com"
|
||||
value={newDomain}
|
||||
onChange={(e) => setNewDomain(e.target.value)}
|
||||
disabled={isUpdating}
|
||||
/>
|
||||
<Button type="submit" disabled={isUpdating}>
|
||||
{isUpdating ? (
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
) : (
|
||||
<Plus className="w-4 h-4 mr-2" />
|
||||
)}
|
||||
Add Domain
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
{/* Pending Domains Section */}
|
||||
<Card className="border-amber-200 dark:border-amber-900 bg-amber-50/10 dark:bg-amber-950/5">
|
||||
<CardHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<ShieldAlert className="w-5 h-5 text-amber-500" />
|
||||
<CardTitle>Pending Domain Approvals</CardTitle>
|
||||
</div>
|
||||
<CardDescription>
|
||||
These domains were blocked during agent execution. You can approve them to allow future
|
||||
network requests, or delete them from this list.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-3">
|
||||
{sandbox?.pendingDomains && sandbox.pendingDomains.length > 0 ? (
|
||||
<div className="divide-y divide-slate-100 dark:divide-slate-800">
|
||||
{sandbox.pendingDomains.map((domain) => (
|
||||
<div className="space-y-2">
|
||||
<h4 className="text-sm font-medium text-muted-foreground mb-3">Allowed Domains</h4>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{sandbox?.allowedDomains.map((domain) => (
|
||||
<div
|
||||
key={domain}
|
||||
className="flex items-center justify-between py-2.5 first:pt-0 last:pb-0"
|
||||
className="flex items-center gap-1 px-3 py-1.5 bg-muted rounded-full text-sm border border-border transition-all hover:border-muted-foreground/50"
|
||||
>
|
||||
<span className="font-mono text-sm text-slate-700 dark:text-slate-300 bg-slate-100 dark:bg-slate-800 px-2 py-1 rounded break-all">
|
||||
{domain}
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="h-8 border-emerald-200 text-emerald-600 hover:bg-emerald-50 hover:text-emerald-700 dark:border-emerald-900 dark:text-emerald-400 dark:hover:bg-emerald-950/20"
|
||||
onClick={() => handleApproveDomain(domain)}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
<Check className="w-4 h-4 mr-1.5" />
|
||||
Approve
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="h-8 border-red-200 text-red-600 hover:bg-red-50 hover:text-red-700 dark:border-red-900 dark:text-red-400 dark:hover:bg-red-950/20"
|
||||
onClick={() => handleDeletePendingDomain(domain)}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
<Trash2 className="w-4 h-4 mr-1.5" />
|
||||
Delete
|
||||
</Button>
|
||||
</div>
|
||||
<span className="font-medium text-foreground">{domain}</span>
|
||||
<button
|
||||
onClick={() => handleRemoveDomain(domain)}
|
||||
className="ml-1 text-muted-foreground hover:text-destructive transition-colors"
|
||||
disabled={isUpdating}
|
||||
>
|
||||
<X className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
{sandbox?.allowedDomains.length === 0 && (
|
||||
<div className="text-sm text-muted-foreground italic">
|
||||
No custom domains allowed
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-sm text-slate-400 italic py-2">
|
||||
No pending domains requiring approval
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Filesystem Restriction</CardTitle>
|
||||
<CardDescription>
|
||||
The agent is restricted to reading and writing only within the <code>.pi</code> and{' '}
|
||||
<code>/tmp</code> folders. These settings are currently hardcoded for security.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
</div>
|
||||
{/* Pending Domains Section */}
|
||||
<Card className="border-orange-500/20 bg-orange-500/5">
|
||||
<CardHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<ShieldAlert className="w-5 h-5 text-orange-500" />
|
||||
<CardTitle>Pending Domain Approvals</CardTitle>
|
||||
</div>
|
||||
<CardDescription>
|
||||
These domains were blocked during agent execution. You can approve them to allow
|
||||
future network requests, or delete them from this list.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-3">
|
||||
{sandbox?.pendingDomains && sandbox.pendingDomains.length > 0 ? (
|
||||
<div className="divide-y divide-border">
|
||||
{sandbox.pendingDomains.map((domain) => (
|
||||
<div
|
||||
key={domain}
|
||||
className="flex items-center justify-between py-2.5 first:pt-0 last:pb-0"
|
||||
>
|
||||
<span className="font-mono text-sm text-foreground bg-muted px-2 py-1 rounded break-all">
|
||||
{domain}
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="h-8 border-emerald-500/20 text-emerald-600 hover:bg-emerald-500/10 hover:text-emerald-600 dark:text-emerald-400 dark:hover:bg-emerald-500/20"
|
||||
onClick={() => handleApproveDomain(domain)}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
<Check className="w-4 h-4 mr-1.5" />
|
||||
Approve
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="h-8 border-destructive/20 text-destructive hover:bg-destructive/10"
|
||||
onClick={() => handleDeletePendingDomain(domain)}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
<Trash2 className="w-4 h-4 mr-1.5" />
|
||||
Delete
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-sm text-muted-foreground italic py-2">
|
||||
No pending domains requiring approval
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Filesystem Restriction</CardTitle>
|
||||
<CardDescription>
|
||||
The agent is restricted to reading and writing only within the <code>.pi</code> and{' '}
|
||||
<code>/tmp</code> folders. These settings are currently hardcoded for security.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
</div>
|
||||
</ScrollArea>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import React, { useState, useRef } from 'react'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/ui/components/ui/card'
|
||||
import { Button } from '@/ui/components/ui/button'
|
||||
import { cn } from '@/ui/lib/utils'
|
||||
import { ScrollArea } from '@/ui/components/ui/scroll-area'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -172,7 +173,7 @@ export const SkillsConfigCard: React.FC<SkillsConfigCardProps> = ({ teamId }) =>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
className="bg-destructive hover:bg-destructive/90 text-white"
|
||||
className="bg-destructive hover:bg-destructive/90 text-destructive-foreground"
|
||||
onClick={() => {
|
||||
if (selectedSkill) {
|
||||
deleteMutation.mutate(selectedSkill.id)
|
||||
@@ -222,7 +223,7 @@ const SkillItem = ({
|
||||
e.stopPropagation()
|
||||
onDelete()
|
||||
}}
|
||||
className="text-red-500 focus:text-red-500 gap-2 cursor-pointer"
|
||||
className="text-destructive focus:text-destructive gap-2 cursor-pointer"
|
||||
>
|
||||
<Trash2 className="w-4 h-4" /> Delete
|
||||
</DropdownMenuItem>
|
||||
@@ -382,8 +383,8 @@ const AddSkillDialog = ({
|
||||
className={cn(
|
||||
'group relative h-32 border-2 border-dashed rounded-xl flex flex-col items-center justify-center transition-all cursor-pointer',
|
||||
isProcessing
|
||||
? 'opacity-50 cursor-not-allowed bg-slate-50 dark:bg-slate-900 border-slate-200 dark:border-slate-800'
|
||||
: 'hover:bg-blue-50/50 dark:hover:bg-blue-900/10 hover:border-blue-500/50 border-slate-200 dark:border-slate-800',
|
||||
? 'opacity-50 cursor-not-allowed bg-muted/50 border-border'
|
||||
: 'hover:bg-primary/5 hover:border-primary/50 border-border',
|
||||
)}
|
||||
>
|
||||
<input
|
||||
@@ -393,20 +394,18 @@ const AddSkillDialog = ({
|
||||
accept=".zip"
|
||||
onChange={(e) => handleFileUpload(e.target.files)}
|
||||
/>
|
||||
<div className="p-3 bg-slate-100 dark:bg-slate-800 rounded-full group-hover:bg-blue-100 dark:group-hover:bg-blue-900/30 transition-colors">
|
||||
<Upload className="w-6 h-6 text-slate-400 group-hover:text-blue-500" />
|
||||
<div className="p-3 bg-muted rounded-full group-hover:bg-primary/10 transition-colors">
|
||||
<Upload className="w-6 h-6 text-muted-foreground group-hover:text-primary" />
|
||||
</div>
|
||||
<div className="mt-3 text-center">
|
||||
<p className="text-sm font-medium text-slate-700 dark:text-slate-300">
|
||||
Select ZIP file
|
||||
</p>
|
||||
<p className="text-[10px] text-slate-500 dark:text-slate-400 mt-1 uppercase tracking-wider font-semibold">
|
||||
<p className="text-sm font-medium text-foreground">Select ZIP file</p>
|
||||
<p className="text-[10px] text-muted-foreground mt-1 uppercase tracking-wider font-semibold">
|
||||
Packages must contain a SKILL.md
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{isProcessing && !githubUrl && (
|
||||
<div className="flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 justify-center bg-blue-50 dark:bg-blue-900/10 py-2 rounded-lg animate-pulse">
|
||||
<div className="flex items-center gap-2 text-sm text-primary justify-center bg-primary/10 py-2 rounded-lg animate-pulse">
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
Processing package...
|
||||
</div>
|
||||
@@ -415,10 +414,10 @@ const AddSkillDialog = ({
|
||||
|
||||
<div className="relative">
|
||||
<div className="absolute inset-0 flex items-center">
|
||||
<span className="w-full border-t border-slate-200 dark:border-slate-800" />
|
||||
<span className="w-full border-t border-border" />
|
||||
</div>
|
||||
<div className="relative flex justify-center text-xs uppercase">
|
||||
<span className="bg-white dark:bg-slate-950 px-2 text-slate-500 font-bold">OR</span>
|
||||
<span className="bg-background px-2 text-muted-foreground font-bold">OR</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -428,7 +427,7 @@ const AddSkillDialog = ({
|
||||
<Label htmlFor="githubUrl">GitHub Repository URL</Label>
|
||||
<div className="flex gap-2">
|
||||
<div className="relative flex-1">
|
||||
<Github className="absolute left-3 top-2.5 w-4 h-4 text-slate-400" />
|
||||
<Github className="absolute left-3 top-2.5 w-4 h-4 text-muted-foreground" />
|
||||
<Input
|
||||
id="githubUrl"
|
||||
placeholder="https://github.com/owner/repo"
|
||||
@@ -450,7 +449,7 @@ const AddSkillDialog = ({
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-[10px] text-slate-500 dark:text-slate-400 italic">
|
||||
<p className="text-[10px] text-muted-foreground italic">
|
||||
Example: https://github.com/google/gemini-cli
|
||||
</p>
|
||||
</div>
|
||||
@@ -540,7 +539,7 @@ const ConfigSkillDialog = ({
|
||||
<DialogHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<Code className="w-5 h-5 text-blue-500" />
|
||||
<Code className="w-5 h-5 text-primary" />
|
||||
Configure Skill: {skill.name}
|
||||
</DialogTitle>
|
||||
</div>
|
||||
@@ -549,63 +548,65 @@ const ConfigSkillDialog = ({
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="py-4 space-y-4 max-h-[60vh] overflow-y-auto pr-2 custom-scrollbar">
|
||||
{envVars.length === 0 ? (
|
||||
<div className="text-center py-10 bg-slate-50 dark:bg-slate-900 rounded-xl border border-dashed border-slate-200 dark:border-slate-800">
|
||||
<p className="text-slate-500 dark:text-slate-400 text-sm italic">
|
||||
No environment variables found. Click "Add Variable" to create one.
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
envVars.map((env: { name: string; default?: string | undefined }, index: number) => (
|
||||
<div
|
||||
key={index}
|
||||
className="p-4 bg-slate-100/50 dark:bg-slate-800/50 rounded-xl border border-slate-200 dark:border-slate-700 space-y-3 relative group"
|
||||
>
|
||||
<button
|
||||
onClick={() => removeEnvVar(index)}
|
||||
className="absolute top-2 right-2 p-1 text-slate-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-md transition-colors opacity-0 group-hover:opacity-100"
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</button>
|
||||
|
||||
<div className="space-y-1.5">
|
||||
<Label className="text-[10px] uppercase tracking-wider font-bold text-slate-400">
|
||||
Variable Name
|
||||
</Label>
|
||||
<Input
|
||||
value={env.name}
|
||||
onChange={(e) => handleEnvVarNameChange(index, e.target.value)}
|
||||
placeholder="e.app. API_KEY"
|
||||
className="h-8 bg-white dark:bg-slate-950 border-slate-200 dark:border-slate-800 text-sm font-mono"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1.5">
|
||||
<Label className="text-[10px] uppercase tracking-wider font-bold text-slate-400">
|
||||
Default Value
|
||||
</Label>
|
||||
<Input
|
||||
value={env.default || ''}
|
||||
onChange={(e) => handleEnvVarValueChange(index, e.target.value)}
|
||||
placeholder="Optional default value..."
|
||||
className="h-8 bg-white dark:bg-slate-950 border-slate-200 dark:border-slate-800 text-sm"
|
||||
/>
|
||||
<p className="text-[10px] text-slate-500 italic">
|
||||
If left empty, the value will be read from the host machine's environment.
|
||||
</p>
|
||||
</div>
|
||||
<ScrollArea className="max-h-[60vh]">
|
||||
<div className="py-4 space-y-4 pr-4">
|
||||
{envVars.length === 0 ? (
|
||||
<div className="text-center py-10 bg-muted/50 rounded-xl border border-dashed border-border">
|
||||
<p className="text-muted-foreground text-sm italic">
|
||||
No environment variables found. Click "Add Variable" to create one.
|
||||
</p>
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
envVars.map((env: { name: string; default?: string | undefined }, index: number) => (
|
||||
<div
|
||||
key={index}
|
||||
className="p-4 bg-muted/50 rounded-xl border border-border space-y-3 relative group"
|
||||
>
|
||||
<button
|
||||
onClick={() => removeEnvVar(index)}
|
||||
className="absolute top-2 right-2 p-1 text-muted-foreground hover:text-destructive hover:bg-destructive/10 rounded-md transition-colors opacity-0 group-hover:opacity-100"
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
</button>
|
||||
|
||||
<DialogFooter className="flex items-center justify-between sm:justify-between w-full pt-2 border-t border-slate-100 dark:border-slate-800">
|
||||
<div className="space-y-1.5">
|
||||
<Label className="text-[10px] uppercase tracking-wider font-bold text-muted-foreground">
|
||||
Variable Name
|
||||
</Label>
|
||||
<Input
|
||||
value={env.name}
|
||||
onChange={(e) => handleEnvVarNameChange(index, e.target.value)}
|
||||
placeholder="e.app. API_KEY"
|
||||
className="h-8 bg-background border-border text-sm font-mono"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1.5">
|
||||
<Label className="text-[10px] uppercase tracking-wider font-bold text-muted-foreground">
|
||||
Default Value
|
||||
</Label>
|
||||
<Input
|
||||
value={env.default || ''}
|
||||
onChange={(e) => handleEnvVarValueChange(index, e.target.value)}
|
||||
placeholder="Optional default value..."
|
||||
className="h-8 bg-background border-border text-sm"
|
||||
/>
|
||||
<p className="text-[10px] text-muted-foreground italic">
|
||||
If left empty, the value will be read from the host machine's environment.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
|
||||
<DialogFooter className="flex items-center justify-between sm:justify-between w-full pt-2 border-t border-border">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={addEnvVar}
|
||||
className="h-8 gap-1.5 text-blue-600 hover:text-blue-700 hover:bg-blue-50 dark:text-blue-400 dark:hover:bg-blue-900/20"
|
||||
className="h-8 gap-1.5 text-primary hover:text-primary hover:bg-primary/10"
|
||||
>
|
||||
<Plus className="w-3.5 h-3.5" /> Add Variable
|
||||
</Button>
|
||||
@@ -613,11 +614,7 @@ const ConfigSkillDialog = ({
|
||||
<Button variant="ghost" onClick={() => onOpenChange(false)}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleSave}
|
||||
disabled={isSaving}
|
||||
className="px-8 bg-blue-600 hover:bg-blue-700 text-white"
|
||||
>
|
||||
<Button onClick={handleSave} disabled={isSaving} className="px-8">
|
||||
{isSaving ? <Loader2 className="w-4 h-4 animate-spin mr-2" /> : null}
|
||||
Save Changes
|
||||
</Button>
|
||||
|
||||
@@ -159,7 +159,7 @@ export const SpriteScrubber: React.FC<SpriteScrubberProps> = ({
|
||||
return (
|
||||
<div
|
||||
ref={containerRef}
|
||||
className={`relative w-full h-full overflow-hidden cursor-crosshair group bg-gray-900 select-none ${className}`}
|
||||
className={`relative w-full h-full overflow-hidden cursor-crosshair group bg-black select-none ${className}`}
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
onMouseMove={handleMouseMove}
|
||||
|
||||