Skip to content

Commit a8cd419

Browse files
committed
feat: 1Shell 3.1.0 release
- 1Shell native AI engine (replaces Claude Code CLI dependency) - IDE workbench with 10 built-in tools (execute_command, run_skill, run_playbook, etc.) - Skill/Playbook/Program CRUD with delete support - Streaming retry for Premature close / ECONNRESET errors - Windows GBK encoding fix for local command execution - AI config panel redesign: 1Shell AI Engine as first-class card
0 parents  commit a8cd419

186 files changed

Lines changed: 42679 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules
2+
npm-debug.log
3+
.env
4+
data/*.db
5+
data/*.json
6+
data/*.log
7+
test
8+
test-results
9+
docs
10+
artifacts
11+
*.png
12+
*.md
13+
.git
14+
.claude

.env.example

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# AI Web Terminal - 环境变量配置
2+
3+
# ===== OpenAI 兼容 API 配置 =====
4+
# 填写你的第三方 API 基础地址(不含 /chat/completions)
5+
OPENAI_API_BASE=https://api.openai.com/v1
6+
7+
# 填写你的 API Key
8+
OPENAI_API_KEY=sk-your-api-key-here
9+
10+
# 使用的模型名称
11+
OPENAI_MODEL=gpt-4o
12+
13+
# ===== Web 控制台登录配置 =====
14+
APP_LOGIN_USERNAME=admin
15+
APP_LOGIN_PASSWORD=admin
16+
17+
# 登录会话有效期(小时)
18+
APP_SESSION_TTL_HOURS=12
19+
20+
# ===== 服务器配置 =====
21+
PORT=3301
22+
23+
# ===== V6 Bridge & MCP 配置 =====
24+
# Bridge Token:用于内部 API 鉴权(/api/internal/bridge/exec 和 /mcp/* 端点)
25+
# 生产环境务必设置为高强度随机字符串,留空则 Bridge 和 MCP 功能不可用
26+
BRIDGE_TOKEN=replace-with-a-long-random-bridge-token
27+
28+
# Bridge 命令执行超时(毫秒),默认 30000
29+
# BRIDGE_EXEC_TIMEOUT_MS=30000
30+
31+
# ===== V6 Agent Provider 配置 =====
32+
# 默认 Agent Provider(claude-code / opencode / codex)
33+
# AGENT_DEFAULT_PROVIDER=claude-code
34+
35+
# ===== 日志配置 =====
36+
# 日志级别:debug / info / warn / error
37+
# LOG_LEVEL=info
38+
39+
# ===== 探针配置 =====
40+
# 探针超时毫秒数(默认 12000)
41+
# PROBE_TIMEOUT_MS=12000
42+
# 探针轮询间隔毫秒数(默认 15000)
43+
# PROBE_INTERVAL_MS=15000
44+
# 远程探针并发数(默认 3)
45+
# PROBE_REMOTE_CONCURRENCY=3

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI · 1Shell 2.0
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [18, 20]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run tests
29+
run: npm test
30+
env:
31+
APP_SECRET: ci-test-secret-key-for-testing
32+
APP_LOGIN_PASSWORD: ci-test-password
33+
34+
docker:
35+
runs-on: ubuntu-latest
36+
needs: test
37+
if: github.ref == 'refs/heads/main'
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Build Docker image
43+
run: docker build -t 1shell:test .
44+
45+
- name: Verify container starts
46+
run: |
47+
docker run -d --name 1shell-test \
48+
-e APP_SECRET=ci-test-secret \
49+
-e APP_LOGIN_PASSWORD=ci-test-pw \
50+
-p 3301:3301 \
51+
1shell:test
52+
sleep 5
53+
curl -sf http://localhost:3301/api/health | grep -q '"status":"ok"'
54+
docker stop 1shell-test

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
node_modules/
2+
.env
3+
*.log
4+
data/*.db
5+
data/*.db-shm
6+
data/*.db-wal
7+
data/*.log
8+
data/*.json
9+
data/bridge-token.json
10+
data/audit.log
11+
.DS_Store
12+
Thumbs.db
13+
test-results/
14+
*.pyc
15+
__pycache__/
16+
17+
# Debug / 临时文件
18+
_debug*.txt
19+
_debug*.js
20+
_rescue_logs*.txt
21+
*.tmp
22+
23+
# 部署脚本(含服务器凭据,仅本地使用)
24+
deploy.js
25+
26+
# 内部规格/设计文档(不对外发布)
27+
.spec-workflow/

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM node:20-slim
2+
3+
# node-pty / better-sqlite3 编译依赖
4+
# 某些 VPS 的 Docker build 默认网络无法正确继承宿主机 DNS,
5+
# compose 中已显式使用 build.network=host 以避免 apt 源解析失败。
6+
# 运行时工具:openssl(证书解析)、procps(pgrep)、curl、cron(crontab -l)——
7+
# site-scan / container 管理脚本在"本机"模式下需要这些二进制。
8+
RUN apt-get update && apt-get install -y --no-install-recommends \
9+
python3 \
10+
make \
11+
g++ \
12+
pkg-config \
13+
openssl \
14+
procps \
15+
curl \
16+
cron \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
WORKDIR /app
20+
21+
# 先复制依赖清单,利用 Docker 缓存
22+
COPY package.json package-lock.json ./
23+
RUN npm ci --omit=dev
24+
25+
COPY . .
26+
27+
# 数据目录(挂载卷持久化)
28+
RUN mkdir -p /app/data
29+
VOLUME ["/app/data"]
30+
31+
EXPOSE 3301
32+
33+
ENV NODE_ENV=production
34+
35+
CMD ["node", "server.js"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 1Shell 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.

0 commit comments

Comments
 (0)