seclab-taskflow-agent 0.0.5__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 (106) hide show
  1. seclab_taskflow_agent-0.0.5/.devcontainer/Dockerfile +15 -0
  2. seclab_taskflow_agent-0.0.5/.devcontainer/devcontainer.json +53 -0
  3. seclab_taskflow_agent-0.0.5/.devcontainer/post-create.sh +50 -0
  4. seclab_taskflow_agent-0.0.5/.dockerignore +9 -0
  5. seclab_taskflow_agent-0.0.5/.github/workflows/ci.yml +42 -0
  6. seclab_taskflow_agent-0.0.5/.github/workflows/codeql.yml +44 -0
  7. seclab_taskflow_agent-0.0.5/.github/workflows/publish-to-pypi.yaml +71 -0
  8. seclab_taskflow_agent-0.0.5/.github/workflows/publish-to-testpypi.yaml +77 -0
  9. seclab_taskflow_agent-0.0.5/.github/workflows/release.yml +53 -0
  10. seclab_taskflow_agent-0.0.5/.github/workflows/smoketest.yaml +74 -0
  11. seclab_taskflow_agent-0.0.5/.gitignore +190 -0
  12. seclab_taskflow_agent-0.0.5/CODEOWNERS +2 -0
  13. seclab_taskflow_agent-0.0.5/CODE_OF_CONDUCT.md +74 -0
  14. seclab_taskflow_agent-0.0.5/CONTRIBUTING.md +31 -0
  15. seclab_taskflow_agent-0.0.5/LICENSE +21 -0
  16. seclab_taskflow_agent-0.0.5/NOTICE +11 -0
  17. seclab_taskflow_agent-0.0.5/PKG-INFO +623 -0
  18. seclab_taskflow_agent-0.0.5/README.md +519 -0
  19. seclab_taskflow_agent-0.0.5/SECURITY.md +31 -0
  20. seclab_taskflow_agent-0.0.5/SUPPORT.md +13 -0
  21. seclab_taskflow_agent-0.0.5/doc/GRAMMAR.md +486 -0
  22. seclab_taskflow_agent-0.0.5/docker/Dockerfile +48 -0
  23. seclab_taskflow_agent-0.0.5/docker/run.sh +15 -0
  24. seclab_taskflow_agent-0.0.5/examples/model_configs/model_config.yaml +11 -0
  25. seclab_taskflow_agent-0.0.5/examples/personalities/apple_expert.yaml +12 -0
  26. seclab_taskflow_agent-0.0.5/examples/personalities/banana_expert.yaml +12 -0
  27. seclab_taskflow_agent-0.0.5/examples/personalities/echo.yaml +17 -0
  28. seclab_taskflow_agent-0.0.5/examples/personalities/example_triage_agent.yaml +13 -0
  29. seclab_taskflow_agent-0.0.5/examples/personalities/fruit_expert.yaml +12 -0
  30. seclab_taskflow_agent-0.0.5/examples/personalities/orange_expert.yaml +12 -0
  31. seclab_taskflow_agent-0.0.5/examples/prompts/example_prompt.yaml +9 -0
  32. seclab_taskflow_agent-0.0.5/examples/taskflows/CVE-2023-2283.yaml +95 -0
  33. seclab_taskflow_agent-0.0.5/examples/taskflows/echo.yaml +24 -0
  34. seclab_taskflow_agent-0.0.5/examples/taskflows/example.yaml +71 -0
  35. seclab_taskflow_agent-0.0.5/examples/taskflows/example_globals.yaml +15 -0
  36. seclab_taskflow_agent-0.0.5/examples/taskflows/example_inputs.yaml +16 -0
  37. seclab_taskflow_agent-0.0.5/examples/taskflows/example_large_list_result_iter.yaml +27 -0
  38. seclab_taskflow_agent-0.0.5/examples/taskflows/example_repeat_prompt.yaml +31 -0
  39. seclab_taskflow_agent-0.0.5/examples/taskflows/example_repeat_prompt_async.yaml +35 -0
  40. seclab_taskflow_agent-0.0.5/examples/taskflows/example_repeat_prompt_dictionary.yaml +32 -0
  41. seclab_taskflow_agent-0.0.5/examples/taskflows/example_reusable_prompt.yaml +15 -0
  42. seclab_taskflow_agent-0.0.5/examples/taskflows/example_reusable_taskflows.yaml +13 -0
  43. seclab_taskflow_agent-0.0.5/examples/taskflows/example_triage_taskflow.yaml +43 -0
  44. seclab_taskflow_agent-0.0.5/examples/taskflows/single_step_taskflow.yaml +14 -0
  45. seclab_taskflow_agent-0.0.5/misc/codeql_fetch_db.sh +41 -0
  46. seclab_taskflow_agent-0.0.5/pyproject.toml +147 -0
  47. seclab_taskflow_agent-0.0.5/release_tools/HOWTO.md +33 -0
  48. seclab_taskflow_agent-0.0.5/release_tools/copy_files.py +84 -0
  49. seclab_taskflow_agent-0.0.5/release_tools/publish_docker.py +44 -0
  50. seclab_taskflow_agent-0.0.5/release_tools/release.sh +2 -0
  51. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/__about__.py +3 -0
  52. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/__init__.py +2 -0
  53. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/__main__.py +661 -0
  54. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/agent.py +187 -0
  55. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/available_tools.py +89 -0
  56. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/capi.py +72 -0
  57. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/env_utils.py +26 -0
  58. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/client.py +628 -0
  59. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/LICENSE +27 -0
  60. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/__init__.py +939 -0
  61. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/__meta__.py +15 -0
  62. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/py.typed +0 -0
  63. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/mcp_server.py +217 -0
  64. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/README.md +3 -0
  65. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/absolute_to_relative.ql +15 -0
  66. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/call_graph_from.ql +29 -0
  67. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/call_graph_from_to.ql +76 -0
  68. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/call_graph_to.ql +29 -0
  69. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/codeql-pack.lock.yml +24 -0
  70. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/declaration_location_for_variable.ql +25 -0
  71. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/definition_location_for_function.ql +24 -0
  72. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/list_functions.ql +12 -0
  73. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/locations.qll +12 -0
  74. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/qlpack.yml +7 -0
  75. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/relative_to_absolute.ql +15 -0
  76. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-cpp/stmt_location.ql +25 -0
  77. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/absolute_to_relative.ql +15 -0
  78. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/call_graph_from.ql +28 -0
  79. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/call_graph_to.ql +20 -0
  80. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/definition_location_for_function.ql +24 -0
  81. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/locations.qll +10 -0
  82. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/qlpack.yml +7 -0
  83. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/codeql/queries/mcp-js/relative_to_absolute.ql +15 -0
  84. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/echo/echo.py +37 -0
  85. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/logbook/logbook.py +95 -0
  86. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/memcache/__init__.py +2 -0
  87. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/memcache/memcache.py +72 -0
  88. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/__init__.py +2 -0
  89. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/backend.py +23 -0
  90. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/dictionary_file.py +102 -0
  91. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/sql_models.py +19 -0
  92. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_servers/memcache/memcache_backend/sqlite.py +91 -0
  93. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/mcp_utils.py +467 -0
  94. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/personalities/assistant.yaml +14 -0
  95. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/personalities/c_auditer.yaml +21 -0
  96. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/render_utils.py +36 -0
  97. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/shell_utils.py +40 -0
  98. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/toolboxes/codeql.yaml +78 -0
  99. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/toolboxes/echo.yaml +14 -0
  100. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/toolboxes/github_official.yaml +16 -0
  101. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/toolboxes/logbook.yaml +17 -0
  102. seclab_taskflow_agent-0.0.5/src/seclab_taskflow_agent/toolboxes/memcache.yaml +18 -0
  103. seclab_taskflow_agent-0.0.5/tests/README.md +33 -0
  104. seclab_taskflow_agent-0.0.5/tests/__init__.py +4 -0
  105. seclab_taskflow_agent-0.0.5/tests/data/test_yaml_parser_personality000.yaml +11 -0
  106. seclab_taskflow_agent-0.0.5/tests/test_yaml_parser.py +47 -0
@@ -0,0 +1,15 @@
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
+ # Set working directory
13
+ WORKDIR /workspaces/seclab-taskflow-agent
14
+
15
+ # The rest of the setup will be done in post-create script
@@ -0,0 +1,53 @@
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
+ },
20
+ // Configure tool-specific properties
21
+ "customizations": {
22
+ "vscode": {
23
+ "extensions": [
24
+ "ms-python.python",
25
+ "ms-python.vscode-pylance",
26
+ "redhat.vscode-yaml",
27
+ "GitHub.copilot",
28
+ "GitHub.copilot-chat",
29
+ "ms-azuretools.vscode-docker"
30
+ ],
31
+ "settings": {
32
+ "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
33
+ "python.terminal.activateEnvironment": true
34
+ }
35
+ }
36
+ },
37
+ // Use 'forwardPorts' to make a list of ports inside the container available locally
38
+ "forwardPorts": [],
39
+ // Use 'postCreateCommand' to run commands after the container is created
40
+ "postCreateCommand": "bash .devcontainer/post-create.sh",
41
+ // Use 'postStartCommand' to run commands when the container starts
42
+ // "postStartCommand": "",
43
+ // Environment variables
44
+ "containerEnv": {
45
+ "PYTHONUNBUFFERED": "1"
46
+ },
47
+ // Set the user to use in the container (non-root)
48
+ "remoteUser": "vscode",
49
+ // Grant the container access to the host's Docker daemon
50
+ "runArgs": [
51
+ "--init"
52
+ ]
53
+ }
@@ -0,0 +1,50 @@
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
+ # If running in Codespaces, check for necessary secrets and print error if missing
18
+ if [ -n "$CODESPACES" ]; then
19
+ echo "🔐 Running in Codespaces - injecting secrets from Codespaces settings..."
20
+ if [ -n "$COPILOT_TOKEN" ]; then
21
+ echo "Running in Codespaces - please add COPILOT_TOKEN to your Codespaces secrets"
22
+ fi
23
+ if [ -n "$GITHUB_AUTH_HEADER" ]; then
24
+ echo "Running in Codespaces - please add GITHUB_AUTH_HEADER to your Codespaces secrets"
25
+ fi
26
+ fi
27
+
28
+ # Create .env file if it doesn't exist
29
+ if [ ! -f .env ]; then
30
+ echo "📝 Creating .env template..."
31
+ cat > .env << 'EOF'
32
+
33
+ # Optional: CodeQL database base path
34
+ CODEQL_DBS_BASE_PATH=/workspaces/seclab-taskflow-agent/my_data
35
+
36
+ EOF
37
+ echo "⚠️ Please configure the enviroment or your .env file with required tokens!"
38
+ fi
39
+
40
+ # Create logs directory if it doesn't exist
41
+ mkdir -p logs
42
+
43
+ # Create optional data directories
44
+ mkdir -p my_data
45
+
46
+ echo "✅ Development environment setup complete!"
47
+ echo ""
48
+ echo "📋 Next steps:"
49
+ echo "Configure your environment with COPILOT_TOKEN and GITHUB_AUTH_HEADER as needed."
50
+ echo "💡 Remember to activate the virtual environment: source .venv/bin/activate"
@@ -0,0 +1,9 @@
1
+ __pycache__
2
+ docker/
3
+ logs/**/*
4
+ .env
5
+ .venv
6
+ .direnv
7
+ .envrc
8
+ .devcontainer
9
+ .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,71 @@
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
65
+
66
+ - name: Publish to TestPyPI
67
+ uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
68
+ with:
69
+ repository-url: https://test.pypi.org/legacy/
70
+ verbose: true
71
+ attestations: false
@@ -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,74 @@
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
+ if: github.event.issue.pull_request # Make sure the comment is on a PR
20
+ steps:
21
+ - name: branch-deploy
22
+ id: branch-deploy
23
+ uses: github/branch-deploy@48285b12b35e47e2dde0c27d2abb33daa846d98b # v11.0.0
24
+ with:
25
+ trigger: "smoke test"
26
+ reaction: "eyes"
27
+ stable_branch: "main"
28
+ update_branch: "disabled"
29
+
30
+ - name: Setup Python
31
+ uses: actions/setup-python@v5
32
+ with:
33
+ python-version: '3.11'
34
+
35
+ - name: Checkout the repo
36
+ uses: actions/checkout@v5
37
+
38
+ - name: Checkout the PR
39
+ env:
40
+ PR_NUMBER: ${{ github.event.issue.number }}
41
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42
+ run: |
43
+ gh pr checkout $PR_NUMBER
44
+
45
+ - name: Setup Python venv
46
+ run: |
47
+ python -m venv .venv
48
+ source .venv/bin/activate
49
+ python -m pip install hatch
50
+
51
+ - name: Run tests
52
+ env:
53
+ COPILOT_TOKEN: ${{ secrets.COPILOT_TOKEN }}
54
+ GITHUB_AUTH_HEADER: "Bearer ${{ secrets.GITHUB_TOKEN }}"
55
+
56
+ run: |
57
+ source .venv/bin/activate
58
+ hatch build
59
+ hatch run main -p seclab_taskflow_agent.personalities.assistant 'explain modems to me please'
60
+ hatch run main -p seclab_taskflow_agent.personalities.c_auditer 'explain modems to me please'
61
+ hatch run main -p examples.personalities.echo 'explain modems to me please'
62
+ hatch run main -t examples.taskflows.CVE-2023-2283
63
+ hatch run main -t examples.taskflows.echo
64
+ hatch run main -t examples.taskflows.example
65
+ hatch run main -t examples.taskflows.example_globals
66
+ hatch run main -t examples.taskflows.example_inputs
67
+ hatch run main -t examples.taskflows.example_large_list_result_iter
68
+ hatch run main -t examples.taskflows.example_repeat_prompt
69
+ hatch run main -t examples.taskflows.example_repeat_prompt_async
70
+ hatch run main -t examples.taskflows.example_repeat_prompt_dictionary
71
+ hatch run main -t examples.taskflows.example_reusable_prompt
72
+ hatch run main -t examples.taskflows.example_reusable_taskflows
73
+ hatch run main -t examples.taskflows.example_triage_taskflow
74
+ hatch run main -t examples.taskflows.single_step_taskflow
@@ -0,0 +1,190 @@
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
+ # Logs directory
17
+ logs/
18
+
19
+ # Distribution / packaging
20
+ .Python
21
+ build/
22
+ develop-eggs/
23
+ dist/
24
+ downloads/
25
+ eggs/
26
+ .eggs/
27
+ parts/
28
+ sdist/
29
+ var/
30
+ wheels/
31
+ share/python-wheels/
32
+ *.egg-info/
33
+ .installed.cfg
34
+ *.egg
35
+ MANIFEST
36
+
37
+ # PyInstaller
38
+ # Usually these files are written by a python script from a template
39
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
40
+ *.manifest
41
+ *.spec
42
+
43
+ # Installer logs
44
+ pip-log.txt
45
+ pip-delete-this-directory.txt
46
+
47
+ # Unit test / coverage reports
48
+ htmlcov/
49
+ .tox/
50
+ .nox/
51
+ .coverage
52
+ .coverage.*
53
+ .cache
54
+ nosetests.xml
55
+ coverage.xml
56
+ *.cover
57
+ *.py,cover
58
+ .hypothesis/
59
+ .pytest_cache/
60
+ cover/
61
+
62
+ # Translations
63
+ *.mo
64
+ *.pot
65
+
66
+ # Django stuff:
67
+ *.log
68
+ local_settings.py
69
+ db.sqlite3
70
+ db.sqlite3-journal
71
+
72
+ # Flask stuff:
73
+ instance/
74
+ .webassets-cache
75
+
76
+ # Scrapy stuff:
77
+ .scrapy
78
+
79
+ # Sphinx documentation
80
+ docs/_build/
81
+
82
+ # PyBuilder
83
+ .pybuilder/
84
+ target/
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # pyenv
94
+ # For a library or package, you might want to ignore these files since the code is
95
+ # intended to run in multiple environments; otherwise, check them in:
96
+ # .python-version
97
+
98
+ # pipenv
99
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
101
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
102
+ # install all needed dependencies.
103
+ #Pipfile.lock
104
+
105
+ # UV
106
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
107
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
108
+ # commonly ignored for libraries.
109
+ #uv.lock
110
+
111
+ # poetry
112
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
113
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
114
+ # commonly ignored for libraries.
115
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
116
+ #poetry.lock
117
+
118
+ # pdm
119
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
120
+ #pdm.lock
121
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
122
+ # in version control.
123
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
124
+ .pdm.toml
125
+ .pdm-python
126
+ .pdm-build/
127
+
128
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
129
+ __pypackages__/
130
+
131
+ # Celery stuff
132
+ celerybeat-schedule
133
+ celerybeat.pid
134
+
135
+ # SageMath parsed files
136
+ *.sage.py
137
+
138
+ # Environments
139
+ .env
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Ruff stuff:
179
+ .ruff_cache/
180
+
181
+ # PyPI configuration file
182
+ .pypirc
183
+
184
+ #config.yaml
185
+ config.yaml
186
+
187
+ #database
188
+ *.db
189
+ #logs
190
+ logs/
@@ -0,0 +1,2 @@
1
+ # This repository is maintained by:
2
+ * @m-y-mo @p- @jarlob @kevinbackhouse @sylwia-budzynska @kwstubbs