|
1 | 1 | #!/usr/bin/env node |
2 | 2 | import * as p from '@clack/prompts'; |
3 | | -import fs from 'fs'; |
4 | | -import { Settings, updateAgentTeammates } from '@tinyclaw/core'; |
| 3 | +import { Settings } from '@tinyclaw/core'; |
5 | 4 | import { |
6 | 5 | unwrap, cleanId, validateId, |
7 | 6 | writeSettings, requireSettings, |
8 | 7 | } from './shared.ts'; |
9 | 8 |
|
10 | | -function refreshTeamInfo(settings: Settings) { |
11 | | - const agents = settings.agents || {}; |
12 | | - const teams = settings.teams || {}; |
13 | | - for (const [agentId, agent] of Object.entries(agents)) { |
14 | | - if (agent.working_directory && fs.existsSync(agent.working_directory)) { |
15 | | - updateAgentTeammates(agent.working_directory, agentId, agents, teams); |
16 | | - } |
17 | | - } |
18 | | -} |
19 | | - |
20 | 9 | // --- team add --- |
21 | 10 |
|
22 | 11 | async function teamAdd() { |
@@ -78,8 +67,6 @@ async function teamAdd() { |
78 | 67 | }; |
79 | 68 | writeSettings(settings); |
80 | 69 |
|
81 | | - refreshTeamInfo(settings); |
82 | | - |
83 | 70 | p.log.success(`Team '${teamId}' created!`); |
84 | 71 | p.log.info(`Agents: ${selectedAgents.join(', ')}`); |
85 | 72 | p.log.info(`Leader: @${leader}`); |
@@ -109,7 +96,6 @@ async function teamRemove(teamId: string) { |
109 | 96 | delete settings.teams![teamId]; |
110 | 97 | writeSettings(settings); |
111 | 98 |
|
112 | | - refreshTeamInfo(settings); |
113 | 99 | p.log.success(`Team '${teamId}' removed.`); |
114 | 100 | } |
115 | 101 |
|
@@ -161,8 +147,6 @@ async function teamRemoveAgent(teamId: string, agentId: string) { |
161 | 147 | team.leader_agent = newLeader; |
162 | 148 | writeSettings(settings); |
163 | 149 |
|
164 | | - refreshTeamInfo(settings); |
165 | | - |
166 | 150 | p.log.success(`Removed @${agentId} from team '${teamId}'.${newLeader !== team.leader_agent ? ` New leader: @${newLeader}.` : ''}`); |
167 | 151 | } |
168 | 152 |
|
@@ -235,8 +219,6 @@ function teamAddAgent(teamId: string, agentId: string) { |
235 | 219 | team.agents.push(agentId); |
236 | 220 | writeSettings(settings); |
237 | 221 |
|
238 | | - refreshTeamInfo(settings); |
239 | | - |
240 | 222 | p.log.success(`Added @${agentId} to team '${teamId}' (${team.name}).`); |
241 | 223 | } |
242 | 224 |
|
|
0 commit comments