diff --git a/packages/webui/components/file-browser/file-card.tsx b/packages/webui/components/file-browser/file-card.tsx index 01ebb4e1..ffd8d17c 100644 --- a/packages/webui/components/file-browser/file-card.tsx +++ b/packages/webui/components/file-browser/file-card.tsx @@ -6,11 +6,11 @@ import { Badge } from '@/ui/components/ui/badge' import { Button } from '@/ui/components/ui/button' import { Checkbox } from '@/ui/components/ui/checkbox' import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuSeparator, - DropdownMenuTrigger, + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuTrigger, } from '@/ui/components/ui/dropdown-menu' import { EditableText } from '@/ui/components/ui/editable-text' import { Skeleton } from '@/ui/components/ui/skeleton' diff --git a/packages/webui/components/settings/NotificationSettings.tsx b/packages/webui/components/settings/NotificationSettings.tsx index 5f80ad3a..ac268687 100644 --- a/packages/webui/components/settings/NotificationSettings.tsx +++ b/packages/webui/components/settings/NotificationSettings.tsx @@ -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 ( -
- {/* Comments Settings */} - - -
- - Comments & Replies -
- - Control notification preferences when other users comment on assets you collaborate on - or mention you. - -
- - {/* General Comments */} -
-
-
- + +
+ {/* Comments Settings */} + + +
+ + Comments & Replies +
+ + Control notification preferences when other users comment on assets you collaborate on + or mention you. + +
+ + {/* General Comments */} +
+
+
+ +
+
+

+ General Comments +

+

+ When someone comments on an asset +

+
-
-

- General Comments -

-

- When someone comments on an asset -

-
+ handleToggle('comments')} + disabled={isUpdating} + />
- handleToggle('comments')} - disabled={isUpdating} - /> -
- {/* Comment Replies */} -
-
-
- -
-
-

- Comment Replies -

-

- When someone replies to your comment -

+ {/* Comment Replies */} +
+
+
+ +
+
+

+ Comment Replies +

+

+ When someone replies to your comment +

+
+ handleToggle('replies')} + disabled={isUpdating} + />
- handleToggle('replies')} - disabled={isUpdating} - /> -
- {/* Mentions */} -
-
-
- -
-
-

@Mentions

-

- When someone @mentions you in a comment -

+ {/* Mentions */} +
+
+
+ +
+
+

+ @Mentions +

+

+ When someone @mentions you in a comment +

+
+ handleToggle('mentions')} + disabled={isUpdating} + />
- handleToggle('mentions')} - disabled={isUpdating} - /> -
- - + + - {/* Assets Settings */} - - -
- - Assets & Statuses -
- - Manage notifications related to file uploads and metadata field status updates. - -
- - {/* Your Uploads */} -
-
-
- + {/* Assets Settings */} + + +
+ + Assets & Statuses +
+ + Manage notifications related to file uploads and metadata field status updates. + +
+ + {/* Your Uploads */} +
+
+
+ +
+
+

+ Your Uploads +

+

+ When you upload assets +

+
-
-

- Your Uploads -

-

When you upload assets

-
+ handleToggle('yourUploads')} + disabled={isUpdating} + />
- handleToggle('yourUploads')} - disabled={isUpdating} - /> -
- {/* Other Uploads */} -
-
-
- -
-
-

- Other Uploads -

-

- When other users upload assets -

+ {/* Other Uploads */} +
+
+
+ +
+
+

+ Other Uploads +

+

+ When other users upload assets +

+
+ handleToggle('otherUploads')} + disabled={isUpdating} + />
- handleToggle('otherUploads')} - disabled={isUpdating} - /> -
- {/* Status Updates */} -
-
-
- -
-
-

- Status Updates -

-

- When someone changes an asset’s status -

+ {/* Status Updates */} +
+
+
+ +
+
+

+ Status Updates +

+

+ When someone changes an asset’s status +

+
+ handleToggle('statusUpdates')} + disabled={isUpdating} + />
- handleToggle('statusUpdates')} - disabled={isUpdating} - /> -
- - -
+ + +
+ ) } diff --git a/packages/webui/components/settings/ProvidersSettings.tsx b/packages/webui/components/settings/ProvidersSettings.tsx index 1ffc48f6..39e28536 100644 --- a/packages/webui/components/settings/ProvidersSettings.tsx +++ b/packages/webui/components/settings/ProvidersSettings.tsx @@ -1,40 +1,41 @@ import { client } from '@/ui/api/client' +import { ScrollArea } from '@/ui/components/ui/scroll-area' import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, } from '@/ui/components/ui/alert-dialog' 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, + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, } from '@/ui/components/ui/dialog' import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, + 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 { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, } from '@/ui/components/ui/select' import { Switch } from '@/ui/components/ui/switch' import { providerConfigSchema, providerModelSchema } from '@shumai/dtos' @@ -42,18 +43,18 @@ 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, + 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' @@ -227,8 +228,8 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
-
-
+ +
{filteredProviders.map((provider) => ( )}
-
+ -
- {/* Row 1: Basic Config */} -
- { - const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched - return ( - - Provider Name - field.handleChange(e.target.value)} - placeholder="e.g., My OpenAI" - disabled={isBuiltin} - aria-invalid={isInvalid} - /> - {isInvalid && } - - ) - }} - /> - - { - const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched - return ( - - Global API Protocol - - {isInvalid && } - - ) - }} - /> - -
+ +
+ {/* Row 1: Basic Config */} +
{ const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched return ( - Base URL (Optional) + Provider Name field.handleChange(e.target.value)} - placeholder="https://api.openai.com/v1" + placeholder="e.g., My OpenAI" + disabled={isBuiltin} aria-invalid={isInvalid} /> - Override the default endpoint. {isInvalid && } ) }} /> + + { + const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched + return ( + + Global API Protocol + + {isInvalid && } + + ) + }} + /> + +
+ { + const isInvalid = + !!field.state.meta.errors.length && field.state.meta.isTouched + return ( + + Base URL (Optional) + field.handleChange(e.target.value)} + placeholder="https://api.openai.com/v1" + aria-invalid={isInvalid} + /> + Override the default endpoint. + {isInvalid && } + + ) + }} + /> +
+
+ + {/* Row 2: API Key Card */} + + + { + const isInvalid = + !!field.state.meta.errors.length && field.state.meta.isTouched + return ( + + + API Key + + field.handleChange(e.target.value)} + placeholder="Enter API Key or Environment Variable" + aria-invalid={isInvalid} + /> + + You can provide a literal value (e.g.{' '} + sk-...) or + an Environment variable name (e.g.{' '} + MY_API_KEY + ). + + {isInvalid && } + + ) + }} + /> + + + + {/* Models Section */} +
+ ( +
+
+ + +
+ +
+ {modelsField.state.value.map((_, index) => ( +
+ {/* Row 1: ID and Name */} +
+ { + const isInvalid = + !!field.state.meta.errors.length && field.state.meta.isTouched + return ( + + Model ID + field.handleChange(e.target.value)} + placeholder="gpt-4o" + aria-invalid={isInvalid} + /> + {isInvalid && ( + + )} + + ) + }} + /> + { + const isInvalid = + !!field.state.meta.errors.length && field.state.meta.isTouched + return ( + + + Display Name (Optional) + + field.handleChange(e.target.value)} + placeholder="e.g., GPT-4o" + aria-invalid={isInvalid} + disabled={isBuiltin} + /> + {isInvalid && ( + + )} + + ) + }} + /> +
+ + {/* Row 2: Reasoning and Context Window */} +
+ ( + + Reasoning Support + + + )} + /> + { + const isInvalid = + !!field.state.meta.errors.length && field.state.meta.isTouched + return ( + + + Context Window (tokens) + + + field.handleChange(parseInt(e.target.value) || 0) + } + aria-invalid={isInvalid} + disabled={isBuiltin} + /> + {isInvalid && ( + + )} + + ) + }} + /> +
+ + {/* Row 3: Constraints and Cost */} +
+ { + const isInvalid = + !!field.state.meta.errors.length && field.state.meta.isTouched + return ( + + + Max Output Tokens + + + field.handleChange(parseInt(e.target.value) || 0) + } + aria-invalid={isInvalid} + disabled={isBuiltin} + /> + {isInvalid && ( + + )} + + ) + }} + /> + { + const isInvalid = + !!field.state.meta.errors.length && field.state.meta.isTouched + return ( + + + Input Cost (1M) + + + field.handleChange(parseFloat(e.target.value) || 0) + } + aria-invalid={isInvalid} + disabled={isBuiltin} + /> + {isInvalid && ( + + )} + + ) + }} + /> + { + const isInvalid = + !!field.state.meta.errors.length && field.state.meta.isTouched + return ( + + + Output Cost (1M) + + + field.handleChange(parseFloat(e.target.value) || 0) + } + aria-invalid={isInvalid} + disabled={isBuiltin} + /> + {isInvalid && ( + + )} + + ) + }} + /> +
+ + {!isBuiltin && ( + + )} +
+ ))} +
+
+ )} + />
- - {/* Row 2: API Key Card */} - - - { - const isInvalid = !!field.state.meta.errors.length && field.state.meta.isTouched - return ( - - - API Key - - field.handleChange(e.target.value)} - placeholder="Enter API Key or Environment Variable" - aria-invalid={isInvalid} - /> - - You can provide a literal value (e.g.{' '} - sk-...) or an - Environment variable name (e.g.{' '} - MY_API_KEY - ). - - {isInvalid && } - - ) - }} - /> - - - - {/* Models Section */} -
- ( -
-
- - -
- -
- {modelsField.state.value.map((_, index) => ( -
- {/* Row 1: ID and Name */} -
- { - const isInvalid = - !!field.state.meta.errors.length && field.state.meta.isTouched - return ( - - Model ID - field.handleChange(e.target.value)} - placeholder="gpt-4o" - aria-invalid={isInvalid} - /> - {isInvalid && ( - - )} - - ) - }} - /> - { - const isInvalid = - !!field.state.meta.errors.length && field.state.meta.isTouched - return ( - - - Display Name (Optional) - - field.handleChange(e.target.value)} - placeholder="e.g., GPT-4o" - aria-invalid={isInvalid} - disabled={isBuiltin} - /> - {isInvalid && ( - - )} - - ) - }} - /> -
- - {/* Row 2: Reasoning and Context Window */} -
- ( - - Reasoning Support - - - )} - /> - { - const isInvalid = - !!field.state.meta.errors.length && field.state.meta.isTouched - return ( - - - Context Window (tokens) - - - field.handleChange(parseInt(e.target.value) || 0) - } - aria-invalid={isInvalid} - disabled={isBuiltin} - /> - {isInvalid && ( - - )} - - ) - }} - /> -
- - {/* Row 3: Constraints and Cost */} -
- { - const isInvalid = - !!field.state.meta.errors.length && field.state.meta.isTouched - return ( - - - Max Output Tokens - - - field.handleChange(parseInt(e.target.value) || 0) - } - aria-invalid={isInvalid} - disabled={isBuiltin} - /> - {isInvalid && ( - - )} - - ) - }} - /> - { - const isInvalid = - !!field.state.meta.errors.length && field.state.meta.isTouched - return ( - - - Input Cost (1M) - - - field.handleChange(parseFloat(e.target.value) || 0) - } - aria-invalid={isInvalid} - disabled={isBuiltin} - /> - {isInvalid && ( - - )} - - ) - }} - /> - { - const isInvalid = - !!field.state.meta.errors.length && field.state.meta.isTouched - return ( - - - Output Cost (1M) - - - field.handleChange(parseFloat(e.target.value) || 0) - } - aria-invalid={isInvalid} - disabled={isBuiltin} - /> - {isInvalid && ( - - )} - - ) - }} - /> -
- - {!isBuiltin && ( - - )} -
- ))} -
-
- )} - /> -
-
+ - - -
-

Allowed Domains

-
- {sandbox?.allowedDomains.map((domain) => ( -
- {domain} - -
- ))} - {sandbox?.allowedDomains.length === 0 && ( -
No custom domains allowed
- )} + +
+ + +
+ + Network Sandbox
-
- - + + Configure allowed domains for the sandboxed agent. By default, only essential domains + are allowed. + + + +
+ setNewDomain(e.target.value)} + disabled={isUpdating} + /> + +
- {/* Pending Domains Section */} - - -
- - Pending Domain Approvals -
- - These domains were blocked during agent execution. You can approve them to allow future - network requests, or delete them from this list. - -
- -
- {sandbox?.pendingDomains && sandbox.pendingDomains.length > 0 ? ( -
- {sandbox.pendingDomains.map((domain) => ( +
+

Allowed Domains

+
+ {sandbox?.allowedDomains.map((domain) => (
- - {domain} - -
- - -
+ {domain} +
))} + {sandbox?.allowedDomains.length === 0 && ( +
+ No custom domains allowed +
+ )}
- ) : ( -
- No pending domains requiring approval -
- )} -
- - +
+ + - - - Filesystem Restriction - - The agent is restricted to reading and writing only within the .pi and{' '} - /tmp folders. These settings are currently hardcoded for security. - - - -
+ {/* Pending Domains Section */} + + +
+ + Pending Domain Approvals +
+ + These domains were blocked during agent execution. You can approve them to allow + future network requests, or delete them from this list. + +
+ +
+ {sandbox?.pendingDomains && sandbox.pendingDomains.length > 0 ? ( +
+ {sandbox.pendingDomains.map((domain) => ( +
+ + {domain} + +
+ + +
+
+ ))} +
+ ) : ( +
+ No pending domains requiring approval +
+ )} +
+
+
+ + + + Filesystem Restriction + + The agent is restricted to reading and writing only within the .pi and{' '} + /tmp folders. These settings are currently hardcoded for security. + + + +
+ ) } diff --git a/packages/webui/components/settings/SkillsConfigCard.tsx b/packages/webui/components/settings/SkillsConfigCard.tsx index c9f7459c..e0d5598f 100644 --- a/packages/webui/components/settings/SkillsConfigCard.tsx +++ b/packages/webui/components/settings/SkillsConfigCard.tsx @@ -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, @@ -397,9 +398,7 @@ const AddSkillDialog = ({
-

- Select ZIP file -

+

Select ZIP file

Packages must contain a SKILL.md

@@ -549,56 +548,58 @@ const ConfigSkillDialog = ({ -
- {envVars.length === 0 ? ( -
-

- No environment variables found. Click "Add Variable" to create one. -

-
- ) : ( - envVars.map((env: { name: string; default?: string | undefined }, index: number) => ( -
- - -
- - handleEnvVarNameChange(index, e.target.value)} - placeholder="e.app. API_KEY" - className="h-8 bg-background border-border text-sm font-mono" - /> -
- -
- - handleEnvVarValueChange(index, e.target.value)} - placeholder="Optional default value..." - className="h-8 bg-background border-border text-sm" - /> -

- If left empty, the value will be read from the host machine's environment. -

-
+ +
+ {envVars.length === 0 ? ( +
+

+ No environment variables found. Click "Add Variable" to create one. +

- )) - )} -
+ ) : ( + envVars.map((env: { name: string; default?: string | undefined }, index: number) => ( +
+ + +
+ + handleEnvVarNameChange(index, e.target.value)} + placeholder="e.app. API_KEY" + className="h-8 bg-background border-border text-sm font-mono" + /> +
+ +
+ + handleEnvVarValueChange(index, e.target.value)} + placeholder="Optional default value..." + className="h-8 bg-background border-border text-sm" + /> +

+ If left empty, the value will be read from the host machine's environment. +

+
+
+ )) + )} +
+ -