« blib/lib/SignalWire/REST/Namespaces/Base.pm
↑ Summary
blib/lib/SignalWire/REST/Namespaces/Chat.pm »
| 1 | package SignalWire::Skills::Builtin::ClaudeSkills; | ||||||||||||
| 2 | 4 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 4 | ▶ | use Moo; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 4 | extends 'SignalWire::Skills::SkillBase'; | |||||||||||
| 6 | |||||||||||||
| 7 | 4 | ▶ | use SignalWire::Skills::SkillRegistry; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 4 | SignalWire::Skills::SkillRegistry->register_skill('claude_skills', __PACKAGE__); | |||||||||||
| 9 | |||||||||||||
| 10 | 6 | ▶ | has '+skill_name' => (default => sub { 'claude_skills' }); | ||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 6 | ▶ | has '+skill_description' => (default => sub { 'Load Claude SKILL.md files as agent tools' }); | ||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 6 | ▶ | has '+supports_multiple_instances' => (default => sub { 1 }); | ||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | 4 | ▶ | sub setup { 1 } | ||||||||||
|
Subroutine
setup: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 15 | |||||||||||||
| 16 | 3 | ▶ | sub register_tools { | ||||||||||
|
Subroutine
register_tools: called CC=2 SCAR=7.9
Pod
undocumented
| |||||||||||||
| 17 | 3 | my ($self) = @_; | |||||||||||
| 18 | 3 | ▶ | my $prefix = $self->params->{tool_prefix} // 'claude_'; | ||||||||||
|
Condition100%2/2
$self->params->{"tool_prefix"} // "claude_"
MC/DC100%1/1
$self->params->{"tool_prefix"} // "claude_"
$self->params->{"tool_prefix"}
Truth table100%2/2
A
A= $self->params->{"tool_prefix"}
| |||||||||||||
| 19 | # In the Perl port, we register a stub tool that represents the skill. | ||||||||||||
| 20 | # Full file-discovery would require YAML parsing (not available in minimal installs). | ||||||||||||
| 21 | $self->define_tool( | ||||||||||||
| 22 | name => "${prefix}skill", | ||||||||||||
| 23 | description => "Claude skill tool (stub)", | ||||||||||||
| 24 | parameters => { | ||||||||||||
| 25 | type => 'object', | ||||||||||||
| 26 | properties => { | ||||||||||||
| 27 | arguments => { type => 'string', description => 'Arguments to pass' }, | ||||||||||||
| 28 | }, | ||||||||||||
| 29 | required => ['arguments'], | ||||||||||||
| 30 | }, | ||||||||||||
| 31 | 0 | ▶ | handler => sub { | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 32 | 0 | my ($args, $raw) = @_; | |||||||||||
| 33 | 0 | require SignalWire::SWAIG::FunctionResult; | |||||||||||
| 34 | 0 | return SignalWire::SWAIG::FunctionResult->new( | |||||||||||
| 35 | response => "Claude skill invoked with: $args->{arguments}" | ||||||||||||
| 36 | ); | ||||||||||||
| 37 | }, | ||||||||||||
| 38 | 3 | ); | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | 1 | ▶ | sub get_hints { | ||||||||||
|
Subroutine
get_hints: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 42 | 1 | my ($self) = @_; | |||||||||||
| 43 | 1 | return ['claude', 'skill']; | |||||||||||
| 44 | } | ||||||||||||
| 45 | |||||||||||||
| 46 | 1 | ▶ | sub get_parameter_schema { | ||||||||||
|
Subroutine
get_parameter_schema: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 47 | return { | ||||||||||||
| 48 | 1 | %{ SignalWire::Skills::SkillBase->get_parameter_schema }, | |||||||||||
| 49 | skills_path => { type => 'string', required => 1 }, | ||||||||||||
| 50 | tool_prefix => { type => 'string', default => 'claude_' }, | ||||||||||||
| 51 | }; | ||||||||||||
| 52 | } | ||||||||||||
| 53 | |||||||||||||
| 54 | 4 | 1; | |||||||||||