forge-agent 1.1.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.
- forge_agent-1.1.5/LICENSE +21 -0
- forge_agent-1.1.5/PKG-INFO +255 -0
- forge_agent-1.1.5/README.md +212 -0
- forge_agent-1.1.5/forge/__init__.py +63 -0
- forge_agent-1.1.5/forge/brain/__init__.py +4 -0
- forge_agent-1.1.5/forge/brain/approval.py +111 -0
- forge_agent-1.1.5/forge/brain/composer.py +54 -0
- forge_agent-1.1.5/forge/brain/contracts.py +128 -0
- forge_agent-1.1.5/forge/brain/council.py +244 -0
- forge_agent-1.1.5/forge/brain/intent.py +331 -0
- forge_agent-1.1.5/forge/brain/mission_store.py +186 -0
- forge_agent-1.1.5/forge/brain/operator.py +716 -0
- forge_agent-1.1.5/forge/brain/orchestrator.py +1541 -0
- forge_agent-1.1.5/forge/brain/planner.py +992 -0
- forge_agent-1.1.5/forge/brain/prompt.py +62 -0
- forge_agent-1.1.5/forge/brain/worker_executor.py +139 -0
- forge_agent-1.1.5/forge/brain/worker_protocol.py +56 -0
- forge_agent-1.1.5/forge/brain/worker_runtime.py +395 -0
- forge_agent-1.1.5/forge/cli/__init__.py +0 -0
- forge_agent-1.1.5/forge/cli/main.py +561 -0
- forge_agent-1.1.5/forge/config/__init__.py +3 -0
- forge_agent-1.1.5/forge/config/settings.py +63 -0
- forge_agent-1.1.5/forge/core/__init__.py +0 -0
- forge_agent-1.1.5/forge/core/discovery.py +291 -0
- forge_agent-1.1.5/forge/core/models.py +164 -0
- forge_agent-1.1.5/forge/core/quota.py +252 -0
- forge_agent-1.1.5/forge/core/router.py +560 -0
- forge_agent-1.1.5/forge/core/session.py +309 -0
- forge_agent-1.1.5/forge/desktop/__init__.py +2 -0
- forge_agent-1.1.5/forge/desktop/account_client.py +149 -0
- forge_agent-1.1.5/forge/desktop/app.py +371 -0
- forge_agent-1.1.5/forge/desktop/diagnostics.py +23 -0
- forge_agent-1.1.5/forge/desktop/runtime.py +1447 -0
- forge_agent-1.1.5/forge/desktop/server.py +3261 -0
- forge_agent-1.1.5/forge/memory/__init__.py +4 -0
- forge_agent-1.1.5/forge/memory/context.py +65 -0
- forge_agent-1.1.5/forge/memory/graph.py +351 -0
- forge_agent-1.1.5/forge/providers/__init__.py +8 -0
- forge_agent-1.1.5/forge/providers/anthropic.py +128 -0
- forge_agent-1.1.5/forge/providers/base.py +324 -0
- forge_agent-1.1.5/forge/providers/cloudflare.py +173 -0
- forge_agent-1.1.5/forge/providers/deepseek.py +129 -0
- forge_agent-1.1.5/forge/providers/gemini.py +135 -0
- forge_agent-1.1.5/forge/providers/groq.py +159 -0
- forge_agent-1.1.5/forge/providers/mistral.py +133 -0
- forge_agent-1.1.5/forge/providers/nvidia.py +145 -0
- forge_agent-1.1.5/forge/providers/ollama.py +264 -0
- forge_agent-1.1.5/forge/providers/openai.py +164 -0
- forge_agent-1.1.5/forge/providers/openrouter.py +139 -0
- forge_agent-1.1.5/forge/providers/registry.py +44 -0
- forge_agent-1.1.5/forge/providers/together.py +141 -0
- forge_agent-1.1.5/forge/recovery/__init__.py +3 -0
- forge_agent-1.1.5/forge/recovery/manager.py +47 -0
- forge_agent-1.1.5/forge/runtime/__init__.py +28 -0
- forge_agent-1.1.5/forge/runtime/agent.py +200 -0
- forge_agent-1.1.5/forge/runtime/contracts.py +59 -0
- forge_agent-1.1.5/forge/runtime/gateway.py +190 -0
- forge_agent-1.1.5/forge/runtime/heartbeat.py +108 -0
- forge_agent-1.1.5/forge/runtime/lanes.py +129 -0
- forge_agent-1.1.5/forge/runtime/markdown_memory.py +265 -0
- forge_agent-1.1.5/forge/runtime/state_store.py +877 -0
- forge_agent-1.1.5/forge/runtime/worker_host.py +207 -0
- forge_agent-1.1.5/forge/safety/__init__.py +3 -0
- forge_agent-1.1.5/forge/safety/guard.py +156 -0
- forge_agent-1.1.5/forge/safety/sanitizer.py +78 -0
- forge_agent-1.1.5/forge/skills/__init__.py +5 -0
- forge_agent-1.1.5/forge/skills/contracts.py +69 -0
- forge_agent-1.1.5/forge/skills/loader.py +129 -0
- forge_agent-1.1.5/forge/skills/registry.py +294 -0
- forge_agent-1.1.5/forge/skills/router.py +391 -0
- forge_agent-1.1.5/forge/skills/runtime.py +86 -0
- forge_agent-1.1.5/forge/skills_catalog/_template/SKILL.md +50 -0
- forge_agent-1.1.5/forge/skills_catalog/affiliate-offer-analyzer/SKILL.md +54 -0
- forge_agent-1.1.5/forge/skills_catalog/affiliate-offer-analyzer/executor.py +26 -0
- forge_agent-1.1.5/forge/skills_catalog/affiliate-offer-analyzer/schema.json +69 -0
- forge_agent-1.1.5/forge/skills_catalog/artifact-writer/SKILL.md +55 -0
- forge_agent-1.1.5/forge/skills_catalog/artifact-writer/executor.py +74 -0
- forge_agent-1.1.5/forge/skills_catalog/artifact-writer/schema.json +67 -0
- forge_agent-1.1.5/forge/skills_catalog/browser-executor/SKILL.md +65 -0
- forge_agent-1.1.5/forge/skills_catalog/browser-executor/executor.py +143 -0
- forge_agent-1.1.5/forge/skills_catalog/browser-executor/schema.json +133 -0
- forge_agent-1.1.5/forge/skills_catalog/codebase-analyzer/SKILL.md +64 -0
- forge_agent-1.1.5/forge/skills_catalog/codebase-analyzer/executor.py +230 -0
- forge_agent-1.1.5/forge/skills_catalog/codebase-analyzer/schema.json +67 -0
- forge_agent-1.1.5/forge/skills_catalog/external-publisher/SKILL.md +63 -0
- forge_agent-1.1.5/forge/skills_catalog/external-publisher/executor.py +54 -0
- forge_agent-1.1.5/forge/skills_catalog/external-publisher/schema.json +90 -0
- forge_agent-1.1.5/forge/skills_catalog/file-editor/SKILL.md +68 -0
- forge_agent-1.1.5/forge/skills_catalog/file-editor/executor.py +223 -0
- forge_agent-1.1.5/forge/skills_catalog/file-editor/schema.json +106 -0
- forge_agent-1.1.5/forge/skills_catalog/file-reader/SKILL.md +60 -0
- forge_agent-1.1.5/forge/skills_catalog/file-reader/executor.py +85 -0
- forge_agent-1.1.5/forge/skills_catalog/file-reader/schema.json +61 -0
- forge_agent-1.1.5/forge/skills_catalog/github-publisher/SKILL.md +71 -0
- forge_agent-1.1.5/forge/skills_catalog/github-publisher/executor.py +65 -0
- forge_agent-1.1.5/forge/skills_catalog/github-publisher/schema.json +97 -0
- forge_agent-1.1.5/forge/skills_catalog/research-brief/SKILL.md +54 -0
- forge_agent-1.1.5/forge/skills_catalog/research-brief/executor.py +23 -0
- forge_agent-1.1.5/forge/skills_catalog/research-brief/schema.json +68 -0
- forge_agent-1.1.5/forge/skills_catalog/seo-article-writer/SKILL.md +54 -0
- forge_agent-1.1.5/forge/skills_catalog/seo-article-writer/executor.py +24 -0
- forge_agent-1.1.5/forge/skills_catalog/seo-article-writer/schema.json +64 -0
- forge_agent-1.1.5/forge/skills_catalog/shell-executor/SKILL.md +65 -0
- forge_agent-1.1.5/forge/skills_catalog/shell-executor/executor.py +80 -0
- forge_agent-1.1.5/forge/skills_catalog/shell-executor/schema.json +84 -0
- forge_agent-1.1.5/forge/skills_catalog/system-inspector/SKILL.md +62 -0
- forge_agent-1.1.5/forge/skills_catalog/system-inspector/executor.py +93 -0
- forge_agent-1.1.5/forge/skills_catalog/system-inspector/schema.json +83 -0
- forge_agent-1.1.5/forge/skills_catalog/wordpress-publisher/SKILL.md +73 -0
- forge_agent-1.1.5/forge/skills_catalog/wordpress-publisher/executor.py +68 -0
- forge_agent-1.1.5/forge/skills_catalog/wordpress-publisher/schema.json +101 -0
- forge_agent-1.1.5/forge/skills_catalog/workspace-inspector/SKILL.md +55 -0
- forge_agent-1.1.5/forge/skills_catalog/workspace-inspector/executor.py +24 -0
- forge_agent-1.1.5/forge/skills_catalog/workspace-inspector/schema.json +72 -0
- forge_agent-1.1.5/forge/tools/__init__.py +15 -0
- forge_agent-1.1.5/forge/tools/browser.py +600 -0
- forge_agent-1.1.5/forge/tools/credentials.py +70 -0
- forge_agent-1.1.5/forge/tools/github.py +190 -0
- forge_agent-1.1.5/forge/tools/publish.py +50 -0
- forge_agent-1.1.5/forge/tools/shell.py +152 -0
- forge_agent-1.1.5/forge/tools/system.py +219 -0
- forge_agent-1.1.5/forge/tools/wordpress.py +159 -0
- forge_agent-1.1.5/forge/tools/workspace.py +422 -0
- forge_agent-1.1.5/forge/validation/__init__.py +11 -0
- forge_agent-1.1.5/forge/validation/json_validator.py +64 -0
- forge_agent-1.1.5/forge/validation/validator.py +273 -0
- forge_agent-1.1.5/forge_agent.egg-info/PKG-INFO +255 -0
- forge_agent-1.1.5/forge_agent.egg-info/SOURCES.txt +132 -0
- forge_agent-1.1.5/forge_agent.egg-info/dependency_links.txt +1 -0
- forge_agent-1.1.5/forge_agent.egg-info/entry_points.txt +2 -0
- forge_agent-1.1.5/forge_agent.egg-info/requires.txt +23 -0
- forge_agent-1.1.5/forge_agent.egg-info/top_level.txt +1 -0
- forge_agent-1.1.5/pyproject.toml +73 -0
- forge_agent-1.1.5/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 TREN Studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: forge-agent
|
|
3
|
+
Version: 1.1.5
|
|
4
|
+
Summary: The world's most powerful free AI agent. Self-evolving. Zero cost. Forever.
|
|
5
|
+
Author-email: TREN Studio <hello@trenstudio.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://www.trenstudio.com/FORGE
|
|
8
|
+
Project-URL: Repository, https://github.com/TREN-Studio/FORGE
|
|
9
|
+
Project-URL: Issues, https://github.com/TREN-Studio/FORGE/issues
|
|
10
|
+
Keywords: ai,agent,llm,free,open-source,forge
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: httpx>=0.27
|
|
22
|
+
Requires-Dist: rich>=13.7
|
|
23
|
+
Requires-Dist: typer>=0.12
|
|
24
|
+
Requires-Dist: pydantic>=2.6
|
|
25
|
+
Requires-Dist: sqlmodel>=0.0.18
|
|
26
|
+
Requires-Dist: aiohttp>=3.9
|
|
27
|
+
Requires-Dist: tenacity>=8.3
|
|
28
|
+
Requires-Dist: diskcache>=5.6
|
|
29
|
+
Requires-Dist: python-dotenv>=1.0
|
|
30
|
+
Requires-Dist: tiktoken>=0.7
|
|
31
|
+
Requires-Dist: colorama>=0.4
|
|
32
|
+
Requires-Dist: cryptography>=42
|
|
33
|
+
Provides-Extra: tools
|
|
34
|
+
Requires-Dist: playwright>=1.44; extra == "tools"
|
|
35
|
+
Requires-Dist: beautifulsoup4>=4.12; extra == "tools"
|
|
36
|
+
Requires-Dist: duckduckgo-search>=6.2; extra == "tools"
|
|
37
|
+
Provides-Extra: dev
|
|
38
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
40
|
+
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
41
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# FORGE
|
|
45
|
+
|
|
46
|
+
**Free Open Reasoning and Generation Engine**
|
|
47
|
+
|
|
48
|
+
FORGE is an English-first, multilingual AI operator that routes across free and local models, chooses the best execution path for the task, and runs through a modular skill system built for real-world work.
|
|
49
|
+
|
|
50
|
+
[](LICENSE)
|
|
51
|
+
[](https://python.org)
|
|
52
|
+
[](https://www.trenstudio.com/FORGE)
|
|
53
|
+
|
|
54
|
+
## Why FORGE
|
|
55
|
+
|
|
56
|
+
- English-first product surface with multilingual task support.
|
|
57
|
+
- Smart model routing across free providers and local runtimes.
|
|
58
|
+
- Skill-based execution brain with planning, safety, validation, and recovery.
|
|
59
|
+
- Persistent context and memory for long-running operator workflows.
|
|
60
|
+
- Safe artifact generation for reports, analysis outputs, and execution traces.
|
|
61
|
+
|
|
62
|
+
## Core Capabilities
|
|
63
|
+
|
|
64
|
+
### Universal Model Routing
|
|
65
|
+
|
|
66
|
+
FORGE connects to multiple providers and local runtimes, scores candidates for the active task, and selects the strongest available path.
|
|
67
|
+
|
|
68
|
+
### Skill-Based Operator Brain
|
|
69
|
+
|
|
70
|
+
The operator is split into explicit layers:
|
|
71
|
+
|
|
72
|
+
1. Intent resolution
|
|
73
|
+
2. Structured planning
|
|
74
|
+
3. Skill routing
|
|
75
|
+
4. Safety guard
|
|
76
|
+
5. Execution runtime
|
|
77
|
+
6. Validation
|
|
78
|
+
7. Recovery and fallback
|
|
79
|
+
8. Response composition
|
|
80
|
+
|
|
81
|
+
### Grounded Local Execution
|
|
82
|
+
|
|
83
|
+
FORGE can inspect a workspace, read files safely, analyze the codebase with evidence, and write output artifacts without mutating source files.
|
|
84
|
+
|
|
85
|
+
## Architecture
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
forge/
|
|
89
|
+
brain/ Core orchestration brain
|
|
90
|
+
core/ Provider routing, quotas, discovery, session runtime
|
|
91
|
+
memory/ Session and persistent context
|
|
92
|
+
providers/ Provider adapters
|
|
93
|
+
recovery/ Retry and fallback handling
|
|
94
|
+
safety/ Risk policy and confirmation logic
|
|
95
|
+
skills/ Skill contracts, registry, loader, router, runtime
|
|
96
|
+
skills_catalog/Pluggable skill folders
|
|
97
|
+
tools/ Safe local execution tools
|
|
98
|
+
validation/ Output and completion validation
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Skill System
|
|
102
|
+
|
|
103
|
+
Every skill is self-contained in its own folder:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
skills_catalog/<skill-name>/
|
|
107
|
+
SKILL.md
|
|
108
|
+
schema.json # optional
|
|
109
|
+
executor.py # optional
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
This makes new skills pluggable without rewriting the core brain.
|
|
113
|
+
|
|
114
|
+
## Install
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pip install forge-agent
|
|
118
|
+
forge --version
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Quick Start
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
forge --version
|
|
125
|
+
forge status
|
|
126
|
+
forge discover
|
|
127
|
+
forge operate "Analyze this repository and save a summary file"
|
|
128
|
+
forge operate "Read forge/brain/operator.py and explain the execution flow"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Current Python package target: `1.1.5`.
|
|
132
|
+
|
|
133
|
+
## Python API
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
import forge
|
|
137
|
+
|
|
138
|
+
result = forge.operate("Analyze this project and save a summary file")
|
|
139
|
+
print(result.result)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Safety Model
|
|
143
|
+
|
|
144
|
+
- Untrusted external skills do not run automatically.
|
|
145
|
+
- Medium-risk actions can be forced into dry-run mode.
|
|
146
|
+
- High-risk actions require confirmation.
|
|
147
|
+
- Validation runs before success is reported.
|
|
148
|
+
- FORGE never claims execution without evidence.
|
|
149
|
+
|
|
150
|
+
## Status
|
|
151
|
+
|
|
152
|
+
Current foundation includes:
|
|
153
|
+
|
|
154
|
+
- model routing and provider registry
|
|
155
|
+
- quota management and model discovery
|
|
156
|
+
- skill registry and skill router
|
|
157
|
+
- skill governance metadata, precondition checks, and gated Tier 4 routing
|
|
158
|
+
- live desktop execution streaming with visible plan and step progress
|
|
159
|
+
- safety, validation, and recovery layers
|
|
160
|
+
- grounded workspace analysis and file reading skills
|
|
161
|
+
|
|
162
|
+
## Windows Releases
|
|
163
|
+
|
|
164
|
+
- Current public release line: `1.1.4`.
|
|
165
|
+
- GitHub's latest stable release must also resolve to `v1.1.4`; prerelease engineering snapshots such as `v1.1.5-AgentReality` are not canonical install releases.
|
|
166
|
+
- The canonical public download source is the GitHub Release for the matching tag: https://github.com/TREN-Studio/FORGE/releases/tag/v1.1.4
|
|
167
|
+
- The release workflow in `.github/workflows/release_forge_windows.yml` builds `FORGE-Desktop.exe`, `FORGE-Setup-<version>.exe`, the portable ZIP, the source ZIP, `SHA256SUMS-<version>.txt`, and `release-manifest.json` from one pipeline.
|
|
168
|
+
- That same pipeline publishes the assets to GitHub Release and mirrors the exact same bytes to `https://www.trenstudio.com/FORGE/downloads/` when Hostinger secrets are configured.
|
|
169
|
+
- The supported desktop build entrypoint is `python tools/build_windows_desktop.py`; that script is the source of truth for orchestration and invokes the portable `FORGE-Desktop.spec`.
|
|
170
|
+
- Release packaging runs through `python tools/package_release_assets.py`, which writes release assets under `release-assets/` only. It does not publish or sync binary files into `site/downloads/`.
|
|
171
|
+
- The public downloads page at `site/downloads/index.html` reads `release-manifest.json`, generated from the canonical GitHub Release or from the release pipeline, and prefers verified official-site mirror URLs while preserving GitHub URLs as the canonical reference.
|
|
172
|
+
- `python tools/verify_release_public_assets.py --manifest release-assets/release-manifest.json --require-mirror` verifies version, size, SHA256, GitHub Release presence, and byte identity for the Hostinger mirror.
|
|
173
|
+
- `tools/deploy_hostinger_site.py` deploys the downloads page and portal only; the TREN Studio root page owns `https://www.trenstudio.com/FORGE/`, and the release workflow owns `release-manifest.json` plus mirrored binary files on Hostinger.
|
|
174
|
+
- Legacy desktop spec variants were removed. `FORGE-Desktop.spec` is the only supported PyInstaller spec.
|
|
175
|
+
- If `WINDOWS_PFX_BASE64` and `WINDOWS_PFX_PASSWORD` are configured in GitHub Secrets, the workflow signs both artifacts before publishing the GitHub Release.
|
|
176
|
+
- Until code signing is configured, Windows SmartScreen and local execution reputation checks can still block downloaded installers.
|
|
177
|
+
|
|
178
|
+
## Roadmap
|
|
179
|
+
|
|
180
|
+
1. Add guarded file editing and patch execution
|
|
181
|
+
2. Add web research and publishing skills
|
|
182
|
+
3. Add audit logs and evidence snapshots for every action
|
|
183
|
+
4. Add richer test coverage and benchmark suites
|
|
184
|
+
|
|
185
|
+
## Contributing
|
|
186
|
+
|
|
187
|
+
FORGE is designed as an open-source operator platform. Contributions should preserve:
|
|
188
|
+
|
|
189
|
+
- modular contracts
|
|
190
|
+
- safety-by-default behavior
|
|
191
|
+
- grounded execution
|
|
192
|
+
- production-oriented output quality
|
|
193
|
+
|
|
194
|
+
## License
|
|
195
|
+
|
|
196
|
+
MIT
|
|
197
|
+
|
|
198
|
+
## Links
|
|
199
|
+
|
|
200
|
+
- Website: https://www.trenstudio.com/FORGE
|
|
201
|
+
- Downloads: https://www.trenstudio.com/FORGE/downloads/
|
|
202
|
+
- Organization: https://github.com/TREN-Studio
|
|
203
|
+
- Repository: https://github.com/TREN-Studio/FORGE
|
|
204
|
+
|
|
205
|
+
## Production Deployment
|
|
206
|
+
|
|
207
|
+
FORGE keeps its public downloads page and portal bundle inside [`site/`](site). The production page at `https://www.trenstudio.com/FORGE/` remains the TREN Studio project page; the FORGE download interface lives at `https://www.trenstudio.com/FORGE/downloads/` and is deployed from `site/downloads/index.html`.
|
|
208
|
+
|
|
209
|
+
GitHub Release is the canonical release record. Hostinger may serve an official mirror under `https://www.trenstudio.com/FORGE/downloads/`, but only when the files are copied from the same CI-built release assets and pass SHA256, file size, version, and byte-identity verification.
|
|
210
|
+
|
|
211
|
+
The current public download set is:
|
|
212
|
+
|
|
213
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/FORGE-Desktop.exe`
|
|
214
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/FORGE-Setup-1.1.4.exe`
|
|
215
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/FORGE-Windows-Portable-1.1.4.zip`
|
|
216
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/FORGE-Source-v1.1.4.zip`
|
|
217
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/SHA256SUMS-1.1.4.txt`
|
|
218
|
+
|
|
219
|
+
The matching official-site mirror paths, when present, are:
|
|
220
|
+
|
|
221
|
+
- `https://www.trenstudio.com/FORGE/downloads/FORGE-Desktop.exe`
|
|
222
|
+
- `https://www.trenstudio.com/FORGE/downloads/FORGE-Setup-1.1.4.exe`
|
|
223
|
+
- `https://www.trenstudio.com/FORGE/downloads/FORGE-Windows-Portable-1.1.4.zip`
|
|
224
|
+
- `https://www.trenstudio.com/FORGE/downloads/FORGE-Source-v1.1.4.zip`
|
|
225
|
+
- `https://www.trenstudio.com/FORGE/downloads/SHA256SUMS-1.1.4.txt`
|
|
226
|
+
|
|
227
|
+
### Auto-Deploy Pipeline
|
|
228
|
+
|
|
229
|
+
GitHub Actions workflow: [`.github/workflows/deploy_forge_site.yml`](.github/workflows/deploy_forge_site.yml)
|
|
230
|
+
|
|
231
|
+
Deployment script: [`tools/deploy_hostinger_site.py`](tools/deploy_hostinger_site.py). It preserves the remote `/FORGE/index.html` root page unless this repository explicitly adds a root `site/index.html`.
|
|
232
|
+
|
|
233
|
+
Deploy guard: the script refuses to deploy `site/index.html` to `/FORGE/index.html` unless `--allow-root-index-deploy` or `FORGE_ALLOW_ROOT_INDEX_DEPLOY=1` is provided. Normal downloads/portal deploys also compare the remote `/FORGE/index.html` hash before and after upload and fail if it changes.
|
|
234
|
+
|
|
235
|
+
Route verification: [`tools/verify_forge_public_routes.py`](tools/verify_forge_public_routes.py) checks that `/FORGE/` is still the original project page, `/FORGE/downloads/` is still the downloads page, and the public `release-manifest.json` matches the expected release manifest.
|
|
236
|
+
|
|
237
|
+
Required GitHub repository secrets:
|
|
238
|
+
|
|
239
|
+
- `HOSTINGER_HOST`
|
|
240
|
+
- `HOSTINGER_PORT`
|
|
241
|
+
- `HOSTINGER_USERNAME`
|
|
242
|
+
- `HOSTINGER_PASSWORD`
|
|
243
|
+
- `HOSTINGER_REMOTE_ROOT`
|
|
244
|
+
|
|
245
|
+
Recommended `HOSTINGER_REMOTE_ROOT` value:
|
|
246
|
+
|
|
247
|
+
```text
|
|
248
|
+
domains/trenstudio.com/public_html/FORGE
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Manual local deploy remains available:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
python tools/deploy_hostinger_site.py
|
|
255
|
+
```
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# FORGE
|
|
2
|
+
|
|
3
|
+
**Free Open Reasoning and Generation Engine**
|
|
4
|
+
|
|
5
|
+
FORGE is an English-first, multilingual AI operator that routes across free and local models, chooses the best execution path for the task, and runs through a modular skill system built for real-world work.
|
|
6
|
+
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://python.org)
|
|
9
|
+
[](https://www.trenstudio.com/FORGE)
|
|
10
|
+
|
|
11
|
+
## Why FORGE
|
|
12
|
+
|
|
13
|
+
- English-first product surface with multilingual task support.
|
|
14
|
+
- Smart model routing across free providers and local runtimes.
|
|
15
|
+
- Skill-based execution brain with planning, safety, validation, and recovery.
|
|
16
|
+
- Persistent context and memory for long-running operator workflows.
|
|
17
|
+
- Safe artifact generation for reports, analysis outputs, and execution traces.
|
|
18
|
+
|
|
19
|
+
## Core Capabilities
|
|
20
|
+
|
|
21
|
+
### Universal Model Routing
|
|
22
|
+
|
|
23
|
+
FORGE connects to multiple providers and local runtimes, scores candidates for the active task, and selects the strongest available path.
|
|
24
|
+
|
|
25
|
+
### Skill-Based Operator Brain
|
|
26
|
+
|
|
27
|
+
The operator is split into explicit layers:
|
|
28
|
+
|
|
29
|
+
1. Intent resolution
|
|
30
|
+
2. Structured planning
|
|
31
|
+
3. Skill routing
|
|
32
|
+
4. Safety guard
|
|
33
|
+
5. Execution runtime
|
|
34
|
+
6. Validation
|
|
35
|
+
7. Recovery and fallback
|
|
36
|
+
8. Response composition
|
|
37
|
+
|
|
38
|
+
### Grounded Local Execution
|
|
39
|
+
|
|
40
|
+
FORGE can inspect a workspace, read files safely, analyze the codebase with evidence, and write output artifacts without mutating source files.
|
|
41
|
+
|
|
42
|
+
## Architecture
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
forge/
|
|
46
|
+
brain/ Core orchestration brain
|
|
47
|
+
core/ Provider routing, quotas, discovery, session runtime
|
|
48
|
+
memory/ Session and persistent context
|
|
49
|
+
providers/ Provider adapters
|
|
50
|
+
recovery/ Retry and fallback handling
|
|
51
|
+
safety/ Risk policy and confirmation logic
|
|
52
|
+
skills/ Skill contracts, registry, loader, router, runtime
|
|
53
|
+
skills_catalog/Pluggable skill folders
|
|
54
|
+
tools/ Safe local execution tools
|
|
55
|
+
validation/ Output and completion validation
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Skill System
|
|
59
|
+
|
|
60
|
+
Every skill is self-contained in its own folder:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
skills_catalog/<skill-name>/
|
|
64
|
+
SKILL.md
|
|
65
|
+
schema.json # optional
|
|
66
|
+
executor.py # optional
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This makes new skills pluggable without rewriting the core brain.
|
|
70
|
+
|
|
71
|
+
## Install
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pip install forge-agent
|
|
75
|
+
forge --version
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Quick Start
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
forge --version
|
|
82
|
+
forge status
|
|
83
|
+
forge discover
|
|
84
|
+
forge operate "Analyze this repository and save a summary file"
|
|
85
|
+
forge operate "Read forge/brain/operator.py and explain the execution flow"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Current Python package target: `1.1.5`.
|
|
89
|
+
|
|
90
|
+
## Python API
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
import forge
|
|
94
|
+
|
|
95
|
+
result = forge.operate("Analyze this project and save a summary file")
|
|
96
|
+
print(result.result)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Safety Model
|
|
100
|
+
|
|
101
|
+
- Untrusted external skills do not run automatically.
|
|
102
|
+
- Medium-risk actions can be forced into dry-run mode.
|
|
103
|
+
- High-risk actions require confirmation.
|
|
104
|
+
- Validation runs before success is reported.
|
|
105
|
+
- FORGE never claims execution without evidence.
|
|
106
|
+
|
|
107
|
+
## Status
|
|
108
|
+
|
|
109
|
+
Current foundation includes:
|
|
110
|
+
|
|
111
|
+
- model routing and provider registry
|
|
112
|
+
- quota management and model discovery
|
|
113
|
+
- skill registry and skill router
|
|
114
|
+
- skill governance metadata, precondition checks, and gated Tier 4 routing
|
|
115
|
+
- live desktop execution streaming with visible plan and step progress
|
|
116
|
+
- safety, validation, and recovery layers
|
|
117
|
+
- grounded workspace analysis and file reading skills
|
|
118
|
+
|
|
119
|
+
## Windows Releases
|
|
120
|
+
|
|
121
|
+
- Current public release line: `1.1.4`.
|
|
122
|
+
- GitHub's latest stable release must also resolve to `v1.1.4`; prerelease engineering snapshots such as `v1.1.5-AgentReality` are not canonical install releases.
|
|
123
|
+
- The canonical public download source is the GitHub Release for the matching tag: https://github.com/TREN-Studio/FORGE/releases/tag/v1.1.4
|
|
124
|
+
- The release workflow in `.github/workflows/release_forge_windows.yml` builds `FORGE-Desktop.exe`, `FORGE-Setup-<version>.exe`, the portable ZIP, the source ZIP, `SHA256SUMS-<version>.txt`, and `release-manifest.json` from one pipeline.
|
|
125
|
+
- That same pipeline publishes the assets to GitHub Release and mirrors the exact same bytes to `https://www.trenstudio.com/FORGE/downloads/` when Hostinger secrets are configured.
|
|
126
|
+
- The supported desktop build entrypoint is `python tools/build_windows_desktop.py`; that script is the source of truth for orchestration and invokes the portable `FORGE-Desktop.spec`.
|
|
127
|
+
- Release packaging runs through `python tools/package_release_assets.py`, which writes release assets under `release-assets/` only. It does not publish or sync binary files into `site/downloads/`.
|
|
128
|
+
- The public downloads page at `site/downloads/index.html` reads `release-manifest.json`, generated from the canonical GitHub Release or from the release pipeline, and prefers verified official-site mirror URLs while preserving GitHub URLs as the canonical reference.
|
|
129
|
+
- `python tools/verify_release_public_assets.py --manifest release-assets/release-manifest.json --require-mirror` verifies version, size, SHA256, GitHub Release presence, and byte identity for the Hostinger mirror.
|
|
130
|
+
- `tools/deploy_hostinger_site.py` deploys the downloads page and portal only; the TREN Studio root page owns `https://www.trenstudio.com/FORGE/`, and the release workflow owns `release-manifest.json` plus mirrored binary files on Hostinger.
|
|
131
|
+
- Legacy desktop spec variants were removed. `FORGE-Desktop.spec` is the only supported PyInstaller spec.
|
|
132
|
+
- If `WINDOWS_PFX_BASE64` and `WINDOWS_PFX_PASSWORD` are configured in GitHub Secrets, the workflow signs both artifacts before publishing the GitHub Release.
|
|
133
|
+
- Until code signing is configured, Windows SmartScreen and local execution reputation checks can still block downloaded installers.
|
|
134
|
+
|
|
135
|
+
## Roadmap
|
|
136
|
+
|
|
137
|
+
1. Add guarded file editing and patch execution
|
|
138
|
+
2. Add web research and publishing skills
|
|
139
|
+
3. Add audit logs and evidence snapshots for every action
|
|
140
|
+
4. Add richer test coverage and benchmark suites
|
|
141
|
+
|
|
142
|
+
## Contributing
|
|
143
|
+
|
|
144
|
+
FORGE is designed as an open-source operator platform. Contributions should preserve:
|
|
145
|
+
|
|
146
|
+
- modular contracts
|
|
147
|
+
- safety-by-default behavior
|
|
148
|
+
- grounded execution
|
|
149
|
+
- production-oriented output quality
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT
|
|
154
|
+
|
|
155
|
+
## Links
|
|
156
|
+
|
|
157
|
+
- Website: https://www.trenstudio.com/FORGE
|
|
158
|
+
- Downloads: https://www.trenstudio.com/FORGE/downloads/
|
|
159
|
+
- Organization: https://github.com/TREN-Studio
|
|
160
|
+
- Repository: https://github.com/TREN-Studio/FORGE
|
|
161
|
+
|
|
162
|
+
## Production Deployment
|
|
163
|
+
|
|
164
|
+
FORGE keeps its public downloads page and portal bundle inside [`site/`](site). The production page at `https://www.trenstudio.com/FORGE/` remains the TREN Studio project page; the FORGE download interface lives at `https://www.trenstudio.com/FORGE/downloads/` and is deployed from `site/downloads/index.html`.
|
|
165
|
+
|
|
166
|
+
GitHub Release is the canonical release record. Hostinger may serve an official mirror under `https://www.trenstudio.com/FORGE/downloads/`, but only when the files are copied from the same CI-built release assets and pass SHA256, file size, version, and byte-identity verification.
|
|
167
|
+
|
|
168
|
+
The current public download set is:
|
|
169
|
+
|
|
170
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/FORGE-Desktop.exe`
|
|
171
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/FORGE-Setup-1.1.4.exe`
|
|
172
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/FORGE-Windows-Portable-1.1.4.zip`
|
|
173
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/FORGE-Source-v1.1.4.zip`
|
|
174
|
+
- `https://github.com/TREN-Studio/FORGE/releases/download/v1.1.4/SHA256SUMS-1.1.4.txt`
|
|
175
|
+
|
|
176
|
+
The matching official-site mirror paths, when present, are:
|
|
177
|
+
|
|
178
|
+
- `https://www.trenstudio.com/FORGE/downloads/FORGE-Desktop.exe`
|
|
179
|
+
- `https://www.trenstudio.com/FORGE/downloads/FORGE-Setup-1.1.4.exe`
|
|
180
|
+
- `https://www.trenstudio.com/FORGE/downloads/FORGE-Windows-Portable-1.1.4.zip`
|
|
181
|
+
- `https://www.trenstudio.com/FORGE/downloads/FORGE-Source-v1.1.4.zip`
|
|
182
|
+
- `https://www.trenstudio.com/FORGE/downloads/SHA256SUMS-1.1.4.txt`
|
|
183
|
+
|
|
184
|
+
### Auto-Deploy Pipeline
|
|
185
|
+
|
|
186
|
+
GitHub Actions workflow: [`.github/workflows/deploy_forge_site.yml`](.github/workflows/deploy_forge_site.yml)
|
|
187
|
+
|
|
188
|
+
Deployment script: [`tools/deploy_hostinger_site.py`](tools/deploy_hostinger_site.py). It preserves the remote `/FORGE/index.html` root page unless this repository explicitly adds a root `site/index.html`.
|
|
189
|
+
|
|
190
|
+
Deploy guard: the script refuses to deploy `site/index.html` to `/FORGE/index.html` unless `--allow-root-index-deploy` or `FORGE_ALLOW_ROOT_INDEX_DEPLOY=1` is provided. Normal downloads/portal deploys also compare the remote `/FORGE/index.html` hash before and after upload and fail if it changes.
|
|
191
|
+
|
|
192
|
+
Route verification: [`tools/verify_forge_public_routes.py`](tools/verify_forge_public_routes.py) checks that `/FORGE/` is still the original project page, `/FORGE/downloads/` is still the downloads page, and the public `release-manifest.json` matches the expected release manifest.
|
|
193
|
+
|
|
194
|
+
Required GitHub repository secrets:
|
|
195
|
+
|
|
196
|
+
- `HOSTINGER_HOST`
|
|
197
|
+
- `HOSTINGER_PORT`
|
|
198
|
+
- `HOSTINGER_USERNAME`
|
|
199
|
+
- `HOSTINGER_PASSWORD`
|
|
200
|
+
- `HOSTINGER_REMOTE_ROOT`
|
|
201
|
+
|
|
202
|
+
Recommended `HOSTINGER_REMOTE_ROOT` value:
|
|
203
|
+
|
|
204
|
+
```text
|
|
205
|
+
domains/trenstudio.com/public_html/FORGE
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Manual local deploy remains available:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
python tools/deploy_hostinger_site.py
|
|
212
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""
|
|
2
|
+
FORGE — Free Open Reasoning & Generation Engine
|
|
3
|
+
================================================
|
|
4
|
+
The world's most powerful free AI agent.
|
|
5
|
+
Self-evolving. Zero cost. Forever.
|
|
6
|
+
|
|
7
|
+
forge.ask("write me a web scraper") # auto-selects best free model
|
|
8
|
+
forge.code("fix this bug", file="x.py") # routes to coding specialist
|
|
9
|
+
forge.research("quantum computing") # deep multi-model research
|
|
10
|
+
|
|
11
|
+
GitHub : https://github.com/trenstudio/forge
|
|
12
|
+
Website: https://www.trenstudio.com/FORGE
|
|
13
|
+
License: MIT
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
__version__ = "1.1.5"
|
|
17
|
+
__author__ = "TREN Studio"
|
|
18
|
+
__license__ = "MIT"
|
|
19
|
+
|
|
20
|
+
from forge.core.router import ForgeRouter
|
|
21
|
+
from forge.core.session import ForgeSession
|
|
22
|
+
from forge.brain.operator import ForgeOperator
|
|
23
|
+
from forge.memory.graph import MemoryGraph
|
|
24
|
+
from forge.runtime import ForgeAgentRuntime
|
|
25
|
+
|
|
26
|
+
# One-line convenience API
|
|
27
|
+
_default_session: ForgeSession | None = None
|
|
28
|
+
|
|
29
|
+
def _session() -> ForgeSession:
|
|
30
|
+
global _default_session
|
|
31
|
+
if _default_session is None:
|
|
32
|
+
_default_session = ForgeSession()
|
|
33
|
+
return _default_session
|
|
34
|
+
|
|
35
|
+
def ask(prompt: str, **kwargs) -> str:
|
|
36
|
+
"""Send a prompt. FORGE picks the best free model automatically."""
|
|
37
|
+
return _session().ask(prompt, **kwargs)
|
|
38
|
+
|
|
39
|
+
def code(prompt: str, **kwargs) -> str:
|
|
40
|
+
"""Coding task — routed to the strongest available coding model."""
|
|
41
|
+
return _session().ask(prompt, task_type="code", **kwargs)
|
|
42
|
+
|
|
43
|
+
def research(prompt: str, **kwargs) -> str:
|
|
44
|
+
"""Deep research task with optional web search."""
|
|
45
|
+
return _session().ask(prompt, task_type="research", **kwargs)
|
|
46
|
+
|
|
47
|
+
def operate(prompt: str, **kwargs) -> str:
|
|
48
|
+
"""Run the skill-based operator brain."""
|
|
49
|
+
operator = ForgeOperator()
|
|
50
|
+
return operator.handle_as_text(prompt, **kwargs)
|
|
51
|
+
|
|
52
|
+
__all__ = [
|
|
53
|
+
"__version__",
|
|
54
|
+
"ForgeRouter",
|
|
55
|
+
"ForgeSession",
|
|
56
|
+
"ForgeOperator",
|
|
57
|
+
"ForgeAgentRuntime",
|
|
58
|
+
"MemoryGraph",
|
|
59
|
+
"ask",
|
|
60
|
+
"code",
|
|
61
|
+
"operate",
|
|
62
|
+
"research",
|
|
63
|
+
]
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from forge.runtime.state_store import PersistentStateStore
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
AUTO_APPROVE_CLASSES = {"local_readonly"}
|
|
10
|
+
HUMAN_APPROVAL_CLASSES = {
|
|
11
|
+
"network_post",
|
|
12
|
+
"network_egress",
|
|
13
|
+
"authenticated_browser",
|
|
14
|
+
"external_publish",
|
|
15
|
+
"sensitive_file_write",
|
|
16
|
+
"destructive_shell",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass(slots=True)
|
|
21
|
+
class ApprovalDecision:
|
|
22
|
+
allowed: bool
|
|
23
|
+
approval_required: bool
|
|
24
|
+
approval_id: str | None
|
|
25
|
+
approval_class: str | None
|
|
26
|
+
notes: list[str]
|
|
27
|
+
status: str
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ApprovalPolicyEngine:
|
|
31
|
+
"""Policy + encrypted payload approval flow."""
|
|
32
|
+
|
|
33
|
+
def __init__(self, store: PersistentStateStore) -> None:
|
|
34
|
+
self._store = store
|
|
35
|
+
|
|
36
|
+
def evaluate(
|
|
37
|
+
self,
|
|
38
|
+
*,
|
|
39
|
+
mission_id: str,
|
|
40
|
+
step_id: str,
|
|
41
|
+
approval_class: str | None,
|
|
42
|
+
request_excerpt: str,
|
|
43
|
+
payload: dict[str, Any],
|
|
44
|
+
summary: str,
|
|
45
|
+
confirmed: bool,
|
|
46
|
+
) -> ApprovalDecision:
|
|
47
|
+
if not approval_class:
|
|
48
|
+
return ApprovalDecision(True, False, None, None, [], "allowed")
|
|
49
|
+
|
|
50
|
+
if approval_class in AUTO_APPROVE_CLASSES:
|
|
51
|
+
return ApprovalDecision(
|
|
52
|
+
True,
|
|
53
|
+
False,
|
|
54
|
+
None,
|
|
55
|
+
approval_class,
|
|
56
|
+
[f"Approval class `{approval_class}` auto-approved by policy."],
|
|
57
|
+
"auto_approved",
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
if confirmed:
|
|
61
|
+
return ApprovalDecision(
|
|
62
|
+
True,
|
|
63
|
+
False,
|
|
64
|
+
None,
|
|
65
|
+
approval_class,
|
|
66
|
+
[f"Approval class `{approval_class}` approved explicitly by operator input."],
|
|
67
|
+
"confirmed",
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
if approval_class in HUMAN_APPROVAL_CLASSES:
|
|
71
|
+
approval_id = self._store.create_pending_approval(
|
|
72
|
+
mission_id=mission_id,
|
|
73
|
+
step_id=step_id,
|
|
74
|
+
approval_class=approval_class,
|
|
75
|
+
request_excerpt=request_excerpt[:500],
|
|
76
|
+
payload=payload,
|
|
77
|
+
summary=summary,
|
|
78
|
+
policy_mode="human_approval",
|
|
79
|
+
)
|
|
80
|
+
return ApprovalDecision(
|
|
81
|
+
False,
|
|
82
|
+
True,
|
|
83
|
+
approval_id,
|
|
84
|
+
approval_class,
|
|
85
|
+
[
|
|
86
|
+
f"Approval class: {approval_class}. Human confirmation is required before execution.",
|
|
87
|
+
f"Approval request created: {approval_id}.",
|
|
88
|
+
],
|
|
89
|
+
"pending",
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return ApprovalDecision(
|
|
93
|
+
True,
|
|
94
|
+
False,
|
|
95
|
+
None,
|
|
96
|
+
approval_class,
|
|
97
|
+
[f"Approval class `{approval_class}` allowed by current policy."],
|
|
98
|
+
"allowed",
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
def approval_status(self, approval_id: str) -> dict[str, Any] | None:
|
|
102
|
+
return self._store.get_approval(approval_id, include_payload=False)
|
|
103
|
+
|
|
104
|
+
def approve(self, approval_id: str, *, notes: str = "") -> dict[str, Any] | None:
|
|
105
|
+
return self._store.decide_approval(approval_id, approved=True, notes=notes)
|
|
106
|
+
|
|
107
|
+
def reject(self, approval_id: str, *, notes: str = "") -> dict[str, Any] | None:
|
|
108
|
+
return self._store.decide_approval(approval_id, approved=False, notes=notes)
|
|
109
|
+
|
|
110
|
+
def list_pending(self) -> list[dict[str, Any]]:
|
|
111
|
+
return self._store.list_approvals(status="pending")
|