Skip to main content

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 SDKmink-agent pip 包,内置二进制,支持沙箱控制和全参数配置
  • 沙箱防护 — Linux nsjail/bubblewrap(完整文件系统隔离)、macOS sandbox-exec(写入隔离)
  • CPython WASI 沙箱PythonSandbox 工具,在 wasmtime + CPython WASI 中执行 Python 代码,WASI 级进程隔离
  • 运行时约束--disable-bash / --disable-sub-agent / --disable-web / --disable-python 按场景禁用工具;--enable-python-sandbox 启用沙箱 Python 工具
  • 机器协议--print 输出 ndjson 事件流并以 final 结束;--agent-jsonl 提供 single-shot Agent JSONL 协议

快速开始

# 前置: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("处理文档")
print(result["status"], result["events_path"])

详见 mink_agent/README.md


文档索引

文档 说明
使用手册 完整 CLI 参数、配置、环境变量、会话管理、工具、技能
架构说明 运行时分层、模块职责、核心数据流
设计文档 14 个主题的设计哲学与实现取舍
信号系统设计 控制论 + 贝叶斯、冷却机制、信念度展示
Agent 开发指南 面向 AI agent:项目结构、模块索引、开发惯例
工具参考 内置工具参数与行为

许可

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mink_agent-0.1.6-py3-none-musllinux_1_2_x86_64.whl (4.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

mink_agent-0.1.6-py3-none-manylinux_2_35_x86_64.whl (4.7 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

mink_agent-0.1.6-py3-none-macosx_15_0_arm64.whl (4.1 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

File details

Details for the file mink_agent-0.1.6-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mink_agent-0.1.6-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 44a366d21b6ad2b9a1e08563b3e97ea03b58f7dba9b5e149332da89bef31a584
MD5 10d1b5003772bdaf3b9e09e4aa929801
BLAKE2b-256 94875c767e47013e69fe5ecdb3cfa25e0f4cc9e351bab894b961ffa06efa6110

See more details on using hashes here.

Provenance

The following attestation bundles were made for mink_agent-0.1.6-py3-none-musllinux_1_2_x86_64.whl:

Publisher: ci.yml on fierceX/mink

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mink_agent-0.1.6-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mink_agent-0.1.6-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 29dd33d4b9a3b88fcc1a9d1d11c26df8d495c45d4990ff37852567b9305bd6cf
MD5 00463e2e4465e44f219416fdaf14324b
BLAKE2b-256 e2e42e2429e3302d04ac8025668d7dfd222b15545f10a96a6a36e3fd50cf4856

See more details on using hashes here.

Provenance

The following attestation bundles were made for mink_agent-0.1.6-py3-none-manylinux_2_35_x86_64.whl:

Publisher: ci.yml on fierceX/mink

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mink_agent-0.1.6-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mink_agent-0.1.6-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 cf035e539df51fe9aa0089af6555738d3cc9bfbcadbbf82613170b2451e3f95d
MD5 d955219395a4afc65b876d17c8703ad9
BLAKE2b-256 bff883af5849fd588aaf9f226d856c17f47cba241d581a67c2fc6f36f65a52d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mink_agent-0.1.6-py3-none-macosx_15_0_arm64.whl:

Publisher: ci.yml on fierceX/mink

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page