@standardagents/cli 0.41.20 → 0.41.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standardagents/cli",
3
- "version": "0.41.20",
3
+ "version": "0.41.23",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -33,9 +33,9 @@
33
33
  "dev:chat-next": "pnpm exec tsx scripts/dev-chat.ts --next"
34
34
  },
35
35
  "dependencies": {
36
- "@standardagents/agentbuilder-template": "0.41.20",
36
+ "@standardagents/agentbuilder-template": "0.41.23",
37
37
  "@inkjs/ui": "^2.0.0",
38
- "@standardagents/skill": "0.41.20",
38
+ "@standardagents/skill": "0.41.23",
39
39
  "chalk": "^5.3.0",
40
40
  "commander": "^12.1.0",
41
41
  "ink": "^6.8.0",
@@ -1,102 +0,0 @@
1
- 'use client'
2
-
3
- import { useState, useEffect, useRef } from 'react'
4
-
5
- interface Agent {
6
- id: string
7
- name: string
8
- title?: string
9
- }
10
-
11
- interface AgentSelectorProps {
12
- selectedAgentId: string
13
- onSelectAgent: (agentId: string) => void
14
- }
15
-
16
- export function AgentSelector({ selectedAgentId, onSelectAgent }: AgentSelectorProps) {
17
- const [agents, setAgents] = useState<Agent[]>([])
18
- const [loading, setLoading] = useState(true)
19
- const [isOpen, setIsOpen] = useState(false)
20
- const dropdownRef = useRef<HTMLDivElement>(null)
21
-
22
- useEffect(() => {
23
- const fetchAgents = async () => {
24
- try {
25
- const response = await fetch('/api/agents')
26
- if (!response.ok) throw new Error('Failed to fetch agents')
27
- const data = await response.json()
28
- const agentList = data.agents || []
29
- setAgents(agentList)
30
- if (!selectedAgentId && agentList.length > 0) {
31
- onSelectAgent(agentList[0].id)
32
- }
33
- } catch (err) {
34
- console.error('Failed to load agents:', err)
35
- } finally {
36
- setLoading(false)
37
- }
38
- }
39
- fetchAgents()
40
- }, [selectedAgentId, onSelectAgent])
41
-
42
- useEffect(() => {
43
- const handleClickOutside = (e: MouseEvent) => {
44
- if (dropdownRef.current && !dropdownRef.current.contains(e.target as Node)) {
45
- setIsOpen(false)
46
- }
47
- }
48
- document.addEventListener('mousedown', handleClickOutside)
49
- return () => document.removeEventListener('mousedown', handleClickOutside)
50
- }, [])
51
-
52
- const selectedAgent = agents.find(a => a.id === selectedAgentId)
53
-
54
- if (loading) {
55
- return (
56
- <div className="inline-flex items-center gap-2 px-4 py-2 bg-zinc-800 rounded-full text-sm text-zinc-400">
57
- Loading agents...
58
- </div>
59
- )
60
- }
61
-
62
- if (agents.length === 0) {
63
- return (
64
- <div className="inline-flex items-center gap-2 px-4 py-2 bg-zinc-800 rounded-full text-sm text-zinc-400">
65
- No agents available
66
- </div>
67
- )
68
- }
69
-
70
- return (
71
- <div ref={dropdownRef} className="relative inline-block">
72
- <button
73
- onClick={() => setIsOpen(!isOpen)}
74
- className="inline-flex items-center gap-2 px-4 py-2 bg-zinc-800 hover:bg-zinc-700 rounded-full text-sm transition-colors"
75
- >
76
- <span className="text-zinc-300">{selectedAgent?.title || selectedAgent?.name || 'Select agent'}</span>
77
- <svg className={`w-4 h-4 text-zinc-500 transition-transform ${isOpen ? 'rotate-180' : ''}`} fill="none" stroke="currentColor" viewBox="0 0 24 24">
78
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
79
- </svg>
80
- </button>
81
-
82
- {isOpen && (
83
- <div className="absolute top-full mt-2 left-1/2 -translate-x-1/2 min-w-[200px] bg-zinc-800 border border-zinc-700 rounded-xl shadow-xl overflow-hidden z-50">
84
- {agents.map((agent) => (
85
- <button
86
- key={agent.id}
87
- onClick={() => {
88
- onSelectAgent(agent.id)
89
- setIsOpen(false)
90
- }}
91
- className={`w-full px-4 py-3 text-left text-sm hover:bg-zinc-700 transition-colors ${
92
- agent.id === selectedAgentId ? 'bg-zinc-700 text-white' : 'text-zinc-300'
93
- }`}
94
- >
95
- {agent.title || agent.name}
96
- </button>
97
- ))}
98
- </div>
99
- )}
100
- </div>
101
- )
102
- }