File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { COMMAND_DESCRIPTIONS } from '../../constants';
22import { getErrorMessage } from '../../errors' ;
33import { handleLogsEval } from '../../operations/eval' ;
44import type { LogsEvalOptions } from '../../operations/eval' ;
5+ import { withCommandRunTelemetry } from '../../telemetry/cli-command-run.js' ;
56import { requireProject } from '../../tui/guards' ;
67import { handleLogs } from './action' ;
78import type { LogsOptions } from './types' ;
@@ -31,7 +32,11 @@ export const registerLogs = (program: Command) => {
3132 requireProject ( ) ;
3233
3334 try {
34- const result = await handleLogs ( cliOptions ) ;
35+ const result = await withCommandRunTelemetry (
36+ 'logs' ,
37+ { has_query : ! ! cliOptions . query , has_level_filter : ! ! cliOptions . level } ,
38+ ( ) => handleLogs ( cliOptions )
39+ ) ;
3540
3641 if ( ! result . success ) {
3742 render ( < Text color = "red" > { result . error . message } </ Text > ) ;
@@ -56,7 +61,9 @@ export const registerLogs = (program: Command) => {
5661 requireProject ( ) ;
5762
5863 try {
59- const result = await handleLogsEval ( cliOptions ) ;
64+ const result = await withCommandRunTelemetry ( 'logs.evals' , { has_follow : ! ! cliOptions . follow } , ( ) =>
65+ handleLogsEval ( cliOptions )
66+ ) ;
6067
6168 if ( ! result . success ) {
6269 render ( < Text color = "red" > { result . error . message } </ Text > ) ;
Original file line number Diff line number Diff line change 1- import { toError } from '../../../../lib' ;
1+ import { ValidationError , toError } from '../../../../lib' ;
22import type { AgentContext } from '../../../commands/logs/action' ;
33import { resolveAgentContext } from '../../../commands/logs/action' ;
44import { loadDeployedProjectConfig } from '../../../operations/resolve-agent' ;
@@ -40,7 +40,7 @@ export function useLogsFlow(): UseLogsFlowResult {
4040 const runtimeNames = context . project . runtimes . map ( r => r . name ) ;
4141
4242 if ( runtimeNames . length === 0 ) {
43- return { success : false as const , error : new Error ( 'No runtimes defined in agentcore.json' ) } ;
43+ return { success : false as const , error : new ValidationError ( 'No runtimes defined in agentcore.json' ) } ;
4444 }
4545
4646 const resolved : AgentContext [ ] = [ ] ;
@@ -54,7 +54,7 @@ export function useLogsFlow(): UseLogsFlowResult {
5454 if ( resolved . length === 0 ) {
5555 return {
5656 success : false as const ,
57- error : new Error ( 'No deployed agents found. Run `agentcore deploy` first.' ) ,
57+ error : new ValidationError ( 'No deployed agents found. Run `agentcore deploy` first.' ) ,
5858 } ;
5959 }
6060
You can’t perform that action at this time.
0 commit comments