Class: Yorishiro::Tools::Task
Instance Method Summary
collapse
#configure, #definition, #permission_check, #preview
Instance Method Details
#attach(provider:, output:) ⇒ Object
Called by the CLI so the subagent reuses the session's provider and
prints its progress to the session's output.
44
45
46
47
|
# File 'lib/yorishiro/tools/task.rb', line 44
def attach(provider:, output:)
@provider = provider
@output = output
end
|
#description ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'lib/yorishiro/tools/task.rb', line 16
def description
"Delegate a read-only research task to a subagent with its own fresh " \
"context window. The subagent can read files, list files, and grep, " \
"and returns a text summary of its findings. Use it for exploratory " \
"work (finding where something is defined, summarizing several files) " \
"to keep your own context small. The subagent cannot see this " \
"conversation, so the prompt must be complete and self-contained."
end
|
#execute(**params) ⇒ Object
49
50
51
52
53
54
|
# File 'lib/yorishiro/tools/task.rb', line 49
def execute(**params)
prompt = params[:prompt] || params["prompt"]
raise "prompt is required" if prompt.to_s.strip.empty?
SubAgent.new(provider: provider, tools: child_tools, output: output).run(prompt)
end
|
#name ⇒ Object
12
13
14
|
# File 'lib/yorishiro/tools/task.rb', line 12
def name
"task"
end
|
#parameters ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/yorishiro/tools/task.rb', line 25
def parameters
{
type: "object",
properties: {
description: {
type: "string",
description: "Short (3-7 word) label for the task"
},
prompt: {
type: "string",
description: "Complete, self-contained instructions: what to investigate and what to report back"
}
},
required: ["prompt"]
}
end
|
#read_only? ⇒ Boolean
Read-only: the subagent only ever receives read-only tools, so a
task can never mutate anything.
8
9
10
|
# File 'lib/yorishiro/tools/task.rb', line 8
def read_only?
true
end
|