seclab-taskflow-agent 0.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. seclab_taskflow_agent-0.0.7/.devcontainer/Dockerfile +22 -0
  2. seclab_taskflow_agent-0.0.7/.devcontainer/devcontainer.json +56 -0
  3. seclab_taskflow_agent-0.0.7/.devcontainer/post-attach.sh +15 -0
  4. seclab_taskflow_agent-0.0.7/.devcontainer/post-create.sh +27 -0
  5. seclab_taskflow_agent-0.0.7/.dockerignore +8 -0
  6. seclab_taskflow_agent-0.0.7/.github/workflows/ci.yml +42 -0
  7. seclab_taskflow_agent-0.0.7/.github/workflows/codeql.yml +44 -0
  8. seclab_taskflow_agent-0.0.7/.github/workflows/publish-to-pypi.yaml +64 -0
  9. seclab_taskflow_agent-0.0.7/.github/workflows/publish-to-testpypi.yaml +77 -0
  10. seclab_taskflow_agent-0.0.7/.github/workflows/release.yml +53 -0
  11. seclab_taskflow_agent-0.0.7/.github/workflows/smoketest.yaml +76 -0
  12. seclab_taskflow_agent-0.0.7/.gitignore +185 -0
  13. seclab_taskflow_agent-0.0.7/CODEOWNERS +2 -0
  14. seclab_taskflow_agent-0.0.7/CODE_OF_CONDUCT.md +74 -0
  15. seclab_taskflow_agent-0.0.7/CONTRIBUTING.md +31 -0
  16. seclab_taskflow_agent-0.0.7/LICENSE +21 -0
  17. seclab_taskflow_agent-0.0.7/NOTICE +11 -0
  18. seclab_taskflow_agent-0.0.7/PKG-INFO +661 -0
  19. seclab_taskflow_agent-0.0.7/README.md +557 -0
  20. seclab_taskflow_agent-0.0.7/SECURITY.md +31 -0
  21. seclab_taskflow_agent-0.0.7/SUPPORT.md +13 -0
  22. seclab_taskflow_agent-0.0.7/doc/GRAMMAR.md +512 -0
  23. seclab_taskflow_agent-0.0.7/docker/Dockerfile +48 -0
  24. seclab_taskflow_agent-0.0.7/docker/run.sh +24 -0
  25. seclab_taskflow_agent-0.0.7/examples/model_configs/model_config.yaml +11 -0
  26. seclab_taskflow_agent-0.0.7/examples/personalities/apple_expert.yaml +12 -0
  27. seclab_taskflow_agent-0.0.7/examples/personalities/banana_expert.yaml +12 -0
  28. seclab_taskflow_agent-0.0.7/examples/personalities/echo.yaml +17 -0
  29. seclab_taskflow_agent-0.0.7/examples/personalities/example_triage_agent.yaml +13 -0
  30. seclab_taskflow_agent-0.0.7/examples/personalities/fruit_expert.yaml +12 -0
  31. seclab_taskflow_agent-0.0.7/examples/personalities/orange_expert.yaml +12 -0
  32. seclab_taskflow_agent-0.0.7/examples/prompts/example_prompt.yaml +9 -0
  33. seclab_taskflow_agent-0.0.7/examples/taskflows/CVE-2023-2283.yaml +95 -0
  34. seclab_taskflow_agent-0.0.7/examples/taskflows/echo.yaml +23 -0
  35. seclab_taskflow_agent-0.0.7/examples/taskflows/example.yaml +73 -0
  36. seclab_taskflow_agent-0.0.7/examples/taskflows/example_globals.yaml +15 -0
  37. seclab_taskflow_agent-0.0.7/examples/taskflows/example_inputs.yaml +16 -0
  38. seclab_taskflow_agent-0.0.7/examples/taskflows/example_large_list_result_iter.yaml +27 -0
  39. seclab_taskflow_agent-0.0.7/examples/taskflows/example_repeat_prompt.yaml +31 -0
  40. seclab_taskflow_agent-0.0.7/examples/taskflows/example_repeat_prompt_async.yaml +35 -0
  41. seclab_taskflow_agent-0.0.7/examples/taskflows/example_repeat_prompt_dictionary.yaml +32 -0
  42. seclab_taskflow_agent-0.0.7/examples/taskflows/example_reusable_prompt.yaml +15 -0
  43. seclab_taskflow_agent-0.0.7/examples/taskflows/example_reusable_taskflows.yaml +15 -0
  44. seclab_taskflow_agent-0.0.7/examples/taskflows/example_triage_taskflow.yaml +42 -0
  45. seclab_taskflow_agent-0.0.7/examples/taskflows/single_step_taskflow.yaml +13 -0
  46. seclab_taskflow_agent-0.0.7/misc/codeql_fetch_db.sh +41 -0
  47. seclab_taskflow_agent-0.0.7/pyproject.toml +147 -0
  48. seclab_taskflow_agent-0.0.7/release_tools/HOWTO.md +33 -0
  49. seclab_taskflow_agent-0.0.7/release_tools/copy_files.py +84 -0
  50. seclab_taskflow_agent-0.0.7/release_tools/publish_docker.py +44 -0
  51. seclab_taskflow_agent-0.0.7/release_tools/release.sh +2 -0
  52. seclab_taskflow_agent-0.0.7/release_tools/version_bump.sh +65 -0
  53. seclab_taskflow_agent-0.0.7/release_tools/version_tag.sh +65 -0
  54. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/__about__.py +3 -0
  55. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/__init__.py +2 -0
  56. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/__main__.py +697 -0
  57. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/agent.py +188 -0
  58. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/available_tools.py +89 -0
  59. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/capi.py +99 -0
  60. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/env_utils.py +26 -0
  61. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/client.py +628 -0
  62. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/LICENSE +27 -0
  63. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/__init__.py +939 -0
  64. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/__meta__.py +15 -0
  65. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/py.typed +0 -0
  66. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/mcp_server.py +219 -0
  67. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/README.md +3 -0
  68. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/absolute_to_relative.ql +15 -0
  69. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/call_graph_from.ql +29 -0
  70. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/call_graph_from_to.ql +76 -0
  71. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/call_graph_to.ql +29 -0
  72. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/codeql-pack.lock.yml +24 -0
  73. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/declaration_location_for_variable.ql +25 -0
  74. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/definition_location_for_function.ql +24 -0
  75. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/list_functions.ql +12 -0
  76. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/locations.qll +12 -0
  77. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/qlpack.yml +7 -0
  78. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/relative_to_absolute.ql +15 -0
  79. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/stmt_location.ql +25 -0
  80. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/absolute_to_relative.ql +15 -0
  81. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/call_graph_from.ql +28 -0
  82. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/call_graph_to.ql +20 -0
  83. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/definition_location_for_function.ql +24 -0
  84. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/locations.qll +10 -0
  85. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/qlpack.yml +7 -0
  86. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/relative_to_absolute.ql +15 -0
  87. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/echo/echo.py +39 -0
  88. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/logbook/logbook.py +95 -0
  89. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/memcache/__init__.py +2 -0
  90. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/memcache/memcache.py +71 -0
  91. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/__init__.py +2 -0
  92. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/backend.py +23 -0
  93. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/dictionary_file.py +102 -0
  94. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/sql_models.py +19 -0
  95. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/sqlite.py +91 -0
  96. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/mcp_utils.py +467 -0
  97. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/path_utils.py +71 -0
  98. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/personalities/assistant.yaml +14 -0
  99. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/personalities/c_auditer.yaml +21 -0
  100. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/render_utils.py +44 -0
  101. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/shell_utils.py +40 -0
  102. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/toolboxes/codeql.yaml +78 -0
  103. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/toolboxes/echo.yaml +14 -0
  104. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/toolboxes/github_official.yaml +16 -0
  105. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/toolboxes/logbook.yaml +17 -0
  106. seclab_taskflow_agent-0.0.7/src/seclab_taskflow_agent/toolboxes/memcache.yaml +18 -0
  107. seclab_taskflow_agent-0.0.7/tests/README.md +33 -0
  108. seclab_taskflow_agent-0.0.7/tests/__init__.py +4 -0
  109. seclab_taskflow_agent-0.0.7/tests/data/test_globals_taskflow.yaml +13 -0
  110. seclab_taskflow_agent-0.0.7/tests/data/test_yaml_parser_personality000.yaml +11 -0
  111. seclab_taskflow_agent-0.0.7/tests/test_api_endpoint_config.py +47 -0
  112. seclab_taskflow_agent-0.0.7/tests/test_cli_parser.py +73 -0
  113. seclab_taskflow_agent-0.0.7/tests/test_yaml_parser.py +44 -0
@@ -0,0 +1,22 @@
1
+ # Use Ubuntu 24.04 as base image to match the current environment
2
+ FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
3
+
4
+ # Install system dependencies
5
+ # Note: Python and Git are installed via devcontainer features
6
+ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
7
+ && apt-get -y install --no-install-recommends \
8
+ build-essential \
9
+ && apt-get clean \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Install CodeQL CLI
13
+ RUN curl -Ls -o /tmp/codeql.zip https://github.com/github/codeql-cli-binaries/releases/latest/download/codeql-linux64.zip \
14
+ && unzip /tmp/codeql.zip -d /opt \
15
+ && mv /opt/codeql /opt/codeql-cli \
16
+ && ln -s /opt/codeql-cli/codeql /usr/local/bin/codeql \
17
+ && rm /tmp/codeql.zip
18
+
19
+ # Set working directory
20
+ WORKDIR /workspaces/seclab-taskflow-agent
21
+
22
+ # The rest of the setup will be done in post-create script
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "Seclab Taskflow Agent",
3
+ "build": {
4
+ "dockerfile": "Dockerfile",
5
+ "context": ".."
6
+ },
7
+ // Features to add to the dev container
8
+ "features": {
9
+ "ghcr.io/devcontainers/features/python:1": {
10
+ "version": "3.11",
11
+ "installTools": true
12
+ },
13
+ "ghcr.io/devcontainers/features/git:1": {
14
+ "version": "latest"
15
+ },
16
+ "ghcr.io/devcontainers/features/github-cli:1": {
17
+ "version": "latest"
18
+ },
19
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {
20
+ "version": "latest"
21
+ }
22
+ },
23
+ // Configure tool-specific properties
24
+ "customizations": {
25
+ "vscode": {
26
+ "extensions": [
27
+ "ms-python.python",
28
+ "ms-python.vscode-pylance",
29
+ "ms-python.vscode-python-envs",
30
+ "redhat.vscode-yaml",
31
+ "GitHub.copilot",
32
+ "GitHub.copilot-chat",
33
+ "ms-azuretools.vscode-docker"
34
+ ],
35
+ "settings": {
36
+ "python.useEnvironmentsExtension": true
37
+ }
38
+ }
39
+ },
40
+ // Use 'forwardPorts' to make a list of ports inside the container available locally
41
+ "forwardPorts": [],
42
+ // Use 'postCreateCommand' to run commands after the container is created
43
+ "postCreateCommand": "bash .devcontainer/post-create.sh",
44
+ // Use 'postStartCommand' to run commands when the container starts
45
+ "postAttachCommand": "bash .devcontainer/post-attach.sh",
46
+ // Environment variables
47
+ "containerEnv": {
48
+ "PYTHONUNBUFFERED": "1"
49
+ },
50
+ // Set the user to use in the container (non-root)
51
+ "remoteUser": "vscode",
52
+ // Grant the container access to the host's Docker daemon
53
+ "runArgs": [
54
+ "--init"
55
+ ]
56
+ }
@@ -0,0 +1,15 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # If running in Codespaces, check for necessary secrets and print error if missing
5
+ if [ -v CODESPACES ]; then
6
+ echo "🔐 Running in Codespaces - injecting secrets from Codespaces settings..."
7
+ if [ ! -v AI_API_TOKEN ]; then
8
+ echo "⚠️ Running in Codespaces - please add AI_API_TOKEN to your Codespaces secrets"
9
+ fi
10
+ if [ ! -v GITHUB_PERSONAL_ACCESS_TOKEN ]; then
11
+ echo "⚠️ Running in Codespaces - please add GITHUB_PERSONAL_ACCESS_TOKEN to your Codespaces secrets"
12
+ fi
13
+ fi
14
+
15
+ echo "💡 Remember to activate the virtual environment: source .venv/bin/activate"
@@ -0,0 +1,27 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "🚀 Setting up Seclab Taskflow Agent development environment..."
5
+
6
+ # Create Python virtual environment
7
+ echo "📦 Creating Python virtual environment..."
8
+ python3 -m venv .venv
9
+
10
+ # Activate virtual environment and install dependencies
11
+ echo "📥 Installing Python dependencies..."
12
+ source .venv/bin/activate
13
+ python -m pip install --upgrade pip
14
+ python -m pip install hatch
15
+ hatch build
16
+
17
+ # Install this package from local directory.
18
+ pip install -e .
19
+
20
+ # Create .env file if it doesn't exist
21
+ if [ ! -f .env ]; then
22
+ echo "📝 Creating .env template..."
23
+ echo "# Optional: CodeQL database base path" >> .env
24
+ echo "⚠️ Please configure the environment or your .env file with required tokens!"
25
+ fi
26
+
27
+ echo "✅ Development environment setup complete!"
@@ -0,0 +1,8 @@
1
+ __pycache__
2
+ docker/
3
+ .env
4
+ .venv
5
+ .direnv
6
+ .envrc
7
+ .devcontainer
8
+ .git
@@ -0,0 +1,42 @@
1
+ name: Python CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ name: Run Tests ${{ matrix.python-version }} on ${{ matrix.os }}
15
+ runs-on: ${{ matrix.os }}
16
+ strategy:
17
+ matrix:
18
+ os: [ubuntu-latest, windows-latest, macos-latest]
19
+ python-version: ['3.11', '3.13'] # the one we have in the Codespace + the latest supported one by PyO3.
20
+ fail-fast: false # Continue testing other version(s) if one fails
21
+
22
+ steps:
23
+ - name: Checkout repository
24
+ uses: actions/checkout@v5
25
+
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ uses: actions/setup-python@v6
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+ cache: 'pip'
31
+
32
+
33
+ - name: Install Hatch
34
+ run: pip install --upgrade hatch
35
+
36
+ - name: Run static analysis
37
+ run: |
38
+ # hatch fmt --check
39
+ echo linter errors will be fixed in a separate PR
40
+
41
+ - name: Run tests
42
+ run: hatch test --python ${{ matrix.python-version }} --cover --randomize --parallel --retries 2 --retry-delay 1
@@ -0,0 +1,44 @@
1
+ name: "CodeQL Advanced"
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+ schedule:
9
+ - cron: '29 20 * * 0'
10
+
11
+ jobs:
12
+ analyze:
13
+ name: Analyze (${{ matrix.language }})
14
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
15
+ permissions:
16
+ # required for all workflows
17
+ security-events: write
18
+
19
+ # required to fetch internal or private CodeQL packs
20
+ packages: read
21
+
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ include:
26
+ - language: actions
27
+ build-mode: none
28
+ - language: python
29
+ build-mode: none
30
+ steps:
31
+ - name: Checkout repository
32
+ uses: actions/checkout@v4
33
+
34
+ - name: Initialize CodeQL
35
+ uses: github/codeql-action/init@v4
36
+ with:
37
+ languages: ${{ matrix.language }}
38
+ build-mode: ${{ matrix.build-mode }}
39
+ queries: security-extended,security-and-quality
40
+
41
+ - name: Perform CodeQL Analysis
42
+ uses: github/codeql-action/analyze@v4
43
+ with:
44
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,64 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v[0-9]+.[0-9]+.[0-9]+
7
+
8
+ jobs:
9
+ publish:
10
+ name: Build
11
+ runs-on: ubuntu-latest
12
+
13
+ # This environment is required as an input to pypa/gh-action-pypi-publish
14
+ environment:
15
+ name: pypi
16
+ url: https://pypi.org/p/seclab-taskflow-agent
17
+
18
+ env:
19
+ GITHUB_REPO: ${{ github.repository }}
20
+
21
+ permissions:
22
+ contents: write
23
+ id-token: write # For trusted publishing
24
+
25
+ steps:
26
+ - name: Checkout repository
27
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28
+ with:
29
+ persist-credentials: false
30
+
31
+ - name: Set up Python
32
+ uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
33
+ with:
34
+ python-version: "3.13"
35
+
36
+ - name: Install Hatch
37
+ run: pip install --upgrade hatch
38
+
39
+ - name: Build the wheel
40
+ run: python3 -m hatch build
41
+
42
+ - name: Upload artifacts
43
+ uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
44
+ with:
45
+ name: python-package-distributions
46
+ path: dist/
47
+
48
+ - name: Publish to PyPI
49
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
50
+ with:
51
+ verbose: true
52
+
53
+ - name: Sign with sigstore
54
+ uses: sigstore/gh-action-sigstore-python@f832326173235dcb00dd5d92cd3f353de3188e6c # v3.1.0
55
+ with:
56
+ inputs: >-
57
+ ./dist/*.tar.gz
58
+ ./dist/*.whl
59
+
60
+ - name: Create GitHub Release
61
+ env:
62
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63
+ RELEASE_NAME: ${{ github.ref_name }}
64
+ run: gh release create $RELEASE_NAME dist/* --repo $GITHUB_REPO --generate-notes
@@ -0,0 +1,77 @@
1
+ name: Publish Pre-Release to TestPyPI
2
+
3
+ on: workflow_dispatch
4
+
5
+ jobs:
6
+ publish:
7
+ name: Build
8
+ runs-on: ubuntu-latest
9
+
10
+ # This environment is required as an input to pypa/gh-action-pypi-publish
11
+ environment:
12
+ name: testpypi
13
+ url: https://test.pypi.org/p/seclab-taskflow-agent
14
+
15
+ env:
16
+ GITHUB_REPO: ${{ github.repository }}
17
+
18
+ permissions:
19
+ contents: write
20
+ id-token: write # For trusted publishing
21
+
22
+ steps:
23
+ - name: Checkout repository
24
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25
+ with:
26
+ persist-credentials: false
27
+
28
+ - name: Set up Python
29
+ uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
30
+ with:
31
+ python-version: "3.13"
32
+
33
+ - name: Install Hatch
34
+ run: pip install --upgrade hatch
35
+
36
+ - name: Generate new pre-release version number
37
+ id: create_version_number
38
+ run: |
39
+ # Convert current version number to an alpha release of the next version.
40
+ # For example, 1.0.2 becomes 1.0.3a0
41
+ hatch version micro,a
42
+ # Get latest version number from test.pypi.org
43
+ CURRENT_VERSION_NUMBER=$(pip index versions --pre --index-url https://test.pypi.org/simple seclab-taskflow-agent | sed 's/[^(]*[(]\([^)]*\)[)].*/\1/' | head -n 1)
44
+ # Set version number to match test.pypi.org
45
+ hatch version "$CURRENT_VERSION_NUMBER" || echo TestPyPI is behind current version
46
+ # Bump version number
47
+ hatch version a
48
+ # Create a name for the release
49
+ echo "RELEASE_NAME=test-release-v`hatch version`" >> $GITHUB_OUTPUT
50
+
51
+ - name: Build the wheel
52
+ run: python3 -m hatch build
53
+
54
+ - name: Upload artifacts
55
+ uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
56
+ with:
57
+ name: python-package-distributions
58
+ path: dist/
59
+
60
+ - name: Publish to TestPyPI
61
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
62
+ with:
63
+ repository-url: https://test.pypi.org/legacy/
64
+ verbose: true
65
+
66
+ - name: Sign with sigstore
67
+ uses: sigstore/gh-action-sigstore-python@f832326173235dcb00dd5d92cd3f353de3188e6c # v3.1.0
68
+ with:
69
+ inputs: >-
70
+ ./dist/*.tar.gz
71
+ ./dist/*.whl
72
+
73
+ - name: Create GitHub Release
74
+ env:
75
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76
+ RELEASE_NAME: ${{ steps.create_version_number.outputs.RELEASE_NAME }}
77
+ run: gh release create $RELEASE_NAME dist/* --repo $GITHUB_REPO --prerelease --generate-notes
@@ -0,0 +1,53 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ release_tag:
7
+ description: 'Release tag (e.g. v1.0.0)'
8
+ required: false
9
+ default: 'latest'
10
+
11
+ permissions:
12
+ id-token: write
13
+ contents: read
14
+ attestations: write
15
+ packages: write
16
+
17
+ env:
18
+ REGISTRY: ghcr.io
19
+ USER: githubsecuritylab
20
+ IMAGE_NAME: seclab-taskflow-agent
21
+
22
+ jobs:
23
+ release:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Checkout code
27
+ uses: actions/checkout@v4
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: '3.11'
33
+
34
+ - name: Create release
35
+ id: docker_build
36
+ run: |
37
+ echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u GitHubSecurityLab --password-stdin
38
+ python release_tools/publish_docker.py ${{ env.REGISTRY }}/${{ env.USER }}/${{ env.IMAGE_NAME }} ${{ github.event.inputs.release_tag }}
39
+ DIGEST=$(cat /tmp/digest.txt)
40
+ echo "digest=$DIGEST" >> $GITHUB_OUTPUT
41
+
42
+ - name: Generate artifact attestation
43
+ uses: actions/attest-build-provenance@v3
44
+ with:
45
+ subject-name: ${{ env.REGISTRY }}/${{ env.USER }}/${{ env.IMAGE_NAME }}
46
+ subject-digest: '${{ steps.docker_build.outputs.digest }}'
47
+ push-to-registry: true
48
+
49
+ - name: Verify
50
+ env:
51
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52
+ run: |
53
+ gh attestation verify oci://ghcr.io/${{ env.USER }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.release_tag }} -R ${{ github.repository }}
@@ -0,0 +1,76 @@
1
+ name: Smoke test - run the examples to check for errors
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created] # Add "smoke test" as a PR comment to trigger this workflow.
6
+
7
+ # Permissions needed for reacting and adding comments for IssueOps commands
8
+ # See: https://github.com/github/branch-deploy/blob/48285b12b35e47e2dde0c27d2abb33daa846d98b/README.md?plain=1#L189-L197
9
+ permissions:
10
+ pull-requests: write # Required for commenting on PRs
11
+ deployments: write # Required for updating deployment statuses
12
+ contents: write # Required for reading/writing the lock file
13
+ checks: read # Required for checking if the CI checks have passed in order to deploy the PR
14
+ statuses: read # Required for checking if all commit statuses are "success" in order to deploy the PR
15
+
16
+ jobs:
17
+ Linux:
18
+ runs-on: ubuntu-latest
19
+ environment: smoketest
20
+ if: github.event.issue.pull_request # Make sure the comment is on a PR
21
+ steps:
22
+ - name: branch-deploy
23
+ id: branch-deploy
24
+ uses: github/branch-deploy@48285b12b35e47e2dde0c27d2abb33daa846d98b # v11.0.0
25
+ with:
26
+ trigger: "smoke test"
27
+ reaction: "eyes"
28
+ environment: "smoketest"
29
+ stable_branch: "main"
30
+ update_branch: "disabled"
31
+
32
+ - name: Setup Python
33
+ uses: actions/setup-python@v5
34
+ with:
35
+ python-version: '3.11'
36
+
37
+ - name: Checkout the repo
38
+ uses: actions/checkout@v5
39
+
40
+ - name: Checkout the PR
41
+ env:
42
+ PR_NUMBER: ${{ github.event.issue.number }}
43
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44
+ run: |
45
+ gh pr checkout $PR_NUMBER
46
+
47
+ - name: Setup Python venv
48
+ run: |
49
+ python -m venv .venv
50
+ source .venv/bin/activate
51
+ python -m pip install hatch
52
+
53
+ - name: Run tests
54
+ env:
55
+ AI_API_TOKEN: ${{ secrets.AI_API_TOKEN }}
56
+ GITHUB_AUTH_HEADER: "Bearer ${{ secrets.GITHUB_TOKEN }}"
57
+
58
+ run: |
59
+ source .venv/bin/activate
60
+ hatch build
61
+ hatch run main -p seclab_taskflow_agent.personalities.assistant 'explain modems to me please'
62
+ hatch run main -p seclab_taskflow_agent.personalities.c_auditer 'explain modems to me please'
63
+ hatch run main -p examples.personalities.echo 'explain modems to me please'
64
+ hatch run main -t examples.taskflows.CVE-2023-2283
65
+ hatch run main -t examples.taskflows.echo
66
+ hatch run main -t examples.taskflows.example
67
+ hatch run main -t examples.taskflows.example_globals
68
+ hatch run main -t examples.taskflows.example_inputs
69
+ hatch run main -t examples.taskflows.example_large_list_result_iter
70
+ hatch run main -t examples.taskflows.example_repeat_prompt
71
+ hatch run main -t examples.taskflows.example_repeat_prompt_async
72
+ hatch run main -t examples.taskflows.example_repeat_prompt_dictionary
73
+ hatch run main -t examples.taskflows.example_reusable_prompt
74
+ hatch run main -t examples.taskflows.example_reusable_taskflows
75
+ hatch run main -t examples.taskflows.example_triage_taskflow
76
+ hatch run main -t examples.taskflows.single_step_taskflow
@@ -0,0 +1,185 @@
1
+ .direnv
2
+ .envrc
3
+
4
+ # https://github.com/github/gitignore/blob/main/Python.gitignore
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # emacs backup files
11
+ *~
12
+
13
+ # C extensions
14
+ *.so
15
+
16
+ # Distribution / packaging
17
+ .Python
18
+ build/
19
+ develop-eggs/
20
+ dist/
21
+ downloads/
22
+ eggs/
23
+ .eggs/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ share/python-wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+ MANIFEST
33
+
34
+ # PyInstaller
35
+ # Usually these files are written by a python script from a template
36
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
37
+ *.manifest
38
+ *.spec
39
+
40
+ # Installer logs
41
+ pip-log.txt
42
+ pip-delete-this-directory.txt
43
+
44
+ # Unit test / coverage reports
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py,cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+ db.sqlite3-journal
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ .pybuilder/
81
+ target/
82
+
83
+ # Jupyter Notebook
84
+ .ipynb_checkpoints
85
+
86
+ # IPython
87
+ profile_default/
88
+ ipython_config.py
89
+
90
+ # pyenv
91
+ # For a library or package, you might want to ignore these files since the code is
92
+ # intended to run in multiple environments; otherwise, check them in:
93
+ # .python-version
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ #Pipfile.lock
101
+
102
+ # UV
103
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
104
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
105
+ # commonly ignored for libraries.
106
+ #uv.lock
107
+
108
+ # poetry
109
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
110
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
111
+ # commonly ignored for libraries.
112
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
113
+ #poetry.lock
114
+
115
+ # pdm
116
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117
+ #pdm.lock
118
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
119
+ # in version control.
120
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
121
+ .pdm.toml
122
+ .pdm-python
123
+ .pdm-build/
124
+
125
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
126
+ __pypackages__/
127
+
128
+ # Celery stuff
129
+ celerybeat-schedule
130
+ celerybeat.pid
131
+
132
+ # SageMath parsed files
133
+ *.sage.py
134
+
135
+ # Environments
136
+ .env
137
+ .venv
138
+ env/
139
+ venv/
140
+ ENV/
141
+ env.bak/
142
+ venv.bak/
143
+
144
+ # Spyder project settings
145
+ .spyderproject
146
+ .spyproject
147
+
148
+ # Rope project settings
149
+ .ropeproject
150
+
151
+ # mkdocs documentation
152
+ /site
153
+
154
+ # mypy
155
+ .mypy_cache/
156
+ .dmypy.json
157
+ dmypy.json
158
+
159
+ # Pyre type checker
160
+ .pyre/
161
+
162
+ # pytype static type analyzer
163
+ .pytype/
164
+
165
+ # Cython debug symbols
166
+ cython_debug/
167
+
168
+ # PyCharm
169
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
170
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
171
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
172
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
173
+ #.idea/
174
+
175
+ # Ruff stuff:
176
+ .ruff_cache/
177
+
178
+ # PyPI configuration file
179
+ .pypirc
180
+
181
+ #config.yaml
182
+ config.yaml
183
+
184
+ #database
185
+ *.db
@@ -0,0 +1,2 @@
1
+ # This repository is maintained by:
2
+ * @m-y-mo @p- @jarlob @kevinbackhouse @sylwia-budzynska @kwstubbs