ai-computer-brain 0.1.0__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.
- ai_computer_brain-0.1.0/.env.example +39 -0
- ai_computer_brain-0.1.0/.gitignore +17 -0
- ai_computer_brain-0.1.0/.vscode/settings.json +11 -0
- ai_computer_brain-0.1.0/Caddyfile +12 -0
- ai_computer_brain-0.1.0/Dockerfile +39 -0
- ai_computer_brain-0.1.0/LICENSE +21 -0
- ai_computer_brain-0.1.0/PKG-INFO +493 -0
- ai_computer_brain-0.1.0/README.md +452 -0
- ai_computer_brain-0.1.0/docker-compose.local.yml +18 -0
- ai_computer_brain-0.1.0/docker-compose.yml +63 -0
- ai_computer_brain-0.1.0/docs/admin-panel-hosting.md +101 -0
- ai_computer_brain-0.1.0/docs/architecture.md +62 -0
- ai_computer_brain-0.1.0/docs/assets/banner.svg +243 -0
- ai_computer_brain-0.1.0/docs/cloudflare-domain.md +109 -0
- ai_computer_brain-0.1.0/docs/connecting-agents.md +125 -0
- ai_computer_brain-0.1.0/docs/deployment-vps.md +121 -0
- ai_computer_brain-0.1.0/npm/README.md +16 -0
- ai_computer_brain-0.1.0/npm/bin/brain.js +70 -0
- ai_computer_brain-0.1.0/npm/package.json +33 -0
- ai_computer_brain-0.1.0/plan.md +1698 -0
- ai_computer_brain-0.1.0/pyproject.toml +78 -0
- ai_computer_brain-0.1.0/requirements.txt +14 -0
- ai_computer_brain-0.1.0/scripts/install.ps1 +22 -0
- ai_computer_brain-0.1.0/scripts/install.sh +77 -0
- ai_computer_brain-0.1.0/scripts/make_banner.py +59 -0
- ai_computer_brain-0.1.0/sql/01_init_metadata.sql +108 -0
- ai_computer_brain-0.1.0/src/second_brain/__init__.py +1 -0
- ai_computer_brain-0.1.0/src/second_brain/anthropic_login.py +169 -0
- ai_computer_brain-0.1.0/src/second_brain/auth.py +306 -0
- ai_computer_brain-0.1.0/src/second_brain/background.py +492 -0
- ai_computer_brain-0.1.0/src/second_brain/banner.py +169 -0
- ai_computer_brain-0.1.0/src/second_brain/chat.py +287 -0
- ai_computer_brain-0.1.0/src/second_brain/cli.py +863 -0
- ai_computer_brain-0.1.0/src/second_brain/cloudflare.py +414 -0
- ai_computer_brain-0.1.0/src/second_brain/company_log.py +294 -0
- ai_computer_brain-0.1.0/src/second_brain/config.py +274 -0
- ai_computer_brain-0.1.0/src/second_brain/database.py +137 -0
- ai_computer_brain-0.1.0/src/second_brain/db_watch.py +139 -0
- ai_computer_brain-0.1.0/src/second_brain/documents.py +479 -0
- ai_computer_brain-0.1.0/src/second_brain/git_sync.py +474 -0
- ai_computer_brain-0.1.0/src/second_brain/github_api.py +140 -0
- ai_computer_brain-0.1.0/src/second_brain/guards.py +36 -0
- ai_computer_brain-0.1.0/src/second_brain/hub.py +160 -0
- ai_computer_brain-0.1.0/src/second_brain/keyvault.py +35 -0
- ai_computer_brain-0.1.0/src/second_brain/llm.py +789 -0
- ai_computer_brain-0.1.0/src/second_brain/locks.py +81 -0
- ai_computer_brain-0.1.0/src/second_brain/markdown_engine.py +281 -0
- ai_computer_brain-0.1.0/src/second_brain/models.py +391 -0
- ai_computer_brain-0.1.0/src/second_brain/oauth.py +523 -0
- ai_computer_brain-0.1.0/src/second_brain/picker.py +277 -0
- ai_computer_brain-0.1.0/src/second_brain/rbac.py +234 -0
- ai_computer_brain-0.1.0/src/second_brain/repo_analysis.py +824 -0
- ai_computer_brain-0.1.0/src/second_brain/server.py +746 -0
- ai_computer_brain-0.1.0/src/second_brain/service.py +2361 -0
- ai_computer_brain-0.1.0/src/second_brain/tui.py +3476 -0
- ai_computer_brain-0.1.0/src/second_brain/vault.py +260 -0
- ai_computer_brain-0.1.0/src/second_brain/web_ui.py +1195 -0
- ai_computer_brain-0.1.0/src/second_brain/webhooks.py +48 -0
- ai_computer_brain-0.1.0/start.cmd +3 -0
- ai_computer_brain-0.1.0/start.ps1 +60 -0
- ai_computer_brain-0.1.0/start.sh +55 -0
- ai_computer_brain-0.1.0/templates/admin_dashboard.html +1624 -0
- ai_computer_brain-0.1.0/templates/default_vault/ACCESS_PERMISSIONS.md +80 -0
- ai_computer_brain-0.1.0/templates/default_vault/AGENT_CHANGELOG.md +37 -0
- ai_computer_brain-0.1.0/templates/default_vault/COMPANY_LOG.md +20 -0
- ai_computer_brain-0.1.0/templates/default_vault/COMPANY_PULSE.md +30 -0
- ai_computer_brain-0.1.0/templates/default_vault/DB_SCHEMA_STATE.md +22 -0
- ai_computer_brain-0.1.0/templates/default_vault/DESIGN_SYSTEM.md +34 -0
- ai_computer_brain-0.1.0/templates/default_vault/TECH_AND_INFRA.md +30 -0
- ai_computer_brain-0.1.0/tests/conftest.py +80 -0
- ai_computer_brain-0.1.0/tests/test_auth.py +121 -0
- ai_computer_brain-0.1.0/tests/test_background.py +97 -0
- ai_computer_brain-0.1.0/tests/test_backup_and_disk.py +173 -0
- ai_computer_brain-0.1.0/tests/test_chat_and_login.py +115 -0
- ai_computer_brain-0.1.0/tests/test_cli.py +197 -0
- ai_computer_brain-0.1.0/tests/test_cloudflare.py +154 -0
- ai_computer_brain-0.1.0/tests/test_console.py +378 -0
- ai_computer_brain-0.1.0/tests/test_e2e_http.py +621 -0
- ai_computer_brain-0.1.0/tests/test_llm_and_analysis.py +439 -0
- ai_computer_brain-0.1.0/tests/test_markdown_engine.py +129 -0
- ai_computer_brain-0.1.0/tests/test_oauth.py +204 -0
- ai_computer_brain-0.1.0/tests/test_rbac.py +81 -0
- ai_computer_brain-0.1.0/tests/test_service.py +563 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
BRAIN_HOST=0.0.0.0
|
|
2
|
+
BRAIN_PORT=8000
|
|
3
|
+
PUBLIC_URL=https://brain.yourdomain.com
|
|
4
|
+
BRAIN_DOMAIN=brain.yourdomain.com
|
|
5
|
+
CLOUDFLARE_TUNNEL=
|
|
6
|
+
BRAIN_THEME=ocean
|
|
7
|
+
ADMIN_MASTER_KEY=
|
|
8
|
+
ADMIN_PATH=/admin
|
|
9
|
+
ADMIN_ALLOWED_IPS=
|
|
10
|
+
ADMIN_LOGIN_FAILURES_PER_MINUTE=10
|
|
11
|
+
DATABASE_URL=sqlite+aiosqlite:///./data/brain_metadata.db
|
|
12
|
+
REDIS_URL=
|
|
13
|
+
BRAIN_FILES_DIR=./brain_files
|
|
14
|
+
GIT_AUTHOR_NAME=AI Computer Brain
|
|
15
|
+
GIT_AUTHOR_EMAIL=brain@localhost
|
|
16
|
+
GIT_PUSH_ENABLED=true
|
|
17
|
+
GIT_COMMIT_DEBOUNCE_SECONDS=2
|
|
18
|
+
HOT_LOG_SIZE=50
|
|
19
|
+
INBOX_INLINE_LIMIT=3
|
|
20
|
+
STALE_AFTER_MINUTES=30
|
|
21
|
+
MAX_PATCH_BYTES=65536
|
|
22
|
+
MAX_SUMMARY_CHARS=160
|
|
23
|
+
RATE_LIMIT_WRITES_PER_MINUTE=120
|
|
24
|
+
RATE_LIMIT_READS_PER_MINUTE=600
|
|
25
|
+
HEARTBEAT_SECONDS=20
|
|
26
|
+
CHANGELOG_ENTRIES_PER_DEPARTMENT=100
|
|
27
|
+
FINDINGS_IN_COMPANY_LOG=30
|
|
28
|
+
CHANGELOG_DEDUPE_HOURS=24
|
|
29
|
+
LLM_PROVIDER=
|
|
30
|
+
LLM_API_KEY=
|
|
31
|
+
LLM_MODEL=
|
|
32
|
+
LLM_BASE_URL=
|
|
33
|
+
LLM_AUTH=api_key
|
|
34
|
+
LLM_EFFORT=
|
|
35
|
+
GITHUB_TOKEN=
|
|
36
|
+
GITHUB_OWNER=
|
|
37
|
+
DISK_WATCH_SECONDS=60
|
|
38
|
+
CORS_ORIGINS=
|
|
39
|
+
LOG_LEVEL=info
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"git.autoRepositoryDetection": "openEditors",
|
|
3
|
+
"git.detectSubmodules": false,
|
|
4
|
+
"git.repositoryScanIgnoredFolders": ["node_modules", "brain_files", "data", ".venv", ".pytest_tmp"],
|
|
5
|
+
"search.exclude": {
|
|
6
|
+
"**/.venv": true,
|
|
7
|
+
"**/.pytest_tmp": true,
|
|
8
|
+
"**/brain_files": true,
|
|
9
|
+
"**/data": true
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
FROM python:3.12-slim
|
|
2
|
+
|
|
3
|
+
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
4
|
+
PYTHONUNBUFFERED=1 \
|
|
5
|
+
PIP_NO_CACHE_DIR=1 \
|
|
6
|
+
PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
7
|
+
|
|
8
|
+
RUN apt-get update \
|
|
9
|
+
&& apt-get install -y --no-install-recommends git curl ca-certificates \
|
|
10
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
11
|
+
&& useradd --create-home --uid 10001 brain
|
|
12
|
+
|
|
13
|
+
WORKDIR /app
|
|
14
|
+
|
|
15
|
+
COPY pyproject.toml README.md LICENSE ./
|
|
16
|
+
COPY src ./src
|
|
17
|
+
COPY templates ./templates
|
|
18
|
+
COPY sql ./sql
|
|
19
|
+
|
|
20
|
+
RUN pip install . \
|
|
21
|
+
&& mkdir -p /data /app/brain_files \
|
|
22
|
+
&& chown -R brain:brain /data /app
|
|
23
|
+
|
|
24
|
+
USER brain
|
|
25
|
+
|
|
26
|
+
RUN git config --global safe.directory '*' \
|
|
27
|
+
&& git config --global init.defaultBranch main
|
|
28
|
+
|
|
29
|
+
ENV BRAIN_HOST=0.0.0.0 \
|
|
30
|
+
BRAIN_PORT=8000 \
|
|
31
|
+
BRAIN_FILES_DIR=/app/brain_files \
|
|
32
|
+
DATABASE_URL=sqlite+aiosqlite:////data/brain_metadata.db
|
|
33
|
+
|
|
34
|
+
EXPOSE 8000
|
|
35
|
+
|
|
36
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
|
37
|
+
CMD curl -fsS http://127.0.0.1:8000/healthz || exit 1
|
|
38
|
+
|
|
39
|
+
CMD ["brain", "serve"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AI Computer Brain contributors
|
|
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.
|