agilab 0.0.1__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.
- agilab-0.0.1/LICENSE +22 -0
- agilab-0.0.1/MANIFEST.in +12 -0
- agilab-0.0.1/PKG-INFO +48 -0
- agilab-0.0.1/README.md +19 -0
- agilab-0.0.1/SECURITY.md +34 -0
- agilab-0.0.1/cryptobox.png +0 -0
- agilab-0.0.1/install.ps1 +237 -0
- agilab-0.0.1/install.sh +372 -0
- agilab-0.0.1/pyproject.toml +78 -0
- agilab-0.0.1/setup.cfg +4 -0
- agilab-0.0.1/src/agilab.egg-info/PKG-INFO +48 -0
- agilab-0.0.1/src/agilab.egg-info/SOURCES.txt +58 -0
- agilab-0.0.1/src/agilab.egg-info/dependency_links.txt +1 -0
- agilab-0.0.1/src/agilab.egg-info/requires.txt +8 -0
- agilab-0.0.1/src/agilab.egg-info/top_level.txt +2 -0
- agilab-0.0.1/src/apps/agent-app-template/src/agent_app/__init__.py +1 -0
- agilab-0.0.1/src/apps/agent-app-template/src/agent_app/agent_app.py +180 -0
- agilab-0.0.1/src/apps/agent-app-template/src/agent_app_worker/__init__.py +1 -0
- agilab-0.0.1/src/apps/agent-app-template/src/agent_app_worker/agent_app_worker.py +221 -0
- agilab-0.0.1/src/apps/agent-app-template/src/agent_app_worker/post_install.py +83 -0
- agilab-0.0.1/src/apps/agent-app-template/src/args_ui_snippet.py +13 -0
- agilab-0.0.1/src/apps/dag-app-template/src/args_ui_snippet.py +13 -0
- agilab-0.0.1/src/apps/dag-app-template/src/dag_app/__init__.py +1 -0
- agilab-0.0.1/src/apps/dag-app-template/src/dag_app/dag_app.py +150 -0
- agilab-0.0.1/src/apps/dag-app-template/src/dag_app_worker/__init__.py +1 -0
- agilab-0.0.1/src/apps/dag-app-template/src/dag_app_worker/dag_app_worker.py +185 -0
- agilab-0.0.1/src/apps/dag-app-template/src/dag_app_worker/post_install.py +83 -0
- agilab-0.0.1/src/apps/data-app-template/src/args_ui_snippet.py +13 -0
- agilab-0.0.1/src/apps/data-app-template/src/data_app/__init__.py +1 -0
- agilab-0.0.1/src/apps/data-app-template/src/data_app/data_app.py +157 -0
- agilab-0.0.1/src/apps/data-app-template/src/data_app_worker/__init__.py +1 -0
- agilab-0.0.1/src/apps/data-app-template/src/data_app_worker/data_app_worker.py +92 -0
- agilab-0.0.1/src/apps/data-app-template/src/data_app_worker/post_install.py +83 -0
- agilab-0.0.1/src/apps/flight-project/src/args_ui_snippet.py +207 -0
- agilab-0.0.1/src/apps/flight-project/src/flight/__init__.py +1 -0
- agilab-0.0.1/src/apps/flight-project/src/flight/flight.py +321 -0
- agilab-0.0.1/src/apps/flight-project/src/flight_worker/__init__.py +1 -0
- agilab-0.0.1/src/apps/flight-project/src/flight_worker/flight_worker.py +258 -0
- agilab-0.0.1/src/apps/flight-project/src/flight_worker/post_install.py +82 -0
- agilab-0.0.1/src/apps/flight-project/test/__init__.py +0 -0
- agilab-0.0.1/src/apps/flight-project/test/test_flight.py +84 -0
- agilab-0.0.1/src/apps/flight-project/test/test_flight_manager.py +54 -0
- agilab-0.0.1/src/apps/flight-project/test/test_flight_worker.py +19 -0
- agilab-0.0.1/src/apps/install.py +109 -0
- agilab-0.0.1/src/apps/my-code-project/install.py +40 -0
- agilab-0.0.1/src/apps/my-code-project/scripts/post_install.py +84 -0
- agilab-0.0.1/src/apps/my-code-project/src/args_ui_snippet.py +13 -0
- agilab-0.0.1/src/apps/my-code-project/src/my_code/__init__.py +1 -0
- agilab-0.0.1/src/apps/my-code-project/src/my_code/my_code.py +91 -0
- agilab-0.0.1/src/apps/my-code-project/src/my_code_worker/__init__.py +1 -0
- agilab-0.0.1/src/apps/my-code-project/src/my_code_worker/my_code_worker.py +149 -0
- agilab-0.0.1/src/apps/my-code-project/test/__init__.py +0 -0
- agilab-0.0.1/src/apps/my-code-project/test/test_my_code_manager.py +28 -0
- agilab-0.0.1/src/apps/my-code-project/test/test_my_code_worker.py +15 -0
- agilab-0.0.1/src/views/maps/src/maps/__init__.py +0 -0
- agilab-0.0.1/src/views/maps/src/maps/maps.py +304 -0
- agilab-0.0.1/src/views/maps-3d/src/maps_3d/__init__.py +0 -0
- agilab-0.0.1/src/views/maps-3d/src/maps_3d/maps_3d.py +791 -0
- agilab-0.0.1/test.sh +27 -0
- agilab-0.0.1/zip-agi.py +175 -0
agilab-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Jean-Pierre Morard, THALES SIX GTS France SAS
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
|
7
|
+
following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
|
10
|
+
disclaimer.
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
|
12
|
+
disclaimer in the documentation and/or other materials provided with the distribution.
|
|
13
|
+
3. Neither the name of Jean-Pierre MORARD nor the names of its contributors, or THALES SIX GTS France SAS, may be used
|
|
14
|
+
to endorse or promote products derived from this software without specific prior written permission.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
17
|
+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
19
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
20
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
21
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
22
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
agilab-0.0.1/MANIFEST.in
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Include top-level files
|
|
2
|
+
include README.md
|
|
3
|
+
include SECURITY.md
|
|
4
|
+
include LICENSE
|
|
5
|
+
include pyproject.toml
|
|
6
|
+
include MANIFEST.in
|
|
7
|
+
include test.sh
|
|
8
|
+
include zip-agi.py
|
|
9
|
+
include install.sh
|
|
10
|
+
include install.ps1
|
|
11
|
+
include cryptobox.png
|
|
12
|
+
include apps/*/*
|
agilab-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agilab
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: AGILAB a datascience IDE for engineering to explore AI
|
|
5
|
+
Author-email: Jean-Pierre Morard <focus@thalesgroup.com>
|
|
6
|
+
Project-URL: Documentation, https://thalesgroup.github.io/agilab
|
|
7
|
+
Project-URL: Source, https://github.com/ThalesGroup/agilab
|
|
8
|
+
Project-URL: Tracker, https://github.com/ThalesGroup/agilab/issue
|
|
9
|
+
Keywords: jupyter,mlflow,paramiko,asyncio,dask,rapids,streamlit,distributed,cython,cluster,dataframe,dataset,loadbalancing,genai,copilot,agi,pycharm,datascience
|
|
10
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Operating System :: MacOS
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Requires-Python: ==3.12.*
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: build>=1.2.2.post1
|
|
21
|
+
Requires-Dist: pip>=25.0.1
|
|
22
|
+
Requires-Dist: setuptools>=76.0.0
|
|
23
|
+
Requires-Dist: twine>=6.1.0
|
|
24
|
+
Requires-Dist: wheel>=0.45.1
|
|
25
|
+
Requires-Dist: agi-env
|
|
26
|
+
Requires-Dist: agi-core
|
|
27
|
+
Requires-Dist: agi-gui
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
[](https://pypi.org/project/agilab)
|
|
31
|
+
|
|
32
|
+
# AGILAB Open Source Project
|
|
33
|
+
|
|
34
|
+
AGILAB [BSD license](https://github.com/ThalesGroup/agilab/blob/main/LICENSE) project purpose is to explore AI for engineering. It is designed to help engineers quickly experiment with AI-driven methods.
|
|
35
|
+
See [documentation](https://thalesgroup.github.io/agilab).
|
|
36
|
+
|
|
37
|
+
### Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
mkdir agi-workspace && cd agi-workspace
|
|
41
|
+
uv init && uv add agilab
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Run
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
uv run agilab
|
|
48
|
+
```
|
agilab-0.0.1/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[](https://pypi.org/project/agilab)
|
|
2
|
+
|
|
3
|
+
# AGILAB Open Source Project
|
|
4
|
+
|
|
5
|
+
AGILAB [BSD license](https://github.com/ThalesGroup/agilab/blob/main/LICENSE) project purpose is to explore AI for engineering. It is designed to help engineers quickly experiment with AI-driven methods.
|
|
6
|
+
See [documentation](https://thalesgroup.github.io/agilab).
|
|
7
|
+
|
|
8
|
+
### Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
mkdir agi-workspace && cd agi-workspace
|
|
12
|
+
uv init && uv add agilab
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Run
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uv run agilab
|
|
19
|
+
```
|
agilab-0.0.1/SECURITY.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## Goods practices to follow
|
|
2
|
+
|
|
3
|
+
Do not use credentials to set your cluster but prefer secure keys see chapter <keys generation> in the documentation
|
|
4
|
+
|
|
5
|
+
# Security Policy
|
|
6
|
+
|
|
7
|
+
## Supported Versions
|
|
8
|
+
|
|
9
|
+
| Version | Supported |
|
|
10
|
+
|---------| ------------------ |
|
|
11
|
+
| 1.0 | :x: |
|
|
12
|
+
|
|
13
|
+
## Reporting a Vulnerability
|
|
14
|
+
|
|
15
|
+
## Disclosure policy
|
|
16
|
+
|
|
17
|
+
If you find a security issue please send an email at focus@thalesgroup.com with [SECURITY] in the subject
|
|
18
|
+
do not detail the issue in the email but rather use cryptobox to provide more details.
|
|
19
|
+
If you don't have a cryptobox acces I will send you one:
|
|
20
|
+
it will be send by Cryptobox <no-reply@cryptobox.com>
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
## Security Update policy
|
|
24
|
+
|
|
25
|
+
Update for security Vulnerability will be done every month.
|
|
26
|
+
|
|
27
|
+
## Security related configurationSettings users should consider that would impact the security posture of deploying this project, such as HTTPS, authorization and many others.
|
|
28
|
+
|
|
29
|
+
The deployement of AGILAB software on a cluster is not supported by the open source project and have to be done with cybersecurity experts.
|
|
30
|
+
please contact Thales for commercial request <contact>(https://cpl.thalesgroup.com/fr/contact-us).
|
|
31
|
+
|
|
32
|
+
## Known security gaThales Digital Factory Sas ps & future enhancements
|
|
33
|
+
|
|
34
|
+
Security controls have not been set to enable more people to experiment the solution in a sandboxed environment
|
|
Binary file
|
agilab-0.0.1/install.ps1
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[Parameter(Mandatory = $true)]
|
|
3
|
+
[string]$OpenaiApiKey,
|
|
4
|
+
|
|
5
|
+
[Parameter(Mandatory = $true)]
|
|
6
|
+
[string]$AgiCredentials,
|
|
7
|
+
|
|
8
|
+
[Parameter(Mandatory = $false)]
|
|
9
|
+
[string]$InstallPath = (Get-Location).Path,
|
|
10
|
+
|
|
11
|
+
[Parameter(Mandatory = $false)]
|
|
12
|
+
[string]$PythonPath = (Get-Command python -ErrorAction SilentlyContinue).Source
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
# ================================
|
|
16
|
+
# Prevent Running as Administrator
|
|
17
|
+
# ================================
|
|
18
|
+
if ([Security.Principal.WindowsPrincipal]::new([Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
|
19
|
+
Write-Host "Error: This script should not be run as Administrator. Please run as a regular user." -ForegroundColor Red
|
|
20
|
+
exit 1
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# ================================
|
|
24
|
+
# Logging Setup
|
|
25
|
+
# ================================
|
|
26
|
+
$LogDir = Join-Path $env:USERPROFILE "log\install_logs"
|
|
27
|
+
if (-not (Test-Path $LogDir)) { New-Item -ItemType Directory -Path $LogDir | Out-Null }
|
|
28
|
+
$LogFile = Join-Path $LogDir ("install_{0}.log" -f (Get-Date -Format "yyyyMMdd_HHmmss"))
|
|
29
|
+
Start-Transcript -Path $LogFile
|
|
30
|
+
|
|
31
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
32
|
+
Write-Host "Installation started at $(Get-Date)" -ForegroundColor Blue
|
|
33
|
+
Write-Host "Log file: $LogFile" -ForegroundColor Blue
|
|
34
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
35
|
+
Write-Host ""
|
|
36
|
+
|
|
37
|
+
# ================================
|
|
38
|
+
# Global Variables and Paths
|
|
39
|
+
# ================================
|
|
40
|
+
# AGI_INSTALL_PATH corresponds to $InstallPath.
|
|
41
|
+
$AgiDir = $InstallPath
|
|
42
|
+
# Set Agi_ROOT environment variable for the user
|
|
43
|
+
[System.Environment]::SetEnvironmentVariable('Agi_ROOT', $AgiDir, [System.EnvironmentVariableTarget]::User)
|
|
44
|
+
|
|
45
|
+
# Define project directories (AGI_PROJECT_SRC is "$AgiDir\src")
|
|
46
|
+
$AgiProject = Join-Path $AgiDir "src"
|
|
47
|
+
$FrameworkDir = Join-Path $AgiProject "fwk"
|
|
48
|
+
$AppsDir = Join-Path $AgiProject "apps"
|
|
49
|
+
|
|
50
|
+
Write-Host "Installation Directory: $AgiDir" -ForegroundColor Cyan
|
|
51
|
+
Write-Host "Selected user: $AgiCredentials" -ForegroundColor Yellow
|
|
52
|
+
Write-Host "OpenAI API Key: $OpenaiApiKey" -ForegroundColor Yellow
|
|
53
|
+
|
|
54
|
+
# ================================
|
|
55
|
+
# Utility Functions
|
|
56
|
+
# ================================
|
|
57
|
+
|
|
58
|
+
function Check-Internet {
|
|
59
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
60
|
+
Write-Host "Step 1: Checking Internet Connectivity" -ForegroundColor Blue
|
|
61
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
62
|
+
try {
|
|
63
|
+
$response = Invoke-WebRequest -Uri "https://www.google.com" -Method Head -TimeoutSec 10
|
|
64
|
+
if ($response.StatusCode -eq 200) {
|
|
65
|
+
Write-Host "Internet connection is active." -ForegroundColor Green
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
Write-Host "Error: No internet connection detected. Aborting installation." -ForegroundColor Red
|
|
70
|
+
Stop-Transcript
|
|
71
|
+
exit 1
|
|
72
|
+
}
|
|
73
|
+
Write-Host ""
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function Install-Dependencies {
|
|
77
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
78
|
+
Write-Host "Step 2: Installing System Dependencies" -ForegroundColor Blue
|
|
79
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
80
|
+
Write-Host ""
|
|
81
|
+
$choice = Read-Host "Do you want to install system dependencies? (y/N)"
|
|
82
|
+
if ($choice -match "^[Yy]$") {
|
|
83
|
+
Write-Host "NOTE: Please install required dependencies manually or via your preferred package manager on Windows." -ForegroundColor Yellow
|
|
84
|
+
# Optionally, add code here to install dependencies using Chocolatey if desired.
|
|
85
|
+
}
|
|
86
|
+
Write-Host ""
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function Backup-AGIProject {
|
|
90
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
91
|
+
Write-Host "Step 3: Backing Up Existing AGI Project (if any)" -ForegroundColor Blue
|
|
92
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
93
|
+
Write-Host ""
|
|
94
|
+
if (Test-Path $AgiProject) {
|
|
95
|
+
if (Test-Path (Join-Path $AgiProject "zip-agi.py")) {
|
|
96
|
+
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
|
|
97
|
+
$backupFile = Join-Path $AgiDir ("agilib_{0}_{1}.zip" -f (Split-Path $AgiProject -Leaf), $timestamp)
|
|
98
|
+
Write-Host "Existing AGI project found at $AgiProject. Creating backup: $backupFile" -ForegroundColor Yellow
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
# Use Compress-Archive as a backup mechanism
|
|
102
|
+
Compress-Archive -Path $AgiProject\* -DestinationPath $backupFile -Force
|
|
103
|
+
Write-Host "Backup created successfully at $backupFile." -ForegroundColor Green
|
|
104
|
+
if ((Split-Path $AgiProject -Leaf) -ne "src") {
|
|
105
|
+
Remove-Item -Recurse -Force $AgiProject
|
|
106
|
+
Write-Host "Existing AGI project directory removed." -ForegroundColor Green
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
Write-Host "AGI project directory is 'src'; preserving it." -ForegroundColor Yellow
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
Write-Host "Error: Backup failed. Aborting installation." -ForegroundColor Red
|
|
114
|
+
Stop-Transcript
|
|
115
|
+
exit 1
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
Write-Host "Existing AGI project found at $AgiProject but no zip-agi.py found. Skipping backup." -ForegroundColor Yellow
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
Write-Host "No existing AGI project found at $AgiProject. Skipping backup." -ForegroundColor Yellow
|
|
124
|
+
}
|
|
125
|
+
Write-Host ""
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function Copy-AGIProject {
|
|
129
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
130
|
+
Write-Host "Step 4: Copying AGI Project Files" -ForegroundColor Blue
|
|
131
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
132
|
+
Write-Host ""
|
|
133
|
+
if (Test-Path ".\src") {
|
|
134
|
+
Write-Host "Copying AGI project source from .\src to $AgiProject..." -ForegroundColor Yellow
|
|
135
|
+
if (-not (Test-Path $AgiProject)) {
|
|
136
|
+
New-Item -ItemType Directory -Path $AgiProject | Out-Null
|
|
137
|
+
}
|
|
138
|
+
try {
|
|
139
|
+
Copy-Item -Path ".\src\*" -Destination $AgiProject -Recurse -Force
|
|
140
|
+
Write-Host "AGI project files copied successfully to $AgiProject." -ForegroundColor Green
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
Write-Host "Error: Failed to copy AGI project files to $AgiProject." -ForegroundColor Red
|
|
144
|
+
Stop-Transcript
|
|
145
|
+
exit 1
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
Write-Host "Error: AGI project source (.\src directory) not found. Exiting." -ForegroundColor Red
|
|
150
|
+
Stop-Transcript
|
|
151
|
+
exit 1
|
|
152
|
+
}
|
|
153
|
+
Write-Host ""
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function Update-EnvFile {
|
|
157
|
+
$HomeDir = [Environment]::GetFolderPath("UserProfile")
|
|
158
|
+
$AgiEnvFile = Join-Path $HomeDir ".agi_resources\.env"
|
|
159
|
+
if (-not (Test-Path (Split-Path $AgiEnvFile))) {
|
|
160
|
+
New-Item -ItemType Directory -Path (Split-Path $AgiEnvFile) -Force | Out-Null
|
|
161
|
+
}
|
|
162
|
+
if (-not (Test-Path $AgiEnvFile)) {
|
|
163
|
+
New-Item -ItemType File -Path $AgiEnvFile -Force | Out-Null
|
|
164
|
+
}
|
|
165
|
+
# Append the environment variables (avoid duplicates)
|
|
166
|
+
if (-not (Select-String -Path $AgiEnvFile -Pattern "OPENAI_API_KEY=" -Quiet)) {
|
|
167
|
+
"OPENAI_API_KEY=$OpenaiApiKey" | Out-File -FilePath $AgiEnvFile -Encoding ASCII -Append
|
|
168
|
+
}
|
|
169
|
+
if (-not (Select-String -Path $AgiEnvFile -Pattern "AGI_CREDENTIALS=" -Quiet)) {
|
|
170
|
+
"AGI_CREDENTIALS=$AgiCredentials" | Out-File -FilePath $AgiEnvFile -Encoding ASCII -Append
|
|
171
|
+
}
|
|
172
|
+
if (-not (Select-String -Path $AgiEnvFile -Pattern "PYTHON_PATH=" -Quiet)) {
|
|
173
|
+
"PYTHON_PATH=$PythonPath" | Out-File -FilePath $AgiEnvFile -Encoding ASCII -Append
|
|
174
|
+
}
|
|
175
|
+
Write-Host "Environment variables updated in $AgiEnvFile." -ForegroundColor Green
|
|
176
|
+
Write-Host ""
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function Execute-Installation {
|
|
180
|
+
param(
|
|
181
|
+
[string]$ProjectDir,
|
|
182
|
+
[string]$InstallScript,
|
|
183
|
+
[string]$ProjectName
|
|
184
|
+
)
|
|
185
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
186
|
+
Write-Host "Installing $ProjectName..." -ForegroundColor Blue
|
|
187
|
+
Write-Host "========================================" -ForegroundColor Blue
|
|
188
|
+
Push-Location $ProjectDir
|
|
189
|
+
if (Test-Path $InstallScript) {
|
|
190
|
+
# Pass PythonPath parameter to the child script if needed.
|
|
191
|
+
& $InstallScript -PythonPath $PythonPath
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
Write-Host "Error: Script $InstallScript not found in $ProjectDir" -ForegroundColor Red
|
|
195
|
+
}
|
|
196
|
+
Pop-Location
|
|
197
|
+
Write-Host ""
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
# ================================
|
|
201
|
+
# Main Flow
|
|
202
|
+
# ================================
|
|
203
|
+
Check-Internet
|
|
204
|
+
Install-Dependencies
|
|
205
|
+
Backup-AGIProject
|
|
206
|
+
Copy-AGIProject
|
|
207
|
+
Update-EnvFile
|
|
208
|
+
|
|
209
|
+
# Define installation script paths for framework and apps
|
|
210
|
+
$FrameworkScript = Join-Path $FrameworkDir "install.ps1"
|
|
211
|
+
$AppsScript = Join-Path $AppsDir "install.ps1"
|
|
212
|
+
|
|
213
|
+
# Execute installation scripts for framework and apps
|
|
214
|
+
Execute-Installation -ProjectDir $FrameworkDir -InstallScript $FrameworkScript -ProjectName "Framework"
|
|
215
|
+
Execute-Installation -ProjectDir $AppsDir -InstallScript $AppsScript -ProjectName "Apps"
|
|
216
|
+
|
|
217
|
+
# Starting AGILAB (assuming agilab.ps1 exists at the root of the install directory)
|
|
218
|
+
$AgilabScript = Join-Path $AgiDir "agilab.ps1"
|
|
219
|
+
if (Test-Path $AgilabScript) {
|
|
220
|
+
Write-Host "Starting AGILAB from $AgiDir" -ForegroundColor Green
|
|
221
|
+
& $AgilabScript -OpenaiApiKey $OpenaiApiKey
|
|
222
|
+
if ($LASTEXITCODE -eq 0) {
|
|
223
|
+
Write-Host "AGILAB started successfully." -ForegroundColor Green
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
Write-Host "Error: Failed to start AGILAB." -ForegroundColor Red
|
|
227
|
+
Stop-Transcript
|
|
228
|
+
exit 1
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
Write-Host "Error: AGILAB startup script not found at $AgilabScript" -ForegroundColor Red
|
|
233
|
+
Stop-Transcript
|
|
234
|
+
exit 1
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
Stop-Transcript
|