Python SDK for mink — sandboxed AI coding agent
Project description
mink
简体中文
极简 AI coding agent。Rust 原生实现,专为 DeepSeek 优化。
单二进制,零运行时依赖,可在终端独立运行或被其他程序嵌入编排。
特性
- DeepSeek 原生优化 — 针对 DeepSeek V4 系列设计,最大化 prefix-cache 命中率
- 两种终端模式 — REPL(
-i,rustyline 行编辑)和 TUI(--tui,ratatui 全屏界面) - 信号驱动的信念系统 — 自动检测工具执行错误,低信念时注入修正提示并约束恢复首步;可用
MINK_SIGNAL_MODE=off关闭 - 自适应上下文压缩 — 三级压缩,自动摘要,保持上下文在窗口内
- 维修流水线 — Scavenge → Truncation → Storm Breaker,三段自动修复
- Session 持久化 — JSONL 格式,
--continue无缝恢复 - 子代理(SubAgent) — 隔离或 fork 上下文,并发执行
- 技能系统 — 按需加载 skill 文件,不污染后续 prompt
- 自定义提示词 —
--mission加载 MISSION.md 文件,替换默认系统提示词,自由定义 agent 目标和行为 - Python SDK —
mink-agentpip 包,内置二进制,支持沙箱控制和全参数配置 - 机器协议 —
--print输出 ndjson 事件流;--json-rpc行协议供外部程序调用 - 沙箱防护 — Linux nsjail/bubblewrap(完整文件系统隔离)、macOS sandbox-exec(写入隔离)
- 运行时约束 —
--disable-bash/--disable-sub-agent/--disable-web按场景禁用工具
快速开始
# 前置:Rust 1.85+,设置 DEEPSEEK_API_KEY
# 编译
cargo build --release
# 或
make build
# REPL 交互模式
./target/release/mink -m flash -i
# TUI 全屏模式
./target/release/mink -m flash --tui
# 单次查询
./target/release/mink -m flash "explain this project"
# 继续上次会话
./target/release/mink -m flash --continue -i
# 使用自定义系统提示词
./target/release/mink --mission ./my-task.mission.md -i
Python SDK
通过 pip 安装使用:
pip install mink-agent
from mink_agent import AgentSession, SandboxConfig
session = AgentSession(SandboxConfig(
api_key="sk-...",
read_dirs=["src"],
write_dirs=["src"],
mission_file="./my-task.mission.md",
signal_mode="full",
))
result = session.run("处理文档")
文档索引
| 文档 | 说明 |
|---|---|
| 使用手册 | 完整 CLI 参数、配置、环境变量、会话管理、工具、技能 |
| 架构说明 | 运行时分层、模块职责、核心数据流 |
| 设计文档 | 14 个主题的设计哲学与实现取舍 |
| 信号系统设计 | 控制论 + 贝叶斯、冷却机制、信念度展示 |
| Agent 开发指南 | 面向 AI agent:项目结构、模块索引、开发惯例 |
| 工具参考 | 内置工具参数与行为 |
许可
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mink_agent-0.1.4-py3-none-manylinux_2_31_x86_64.whl.
File metadata
- Download URL: mink_agent-0.1.4-py3-none-manylinux_2_31_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: Python 3, manylinux: glibc 2.31+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ad59d9926e9eac9f32cc523ac782665373a055f2cd5fdf6891441b6e96ed9be
|
|
| MD5 |
00cd713ecd1d3971f68e6733980dd53a
|
|
| BLAKE2b-256 |
af1a0289ba662c7e1787c1725e51d473b74eed56586546b1016248840519fb73
|
Provenance
The following attestation bundles were made for mink_agent-0.1.4-py3-none-manylinux_2_31_x86_64.whl:
Publisher:
ci.yml on fierceX/mink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mink_agent-0.1.4-py3-none-manylinux_2_31_x86_64.whl -
Subject digest:
2ad59d9926e9eac9f32cc523ac782665373a055f2cd5fdf6891441b6e96ed9be - Sigstore transparency entry: 1709794858
- Sigstore integration time:
-
Permalink:
fierceX/mink@01fcc6bf1bad789205a3a1232629126d9c1b4dfb -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/fierceX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@01fcc6bf1bad789205a3a1232629126d9c1b4dfb -
Trigger Event:
push
-
Statement type:
File details
Details for the file mink_agent-0.1.4-py3-none-macosx_15_0_arm64.whl.
File metadata
- Download URL: mink_agent-0.1.4-py3-none-macosx_15_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b90076e8d0fa3a8f2bbbe6a74c032d9c65e018677f9ac74705dfdcfd5e0b7a2
|
|
| MD5 |
af2f1cbb60adf8f8d35ecfb5b2d86d7c
|
|
| BLAKE2b-256 |
1aec60566ad4b8a16b54d19c1ae2ea29bf12d9c70a3ccf755a19f419f748906f
|
Provenance
The following attestation bundles were made for mink_agent-0.1.4-py3-none-macosx_15_0_arm64.whl:
Publisher:
ci.yml on fierceX/mink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mink_agent-0.1.4-py3-none-macosx_15_0_arm64.whl -
Subject digest:
8b90076e8d0fa3a8f2bbbe6a74c032d9c65e018677f9ac74705dfdcfd5e0b7a2 - Sigstore transparency entry: 1709794723
- Sigstore integration time:
-
Permalink:
fierceX/mink@01fcc6bf1bad789205a3a1232629126d9c1b4dfb -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/fierceX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@01fcc6bf1bad789205a3a1232629126d9c1b4dfb -
Trigger Event:
push
-
Statement type: