Skip to main content

aicortexpy(Python daemon)

用已批准的 python.exe 跑本地 agent runtime(跨 Windows / macOS / Linux),无需 Docker。

名称
PyPI aicortexpy(aicortex 与已有包 ai-cortex 过近被拒)
模块 aicortexpy(不能叫 aicortex:本仓库目录也叫 aicortex,在父目录执行会撞 PEP 420 命名空间包)
调用 python -m aicortexpy(不注册 console script,避免与 Go CLI aicortex 抢 PATH)
pip install aicortexpy
python -m aicortexpy --help

安装

从 PyPI

pip install -U aicortexpy

从源码(本仓库)

cd python-daemon
pip install -e .
pip install -e ".[dev]"   # 含 build / twine

运行

# 方式 A:经 Go aicortex CLI(推荐;需已 pip 安装本包)
$env:AICORTEX_DAEMON_BACKEND = "python"
aicortex daemon start
aicortex daemon status
aicortex daemon stop

# 方式 B:直接启动
python -m aicortexpy start --foreground
python -m aicortexpy capabilities
python -m aicortexpy --version

需要 ~/.aicortex/config.json(token + server_url)以及 PATH 上的 agent CLI。

Health 默认端口 19514(与 Go / aicortex daemon status 一致)。不要与 Go daemon 同时跑在同一端口。

发布到 PyPI(对齐 aicorkit / aicortex-bridge)

在 python-daemon/ 目录:

python -m pip install -U build twine
python -m build
python -m twine upload dist/*

版本号改 pyproject.toml 的 version 与 aicortexpy/__init__.py 的 __version__(保持一致),再重新 build / upload。

已对齐能力(相对 Go daemon)

  • 注册/心跳/wakeup/claim/cancel、agentEnv、prior_work_dir 复用
  • Claude(stream-json + MCP --mcp-config)、Codex(+ semantic inactivity)
  • Cursor/Gemini/OpenCode/Copilot stream-json/json 事件流
  • Cursor/Kiro chat ACP 池;Kiro/Hermes/Kimi/Dsh ACP oneshot
  • OpenClaw / pi 启动参数;OpenClaw config fail-closed
  • Repo:allowlist + per-workspace bare + worktree 锁 + co-authored hook
  • Design:handoff zip + example seed
  • Model list:ACP discovery + 60s cache
  • GC:.gc_meta.json + active-root 保护
  • Wakeup 侧带:tunnel、artifact browse/chunk upload、terminal(pipe MVP,需 AICORTEX_DAEMON_TERMINAL_PTY=true)

仍偏薄 / partial:真正的 ConPTY/unix PTY(现为 pipe shell)、OS sandbox wrapper(bwrap/Seatbelt)、Go 式 auto-update(用 pip install -U aicortexpy)。

环境变量(节选)

变量 含义
AICORTEX_DAEMON_BACKEND python 时 aicortex daemon start 启 Python daemon
AICORTEX_DAEMON_HEALTH_PORT 默认 19514
AICORTEX_DAEMON_TERMINAL_PTY true 启用远程终端(pipe MVP)
AICORTEX_AGENT_IDLE_WATCHDOG 无活动强停秒数(默认 300;0 关闭)
AICORTEX_CODEX_SEMANTIC_INACTIVITY_TIMEOUT Codex 无输出强停(默认 600;0 关闭)
AICORTEX_CODEX_MULTI_AGENT 1 保留 Codex native multi_agent
AICORTEX_INJECT_TENCENT_DOCS 1 注入完整 tencent-docs 包
AICORTEX_GC_* GC 开关与 TTL

Metadata

Release files for aicortexpy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aicortexpy 0.1.0
File Size Uploaded
aicortexpy-0.1.0.tar.gz 110.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aicortexpy 0.1.0
File Interpreter ABI Platform
aicortexpy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 240.7 kB

Release files / aicortexpy-0.1.0.tar.gz

Download URL aicortexpy-0.1.0.tar.gz
Size 110.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2a25c38f06c1368b474a48f4878ad94b2101d2f579c2325e350d6baba4a3603c
BLAKE2b-256 checksum
How to use checksums
6480202eabc3ccef8135e7faf4fa9e360aecbcc70f399aca93875f8632977e9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / aicortexpy-0.1.0-py3-none-any.whl

Download URL aicortexpy-0.1.0-py3-none-any.whl
Size 130.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6aac0cdd76ce0dd3ad76959f83cb7157716cfe0e024f6c16af3d31908db48614
BLAKE2b-256 checksum
How to use checksums
9c8721ca698e8120dcd84afd05d5734720f30b93f0a0ba6ff77e6d50faaa6398
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page