MCPcopy
hub / github.com/stitionai/devika / emulate_code_writing

Method emulate_code_writing

src/agents/patcher/patcher.py:90–110  ·  view source on GitHub ↗
(self, code_set: list, project_name: str)

Source from the content-addressed store, hash-verified

88 return f"~~~\n{response}\n~~~"
89
90 def emulate_code_writing(self, code_set: list, project_name: str):
91 files = []
92 for current_file in code_set:
93 file = current_file["file"]
94 code = current_file["code"]
95
96 new_state = AgentState().new_state()
97 new_state["internal_monologue"] = "Writing code..."
98 new_state["terminal_session"]["title"] = f"Editing {file}"
99 new_state["terminal_session"]["command"] = f"vim {file}"
100 new_state["terminal_session"]["output"] = code
101 files.append({
102 "file": file,
103 "code": code
104 })
105 AgentState().add_to_current_state(project_name, new_state)
106 time.sleep(1)
107 emit_agent("code", {
108 "files": files,
109 "from": "patcher"
110 })
111
112 @retry_wrapper
113 def execute(

Callers 1

executeMethod · 0.95

Calls 4

AgentStateClass · 0.90
emit_agentFunction · 0.90
new_stateMethod · 0.80
add_to_current_stateMethod · 0.80

Tested by

no test coverage detected