aicortexpy 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.
Files changed (64) hide show
  1. aicortexpy-0.1.0/MANIFEST.in +4 -0
  2. aicortexpy-0.1.0/PKG-INFO +106 -0
  3. aicortexpy-0.1.0/README.md +89 -0
  4. aicortexpy-0.1.0/aicortexpy/__init__.py +3 -0
  5. aicortexpy-0.1.0/aicortexpy/__main__.py +5 -0
  6. aicortexpy-0.1.0/aicortexpy/acp_client.py +559 -0
  7. aicortexpy-0.1.0/aicortexpy/acp_conn.py +853 -0
  8. aicortexpy-0.1.0/aicortexpy/acp_errors.py +107 -0
  9. aicortexpy-0.1.0/aicortexpy/agent_env.py +88 -0
  10. aicortexpy-0.1.0/aicortexpy/artifact_ws.py +233 -0
  11. aicortexpy-0.1.0/aicortexpy/artifacts.py +67 -0
  12. aicortexpy-0.1.0/aicortexpy/attachments.py +85 -0
  13. aicortexpy-0.1.0/aicortexpy/auto_commit.py +106 -0
  14. aicortexpy-0.1.0/aicortexpy/capabilities.py +92 -0
  15. aicortexpy-0.1.0/aicortexpy/chat_acp_pool.py +321 -0
  16. aicortexpy-0.1.0/aicortexpy/cli.py +133 -0
  17. aicortexpy-0.1.0/aicortexpy/client.py +438 -0
  18. aicortexpy-0.1.0/aicortexpy/codex_config.py +98 -0
  19. aicortexpy-0.1.0/aicortexpy/config.py +298 -0
  20. aicortexpy-0.1.0/aicortexpy/daemon.py +677 -0
  21. aicortexpy-0.1.0/aicortexpy/data/default_skills/agent-memory/SKILL.md +67 -0
  22. aicortexpy-0.1.0/aicortexpy/data/default_skills/aicorkit-atlassian/SKILL.md +144 -0
  23. aicortexpy-0.1.0/aicortexpy/data/default_skills/aicorkit-graph/SKILL.md +145 -0
  24. aicortexpy-0.1.0/aicortexpy/data/default_skills/aicorkit-outlook/SKILL.md +87 -0
  25. aicortexpy-0.1.0/aicortexpy/data/default_skills/aicorkit-wxmsg/SKILL.md +96 -0
  26. aicortexpy-0.1.0/aicortexpy/data/default_skills/aicortex-basics/SKILL.md +10 -0
  27. aicortexpy-0.1.0/aicortexpy/data/default_skills/aicortex-bridge-cdp/SKILL.md +118 -0
  28. aicortexpy-0.1.0/aicortexpy/data/default_skills/aicortex-cli-ops/SKILL.md +100 -0
  29. aicortexpy-0.1.0/aicortexpy/data/default_skills/aicortex-graph/SKILL.md +30 -0
  30. aicortexpy-0.1.0/aicortexpy/data/default_skills/graphify/SKILL.md +97 -0
  31. aicortexpy-0.1.0/aicortexpy/data/default_skills/question-form/SKILL.md +162 -0
  32. aicortexpy-0.1.0/aicortexpy/data/default_skills/test-report-generator/SKILL.md +179 -0
  33. aicortexpy-0.1.0/aicortexpy/data/default_skills/test-report-generator/scripts/generate_cases.py +146 -0
  34. aicortexpy-0.1.0/aicortexpy/data/default_skills/test-report-generator/scripts/generate_report.py +275 -0
  35. aicortexpy-0.1.0/aicortexpy/design_seed.py +59 -0
  36. aicortexpy-0.1.0/aicortexpy/diskusage.py +209 -0
  37. aicortexpy-0.1.0/aicortexpy/execenv.py +264 -0
  38. aicortexpy-0.1.0/aicortexpy/gc.py +286 -0
  39. aicortexpy-0.1.0/aicortexpy/handoff_bundle.py +65 -0
  40. aicortexpy-0.1.0/aicortexpy/health.py +178 -0
  41. aicortexpy-0.1.0/aicortexpy/local_skills.py +157 -0
  42. aicortexpy-0.1.0/aicortexpy/models.py +385 -0
  43. aicortexpy-0.1.0/aicortexpy/openclaw_config.py +153 -0
  44. aicortexpy-0.1.0/aicortexpy/pinned_workdir.py +60 -0
  45. aicortexpy-0.1.0/aicortexpy/platform_info.py +61 -0
  46. aicortexpy-0.1.0/aicortexpy/poisoned.py +44 -0
  47. aicortexpy-0.1.0/aicortexpy/process.py +168 -0
  48. aicortexpy-0.1.0/aicortexpy/procutil.py +61 -0
  49. aicortexpy-0.1.0/aicortexpy/prompt.py +235 -0
  50. aicortexpy-0.1.0/aicortexpy/repo.py +462 -0
  51. aicortexpy-0.1.0/aicortexpy/runner.py +969 -0
  52. aicortexpy-0.1.0/aicortexpy/runtime_config.py +540 -0
  53. aicortexpy-0.1.0/aicortexpy/sandbox.py +264 -0
  54. aicortexpy-0.1.0/aicortexpy/stream.py +422 -0
  55. aicortexpy-0.1.0/aicortexpy/terminal.py +147 -0
  56. aicortexpy-0.1.0/aicortexpy/tunnel.py +82 -0
  57. aicortexpy-0.1.0/aicortexpy/wakeup.py +222 -0
  58. aicortexpy-0.1.0/aicortexpy.egg-info/PKG-INFO +106 -0
  59. aicortexpy-0.1.0/aicortexpy.egg-info/SOURCES.txt +62 -0
  60. aicortexpy-0.1.0/aicortexpy.egg-info/dependency_links.txt +1 -0
  61. aicortexpy-0.1.0/aicortexpy.egg-info/requires.txt +6 -0
  62. aicortexpy-0.1.0/aicortexpy.egg-info/top_level.txt +1 -0
  63. aicortexpy-0.1.0/pyproject.toml +36 -0
  64. aicortexpy-0.1.0/setup.cfg +4 -0
@@ -0,0 +1,4 @@
1
+ global-exclude **/__pycache__/**
2
+ global-exclude *.py[cod]
3
+ recursive-include aicortexpy/data *
4
+ prune aicortexpy/data/default_skills/test-report-generator/scripts/__pycache__
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.2
2
+ Name: aicortexpy
3
+ Version: 0.1.0
4
+ Summary: AICortex Python local agent runtime daemon (no Docker)
5
+ Author: AICortex
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://gitee.com/seacozz2007/aicortex
8
+ Project-URL: Repository, https://gitee.com/seacozz2007/aicortex
9
+ Project-URL: Issues, https://gitee.com/seacozz2007/aicortex/issues
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: websocket-client>=1.6
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest>=7.0; extra == "dev"
15
+ Requires-Dist: build>=1.0; extra == "dev"
16
+ Requires-Dist: twine>=5.0; extra == "dev"
17
+
18
+ # aicortexpy(Python daemon)
19
+
20
+ 用已批准的 `python.exe` 跑本地 agent runtime(跨 Windows / macOS / Linux),**无需 Docker**。
21
+
22
+ | | 名称 |
23
+ |--|--|
24
+ | PyPI | `aicortexpy`(`aicortex` 与已有包 `ai-cortex` 过近被拒) |
25
+ | 模块 | `aicortexpy`(不能叫 `aicortex`:本仓库目录也叫 `aicortex`,在父目录执行会撞 PEP 420 命名空间包) |
26
+ | 调用 | `python -m aicortexpy`(不注册 console script,避免与 Go CLI `aicortex` 抢 PATH) |
27
+
28
+ ```powershell
29
+ pip install aicortexpy
30
+ python -m aicortexpy --help
31
+ ```
32
+
33
+ ## 安装
34
+
35
+ ### 从 PyPI
36
+
37
+ ```powershell
38
+ pip install -U aicortexpy
39
+ ```
40
+
41
+ ### 从源码(本仓库)
42
+
43
+ ```powershell
44
+ cd python-daemon
45
+ pip install -e .
46
+ pip install -e ".[dev]" # 含 build / twine
47
+ ```
48
+
49
+ ## 运行
50
+
51
+ ```powershell
52
+ # 方式 A:经 Go aicortex CLI(推荐;需已 pip 安装本包)
53
+ $env:AICORTEX_DAEMON_BACKEND = "python"
54
+ aicortex daemon start
55
+ aicortex daemon status
56
+ aicortex daemon stop
57
+
58
+ # 方式 B:直接启动
59
+ python -m aicortexpy start --foreground
60
+ python -m aicortexpy capabilities
61
+ python -m aicortexpy --version
62
+ ```
63
+
64
+ 需要 `~/.aicortex/config.json`(token + server_url)以及 PATH 上的 agent CLI。
65
+
66
+ Health 默认端口 **19514**(与 Go / `aicortex daemon status` 一致)。**不要**与 Go daemon 同时跑在同一端口。
67
+
68
+ ## 发布到 PyPI(对齐 aicorkit / aicortex-bridge)
69
+
70
+ 在 `python-daemon/` 目录:
71
+
72
+ ```powershell
73
+ python -m pip install -U build twine
74
+ python -m build
75
+ python -m twine upload dist/*
76
+ ```
77
+
78
+ 版本号改 `pyproject.toml` 的 `version` 与 `aicortexpy/__init__.py` 的 `__version__`(保持一致),再重新 build / upload。
79
+
80
+ ## 已对齐能力(相对 Go daemon)
81
+
82
+ - 注册/心跳/wakeup/claim/cancel、agentEnv、prior_work_dir 复用
83
+ - Claude(stream-json + **MCP `--mcp-config`**)、Codex(+ semantic inactivity)
84
+ - Cursor/Gemini/OpenCode/Copilot **stream-json/json 事件流**
85
+ - Cursor/Kiro chat ACP 池;Kiro/Hermes/Kimi/Dsh ACP oneshot
86
+ - OpenClaw / pi 启动参数;OpenClaw config **fail-closed**
87
+ - Repo:**allowlist** + per-workspace bare + **worktree 锁** + co-authored hook
88
+ - Design:**handoff zip** + **example seed**
89
+ - Model list:**ACP discovery** + 60s cache
90
+ - GC:`.gc_meta.json` + **active-root 保护**
91
+ - Wakeup 侧带:**tunnel**、**artifact browse/chunk upload**、terminal(pipe MVP,需 `AICORTEX_DAEMON_TERMINAL_PTY=true`)
92
+
93
+ **仍偏薄 / partial**:真正的 ConPTY/unix PTY(现为 pipe shell)、OS sandbox wrapper(bwrap/Seatbelt)、Go 式 auto-update(用 `pip install -U aicortexpy`)。
94
+
95
+ ## 环境变量(节选)
96
+
97
+ | 变量 | 含义 |
98
+ |------|------|
99
+ | `AICORTEX_DAEMON_BACKEND` | `python` 时 `aicortex daemon start` 启 Python daemon |
100
+ | `AICORTEX_DAEMON_HEALTH_PORT` | 默认 19514 |
101
+ | `AICORTEX_DAEMON_TERMINAL_PTY` | `true` 启用远程终端(pipe MVP) |
102
+ | `AICORTEX_AGENT_IDLE_WATCHDOG` | 无活动强停秒数(默认 300;`0` 关闭) |
103
+ | `AICORTEX_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | Codex 无输出强停(默认 600;`0` 关闭) |
104
+ | `AICORTEX_CODEX_MULTI_AGENT` | `1` 保留 Codex native multi_agent |
105
+ | `AICORTEX_INJECT_TENCENT_DOCS` | `1` 注入完整 tencent-docs 包 |
106
+ | `AICORTEX_GC_*` | GC 开关与 TTL |
@@ -0,0 +1,89 @@
1
+ # aicortexpy(Python daemon)
2
+
3
+ 用已批准的 `python.exe` 跑本地 agent runtime(跨 Windows / macOS / Linux),**无需 Docker**。
4
+
5
+ | | 名称 |
6
+ |--|--|
7
+ | PyPI | `aicortexpy`(`aicortex` 与已有包 `ai-cortex` 过近被拒) |
8
+ | 模块 | `aicortexpy`(不能叫 `aicortex`:本仓库目录也叫 `aicortex`,在父目录执行会撞 PEP 420 命名空间包) |
9
+ | 调用 | `python -m aicortexpy`(不注册 console script,避免与 Go CLI `aicortex` 抢 PATH) |
10
+
11
+ ```powershell
12
+ pip install aicortexpy
13
+ python -m aicortexpy --help
14
+ ```
15
+
16
+ ## 安装
17
+
18
+ ### 从 PyPI
19
+
20
+ ```powershell
21
+ pip install -U aicortexpy
22
+ ```
23
+
24
+ ### 从源码(本仓库)
25
+
26
+ ```powershell
27
+ cd python-daemon
28
+ pip install -e .
29
+ pip install -e ".[dev]" # 含 build / twine
30
+ ```
31
+
32
+ ## 运行
33
+
34
+ ```powershell
35
+ # 方式 A:经 Go aicortex CLI(推荐;需已 pip 安装本包)
36
+ $env:AICORTEX_DAEMON_BACKEND = "python"
37
+ aicortex daemon start
38
+ aicortex daemon status
39
+ aicortex daemon stop
40
+
41
+ # 方式 B:直接启动
42
+ python -m aicortexpy start --foreground
43
+ python -m aicortexpy capabilities
44
+ python -m aicortexpy --version
45
+ ```
46
+
47
+ 需要 `~/.aicortex/config.json`(token + server_url)以及 PATH 上的 agent CLI。
48
+
49
+ Health 默认端口 **19514**(与 Go / `aicortex daemon status` 一致)。**不要**与 Go daemon 同时跑在同一端口。
50
+
51
+ ## 发布到 PyPI(对齐 aicorkit / aicortex-bridge)
52
+
53
+ 在 `python-daemon/` 目录:
54
+
55
+ ```powershell
56
+ python -m pip install -U build twine
57
+ python -m build
58
+ python -m twine upload dist/*
59
+ ```
60
+
61
+ 版本号改 `pyproject.toml` 的 `version` 与 `aicortexpy/__init__.py` 的 `__version__`(保持一致),再重新 build / upload。
62
+
63
+ ## 已对齐能力(相对 Go daemon)
64
+
65
+ - 注册/心跳/wakeup/claim/cancel、agentEnv、prior_work_dir 复用
66
+ - Claude(stream-json + **MCP `--mcp-config`**)、Codex(+ semantic inactivity)
67
+ - Cursor/Gemini/OpenCode/Copilot **stream-json/json 事件流**
68
+ - Cursor/Kiro chat ACP 池;Kiro/Hermes/Kimi/Dsh ACP oneshot
69
+ - OpenClaw / pi 启动参数;OpenClaw config **fail-closed**
70
+ - Repo:**allowlist** + per-workspace bare + **worktree 锁** + co-authored hook
71
+ - Design:**handoff zip** + **example seed**
72
+ - Model list:**ACP discovery** + 60s cache
73
+ - GC:`.gc_meta.json` + **active-root 保护**
74
+ - Wakeup 侧带:**tunnel**、**artifact browse/chunk upload**、terminal(pipe MVP,需 `AICORTEX_DAEMON_TERMINAL_PTY=true`)
75
+
76
+ **仍偏薄 / partial**:真正的 ConPTY/unix PTY(现为 pipe shell)、OS sandbox wrapper(bwrap/Seatbelt)、Go 式 auto-update(用 `pip install -U aicortexpy`)。
77
+
78
+ ## 环境变量(节选)
79
+
80
+ | 变量 | 含义 |
81
+ |------|------|
82
+ | `AICORTEX_DAEMON_BACKEND` | `python` 时 `aicortex daemon start` 启 Python daemon |
83
+ | `AICORTEX_DAEMON_HEALTH_PORT` | 默认 19514 |
84
+ | `AICORTEX_DAEMON_TERMINAL_PTY` | `true` 启用远程终端(pipe MVP) |
85
+ | `AICORTEX_AGENT_IDLE_WATCHDOG` | 无活动强停秒数(默认 300;`0` 关闭) |
86
+ | `AICORTEX_CODEX_SEMANTIC_INACTIVITY_TIMEOUT` | Codex 无输出强停(默认 600;`0` 关闭) |
87
+ | `AICORTEX_CODEX_MULTI_AGENT` | `1` 保留 Codex native multi_agent |
88
+ | `AICORTEX_INJECT_TENCENT_DOCS` | `1` 注入完整 tencent-docs 包 |
89
+ | `AICORTEX_GC_*` | GC 开关与 TTL |
@@ -0,0 +1,3 @@
1
+ """AICortex Python local agent runtime daemon."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,5 @@
1
+ """Allow `python -m aicortexpy` invocation."""
2
+
3
+ from .cli import main
4
+
5
+ raise SystemExit(main())