Skip to content

Commit 7b51bb8

Browse files
Use paths for referencing other yaml files.
1 parent 7a28da8 commit 7b51bb8

20 files changed

Lines changed: 62 additions & 67 deletions

main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import re
1111
import json
1212
import uuid
13+
import pathlib
1314

1415
from agent import DEFAULT_MODEL, TaskRunHooks, TaskAgentHooks
1516
#from agents.run import DEFAULT_MAX_TURNS # XXX: this is 10, we need more than that
@@ -628,11 +629,12 @@ async def _deploy_task_agents(resolved_agents, prompt):
628629
break
629630

630631
if __name__ == '__main__':
632+
cwd = pathlib.Path.cwd()
631633
available_tools = AvailableTools(
632-
YamlParser('personalities').get_yaml_dict() |
633-
YamlParser('taskflows').get_yaml_dict() |
634-
YamlParser('prompts').get_yaml_dict(dir_namespace=True) |
635-
YamlParser('toolboxes').get_yaml_dict(recurse=True))
634+
YamlParser(cwd).get_yaml_dict((cwd/'personalities').rglob('*')) |
635+
YamlParser(cwd).get_yaml_dict((cwd/'taskflows').rglob('*')) |
636+
YamlParser(cwd).get_yaml_dict((cwd/'prompts').rglob('*')) |
637+
YamlParser(cwd).get_yaml_dict((cwd/'toolboxes').rglob('*')))
636638

637639
p, t, l, user_prompt, help_msg = parse_prompt_args(available_tools)
638640

mcp_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class MCPNamespaceWrap:
221221
def __init__(self, confirms, obj):
222222
self.confirms = confirms
223223
self._obj = obj
224-
self.namespace = f"{obj.name.upper().replace(' ', '_')}_"
224+
self.namespace = f"{obj.name.upper().replace(' ', '_').replace('/','-')}_"
225225

226226
def __getattr__(self, name):
227227
attr = getattr(self._obj, name)

personalities/c_auditer.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ task: |
1414
your findings where possible.
1515
1616
toolboxes:
17-
- memcache
18-
- codeql
17+
- toolboxes/memcache.yaml
18+
- toolboxes/codeql.yaml

personalities/examples/echo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ task: |
99
Echo user inputs using the echo tools.
1010
1111
toolboxes:
12-
- echo
12+
- toolboxes/echo.yaml
1313

taskflows/CVE-2023-2283/CVE-2023-2283.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ taskflow:
77
must_complete: true
88
headless: true
99
agents:
10-
- assistant
10+
- personalities/assistant.yaml
1111
user_prompt: |
1212
Clear the memory cache.
1313
toolboxes:
14-
- memcache
14+
- toolboxes/memcache.yaml
1515
- task:
1616
model: gpt-4.1
1717
must_complete: false
1818
agents:
19-
- c_auditer
19+
- personalities/c_auditer.yaml
2020
user_prompt: |
2121
You are auditing code using the `libssh-mirror/libssh-codeql`
2222
CodeQL database.
@@ -76,15 +76,15 @@ taskflow:
7676
6. Make small and concise single line notes while you work. Update the
7777
existing value for `notes` in memory as you work.
7878
toolboxes:
79-
- codeql
80-
- memcache
79+
- toolboxes/codeql.yaml
80+
- toolboxes/memcache.yaml
8181
- task:
8282
must_complete: true
8383
agents:
84-
- c_auditer
84+
- personalities/c_auditer.yaml
8585
user_prompt: |
8686
Fetch your audit notes from memory using the `notes`
8787
key. Do not perform any additional security review, only show me your
8888
notes.
8989
toolboxes:
90-
- memcache
90+
- toolboxes/memcache.yaml

taskflows/examples/echo.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ taskflow:
88
max_steps: 5
99
must_complete: true
1010
agents:
11-
- echo
11+
- personalities/examples/echo.yaml
1212
user_prompt: |
1313
Hello
1414
- task:
1515
must_complete: true
1616
agents:
17-
- echo
17+
- personalities/examples/echo.yaml
1818
user_prompt: |
1919
Goodbye
2020
env:

taskflows/examples/example.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ taskflow:
1212
must_complete: true
1313
# taskflows can set a primary (first entry) and handoff (additional entries) agent
1414
agents:
15-
- c_auditer
16-
- fruit_expert
15+
- personalities/c_auditer.yaml
16+
- personalities/examples/fruit_expert.yaml
1717
user_prompt: |
1818
Store an example vulnerable C program that uses `strcpy` in the
1919
`vulnerable_c_example` memory key and explain why `strcpy`
@@ -34,13 +34,13 @@ taskflow:
3434
# this normally only has the memcache toolbox, but we extend it here with
3535
# the GHSA toolbox
3636
toolboxes:
37-
- memcache
38-
- codeql
37+
- toolboxes/memcache.yaml
38+
- toolboxes/codeql.yaml
3939
- task:
4040
must_complete: true
4141
model: gpt-4.1
4242
agents:
43-
- c_auditer
43+
- personalities/c_auditer.yaml
4444
user_prompt: |
4545
Retrieve C code for security review from the `vulnerable_c_example`
4646
memory key and perform a review.
@@ -50,7 +50,7 @@ taskflow:
5050
MEMCACHE_STATE_DIR: "example_taskflow/"
5151
MEMCACHE_BACKEND: "dictionary_file"
5252
toolboxes:
53-
- memcache
53+
- toolboxes/memcache.yaml
5454
# headless mode does not prompt for tool call confirms configured for a server
5555
# note: this will auto-allow, if you want control over potentially dangerous
5656
# tool calls, then you should NOT run a task in headless mode (default: false)
@@ -63,6 +63,6 @@ taskflow:
6363
- task:
6464
repeat_prompt: true
6565
agents:
66-
- assistant
66+
- personalities/assistant.yaml
6767
user_prompt: |
6868
What kind of fruit is {{ RESULT }}?

taskflows/examples/example_globals.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ globals:
77
taskflow:
88
- task:
99
agents:
10-
- fruit_expert
10+
- personalities/examples/fruit_expert.yaml
1111
user_prompt: |
1212
Tell me more about {{ GLOBALS_fruit }}.
1313

taskflows/examples/example_inputs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ seclab-taskflow-agent:
55
taskflow:
66
- task:
77
agents:
8-
- fruit_expert
8+
- personalities/examples/fruit_expert.yaml
99
inputs:
1010
fruit: apples
1111
user_prompt: |

taskflows/examples/example_large_list_result_iter.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ taskflow:
77
exclude_from_context: true
88
must_complete: true
99
agents:
10-
- assistant
10+
- personalities/assistant.yaml
1111
user_prompt: |
1212
Fetch all the open pull requests from `github/codeql` github repository.
1313
You do not need to provide a summary of the results.
1414
toolboxes:
15-
- github_official
15+
- toolboxes/github_official.yaml
1616
- task:
1717
must_complete: true
1818
repeat_prompt: true
1919
agents:
20-
- echo
20+
- toolboxes/echo.yaml
2121
user_prompt: |
2222
Echo this: The title is {{ RESULT_title }} and the url is {{ RESULT_url }}.

0 commit comments

Comments
 (0)