Skip to content

Comments

feat(tarko): add workspace display in navbar (close: #1039)#1081

Merged
ulivz merged 5 commits intomainfrom
feat/workspace-display-1039
Aug 11, 2025
Merged

feat(tarko): add workspace display in navbar (close: #1039)#1081
ulivz merged 5 commits intomainfrom
feat/workspace-display-1039

Conversation

@ulivz
Copy link
Member

@ulivz ulivz commented Aug 11, 2025

Summary

Adds workspace directory display in navbar. Shows current working directory as a green badge with folder icon.

image

What's added:

  • /api/v1/agent/options endpoint for workspace info
  • Workspace badge in navbar (📁 + directory name)
  • Auto-truncation for long paths with hover tooltip
  • Sanitized config exposure (masks sensitive data)

UI:
Workspace badge appears before Agent/Model badges with green gradient theme.

🔧 Recent Improvements (Latest Commits)

Fixed Design Issues & Centralized Types

Problems Resolved:

  • ❌ Created duplicate custom interfaces instead of using existing AgentOptions types
  • ❌ Missing many important AgentOptions fields
  • ❌ Incorrect tool serialization logic (tried to exclude non-existent handler instead of function)
  • ❌ Type definitions scattered across packages causing duplication

Solutions Implemented:

  1. Centralized Type Management

    • ✅ Moved shared types to @tarko/interface: SanitizedAgentOptions, SanitizedTool, WorkspaceInfo
    • ✅ Eliminated duplicate definitions between server and web-ui packages
    • ✅ Single source of truth for client-server communication types
  2. Complete AgentOptions Support

    • ✅ Support all AgentOptions fields: id, name, instructions, model, maxTokens, temperature, thinking, tools, tool, toolCallEngine, maxIterations, context, eventStreamOptions, enableStreamingToolCallEvents, logLevel, workspace
    • ✅ Added workspaceName field for UI display
    • ✅ Proper ToolCallEngineType serialization to string
  3. Correct Tool Serialization

    • ✅ Fix tool serialization by excluding function property (not non-existent handler)
    • ✅ Preserve all tool metadata: name, description, schema
    • ✅ Type-safe SanitizedTool interface
  4. Architecture Improvement

    Before:
    ┌─────────────────┐    ┌─────────────────┐
    │   agent-server  │    │  agent-web-ui   │
    │ Custom types    │    │ Custom types    │  ❌ Duplication
    │ (incomplete)    │    │ (inconsistent)  │
    └─────────────────┘    └─────────────────┘
    
    After:
    ┌─────────────────────────────────────────┐
    │              @tarko/interface           │
    │ SanitizedAgentOptions, SanitizedTool,   │  ✅ Single source
    │ WorkspaceInfo                           │
    └─────────────────────────────────────────┘
               ▲                    ▲
               │                    │
    ┌─────────────────┐    ┌─────────────────┐
    │   agent-server  │    │  agent-web-ui   │
    │ Uses shared     │    │ Uses shared     │
    │ types           │    │ types           │
    └─────────────────┘    └─────────────────┘
    

🧪 Testing

  • ✅ All packages build successfully
  • ✅ TypeScript compilation passes
  • ✅ Type safety maintained
  • ✅ Backward compatibility preserved

Closes #1039

Checklist

  • Added or updated necessary tests (Optional).
  • Updated documentation to align with changes (Optional).
  • Verified no breaking changes, or prepared solutions for any occurring breaking changes (Optional).
  • My change does not involve the above items.

- Add unified Agent Options API endpoint (/api/v1/agent/options)
- Implement configuration sanitizer for secure data exposure
- Add workspace badge to navbar with green gradient theme
- Integrate workspace info into session state management
- Support responsive design with dynamic width calculation
- Add proper TypeScript types and error handling

Closes #1039
@netlify
Copy link

netlify bot commented Aug 11, 2025

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit 570f7ee
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/689a5aa5d8233c00084655b3
😎 Deploy Preview https://deploy-preview-1081--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ulivz ulivz changed the title feat: add workspace display in navbar (close: #1039) feat(tarko): add workspace display in navbar (close: #1039) Aug 11, 2025
ulivz added 4 commits August 12, 2025 04:44
- Replace custom interfaces with existing AgentOptions types
- Fix tool serialization by excluding function implementations
- Add proper type safety for ToolCallEngineType serialization
- Update frontend types to match backend SanitizedAgentOptions
- Extract model info from agent options in connection actions
- Add secretlint ignores for legitimate apiKey and key patterns

Resolves design issues in PR #1081 by using existing type system
instead of creating duplicate interfaces.
- Move SanitizedAgentOptions and related types to @tarko/interface
- Remove duplicate type definitions from web-ui
- Update server to use shared types from interface package
- Ensure proper type reuse across packages

This eliminates code duplication and ensures consistent type
definitions between server and client packages.
@ulivz ulivz merged commit c5a3f9c into main Aug 11, 2025
10 checks passed
@ulivz ulivz deleted the feat/workspace-display-1039 branch August 11, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add current directory name display to Web UI Navbar

1 participant