scopeforge 0.1.0__py3-none-any.whl

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 (85) hide show
  1. scopeforge-0.1.0.dist-info/METADATA +188 -0
  2. scopeforge-0.1.0.dist-info/RECORD +85 -0
  3. scopeforge-0.1.0.dist-info/WHEEL +4 -0
  4. scopeforge-0.1.0.dist-info/entry_points.txt +7 -0
  5. scopeforge_engine/__init__.py +1 -0
  6. scopeforge_engine/a2a/__init__.py +5 -0
  7. scopeforge_engine/a2a/bus.py +65 -0
  8. scopeforge_engine/a2a/protocol.py +44 -0
  9. scopeforge_engine/agent.py +326 -0
  10. scopeforge_engine/agents/__init__.py +11 -0
  11. scopeforge_engine/agents/custom_agent.py +88 -0
  12. scopeforge_engine/agents/graph.py +792 -0
  13. scopeforge_engine/agents/state.py +26 -0
  14. scopeforge_engine/browser.py +81 -0
  15. scopeforge_engine/coach.py +102 -0
  16. scopeforge_engine/coverage_skeleton.py +43 -0
  17. scopeforge_engine/db.py +91 -0
  18. scopeforge_engine/egress.py +254 -0
  19. scopeforge_engine/evidence.py +229 -0
  20. scopeforge_engine/exporter.py +150 -0
  21. scopeforge_engine/labs.py +117 -0
  22. scopeforge_engine/llm_providers/__init__.py +14 -0
  23. scopeforge_engine/llm_providers/factory.py +167 -0
  24. scopeforge_engine/llm_providers/manager.py +464 -0
  25. scopeforge_engine/llm_providers/mock.py +250 -0
  26. scopeforge_engine/llm_providers/models.py +253 -0
  27. scopeforge_engine/mcp.py +193 -0
  28. scopeforge_engine/mcp_bridge.py +74 -0
  29. scopeforge_engine/middleware/__init__.py +18 -0
  30. scopeforge_engine/middleware/approval.py +61 -0
  31. scopeforge_engine/middleware/audit.py +76 -0
  32. scopeforge_engine/middleware/base.py +58 -0
  33. scopeforge_engine/middleware/pipeline.py +89 -0
  34. scopeforge_engine/middleware/redaction.py +57 -0
  35. scopeforge_engine/middleware/scope_gate.py +110 -0
  36. scopeforge_engine/models/__init__.py +61 -0
  37. scopeforge_engine/models/anthropic_compat.py +277 -0
  38. scopeforge_engine/models/errors.py +31 -0
  39. scopeforge_engine/models/factory.py +63 -0
  40. scopeforge_engine/models/gemini.py +305 -0
  41. scopeforge_engine/models/http.py +97 -0
  42. scopeforge_engine/models/litellm_bridge.py +194 -0
  43. scopeforge_engine/models/mock.py +88 -0
  44. scopeforge_engine/models/ollama.py +239 -0
  45. scopeforge_engine/models/openai_compat.py +338 -0
  46. scopeforge_engine/models/presets.py +95 -0
  47. scopeforge_engine/models/replay.py +94 -0
  48. scopeforge_engine/models/router.py +143 -0
  49. scopeforge_engine/models/sanitize.py +106 -0
  50. scopeforge_engine/models/secrets.py +75 -0
  51. scopeforge_engine/models/types.py +169 -0
  52. scopeforge_engine/parsers.py +280 -0
  53. scopeforge_engine/policy.py +598 -0
  54. scopeforge_engine/proof_gate.py +66 -0
  55. scopeforge_engine/protocol_generated.py +37 -0
  56. scopeforge_engine/providers.py +154 -0
  57. scopeforge_engine/rag/__init__.py +4 -0
  58. scopeforge_engine/rag/engine.py +150 -0
  59. scopeforge_engine/reports.py +125 -0
  60. scopeforge_engine/roles.py +189 -0
  61. scopeforge_engine/runs.py +280 -0
  62. scopeforge_engine/sec_tools/__init__.py +50 -0
  63. scopeforge_engine/sec_tools/code_tools.py +409 -0
  64. scopeforge_engine/sec_tools/tools.py +375 -0
  65. scopeforge_engine/server.py +1584 -0
  66. scopeforge_engine/skills/__init__.py +5 -0
  67. scopeforge_engine/skills/manager.py +233 -0
  68. scopeforge_engine/skills/models.py +95 -0
  69. scopeforge_engine/store.py +129 -0
  70. scopeforge_engine/tools.py +188 -0
  71. scopeforge_engine/tui/__init__.py +4 -0
  72. scopeforge_engine/tui/app.py +1143 -0
  73. scopeforge_engine/tui/clipboard.py +274 -0
  74. scopeforge_engine/tui/screens/approval_screen.py +46 -0
  75. scopeforge_engine/tui/screens/help_screen.py +104 -0
  76. scopeforge_engine/tui/screens/model_screen.py +538 -0
  77. scopeforge_engine/tui/screens/wiki_screen.py +58 -0
  78. scopeforge_engine/tui/styles.py +265 -0
  79. scopeforge_engine/tui/widgets/chat_log.py +267 -0
  80. scopeforge_engine/tui/widgets/clipboard_input.py +94 -0
  81. scopeforge_engine/tui/widgets/header_bar.py +77 -0
  82. scopeforge_engine/tui/widgets/prompt_bar.py +174 -0
  83. scopeforge_engine/tui/widgets/sidebar.py +188 -0
  84. scopeforge_engine/wiki/__init__.py +4 -0
  85. scopeforge_engine/wiki/store.py +112 -0
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.5
2
+ Name: scopeforge
3
+ Version: 0.1.0
4
+ Summary: ScopeForge — Commercial-Grade Cybersecurity Multi-Agent Harness & Interactive TUI
5
+ Author-email: Boopathi Raj <boopathi@neuronestai.in>
6
+ License: Apache-2.0
7
+ Keywords: agent-harness,claude-code,cybersecurity,langchain,langgraph,mcp,security-automation,textual,tui
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Information Technology
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Security
17
+ Classifier: Topic :: Terminals
18
+ Requires-Python: >=3.12
19
+ Requires-Dist: anyio>=4.4
20
+ Requires-Dist: httpx>=0.27
21
+ Requires-Dist: langchain>=1.0.0
22
+ Requires-Dist: langgraph>=1.0.0
23
+ Requires-Dist: llama-index-core>=0.14.0
24
+ Requires-Dist: pydantic>=2.7
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: textual>=8.0.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: hypothesis>=6; extra == 'dev'
29
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
30
+ Requires-Dist: pytest>=8; extra == 'dev'
31
+ Requires-Dist: respx>=0.22; extra == 'dev'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # ScopeForge
35
+
36
+ > **Commercial-Grade Cybersecurity Multi-Agent Harness & Claude Code Style TUI**
37
+ > Autonomous SecOps Orchestrator, LangGraph Multi-Agent Team, LangChain Tool Harness, MCP Bridge & Interactive Terminal UI.
38
+
39
+ [![PyPI version](https://img.shields.io/pypi/v/scopeforge.svg)](https://pypi.org/project/scopeforge/)
40
+ [![Python Versions](https://img.shields.io/pypi/pyversions/scopeforge.svg)](https://pypi.org/project/scopeforge/)
41
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
42
+ [![Built with Textual](https://img.shields.io/badge/UI-Textual-darkviolet.svg)](https://textual.textualize.io/)
43
+ [![Orchestration LangGraph](https://img.shields.io/badge/Orchestrator-LangGraph-orange.svg)](https://langchain-ai.github.io/langgraph/)
44
+
45
+ ---
46
+
47
+ ## ⚡ What is ScopeForge?
48
+
49
+ **ScopeForge** is a standalone, commercial-grade autonomous cybersecurity agent harness and terminal interface designed to work like **Claude Code** and **Open Code**, but specifically engineered with **ScopeGate Rules of Engagement (RoE)** safety guarantees.
50
+
51
+ Powered by **LangChain**, **LangGraph**, **Textual**, and the **Model Context Protocol (MCP)**, ScopeForge coordinates specialized cybersecurity agents to perform automated reconnaissance, vulnerability scanning, static code analysis (SAST), proof-of-concept verification, and executive reporting—or operates as a general-purpose AI coding and system administration assistant.
52
+
53
+ ---
54
+
55
+ ## 🚀 Installation & Quickstart
56
+
57
+ ### 1. Install via pip / pipx / uv
58
+
59
+ ```bash
60
+ # Recommended: Install using pipx (isolated environment)
61
+ pipx install scopeforge
62
+
63
+ # Or standard pip
64
+ pip install scopeforge
65
+
66
+ # Or run instantly without installation via uv
67
+ uvx scopeforge
68
+ ```
69
+
70
+ ### 2. Launch the Interactive TUI
71
+
72
+ Simply type `scopeforge` or the shorthand `sf` in your terminal:
73
+
74
+ ```bash
75
+ scopeforge
76
+ # Or:
77
+ sf
78
+ ```
79
+
80
+ ScopeForge will launch directly into the dark-themed reactive terminal UI.
81
+
82
+ ---
83
+
84
+ ## ⌨️ Modern Terminal Shortcuts
85
+
86
+ ScopeForge uses standard modern terminal `Ctrl+[key]` bindings:
87
+
88
+ | Shortcut | Secondary | Action | Description |
89
+ |:---:|:---:|:---|:---|
90
+ | <kbd>Ctrl+M</kbd> | <kbd>F1</kbd> | **Model Switcher** | Open live model picker, filter presets, or configure custom endpoints |
91
+ | <kbd>Ctrl+H</kbd> | <kbd>F2</kbd> | **Help Cheatsheet** | Show all slash commands, shortcuts, and agent roles |
92
+ | <kbd>Ctrl+O</kbd> | <kbd>F3</kbd> | **Toggle SecOps Mode** | Cycle policy gates (`plan` ↔ `live` ↔ `artifacts`) |
93
+ | <kbd>Ctrl+B</kbd> | <kbd>F4</kbd> | **Toggle Sidebar** | Expand or collapse agent telemetry and finding ledger |
94
+ | <kbd>Ctrl+W</kbd> | <kbd>F5</kbd> | **SecOps Wiki** | Open persistent knowledge base and user preferences |
95
+ | <kbd>Ctrl+Y</kbd> | <kbd>F6</kbd> | **Copy Last Response** | Copy the latest AI response to system clipboard |
96
+ | <kbd>Ctrl+T</kbd> | <kbd>F7</kbd> | **Toggle Native Mouse** | Switch between TUI clicks and terminal text selection |
97
+ | <kbd>Ctrl+L</kbd> | — | **Clear Screen** | Clear conversation stream and reset buffer |
98
+ | <kbd>Ctrl+Q</kbd> | — | **Quit** | Safely exit ScopeForge |
99
+
100
+ ---
101
+
102
+ ## 🤖 Multi-Agent Team (LangGraph)
103
+
104
+ ScopeForge routes tasks dynamically to specialized autonomous agents:
105
+
106
+ - 🧠 **Supervisor**: General architecture, system management, code discussion, and high-level strategy.
107
+ - 💻 **DevAgent**: Local code workspace operations, terminal sandbox commands, skill installation, and live web research.
108
+ - 🛰️ **ReconAgent**: Passive & active reconnaissance, port discovery telemetry, and attack surface enumeration.
109
+ - 🔬 **AuditAgent**: Static code auditing (SAST), CVE advisory correlation, and OWASP vulnerability identification.
110
+ - ⚡ **ExploitAgent**: Controlled proof-of-concept (PoC) validation within strict authorized bounds.
111
+ - 📋 **ReportAgent**: Executive SecOps summary, CVSS scoring, and remediation action plans.
112
+
113
+ Agents communicate asynchronously using the cryptographically verified **Agent-to-Agent (A2A) Protocol Bus**.
114
+
115
+ ---
116
+
117
+ ## 🛠️ LangChain Autonomous Tool-Calling Harness
118
+
119
+ ScopeForge provides real autonomous tool execution through LangChain:
120
+ - **Autonomous Tool Binding**: Models (`OpenRouter`, `Groq`, `DeepSeek`, `Claude`, `OpenAI`) are automatically bound to the complete toolsuite and active MCP tools via `chat_model.bind_tools()`.
121
+ - **Iterative Tool Execution**: The harness detects `tool_calls`, executes tools safely via the ScopeGate middleware pipeline, feeds `ToolMessage` outputs back into context, and synthesizes answers iteratively.
122
+ - **Built-in Tools**:
123
+ - `bash_cli`: Sandboxed shell execution with dangerous-pattern blocking.
124
+ - `google_web_search`: Live web search for fast technical lookups.
125
+ - `view_file` / `write_file` / `edit_file`: Surgical code workspace inspection and editing.
126
+ - `glob_files` / `grep_search`: Fast repository pattern discovery.
127
+ - `git_status_tool` / `git_diff_tool` / `git_commit_tool`: Git version control operations.
128
+ - `recon_port_scan` / `web_surface_probe`: Perimeter discovery tools.
129
+ - `sast_code_audit` / `cve_advisory_search`: Vulnerability triage tools.
130
+
131
+ ---
132
+
133
+ ## 🌐 Model Support & Custom API Configuration
134
+
135
+ ScopeForge supports any OpenAI-compatible, Anthropic, or Ollama provider:
136
+
137
+ ### Quick Presets (Zero Setup):
138
+ - `openrouter-free`: Meta-router for high-availability free frontier models (`openrouter/free`).
139
+ - `openrouter-free-nemotron`: NVIDIA Nemotron 550B Free.
140
+ - `groq-llama3`: Llama 3.3 70B on Groq Ultra-Fast inference.
141
+ - `ollama-llama3`: Offline local models via Ollama.
142
+
143
+ ### Custom Endpoints & Third-Party Proxies:
144
+ Open the Model Switcher (<kbd>Ctrl+M</kbd>) or use slash commands:
145
+
146
+ ```text
147
+ /model
148
+ /config set key <API_KEY>
149
+ /config set model <MODEL_ID>
150
+ /config set base <CUSTOM_URL>
151
+ ```
152
+
153
+ ScopeForge features native paste de-duplication and custom endpoint normalization (no forced path appending).
154
+
155
+ ---
156
+
157
+ ## 🔌 Model Context Protocol (MCP) & Skills
158
+
159
+ ### MCP Integration:
160
+ ```text
161
+ /mcp # List all configured MCP servers
162
+ /mcp tools # View all registered MCP tools
163
+ /mcp add <name> <command> # Add and enable an MCP server
164
+ /mcp enable <name> # Enable a server
165
+ /mcp disable <name> # Disable a server
166
+ ```
167
+
168
+ ### Extensible Skills (`SKILL.md`):
169
+ Install custom skills from any Git repository:
170
+ ```text
171
+ /skill install https://github.com/example/sec-skills
172
+ /skill list
173
+ ```
174
+
175
+ ---
176
+
177
+ ## 🛡️ ScopeGate Rules of Engagement (RoE)
178
+
179
+ ScopeForge operates under 3 strict enforcement modes:
180
+ 1. **PLAN (`plan`)**: Zero network egress. Generates falsifiable hypotheses, models attack surface, and plans audits.
181
+ 2. **ARTIFACTS (`artifacts`)**: Inspects locally supplied source code, HAR files, and logs without external traffic.
182
+ 3. **LIVE (`live`)**: Network tools enabled strictly against authorized scope domains and IPs.
183
+
184
+ ---
185
+
186
+ ## 📜 License
187
+
188
+ Licensed under the **Apache License, Version 2.0**.
@@ -0,0 +1,85 @@
1
+ scopeforge_engine/__init__.py,sha256=uzWMmijxhSZ-iCPtY1wpXRN3Oop2JsyH5nU6zPLEkZw,49
2
+ scopeforge_engine/agent.py,sha256=gxerBb80XlTEQfsEDBhKNvOqoXT0K9Ny0UAzX1SpAAc,14628
3
+ scopeforge_engine/browser.py,sha256=NL3Ear5RX6JqneM6fIBU9nzmUv9GawWtDgMF6uKra_Q,3278
4
+ scopeforge_engine/coach.py,sha256=AzofVcA4FE7n8x4r_QLiNh5wC_fPpK2vk6-_IzH5uBg,5297
5
+ scopeforge_engine/coverage_skeleton.py,sha256=dn77eeKPWZqiu_QOtwOUusovB2R77_mkH5ZThj6ycT4,2455
6
+ scopeforge_engine/db.py,sha256=Ujm95NY09mGiM0ObLOfCNZUc8EY8ll9SqLgeagUiKvw,3495
7
+ scopeforge_engine/egress.py,sha256=rPPUmEQJ1QT4pleY0eTBModKaVCnFyZFkX12WCTW1PE,11422
8
+ scopeforge_engine/evidence.py,sha256=Rg8MYhVJd0FU3kzDrwLBzl2hJYAwNSXR6xTbcpC3xDY,9121
9
+ scopeforge_engine/exporter.py,sha256=BP56lYmo4vBRBQiEU0RIzqvoZWljj-s5qqtmBoaNopY,6371
10
+ scopeforge_engine/labs.py,sha256=fs7itYbEo79tPn9iNmF2F4GNcvmtCr-Q30NULmZLEUQ,3955
11
+ scopeforge_engine/mcp.py,sha256=xvTD7dkVppzfDOXyP7ETt3qjQpsPGfcRl3X00tv57FI,7505
12
+ scopeforge_engine/mcp_bridge.py,sha256=ABK8sZzmMAIox35oLpZLEUkhy3FQ1Jl1oCW7IuI6ChU,2791
13
+ scopeforge_engine/parsers.py,sha256=H_Ghh64UBBX-Dm1GClSlBB6ilrJZPcAg-bvgWMqhyJg,11216
14
+ scopeforge_engine/policy.py,sha256=UjgS3hxxVVTa8OuJznXV6P6uRwQIl0BgV9piRBkPy3w,25206
15
+ scopeforge_engine/proof_gate.py,sha256=C-hFOy1cb4KWfuWegcXkMcZiuo2ylr0lPPCZz40cwSY,3305
16
+ scopeforge_engine/protocol_generated.py,sha256=1kEDYIzznVV3fHZxz-puEkdXkN9X0FuMjdbJbF9ytgY,1692
17
+ scopeforge_engine/providers.py,sha256=oJpJe_e-XgqrIVmdRkHlVOEsy2_tPUTzIZL11V55zPc,6990
18
+ scopeforge_engine/reports.py,sha256=gZebdZ0LnbWiTmh_ISIbVlWY090xE2AZCMhEyvdU85w,3067
19
+ scopeforge_engine/roles.py,sha256=aYCyeWdKAVAJZpb5DwErnWEiUlyASJYUVm0KnvLyLXU,8921
20
+ scopeforge_engine/runs.py,sha256=w6F4Vf6Kz6_DRMlCtdwb4zH4RKWLc-wMAojcVlhrav4,11227
21
+ scopeforge_engine/server.py,sha256=M3JXyIFaozpXA1F26USQtpfOcjwGYJNFltnH0vWlL5U,79198
22
+ scopeforge_engine/store.py,sha256=iNLRql0ybxQE4cFaW58-gFz3-mugiifv4izTyw0a5OM,4023
23
+ scopeforge_engine/tools.py,sha256=cbsNFhl9AMdScYIfSj_WQcijeXQXW2P4hPinFRV8rsE,7308
24
+ scopeforge_engine/a2a/__init__.py,sha256=wjnkLMa14od6BG6gCkXvrECnMuTjcvCWxwSNoiwkYBU,162
25
+ scopeforge_engine/a2a/bus.py,sha256=6QBpXjGGYWSdIWyrVnjypDYyfptETWh86eDuHj8Wq2M,1944
26
+ scopeforge_engine/a2a/protocol.py,sha256=VBNH7PkCc7Rw2Gq6cbd-97VtwrZKFXVuqdrgB1LOEHs,1596
27
+ scopeforge_engine/agents/__init__.py,sha256=-ZamANIlk5id7EtTB4Mt_nqCdKaIsw2H72807EW6Ifw,298
28
+ scopeforge_engine/agents/custom_agent.py,sha256=YDfnkowcNwEAQQON-Ztq0Kix8CJQYU1ex3qbbWyD3yM,3419
29
+ scopeforge_engine/agents/graph.py,sha256=4LDSsLcmYjtQpQLO1zyiPBVX8nmHwA87TQrnkhiUYJM,40174
30
+ scopeforge_engine/agents/state.py,sha256=dJPujvZmV3rEqA8FaKTlV4_XqCaxVW7sdAPka8vp_u4,958
31
+ scopeforge_engine/llm_providers/__init__.py,sha256=SPLtopCYAES_gcp3q6p6rdXbjOtgV6CeYxR_2Dlt-fQ,431
32
+ scopeforge_engine/llm_providers/factory.py,sha256=ki1c5ZWIDKmzwn0Gh5jI30QhWJLc24ckcB3qLEyqmaE,8039
33
+ scopeforge_engine/llm_providers/manager.py,sha256=XPp2sk313sH2yzpKl4S7YvzOVw0JI9fl4240bC1-NUY,21254
34
+ scopeforge_engine/llm_providers/mock.py,sha256=2kLgOEr3DAbsCABrkctZI8jKCSIBQIADxjRa5UYRUL4,13153
35
+ scopeforge_engine/llm_providers/models.py,sha256=-LIxFLnAf_wDbXJ1jTfy6EqzaUWYU_KXaza72zvEfJg,8632
36
+ scopeforge_engine/middleware/__init__.py,sha256=_2PvLj47fAhLU5RXHVNFTAg-DaCQv4eoULh4xjydyi0,620
37
+ scopeforge_engine/middleware/approval.py,sha256=CmFSySeid3JliCUFXa0fqKjYojage2uDT-BlNDp3_1Q,2287
38
+ scopeforge_engine/middleware/audit.py,sha256=rgsubRWVZKY2oWdp4Ha9yQ_8Tm8ZXhUdPV8hqDh4-HQ,2816
39
+ scopeforge_engine/middleware/base.py,sha256=lHUqqJEy3PNdVPFQofpPOFsG338oFpHNTdN6YJPoSmg,1848
40
+ scopeforge_engine/middleware/pipeline.py,sha256=svkwNirAb7ENSPV1HKDs6iIIa1Z3nBbtnEXhaYTVT6c,2906
41
+ scopeforge_engine/middleware/redaction.py,sha256=D3OplE_3n3lUTatWv8UqTuWO6-9ZtunMLRWuDMhl8ds,2378
42
+ scopeforge_engine/middleware/scope_gate.py,sha256=T5OlpaEw57MXa-6OxS1qAYUY9BN-d9RX2ixfKlWeXfI,4414
43
+ scopeforge_engine/models/__init__.py,sha256=LFFvVY_CsK-GAmzb_nx8qQpGdNDbHJ1UymRkyBTy9b4,2404
44
+ scopeforge_engine/models/anthropic_compat.py,sha256=jMi_v_RoHbWprMMJDQ5c3KaH0Knrp5_tEqhPtPwanPc,12164
45
+ scopeforge_engine/models/errors.py,sha256=hinKesVJNzaEa5q3q8_Fw7LgfOibvyCJXEh4wVOFKro,1161
46
+ scopeforge_engine/models/factory.py,sha256=wi8jL1E-HDX6vgG4Fnsbb0sgX9XPYs_qI-Jje1EvQ8c,2702
47
+ scopeforge_engine/models/gemini.py,sha256=42NAu-DMSm71SZe0jfFv7VPtYBDIQEyJVt-MDr_jt0M,13004
48
+ scopeforge_engine/models/http.py,sha256=sHtPc7URtfBEYfA7F-MnJRIXB6YQ4KkR9f-U_vz_t8E,4488
49
+ scopeforge_engine/models/litellm_bridge.py,sha256=8E3zeyRpclLbFz7i62W8dW4QrpsFg0EiFcwkvlb0TG8,8304
50
+ scopeforge_engine/models/mock.py,sha256=2RfUcJc41EjEuf0P573UKwsnLyErUILrou9Bnd5SEVI,3454
51
+ scopeforge_engine/models/ollama.py,sha256=_HlbkWqC6klZAcicDwe1mKm4qr_faCjfjA45etEspo4,9935
52
+ scopeforge_engine/models/openai_compat.py,sha256=cZyATu_CxcCi6YKNnnbZPqbziqCd0kFT3fC3jq5AqlY,14456
53
+ scopeforge_engine/models/presets.py,sha256=XOytR_FcrsECU4X0ozHPQVrRBveJ4_j6zt91K_ixIUE,3555
54
+ scopeforge_engine/models/replay.py,sha256=ARV_3jtsGxThsMGVsw9DpP-CScnJPk81XfJsqr7chvM,3343
55
+ scopeforge_engine/models/router.py,sha256=hGwIQ1CYeoJ7Vf49Wfh_wZ-oHHkWWumdynSoioYBtAo,5535
56
+ scopeforge_engine/models/sanitize.py,sha256=NoI2m8omJ5cVjc5AVjSFZBzoNeEdep7Pc_Pjklk3L7s,3926
57
+ scopeforge_engine/models/secrets.py,sha256=RG-PQf2tn-iKw-Vz26JLM4kiCx-Wbikvvd4apEvm1Cc,3155
58
+ scopeforge_engine/models/types.py,sha256=ODFHTXalEiJXXwbZrIwamEHLZEh334LU6khPcPoSeq8,4879
59
+ scopeforge_engine/rag/__init__.py,sha256=GPpTOnYHRKrwSElX0ru3wGPGcpAy6oqDLOfl0mcmDkE,185
60
+ scopeforge_engine/rag/engine.py,sha256=dveyrTCjOiQz5Er2zEOKy3gGUPIuCLcIchWLcvx0r74,6963
61
+ scopeforge_engine/sec_tools/__init__.py,sha256=PqGmd-L-04_s6UcZLDTZeYF0CUFl0m_68ROzo1iD9R8,995
62
+ scopeforge_engine/sec_tools/code_tools.py,sha256=YsBfsTeorL4A64I89fPsYdA29IKNgamh9MPdZJdI4xA,15091
63
+ scopeforge_engine/sec_tools/tools.py,sha256=LGtgjXm4KVeUToYzLOgPvjXL_XJDbaeMws1Vp_bBbp8,15480
64
+ scopeforge_engine/skills/__init__.py,sha256=EI_3g-7qPupp7jU4vB0PNlR-SjN7a8BF8V11AjnEO4s,162
65
+ scopeforge_engine/skills/manager.py,sha256=J6ZtTSEnegqvTi2a2vx5ay_-4_CZgszDzywLu4-g81U,10620
66
+ scopeforge_engine/skills/models.py,sha256=G2Pu0AEw1LGBDydq4bEab5kSGRfu_Y_k4M6RrA5EhSY,3611
67
+ scopeforge_engine/tui/__init__.py,sha256=YZPzcux1-Zxv86-H9tokoyfaLTQgizLpDMbgOarzUMI,118
68
+ scopeforge_engine/tui/app.py,sha256=V-u8_Fi6peZ3ccK9eJthM52k2GFGy3C4O2myIEsS8PE,60124
69
+ scopeforge_engine/tui/clipboard.py,sha256=Va92v1Tw7J_IVQOJqb1lVl4g36ipi43qSND--YZ37HQ,8507
70
+ scopeforge_engine/tui/styles.py,sha256=bgIEecY8KAXZyjm7fZUCPqLQDzUVCdBnDtKBC8WodaM,3880
71
+ scopeforge_engine/tui/screens/approval_screen.py,sha256=UAMjSB76J5gMBwmSEwyiBgLoSTxFyIwjpVlXfh5Ie4s,1986
72
+ scopeforge_engine/tui/screens/help_screen.py,sha256=GPWHMJftFjue4t47KrRDKkuAPaZ6oLp2YbKraf5IkQ8,5441
73
+ scopeforge_engine/tui/screens/model_screen.py,sha256=ztxJHNQm242-DSvHejhygNDWrXbqYVop0R3lzP9718U,25406
74
+ scopeforge_engine/tui/screens/wiki_screen.py,sha256=PUDHO8g-8OEEnJIAh4-9XcG8e_PCbRVk9eqz2ge8qFo,2343
75
+ scopeforge_engine/tui/widgets/chat_log.py,sha256=3zMt1kmpP2vbXQHf3fZJEI7xDbbIbn3Rkz7Zg-Q9_aw,12338
76
+ scopeforge_engine/tui/widgets/clipboard_input.py,sha256=ewLYrc4Z0jNr5oq3ZSRLcineSMjtmPplttui3Snbg28,3782
77
+ scopeforge_engine/tui/widgets/header_bar.py,sha256=DhiGrPw8Mrw2hfei5qt-6GvV3ysktWIU9dFed5Xb0D8,2633
78
+ scopeforge_engine/tui/widgets/prompt_bar.py,sha256=vwreuNKHcxcHYz8qVTft2iiAFKXn41cwwxMxMrgXyMk,6500
79
+ scopeforge_engine/tui/widgets/sidebar.py,sha256=H7d3HEWl8WY0K41OaAA5kUp2onkvKUAtz63w409DtBc,7288
80
+ scopeforge_engine/wiki/__init__.py,sha256=xQux0Bo9d1hlDoLk_5rGcVqeAMC_xVVJltk64VFItic,118
81
+ scopeforge_engine/wiki/store.py,sha256=6wV-PSrxGVPWLlZs6qiAkunQ73fjrMwHZJCD9TgvYl8,4473
82
+ scopeforge-0.1.0.dist-info/METADATA,sha256=CXz2rn7dshCcQP3oCjReT3CnDYszVEE19H28Yg9_qno,8258
83
+ scopeforge-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
84
+ scopeforge-0.1.0.dist-info/entry_points.txt,sha256=1pZyZ-mu7SiD6hOfWZZrQOpHOpWootS0MqNlUj1d12I,278
85
+ scopeforge-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,7 @@
1
+ [console_scripts]
2
+ agi = scopeforge_engine.tui.app:main
3
+ scopeforge = scopeforge_engine.tui.app:main
4
+ scopeforge-engine = scopeforge_engine.server:main
5
+ scopeforge-tui = scopeforge_engine.tui.app:main
6
+ sf = scopeforge_engine.tui.app:main
7
+ sourceforge = scopeforge_engine.tui.app:main
@@ -0,0 +1 @@
1
+ """ScopeForge engine package (Phase 1 spine)."""
@@ -0,0 +1,5 @@
1
+ """Agent-to-Agent (A2A) protocol package."""
2
+ from .protocol import A2AMessage, A2AIntent
3
+ from .bus import A2ABus
4
+
5
+ __all__ = ["A2AMessage", "A2AIntent", "A2ABus"]
@@ -0,0 +1,65 @@
1
+ """Agent-to-Agent (A2A) Message Bus."""
2
+ from __future__ import annotations
3
+
4
+ import json
5
+ from pathlib import Path
6
+ from typing import Callable, Dict, List, Optional
7
+
8
+ from .protocol import A2AMessage, A2AIntent
9
+
10
+
11
+ class A2ABus:
12
+ """Central bus for inter-agent communication, telemetry, and collaboration."""
13
+
14
+ def __init__(self, log_path: Optional[Path] = None):
15
+ self.log_path = log_path or Path(".scopeforge/a2a_log.jsonl")
16
+ self.log_path.parent.mkdir(parents=True, exist_ok=True)
17
+ self.messages: List[A2AMessage] = []
18
+ self.subscribers: List[Callable[[A2AMessage], None]] = []
19
+
20
+ def subscribe(self, callback: Callable[[A2AMessage], None]):
21
+ """Subscribe to incoming A2A messages."""
22
+ self.subscribers.append(callback)
23
+
24
+ def publish(self, message: A2AMessage) -> A2AMessage:
25
+ """Sign and broadcast a message to subscribers and audit log."""
26
+ if not message.signature:
27
+ message.sign()
28
+
29
+ self.messages.append(message)
30
+
31
+ # Append to disk log
32
+ try:
33
+ with open(self.log_path, "a", encoding="utf-8") as f:
34
+ f.write(message.model_dump_json() + "\n")
35
+ except Exception:
36
+ pass
37
+
38
+ # Notify subscribers
39
+ for sub in self.subscribers:
40
+ try:
41
+ sub(message)
42
+ except Exception:
43
+ pass
44
+
45
+ return message
46
+
47
+ def send(
48
+ self,
49
+ sender: str,
50
+ recipient: str,
51
+ intent: A2AIntent,
52
+ payload: Dict,
53
+ ) -> A2AMessage:
54
+ """Convenience method to construct and publish an A2A message."""
55
+ msg = A2AMessage(
56
+ sender=sender,
57
+ recipient=recipient,
58
+ intent=intent,
59
+ payload=payload,
60
+ )
61
+ return self.publish(msg)
62
+
63
+ def get_history(self, limit: int = 50) -> List[A2AMessage]:
64
+ """Get recent A2A messages."""
65
+ return self.messages[-limit:]
@@ -0,0 +1,44 @@
1
+ """A2A (Agent-to-Agent) Protocol: Standardized inter-agent messaging and delegation format."""
2
+ from __future__ import annotations
3
+
4
+ import datetime
5
+ import hashlib
6
+ import json
7
+ import uuid
8
+ from enum import Enum
9
+ from typing import Any, Dict, Optional
10
+ from pydantic import BaseModel, Field
11
+
12
+
13
+ class A2AIntent(str, Enum):
14
+ TASK_DELEGATION = "TASK_DELEGATION"
15
+ TASK_RESULT = "TASK_RESULT"
16
+ EVIDENCE_SHARING = "EVIDENCE_SHARING"
17
+ CONSENSUS_REQUEST = "CONSENSUS_REQUEST"
18
+ CONSENSUS_RESPONSE = "CONSENSUS_RESPONSE"
19
+ HANDOVER = "HANDOVER"
20
+ ALERT = "ALERT"
21
+
22
+
23
+ class A2AMessage(BaseModel):
24
+ """Standardized A2A Protocol Envelope."""
25
+ message_id: str = Field(default_factory=lambda: f"a2a_{uuid.uuid4().hex[:10]}")
26
+ timestamp: str = Field(default_factory=lambda: datetime.datetime.now(datetime.timezone.utc).isoformat())
27
+ protocol_version: str = "1.0.0"
28
+ sender: str
29
+ recipient: str
30
+ intent: A2AIntent
31
+ payload: Dict[str, Any]
32
+ signature: str = ""
33
+
34
+ def sign(self) -> str:
35
+ """Compute cryptographic hash of the message payload for integrity."""
36
+ raw = f"{self.sender}:{self.recipient}:{self.intent}:{json.dumps(self.payload, sort_keys=True)}"
37
+ self.signature = hashlib.sha256(raw.encode("utf-8")).hexdigest()
38
+ return self.signature
39
+
40
+ def verify(self) -> bool:
41
+ """Verify the integrity hash of the message."""
42
+ raw = f"{self.sender}:{self.recipient}:{self.intent}:{json.dumps(self.payload, sort_keys=True)}"
43
+ expected = hashlib.sha256(raw.encode("utf-8")).hexdigest()
44
+ return self.signature == expected