| 1 | package Claude::Agent::Content::ToolResult; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 12 | ▶ | use 5.020; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 12 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 12 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 12 | ▶ | use Object::Proto (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 12 | ▶ | use Claude::Agent::Types; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 12 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 12 | Object::Proto::define('Claude::Agent::Content::ToolResult', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 'type:Str:readonly:default(tool_result)', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 'tool_use_id:Str:required', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 'content:StrOrArrayRef:required', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 'is_error:predicate', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 'raw:HashRef:predicate', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 6 | ▶ | sub text { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
text: called CC=7 SCAR=19.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 6 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 6 | my $content = $self->content; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 6 | ▶ | return $content unless ref $content; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 5 | my @texts; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 5 | for my $block (@$content) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 9 | ▶ | if (ref $block eq 'HASH' && defined $block->{type} && $block->{type} eq 'text' && defined $block->{text}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%6/9
ref $block eq "HASH" and defined $block->{"type"} and $block->{"type"} eq "text" and defined $block->{"text"}
ref $block eq "HASH" and defined $block->{"type"} and $block->{"type"} eq "text"
ref $block eq "HASH" and defined $block->{"type"}
MC/DC50%2/4
ref $block eq "HASH" and defined $block->{"type"} and $block->{"type"} eq "text" and defined $block->{"text"}
ref $block eq "HASH"
defined $block->{"type"}
$block->{"type"} eq "text"
defined $block->{"text"}
Truth table60%3/5
A and B and C and D
A= ref $block eq "HASH"B= defined $block->{"type"}C= $block->{"type"} eq "text"D= defined $block->{"text"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 6 | push @texts, $block->{text}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 5 | return join("\n", @texts); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 12 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||