-
Notifications
You must be signed in to change notification settings - Fork 6
Add utility for generating data directories #99
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
Merged
kevinbackhouse
merged 10 commits into
GitHubSecurityLab:main
from
kevinbackhouse:autogen-tmpdirs
Dec 2, 2025
+40
−8
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ac278ea
Add utility for generating data directories.
kevinbackhouse 8783088
Update src/seclab_taskflow_agent/path_utils.py
kevinbackhouse 41843be
Update src/seclab_taskflow_agent/mcp_servers/logbook/logbook.py
kevinbackhouse b8f4a5d
Apply suggestion from @Copilot
kevinbackhouse 8329d42
Update src/seclab_taskflow_agent/path_utils.py
kevinbackhouse 222a5c2
Update src/seclab_taskflow_agent/path_utils.py
kevinbackhouse 460ebae
Apply suggestion from @Copilot
kevinbackhouse e8513b3
Apply suggestion from @Copilot
kevinbackhouse d1d0afb
Apply suggestion from @Copilot
kevinbackhouse 96d9cc1
Apply suggestion from @Copilot
kevinbackhouse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # SPDX-FileCopyrightText: 2025 GitHub | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| import platformdirs | ||
| import os | ||
| from pathlib import Path | ||
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| def mcp_data_dir(packagename: str, mcpname: str, env_override: str | None): | ||
kevinbackhouse marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """ | ||
| Create a directory for an MCP to store its data. | ||
| env_override is the name of an environment variable that | ||
| can be used to override the default location. | ||
kevinbackhouse marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """ | ||
| if env_override: | ||
| p = os.getenv(env_override) | ||
| if p: | ||
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return Path(p) | ||
| # Use [platformdirs](https://pypi.org/project/platformdirs/) to | ||
| # choose an appropriate location. | ||
| d = platformdirs.user_data_dir(appname = "seclab-taskflow-agent", | ||
kevinbackhouse marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
kevinbackhouse marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| appauthor = "GitHubSecurityLab", | ||
| ensure_exists = True) | ||
kevinbackhouse marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # Each MCP server gets its own sub-directory | ||
| p = Path(d).joinpath(packagename).joinpath(mcpname) | ||
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
kevinbackhouse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| p.mkdir(parents = True, exist_ok = True) | ||
kevinbackhouse marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return p | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.