Skip to content

Commit cbea428

Browse files
committed
chore(cli): replace console.log with logger and remove unused types
- Replace console.log with logger.debug in announceLoadedAgents - Remove unused SubsetOf and SetElement types from types/utils.ts
1 parent 8b7ae97 commit cbea428

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

cli/src/types/utils.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
export type SubsetOf<T, U extends T> = U
2-
31
export type Prettify<T> = {
42
[K in keyof T]: T[K]
53
} & {}
6-
7-
export type SetElement<T extends Set<any>> = T extends Set<infer U> ? U : never

cli/src/utils/local-agent-registry.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -320,25 +320,25 @@ export const announceLoadedAgents = (): void => {
320320
const agentsDir = findAgentsDirectory()
321321

322322
if (!agentsDir) {
323-
console.log('[agents] No .agents directory found in this project.')
323+
logger.debug('[agents] No .agents directory found in this project.')
324324
return
325325
}
326326

327327
if (!agents.length) {
328-
console.log(`[agents] No agent files found in ${agentsDir}`)
328+
logger.debug({ agentsDir }, '[agents] No agent files found')
329329
return
330330
}
331331

332-
console.log(
333-
`[agents] Loaded ${pluralize(agents.length, 'local agent')} from ${agentsDir}`,
332+
const agentIdentifiers = agents.map((agent) =>
333+
agent.displayName && agent.displayName !== agent.id
334+
? `${agent.displayName} (${agent.id})`
335+
: agent.displayName || agent.id,
336+
)
337+
338+
logger.debug(
339+
{ agentsDir, agents: agentIdentifiers },
340+
`[agents] Loaded ${pluralize(agents.length, 'local agent')}`,
334341
)
335-
for (const agent of agents) {
336-
const identifier =
337-
agent.displayName && agent.displayName !== agent.id
338-
? `${agent.displayName} (${agent.id})`
339-
: agent.displayName || agent.id
340-
console.log(` - ${identifier}`)
341-
}
342342
}
343343

344344
export const getLoadedAgentsMessage = (): string | null => {

0 commit comments

Comments
 (0)