Create an agentic environment simplifying opentemplate usage.
Currently it would consist of (approximately):
Tools of the mcp server should run specific opentemplate dev commands, namely:
-
refresh:
pdm lock -G:all
pdm setup
- if
0 exit status does not return anything, otherwise returns concatenated stdout and stderr as string
-
test:
pdm run tests
- if
0 exit status does not return anything, otherwise returns concatenated stdout and stderr as string
-
finalize:
pdm run prek run --show-diff-on-failure --no-progress --quiet --files $(git diff --name-only --cached; git diff --name-only; git ls-files --others --exclude-standard)
- runs
N times (possibly +inf times if it's the default)
- if command returns non-zero obtain the output
- if the output is different from the last one (initial output: empty string
"") run the command again
- if the output is the same as previous run (or
N was reached) AND the exit status is not 0 - return concatenated stdout and stderr as string
- if the output is
0 - return nothing
Create an agentic environment simplifying
opentemplateusage.Currently it would consist of (approximately):
new
dev-agentpyproject.tomlsection which includesopentemplatedependencyopentemplate mcp serversubcommand (built usingargparseandfastmcp) with flags:[--tools] <tool1, tool2, ..., toolN>- which tools to enable, by defaultNonemeans all tools--finalize-loops=INT- how many times, at most, should thefinalizetool run (by default: infinitely,until output doesn't change)
[--transport](specifies the MCP transport protocol ["stdio"or"http"), by defaultSTDIOTools of the mcp server should run specific
opentemplatedev commands, namely:refresh:pdm lock -G:allpdm setup0exit status does not return anything, otherwise returns concatenatedstdoutandstderras stringtest:pdm run tests0exit status does not return anything, otherwise returns concatenatedstdoutandstderras stringfinalize:pdm run prek run --show-diff-on-failure --no-progress --quiet --files $(git diff --name-only --cached; git diff --name-only; git ls-files --others --exclude-standard)Ntimes (possibly +inf times if it's the default)"") run the command againNwas reached) AND the exit status is not0- return concatenatedstdoutandstderras string0- return nothing