diff --git a/docs/agents.md b/docs/agents.md index ad875d618..e12a796dd 100644 --- a/docs/agents.md +++ b/docs/agents.md @@ -22,7 +22,7 @@ Try out any of our ready-to-use _**FREE**_ agents: * [Git Commit Message Agent](https://github.com/enola-dev/git-commit-message-agent) -Or [Contact Us](support.md) to have us build an 🥷 Agent for YOU? +Or [Contact Us](support.md) to have a custom 🥷 Agent built for YOU? Or _[make your own](tutorial/agents.md)!_ diff --git a/docs/use/index.md b/docs/use/index.md index 194abee91..369dba6dc 100644 --- a/docs/use/index.md +++ b/docs/use/index.md @@ -68,7 +68,7 @@ PS: The [`enolac`](../download/latest/enolac) script contains the line above. ## JBang -After [installing JBang](https://www.jbang.dev/download/), please [do](https://github.com/enola-dev/enola/issues/1641): +After [installing JBang](https://www.jbang.dev/download/), please run the [following](https://github.com/enola-dev/enola/issues/1641) commands: jbang catalog add --name enola-dev https://raw.githubusercontent.com/enola-dev/jbang-catalog/main/jbang-catalog.json jbang --fresh app install enola@enola-dev diff --git a/models/enola.dev/ai/agent.schema.yaml b/models/enola.dev/ai/agent.schema.yaml index faf35cda0..84fd4c376 100644 --- a/models/enola.dev/ai/agent.schema.yaml +++ b/models/enola.dev/ai/agent.schema.yaml @@ -69,7 +69,7 @@ properties: tools: type: array description: The tools to which the agent has access; see https://docs.enola.dev/concepts/tool. -# TODO tools +# TODO prompt # TODO planning # TODO examples # TODO tests diff --git a/models/enola.dev/ai/exec.schema.yaml b/models/enola.dev/ai/exec.schema.yaml new file mode 100644 index 000000000..487520eb4 --- /dev/null +++ b/models/enola.dev/ai/exec.schema.yaml @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2025 The Enola Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +$id: https://enola.dev/exec +# TODO Make this file actually served at its $id URL! +$schema: https://json-schema.org/draft/2020-12/schema +title: Enola.dev Process Execution +# TODO description: See https://docs.enola.dev/concepts/exec/. +# TODO x-intellij-html-description: See docs.enola.dev. +examples: + - ../../git-scm.com/git.exec.yaml + +type: object +properties: +# NB: Descriptions are copy/pasted in //docs/concepts/exec.md; please keep them (manually, for now) in sync! + +# TODO Add schema for (e.g.) ../../git-scm.com/git.exec.yaml here! + +# TODO Write Enola Java code to validate all models/**.[json|yaml] incl. this one. + +# TODO Eventually contribute this to https://www.schemastore.org + +# TODO Write an exec.proto transliteration of this and allow text proto files diff --git a/models/git-scm.com/git-TODO.schema.yaml b/models/git-scm.com/git-TODO.schema.yaml new file mode 100644 index 000000000..e6f7b9bb7 --- /dev/null +++ b/models/git-scm.com/git-TODO.schema.yaml @@ -0,0 +1,231 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2025 The Enola Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +tools: + - name: git_status + description: Shows the working tree status + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + required: + - repo_path + title: GitStatus + - name: git_diff_unstaged + description: Shows changes in the working directory that are not yet staged + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + context_lines: + default: 3 + title: Context Lines + type: integer + required: + - repo_path + title: GitDiffUnstaged + - name: git_diff_staged + description: Shows changes that are staged for commit + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + context_lines: + default: 3 + title: Context Lines + type: integer + required: + - repo_path + title: GitDiffStaged + - name: git_diff + description: Shows differences between branches or commits + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + target: + title: Target + type: string + context_lines: + default: 3 + title: Context Lines + type: integer + required: + - repo_path + - target + title: GitDiff + - name: git_commit + description: Records changes to the repository + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + message: + title: Message + type: string + required: + - repo_path + - message + title: GitCommit + - name: git_add + description: Adds file contents to the staging area + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + files: + items: + type: string + title: Files + type: array + required: + - repo_path + - files + title: GitAdd + - name: git_reset + description: Unstages all staged changes + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + required: + - repo_path + title: GitReset + - name: git_log + description: Shows the commit logs + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + max_count: + default: 10 + title: Max Count + type: integer + required: + - repo_path + title: GitLog + - name: git_create_branch + description: Creates a new branch from an optional base branch + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + branch_name: + title: Branch Name + type: string + base_branch: + anyOf: + - type: string + - type: 'null' + default: + title: Base Branch + required: + - repo_path + - branch_name + title: GitCreateBranch + - name: git_checkout + description: Switches branches + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + branch_name: + title: Branch Name + type: string + required: + - repo_path + - branch_name + title: GitCheckout + - name: git_show + description: Shows the contents of a commit + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + revision: + title: Revision + type: string + required: + - repo_path + - revision + title: GitShow + - name: git_init + description: Initialize a new Git repository + inputSchema: + type: object + properties: + repo_path: + title: Repo Path + type: string + required: + - repo_path + title: GitInit + - name: git_branch + description: List Git branches + inputSchema: + type: object + properties: + repo_path: + description: The path to the Git repository. + title: Repo Path + type: string + branch_type: + description: Whether to list local branches ('local'), remote branches ('remote') + or all branches('all'). + title: Branch Type + type: string + contains: + anyOf: + - type: string + - type: 'null' + default: + description: The commit sha that branch should contain. Do not pass anything + to this param if no commit sha is specified + title: Contains + not_contains: + anyOf: + - type: string + - type: 'null' + default: + description: The commit sha that branch should NOT contain. Do not pass anything + to this param if no commit sha is specified + title: Not Contains + required: + - repo_path + - branch_type + title: GitBranch diff --git a/models/git-scm.com/git.exec.yaml b/models/git-scm.com/git.exec.yaml new file mode 100644 index 000000000..98d0f98f6 --- /dev/null +++ b/models/git-scm.com/git.exec.yaml @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2025 The Enola Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +$schema: https://enola.dev/exec +$id: https://enola.dev/exec/git + +# Originally inspired by +# https://github.com/modelcontextprotocol/servers/blob/338d8af7a6d117b848d42e07b9ac480e16b80343/src/git/src/mcp_server_git/server.py#L21 + +actions: + status: + description: Shows the working tree status + inSchemaRef: git.schema.yaml#/$defs/status + command: git + args: [status, -C, "{{in.repo_path}}"] + out: "Repository Status: {{OUT}} {{ERR}}" + + commit: + description: Records changes to the repository + inSchemaRef: git.schema.yaml#/$defs/commit + command: git + args: [commit, -C, "{{in.repo_path}}", -m, "{{in.message}}"] + out: "{{OUT}} {{ERR}}" + +# TODO Add everything missing from +# https://github.com/modelcontextprotocol/servers/blob/338d8af7a6d117b848d42e07b9ac480e16b80343/src/git/src/mcp_server_git/server.py#L221 + +sets: + all-read: + - status + all-read-and-commit: + - all-read + - commit + all-write: + - commit + all: + - all-read + - all-write diff --git a/models/git-scm.com/git.schema.yaml b/models/git-scm.com/git.schema.yaml new file mode 100644 index 000000000..7f34501d1 --- /dev/null +++ b/models/git-scm.com/git.schema.yaml @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2025 The Enola Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +$id: https://git-scm.com/schema +$schema: https://json-schema.org/draft/2020-12/schema + +oneOf: + - $ref: #/$defs/status + - $ref: #/$defs/commit + +$defs: + repo: + type: object + title: Git repository + properties: + repo_path: + type: string + description: Git Repo Local Filesystem Path. + required: + - repo_path + + # Originally inspired by + # https://github.com/modelcontextprotocol/servers/blob/338d8af7a6d117b848d42e07b9ac480e16b80343/src/git/src/mcp_server_git/server.py#L21 + + status: + title: Git Status + allOf: + - $ref: #/$defs/repo + + commit: + title: Git Commit + allOf: + - $ref: #/$defs/repo + - type: object + properties: + message: + title: Message + type: string + required: + - message + +# TODO Test if LLMs dig allOf, and then add everything from git-TODO.schema.yaml diff --git a/test/agents/git-commit-message.agent.yaml b/test/agents/git-commit-message.agent.yaml deleted file mode 100644 index 2e8d367f1..000000000 --- a/test/agents/git-commit-message.agent.yaml +++ /dev/null @@ -1,33 +0,0 @@ -$schema: https://enola.dev/ai/agent -model: google://?model=gemini-2.5-flash -description: Enola.dev's very own Eagent-001, which automagically writes great commit messages! -instruction: > - You are a helpful agent who can use Git. - Your mission is to git commit files with an inspiring commit message, based on the staged files. - If there any unstaged changes, you should stop, and asks the user to use git add, first. - If there are only staged changes, then look at their diff, and generate a commit message, - in the Conventional Commit style, that is: Always start with one of the following: - - * feat: If it looks like any sort of new feature is introduced, even minor - * fix: If it's clearly more of a sort of minor fix - * docs: If only files in the docs/ directory changed, and no files outside of it - * deps: If only files like MODULE.bazel, docs/dev/dependencies.txt, maven_install.json changed - - Then write a maximum 60 characters long TL;DR about the change. Do not end it with a dot. - - After the TL;DR, write a fairly technical summary of what changed in which file. - This can be between 1 to 3 paragraphs long, depending on how many things were changed. - - Liberally use any Emojis that you see as even vaguely fitting the change, in both the 1st TL;DR line and after! - The TL;DR line must have at least 1 Emoji. - - Finally, please always end the commit message with a suitable haiku about the change! Separate that with '---'. - - In the end, git commit the changes with the message that you generated. - -# prompt: -tools: - - modelcontextprotocol/git - -# TODO -# - Sometimes it works, sometimes it fails with "Please specify the `repo_path`!"