Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions -> Tools #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
.lsp
/prompts/stable-diffusion/*.png
**/.DS_Store
/functions/tree-sitter/.cpcache/
/functions/tree-sitter/.nrepl-port
/functions/tree-sitter/hs_err_*.log
/functions/tree-sitter/main
/functions/tree-sitter-clj/target/
/functions/tree-sitter-clj/.cpcache/
/tools/tree-sitter/.cpcache/
/tools/tree-sitter/.nrepl-port
/tools/tree-sitter/hs_err_*.log
/tools/tree-sitter/main
/tools/tree-sitter-clj/target/
/tools/tree-sitter-clj/.cpcache/
/.cpcache/
/.nrepl-port
/target/
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
src = ./.;
installPhase = ''
mkdir -p $out/extractors
mkdir -p $out/functions
mkdir -p $out/tools
cp ./extractors/registry.edn $out/extractors
cp ./functions/registry.edn $out/functions
cp ./tools/registry.edn $out/tools
'';
};

Expand Down
1 change: 0 additions & 1 deletion functions/codescope/.direnv/flake-profile

This file was deleted.

1 change: 0 additions & 1 deletion functions/codescope/.direnv/flake-profile-1-link

This file was deleted.

1 change: 0 additions & 1 deletion functions/codescope/result

This file was deleted.

27 changes: 0 additions & 27 deletions functions/git/scripts/extract.sh

This file was deleted.

14 changes: 0 additions & 14 deletions functions/git/scripts/git.sh

This file was deleted.

1 change: 0 additions & 1 deletion functions/write_files/.direnv/flake-profile

This file was deleted.

1 change: 0 additions & 1 deletion functions/write_files/.direnv/flake-profile-1-link

This file was deleted.

1 change: 0 additions & 1 deletion functions/write_files/result

This file was deleted.

16 changes: 6 additions & 10 deletions prompts/check-user-facing-pr-toolsonly/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,11 @@ You are a helpful assistant that checks a PR for user-facing changes.
Execute steps one at a time. Don't use more than one tool at a time. Wait for each step to complete before starting the next.

1. Fetch everything and get on latest main.
2. Generate tree-sitter queries for the given project.
3. Checkout the PR branch and pull latest.
4. Run a three-dot git diff against main for just files changed. Write the output to /thread/diff.txt.
5. Run the `run-javascript-sandbox` tool with a script which reads /thread/diff.txt and filters the extensions to only include user-facing files based on the regex pattern. The script should console.log the user-facing files and write them to /thread/user-facing-diff.txt.
6. Run the generated tree-sitter queries against the first user facing diff file and report the results. Make sure any files are prefixed with the project path `/project/`.
<!-- 4. Run the tree-sitter queries against PR branch. -->
<!-- 5. Compare the results of the queries between main and PR branches.
6. Generate a list of user-facing changes. -->

<!-- 2. Generate tree-sitter queries for the given project. -->
2. Checkout the PR branch and pull latest.
3. Run a three-dot git diff against main for just files changed. Write the output to /thread/diff.txt.
<!-- 5. Run the `run-javascript-sandbox` tool with a script which reads /thread/diff.txt and filters the extensions to only include user-facing files based on the regex pattern. The script should console.log the user-facing files and write them to /thread/user-facing-diff.txt.
6. Run the generated tree-sitter queries against the first user facing diff file and report the results. Make sure any files are prefixed with the project path `/project/`. -->
# prompt user

I need you to check the branch `branch`.
I need you to check the branch `ac-4435-change-desktop-settings-reporting-to`.
6 changes: 4 additions & 2 deletions prompts/monologue.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
extractors:
- name: project-facts
url: http://host.docker.internal:11434/v1/chat/completions
model: llama3.2
stream: false
---

# Example prompt
Expand All @@ -13,5 +16,4 @@ You are an assistant who can write comedic monologues in the style of Stephen Co
Tell me about my project.

My project uses the following languages:
{{project-facts.languages}}

{{project-facts.languages}}
4 changes: 3 additions & 1 deletion prompts/npm-project.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
functions:
tools:
- name: run-javascript-sandbox
description: Run a node.js script in the project
parameters:
Expand All @@ -12,6 +12,8 @@ functions:
image: vonwig/javascript-runner
command:
- "{{javascript|safe}}"
url: https://api.anthropic.com/v1/messages
model: claude-3-5-sonnet-20241022
---

# not a prompt
Expand Down
16 changes: 8 additions & 8 deletions src/registry.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

(set! *warn-on-reflection* true)

(defn- functions-dir []
(dir/get-dir "./functions" "/app/result/functions" "/app/functions"))
(defn- tools-dir []
(dir/get-dir "./tools" "/app/result/tools" "/app/tools"))

(defn- extractors-dir []
(dir/get-dir "./extractors" "/app/result/extractors" "/app/extractors"))
Expand All @@ -26,16 +26,16 @@
(into {}))))

(comment
(pprint (get-registry functions-dir)))
(pprint (get-registry tools-dir)))

(defn get-function
" returns a function definition or nil"
(defn get-tool
" returns a tool definition or nil"
[{:keys [name image]}]
(or
(get (get-registry functions-dir) name)
(get (get-container-images functions-dir) image)))
(get (get-registry tools-dir) name)
(get (get-container-images tools-dir) image)))

(defn get-extractor
" returns a function definition or nil"
" returns a extractor definition or nil"
[{:keys [name]}]
(get (get-registry extractors-dir) name))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions functions/git/Dockerfile → tools/git_thread_ssh/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
FROM alpine/git:latest

# Add jq and bash
RUN apk add --no-cache bash jq

COPY scripts/git.sh /git.sh
COPY scripts/extract.sh /extract.sh

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion functions/registry.yaml → tools/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ registry:
- "{{database}}"
- "{{sql|safe}}"
- name: run-javascript-sandbox
description: Execute javascript in a Node.JS environment.
description: Execute javascript in a Node.JS environment. STDOUT and STDERR will be returned to you.
parameters:
type: object
properties:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.