Skip to content

Commit d096771

Browse files
Move the extractors and functions into a registry
* add warnings when we can't pull images * add the --pat argument - we can't pull without a login
1 parent dc0acf6 commit d096771

File tree

26 files changed

+633
-337
lines changed

26 files changed

+633
-337
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ FROM base
2020

2121
WORKDIR /app
2222

23+
COPY ./extractors/registry.edn ./extractors/registry.edn
24+
COPY ./functions/registry.edn ./functions/registry.edn
25+
2326
COPY --from=build /app/prompts.jar /app/prompts.jar
2427

2528
COPY prompts/docker docker

dev/clean_local_images.clj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"vonwig/codescope"
1313
"vonwig/pre-commit"
1414
"markdownlint/markdownlint"
15-
"hadolint/hadolint"})
15+
"hadolint/hadolint"
16+
"vonwig/fasttext"
17+
"vonwig/typos"
18+
"vonwig/what-is-my-ip"
19+
"vonwig/findutils"})
1620

1721
(comment
1822
(docker/delete-image {:image "vonwig/function_write_files"}))

extractors/registry.edn

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{:registry [{:name "project-facts",
2+
:image "docker/lsp:latest",
3+
:entrypoint "/app/result/bin/docker-lsp",
4+
:command ["project-facts"
5+
"--vs-machine-id"
6+
"none"
7+
"--workspace"
8+
"/docker"]}
9+
{:name "go-linguist",
10+
:image "vonwig/go-linguist:latest",
11+
:command ["-json"],
12+
:output-handler "linguist"}]}

extractors/registry.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
registry:
2+
- name: project-facts
3+
image: docker/lsp:latest
4+
entrypoint: /app/result/bin/docker-lsp
5+
command:
6+
- project-facts
7+
- --vs-machine-id
8+
- none
9+
- --workspace
10+
- /docker
11+
- name: go-linguist
12+
image: vonwig/go-linguist:latest
13+
command:
14+
- -json
15+
output-handler: linguist
16+
17+

functions/registry.edn

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{:registry [{:name "gh-repo-create",
2+
:description "GitHub CLI",
3+
:parameters {:type "object",
4+
:properties {:org {:type "string",
5+
:description "the name of the github organization"},
6+
:name {:type "string",
7+
:description "the name of the new GitHub repository"},
8+
:public {:type "boolean",
9+
:description "whether the new repository should be public or not"}}},
10+
:container {:image "vonwig/github-cli:latest",
11+
:entrypoint ["entrypoint"],
12+
:command ["repo-create"],
13+
:env {:GITHUB_TOKEN ""}}}
14+
{:name "analyze_project",
15+
:description "Analyze a project to determine how it should be built",
16+
:type "prompt",
17+
:ref "github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/project_type"}
18+
{:name "write_files",
19+
:description "Write a set of files to my project",
20+
:parameters {:type "object",
21+
:properties {:files {:type "array",
22+
:items {:type "object",
23+
:properties {:path {:type "string",
24+
:description "the relative path to the file that should be written"},
25+
:content {:type "string",
26+
:description "the content that should be written to a file"},
27+
:executable {:type "boolean",
28+
:description "whether to make the file executable"}}}}}},
29+
:container {:image "vonwig/function_write_files:latest"}}
30+
{:name "docker_scout_tag_recommendation",
31+
:description "get a recommended tag",
32+
:parameters {:type "object",
33+
:properties {:repository {:type "string",
34+
:description "the name docker image repository"}}},
35+
:container {:image "vonwig/docker_scout_tag_recommendation:latest"}}
36+
{:name "pr-create",
37+
:description "create a new pull request",
38+
:parameters {:type "object",
39+
:properties {:title {:type "string",
40+
:description "the title of the pull request"},
41+
:body {:type "string",
42+
:description "the body of the pull request"}}},
43+
:container {:env {:GITHUB_TOKEN ""},
44+
:image "vonwig/github-cli:latest"}}
45+
{:name "git-commit",
46+
:description "create a new pull request",
47+
:parameters {:type "object",
48+
:properties {:branch {:type "string",
49+
:description "the title of the pull request"}}},
50+
:container {:env {:GITHUB_TOKEN ""},
51+
:image "vonwig/git:latest"}}
52+
{:name "typo",
53+
:description "check a set of files for typos",
54+
:parameters {:type "object",
55+
:properties {:files {:type "array",
56+
:items {:type "object",
57+
:properties {:path {:type "string",
58+
:description "the relative path to files that should be checked"}}}}}},
59+
:container {:image "vonwig/typos:latest"}}
60+
{:name "findutils-by-name",
61+
:description "find files in a project by name",
62+
:parameters {:type "object",
63+
:properties {:glob {:type "string",
64+
:description "the glob pattern for files that should be found"}}},
65+
:container {:image "vonwig/findutils:latest",
66+
:command ["find" "." "-name"]}}]}

functions/registry.yaml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
registry:
2+
- name: gh-repo-create
3+
description: "GitHub CLI"
4+
parameters:
5+
type: object
6+
properties:
7+
org:
8+
type: string
9+
description: the name of the github organization
10+
name:
11+
type: string
12+
description: the name of the new GitHub repository
13+
public:
14+
type: boolean
15+
description: whether the new repository should be public or not
16+
container:
17+
image: vonwig/github-cli:latest
18+
entrypoint:
19+
- entrypoint
20+
command:
21+
- repo-create
22+
env:
23+
GITHUB_TOKEN: ""
24+
- name: analyze_project
25+
description: Analyze a project to determine how it should be built
26+
type: prompt
27+
ref: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/project_type
28+
- name: write_files
29+
description: Write a set of files to my project
30+
parameters:
31+
type: object
32+
properties:
33+
files:
34+
type: array
35+
items:
36+
type: object
37+
properties:
38+
path:
39+
type: string
40+
description: the relative path to the file that should be written
41+
content:
42+
type: string
43+
description: the content that should be written to a file
44+
executable:
45+
type: boolean
46+
description: whether to make the file executable
47+
container:
48+
image: vonwig/function_write_files:latest
49+
- name: docker_scout_tag_recommendation
50+
description: get a recommended tag
51+
parameters:
52+
type: object
53+
properties:
54+
repository:
55+
type: string
56+
description: the name docker image repository
57+
container:
58+
image: vonwig/docker_scout_tag_recommendation:latest
59+
- name: pr-create
60+
description: create a new pull request
61+
parameters:
62+
type: object
63+
properties:
64+
title:
65+
type: string
66+
description: the title of the pull request
67+
body:
68+
type: string
69+
description: the body of the pull request
70+
container:
71+
env:
72+
GITHUB_TOKEN: ""
73+
image: vonwig/github-cli:latest
74+
- name: git-commit
75+
description: create a new pull request
76+
parameters:
77+
type: object
78+
properties:
79+
branch:
80+
type: string
81+
description: the title of the pull request
82+
container:
83+
env:
84+
GITHUB_TOKEN: ""
85+
image: vonwig/git:latest
86+
- name: typo
87+
description: check a set of files for typos
88+
parameters:
89+
type: object
90+
properties:
91+
files:
92+
type: array
93+
items:
94+
type: object
95+
properties:
96+
path:
97+
type: string
98+
description: the relative path to files that should be checked
99+
container:
100+
image: vonwig/typos:latest
101+
- name: findutils-by-name
102+
description: find files in a project by name
103+
parameters:
104+
type: object
105+
properties:
106+
glob:
107+
type: string
108+
description: the glob pattern for files that should be found
109+
container:
110+
image: vonwig/findutils:latest
111+
command:
112+
- find
113+
- .
114+
- -name
115+

prompts/docker/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
---
22
extractors:
3-
- image: docker/lsp:latest
4-
entrypoint: /app/result/bin/docker-lsp
5-
command:
6-
- project-facts
7-
- --vs-machine-id
8-
- none
9-
- --workspace
10-
- /docker
3+
- name: project-facts
114
---
125

136
## Description

prompts/dockerfiles/README.md

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,13 @@
11
---
22
extractors:
3-
- image: vonwig/go-linguist:latest
4-
command:
5-
- -json
6-
output-handler: linguist
3+
- name: go-linguist
74
tool_choice: auto
85
model: gpt-4
96
stream: true
107
functions:
118
- name: analyze_project
12-
description: Analyze a project to determine how it should be built
13-
type: prompt
14-
ref: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/project_type
159
- name: write_files
16-
description: Write a set of files to my project
17-
parameters:
18-
type: object
19-
properties:
20-
files:
21-
type: array
22-
items:
23-
type: object
24-
properties:
25-
path:
26-
type: string
27-
description: the relative path to the file that should be written
28-
content:
29-
type: string
30-
description: the content that should be written to a file
31-
executable:
32-
type: boolean
33-
description: whether to make the file executable
34-
container:
35-
image: vonwig/function_write_files:latest
3610
- name: docker_scout_tag_recommendation
37-
description: get a recommended tag
38-
parameters:
39-
type: object
40-
properties:
41-
repository:
42-
type: string
43-
description: the name docker image repository
44-
container:
45-
image: vonwig/docker_scout_tag_recommendation:latest
4611
---
4712

4813
# Background

prompts/eslint/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
---
22
extractors:
3-
- image: docker/lsp:latest
4-
entrypoint: /app/result/bin/docker-lsp
5-
command:
6-
- project-facts
7-
- --vs-machine-id
8-
- none
9-
- --workspace
10-
- /docker
3+
- name: project-facts
114
- image: vonwig/extractor-node:latest
125
---
136

prompts/fix_typos_in_pr/README.md

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,9 @@ model: gpt-4
55
stream: true
66
functions:
77
- name: pr-create
8-
description: create a new pull request
9-
parameters:
10-
type: object
11-
properties:
12-
title:
13-
type: string
14-
description: the title of the pull request
15-
body:
16-
type: string
17-
description: the body of the pull request
18-
container:
19-
env:
20-
GITHUB_TOKEN: ""
21-
image: vonwig/github-cli:latest
228
- name: git-commit
23-
description: create a new pull request
24-
parameters:
25-
type: object
26-
properties:
27-
branch:
28-
type: string
29-
description: the title of the pull request
30-
container:
31-
env:
32-
GITHUB_TOKEN: ""
33-
image: vonwig/git:latest
349
- name: typo
35-
description: check a set of files for typos
36-
parameters:
37-
type: object
38-
properties:
39-
files:
40-
type: array
41-
items:
42-
type: object
43-
properties:
44-
path:
45-
type: string
46-
description: the relative path to files that should be checked
47-
container:
48-
image: vonwig/typos:latest
4910
- name: findutils-by-name
50-
description: find files in a project by name
51-
parameters:
52-
type: object
53-
properties:
54-
glob:
55-
type: string
56-
description: the glob pattern for files that should be found
57-
container:
58-
image: vonwig/findutils:latest
59-
command:
60-
- find
61-
- .
62-
- -name
6311
---
6412

6513
# Background

0 commit comments

Comments
 (0)