Class: Yorishiro::Tools::ExitPlanMode

Inherits:
Yorishiro::Tool show all
Defined in:
lib/yorishiro/tools/exit_plan_mode.rb

Overview

A plan-mode-only tool the model calls to signal that it has finished researching and is ready to present its implementation plan. Calling it is what breaks the plan loop, so the model has an explicit way to stop reading files instead of looping on read-only tools forever.

Instance Method Summary collapse

Methods inherited from Yorishiro::Tool

#configure, #definition, #permission_check, #preview

Instance Method Details

#descriptionObject



18
19
20
21
22
23
24
# File 'lib/yorishiro/tools/exit_plan_mode.rb', line 18

def description
  "Call this tool once you have finished researching and are ready to " \
    "present your implementation plan to the user for approval. Pass the " \
    "complete plan as the `plan` argument. As soon as you understand the " \
    "task, STOP calling read-only tools (read_file, list_files) and call " \
    "this tool instead."
end

#execute(**params) ⇒ Object



36
37
38
# File 'lib/yorishiro/tools/exit_plan_mode.rb', line 36

def execute(**params)
  params[:plan] || params["plan"] || ""
end

#nameObject



14
15
16
# File 'lib/yorishiro/tools/exit_plan_mode.rb', line 14

def name
  "exit_plan_mode"
end

#parametersObject



26
27
28
29
30
31
32
33
34
# File 'lib/yorishiro/tools/exit_plan_mode.rb', line 26

def parameters
  {
    type: "object",
    properties: {
      plan: { type: "string", description: "The complete implementation plan as markdown text" }
    },
    required: ["plan"]
  }
end

#read_only?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/yorishiro/tools/exit_plan_mode.rb', line 10

def read_only?
  true
end