@@ -90,8 +90,9 @@ function fullResolutionHint({
9090 } ) } `;
9191}
9292
93- function getSnapshotImagePreviewFallback ( ) : string {
94- return "Use the Sentry tool `get_sentry_resource`" ;
93+ function getSnapshotImagePreviewFallback ( snapshotUrl : string ) : string {
94+ const separator = snapshotUrl . includes ( "?" ) ? "&" : "?" ;
95+ return `Use the Sentry tool \`get_sentry_resource(url="${ snapshotUrl } ${ separator } selectedSnapshot=<image_file_name>")\`` ;
9596}
9697
9798function formatSnapshotImageFullResolutionStep ( {
@@ -212,7 +213,6 @@ export async function fetchSnapshotImage(
212213 imageIdentifier : string ,
213214 imageResolution : SnapshotImageResolution ,
214215 options : {
215- nextSteps ?: "snapshot-tools" | "resource-url" ;
216216 experimentalMode ?: boolean ;
217217 availableToolNames ?: ReadonlySet < string > ;
218218 directToolNames ?: ReadonlySet < string > ;
@@ -337,7 +337,6 @@ export async function fetchSnapshotSummary(
337337 options : {
338338 showUnmodified ?: boolean ;
339339 listImagesWhenNoDiffs ?: boolean ;
340- nextSteps ?: "snapshot-tools" | "resource-url" ;
341340 experimentalMode ?: boolean ;
342341 availableToolNames ?: ReadonlySet < string > ;
343342 directToolNames ?: ReadonlySet < string > ;
@@ -494,46 +493,29 @@ export async function fetchSnapshotSummary(
494493 }
495494 }
496495
497- if ( options . nextSteps === "resource-url" ) {
498- const separator = resolvedSnapshotUrl . includes ( "?" ) ? "&" : "?" ;
499- const selectedImageUrl = `${ resolvedSnapshotUrl } ${ separator } selectedSnapshot=<image_file_name>` ;
500- sections . push (
501- `\n## Next Steps\n\n- To view a specific image preview, use \`get_sentry_resource(url="${ selectedImageUrl } ")\`\n${ formatSnapshotImageFullResolutionStep (
502- {
503- organizationSlug,
504- snapshotId,
505- imageIdentifier : "<image_file_name>" ,
506- experimentalMode : options . experimentalMode ?? false ,
507- availableToolNames : options . availableToolNames ,
508- directToolNames : options . directToolNames ,
509- } ,
510- ) } `,
511- ) ;
512- } else {
513- sections . push (
514- `\n## Next Steps\n\n- ${ formatToolCallInstruction ( {
515- toolName : "get_snapshot_image" ,
516- arguments : {
517- organizationSlug,
518- snapshotId,
519- imageIdentifier : "<image_file_name>" ,
520- } ,
496+ sections . push (
497+ `\n## Next Steps\n\n- ${ formatToolCallInstruction ( {
498+ toolName : "get_snapshot_image" ,
499+ arguments : {
500+ organizationSlug,
501+ snapshotId,
502+ imageIdentifier : "<image_file_name>" ,
503+ } ,
504+ experimentalMode : options . experimentalMode ?? false ,
505+ availableToolNames : options . availableToolNames ,
506+ directToolNames : options . directToolNames ,
507+ fallbackInstruction : getSnapshotImagePreviewFallback ( resolvedSnapshotUrl ) ,
508+ } ) } to view a specific image preview\n${ formatSnapshotImageFullResolutionStep (
509+ {
510+ organizationSlug,
511+ snapshotId,
512+ imageIdentifier : "<image_file_name>" ,
521513 experimentalMode : options . experimentalMode ?? false ,
522514 availableToolNames : options . availableToolNames ,
523515 directToolNames : options . directToolNames ,
524- fallbackInstruction : getSnapshotImagePreviewFallback ( ) ,
525- } ) } to view a specific image preview\n${ formatSnapshotImageFullResolutionStep (
526- {
527- organizationSlug,
528- snapshotId,
529- imageIdentifier : "<image_file_name>" ,
530- experimentalMode : options . experimentalMode ?? false ,
531- availableToolNames : options . availableToolNames ,
532- directToolNames : options . directToolNames ,
533- } ,
534- ) } `,
535- ) ;
536- }
516+ } ,
517+ ) } `,
518+ ) ;
537519
538520 return sections . join ( "\n" ) ;
539521}
0 commit comments