paimon 0.2.6__tar.gz → 0.2.7__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 (52) hide show
  1. {paimon-0.2.6/paimon.egg-info → paimon-0.2.7}/PKG-INFO +19 -26
  2. {paimon-0.2.6 → paimon-0.2.7}/README.md +16 -24
  3. {paimon-0.2.6 → paimon-0.2.7}/README.zh-CN.md +14 -24
  4. paimon-0.2.7/paimon/_grep_worker.py +16 -0
  5. {paimon-0.2.6 → paimon-0.2.7}/paimon/agent.py +436 -114
  6. {paimon-0.2.6 → paimon-0.2.7}/paimon/app.py +112 -124
  7. {paimon-0.2.6 → paimon-0.2.7}/paimon/app.tcss +8 -5
  8. {paimon-0.2.6 → paimon-0.2.7}/paimon/cli.py +34 -12
  9. {paimon-0.2.6 → paimon-0.2.7}/paimon/commandpane.py +37 -33
  10. {paimon-0.2.6 → paimon-0.2.7}/paimon/compaction.py +5 -16
  11. {paimon-0.2.6 → paimon-0.2.7}/paimon/config.py +3 -7
  12. {paimon-0.2.6 → paimon-0.2.7}/paimon/diff.py +1 -1
  13. {paimon-0.2.6 → paimon-0.2.7}/paimon/headless.py +42 -16
  14. paimon-0.2.7/paimon/herdr.py +145 -0
  15. {paimon-0.2.6 → paimon-0.2.7}/paimon/llm.py +24 -2
  16. {paimon-0.2.6 → paimon-0.2.7}/paimon/lockfile.py +39 -3
  17. {paimon-0.2.6 → paimon-0.2.7}/paimon/pane.py +197 -126
  18. {paimon-0.2.6 → paimon-0.2.7}/paimon/prompt.py +56 -29
  19. {paimon-0.2.6 → paimon-0.2.7}/paimon/session.py +19 -31
  20. {paimon-0.2.6 → paimon-0.2.7}/paimon/skill/SKILL.md +5 -2
  21. {paimon-0.2.6 → paimon-0.2.7}/paimon/tools.py +275 -203
  22. paimon-0.2.7/paimon/turns.py +198 -0
  23. {paimon-0.2.6 → paimon-0.2.7}/paimon/ui.py +119 -9
  24. paimon-0.2.7/paimon/websearch.py +126 -0
  25. {paimon-0.2.6 → paimon-0.2.7/paimon.egg-info}/PKG-INFO +19 -26
  26. {paimon-0.2.6 → paimon-0.2.7}/paimon.egg-info/SOURCES.txt +4 -4
  27. {paimon-0.2.6 → paimon-0.2.7}/paimon.egg-info/requires.txt +2 -1
  28. {paimon-0.2.6 → paimon-0.2.7}/paimon.egg-info/scm_file_list.json +27 -9
  29. paimon-0.2.7/paimon.egg-info/scm_version.json +8 -0
  30. {paimon-0.2.6 → paimon-0.2.7}/pyproject.toml +2 -1
  31. paimon-0.2.6/paimon/agents.py +0 -259
  32. paimon-0.2.6/paimon/aside.py +0 -165
  33. paimon-0.2.6/paimon/jobs.py +0 -454
  34. paimon-0.2.6/paimon/supervisor.py +0 -425
  35. paimon-0.2.6/paimon.egg-info/scm_version.json +0 -8
  36. {paimon-0.2.6 → paimon-0.2.7}/LICENSE +0 -0
  37. {paimon-0.2.6 → paimon-0.2.7}/MANIFEST.in +0 -0
  38. {paimon-0.2.6 → paimon-0.2.7}/paimon/__init__.py +0 -0
  39. {paimon-0.2.6 → paimon-0.2.7}/paimon/__main__.py +0 -0
  40. {paimon-0.2.6 → paimon-0.2.7}/paimon/commands.py +0 -0
  41. {paimon-0.2.6 → paimon-0.2.7}/paimon/errors.py +0 -0
  42. {paimon-0.2.6 → paimon-0.2.7}/paimon/login.py +0 -0
  43. {paimon-0.2.6 → paimon-0.2.7}/paimon/mentions.py +0 -0
  44. {paimon-0.2.6 → paimon-0.2.7}/paimon/model_windows.py +0 -0
  45. {paimon-0.2.6 → paimon-0.2.7}/paimon/retry.py +0 -0
  46. {paimon-0.2.6 → paimon-0.2.7}/paimon/skills.py +0 -0
  47. {paimon-0.2.6 → paimon-0.2.7}/paimon/tabs.py +0 -0
  48. {paimon-0.2.6 → paimon-0.2.7}/paimon/telemetry.py +0 -0
  49. {paimon-0.2.6 → paimon-0.2.7}/paimon.egg-info/dependency_links.txt +0 -0
  50. {paimon-0.2.6 → paimon-0.2.7}/paimon.egg-info/entry_points.txt +0 -0
  51. {paimon-0.2.6 → paimon-0.2.7}/paimon.egg-info/top_level.txt +0 -0
  52. {paimon-0.2.6 → paimon-0.2.7}/setup.cfg +0 -0
@@ -1,15 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: paimon
3
- Version: 0.2.6
3
+ Version: 0.2.7
4
4
  Summary: A minimal code agent built on pydantic-ai + textual
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
7
7
  License-File: LICENSE
8
8
  Requires-Dist: httpx>=0.27
9
- Requires-Dist: pydantic-ai-slim[anthropic,openai]>=2.31.0
9
+ Requires-Dist: pydantic-ai-slim[anthropic,openai]>=2.38.0
10
10
  Requires-Dist: textual>=8.2.7
11
11
  Requires-Dist: textual-serve>=1.1.3
12
12
  Requires-Dist: pyyaml>=6
13
+ Requires-Dist: ddgs>=9
13
14
  Dynamic: license-file
14
15
 
15
16
  # Paimon
@@ -42,7 +43,11 @@ The first launch asks for a provider, model, API base and key. Then just type wh
42
43
 
43
44
  While it runs: `Shift+Tab` switches how much the agent may do on its own (**read** asks before writing files or running commands, **edit** lets edits inside the working directory through, **yolo** never asks and is the default), `Esc` interrupts the current turn, `Ctrl+P` opens the command palette, `Ctrl+C` quits. A line starting with `!` runs in a shell instead of being sent, and Paimon sees what it printed. `!!` keeps it to yourself.
44
45
 
45
- `Ctrl+T` opens another session in a pane of its own, `Ctrl+W` closes one, `Ctrl+PageUp` and `Ctrl+PageDown` move between them, and `Ctrl+G` jumps to a pane waiting for permission. Paimon can open panes itself: ask for two independent things and it starts a second agent in its own tab. It can also leave a command running in a tab of its own, a dev server or a watcher, instead of holding up a turn.
46
+ `Ctrl+T` opens another session in a pane of its own, `Ctrl+W` closes one, `Ctrl+PageUp` and `Ctrl+PageDown` move between them, and `Ctrl+G` jumps to a pane waiting for permission. Paimon can work in parallel: ask for two independent things and it starts a second agent in the background, whose answer comes back into the conversation when it is done. It can also leave a command running in a tab of its own, a dev server or a watcher, instead of holding up a turn.
47
+
48
+ ## Web search
49
+
50
+ Paimon can search the web without an API key. It asks in no permission mode, because a search changes nothing on your machine. Searches go through [ddgs](https://github.com/deedy5/ddgs), a metasearch library, so a query may be sent to any of several public search engines. `--no-web-search` takes the tool away for a run.
46
51
 
47
52
  ## Skills
48
53
 
@@ -102,6 +107,7 @@ paimon log a1b2c3 # what a session did, one line per event
102
107
  ```bash
103
108
  paimon --mode read # start in a more cautious permission mode (yolo is the default)
104
109
  paimon --strict # ask before every command, even read-only ones
110
+ paimon --no-web-search # take the web search tool away for this run
105
111
  paimon --web # the same UI in a browser (--port, default 8000)
106
112
  paimon -p "what does cli.py do?" # one answer on stdout, no UI
107
113
  cat log.txt | paimon -p "summarize this"
@@ -111,15 +117,17 @@ paimon --profile work # a separately configured account
111
117
 
112
118
  `-p` never stops to ask, so with the default `yolo` mode it can already write files and run commands. Add `--output-format result` for a single JSON object with the outcome, which is what a calling program should read. `paimon --help` lists the rest.
113
119
 
120
+ Inside a [Herdr](https://herdr.dev) pane the UI reports its state and resume command to Herdr on its own, with nothing to install.
121
+
114
122
  ## Configuration
115
123
 
116
- Each profile keeps its model settings in `~/.config/paimon/<name>/config.json`, written by the first launch or by `paimon login`. Sessions live in `~/.local/share/paimon/sessions/`. File changes render nicer if [delta](https://github.com/dandavison/delta) is installed.
124
+ Each profile keeps its model settings in `~/.config/paimon/<name>/config.json`, written by the first launch or by `paimon login`. Sessions live in `~/.local/share/paimon/sessions/`.
117
125
 
118
- Read and edit modes run a small set of clearly read-only commands (`ls`, `cat`, `git status`, …) without asking; `--strict` turns that off. **This is a guardrail against agent mistakes, not a security boundary.** For real isolation, run Paimon inside a container or VM.
126
+ Read and edit modes run a small set of clearly read-only commands (`ls`, `cat`, `git status`, …) without asking; `--strict` turns that off. On Windows, where cmd.exe runs the commands, every command asks. **This is a guardrail against agent mistakes, not a security boundary.** For real isolation, run Paimon inside a container or VM.
119
127
 
120
128
  ## Architecture
121
129
 
122
- `Agent.run` is a UI-agnostic stream of events; the TUI, `--web` and headless mode are three renderers over that one stream. `Supervisor` sits between an agent and the subagents or background commands it starts, and is the permission boundary for both.
130
+ `Agent.run` is a UI-agnostic stream of events; the TUI, `--web` and headless mode are three renderers over that one stream. An agent holds the subagents and background commands it starts. A subagent is another `Agent` running as a task in the same process, and its answer is delivered to its parent as a message.
123
131
 
124
132
  ```mermaid
125
133
  flowchart TD
@@ -149,13 +157,7 @@ flowchart TD
149
157
  ModelWindows["model_windows.py<br/>context window sizes"]
150
158
  Retry["retry.py"]
151
159
  Mentions["mentions.py<br/>@path expansion"]
152
- Aside["aside.py<br/>off-turn question, unrecorded"]
153
- end
154
-
155
- subgraph concurrency["Jobs & subagents"]
156
- Supervisor["supervisor.py<br/>job pool, permissions"]
157
- Jobs["jobs.py<br/>AgentJob / CommandJob"]
158
- AgentTypes["agents.py<br/>subagent types"]
160
+ Jobs["turns.py<br/>turn driver"]
159
161
  end
160
162
 
161
163
  subgraph support["Config & skills"]
@@ -175,11 +177,10 @@ flowchart TD
175
177
  App --> CommandPane
176
178
  App --> Tabs
177
179
  App --> Login
178
- App --> Supervisor
179
180
  App --> Config
180
181
 
182
+ Pane --> Jobs
181
183
  Pane --> AgentLoop
182
- Pane --> Aside
183
184
  Pane --> Diff
184
185
  Pane --> UIWidgets
185
186
  Pane --> LLM
@@ -193,26 +194,18 @@ flowchart TD
193
194
  AgentLoop --> Compaction
194
195
  AgentLoop --> Retry
195
196
  AgentLoop --> Mentions
196
- AgentLoop -. "spawn_agent / run_background" .-> Supervisor
197
-
198
- Aside --> Retry
199
- Aside --> SessionMod
197
+ AgentLoop -. "spawn_agent" .-> AgentLoop
198
+ AgentLoop -. "run_background" .-> CommandPane
200
199
 
201
200
  PromptMod --> Skills
202
201
  Compaction --> ModelWindows
203
202
 
204
- Supervisor --> Jobs
205
- Supervisor --> AgentTypes
206
- Supervisor --> ToolsMod
207
- Supervisor -. "launch callback" .-> App
208
203
  Jobs --> AgentLoop
209
204
 
210
- AgentTypes --> ToolsMod
211
- AgentTypes --> Config
212
205
  Skills --> Config
213
206
  Config --> LLM
214
207
  ```
215
208
 
216
209
  ## Telemetry
217
210
 
218
- Each launch sends one anonymous event to Google Analytics: a random install id, the launch mode, the version, the OS name and the configured provider and model name. Nothing from your sessions, prompts, files or credentials is included. Set `PAIMON_NO_TELEMETRY=1` or `DO_NOT_TRACK=1` to turn it off.
211
+ Each launch sends one anonymous event to Google Analytics: a random install id, the launch mode, the version, the OS name, the language from `LC_ALL`/`LANG`, whether this is the first launch, and the configured provider and model name. Nothing from your sessions, prompts, files or credentials is included. Set `PAIMON_NO_TELEMETRY=1` or `DO_NOT_TRACK=1` to turn it off.
@@ -28,7 +28,11 @@ The first launch asks for a provider, model, API base and key. Then just type wh
28
28
 
29
29
  While it runs: `Shift+Tab` switches how much the agent may do on its own (**read** asks before writing files or running commands, **edit** lets edits inside the working directory through, **yolo** never asks and is the default), `Esc` interrupts the current turn, `Ctrl+P` opens the command palette, `Ctrl+C` quits. A line starting with `!` runs in a shell instead of being sent, and Paimon sees what it printed. `!!` keeps it to yourself.
30
30
 
31
- `Ctrl+T` opens another session in a pane of its own, `Ctrl+W` closes one, `Ctrl+PageUp` and `Ctrl+PageDown` move between them, and `Ctrl+G` jumps to a pane waiting for permission. Paimon can open panes itself: ask for two independent things and it starts a second agent in its own tab. It can also leave a command running in a tab of its own, a dev server or a watcher, instead of holding up a turn.
31
+ `Ctrl+T` opens another session in a pane of its own, `Ctrl+W` closes one, `Ctrl+PageUp` and `Ctrl+PageDown` move between them, and `Ctrl+G` jumps to a pane waiting for permission. Paimon can work in parallel: ask for two independent things and it starts a second agent in the background, whose answer comes back into the conversation when it is done. It can also leave a command running in a tab of its own, a dev server or a watcher, instead of holding up a turn.
32
+
33
+ ## Web search
34
+
35
+ Paimon can search the web without an API key. It asks in no permission mode, because a search changes nothing on your machine. Searches go through [ddgs](https://github.com/deedy5/ddgs), a metasearch library, so a query may be sent to any of several public search engines. `--no-web-search` takes the tool away for a run.
32
36
 
33
37
  ## Skills
34
38
 
@@ -88,6 +92,7 @@ paimon log a1b2c3 # what a session did, one line per event
88
92
  ```bash
89
93
  paimon --mode read # start in a more cautious permission mode (yolo is the default)
90
94
  paimon --strict # ask before every command, even read-only ones
95
+ paimon --no-web-search # take the web search tool away for this run
91
96
  paimon --web # the same UI in a browser (--port, default 8000)
92
97
  paimon -p "what does cli.py do?" # one answer on stdout, no UI
93
98
  cat log.txt | paimon -p "summarize this"
@@ -97,15 +102,17 @@ paimon --profile work # a separately configured account
97
102
 
98
103
  `-p` never stops to ask, so with the default `yolo` mode it can already write files and run commands. Add `--output-format result` for a single JSON object with the outcome, which is what a calling program should read. `paimon --help` lists the rest.
99
104
 
105
+ Inside a [Herdr](https://herdr.dev) pane the UI reports its state and resume command to Herdr on its own, with nothing to install.
106
+
100
107
  ## Configuration
101
108
 
102
- Each profile keeps its model settings in `~/.config/paimon/<name>/config.json`, written by the first launch or by `paimon login`. Sessions live in `~/.local/share/paimon/sessions/`. File changes render nicer if [delta](https://github.com/dandavison/delta) is installed.
109
+ Each profile keeps its model settings in `~/.config/paimon/<name>/config.json`, written by the first launch or by `paimon login`. Sessions live in `~/.local/share/paimon/sessions/`.
103
110
 
104
- Read and edit modes run a small set of clearly read-only commands (`ls`, `cat`, `git status`, …) without asking; `--strict` turns that off. **This is a guardrail against agent mistakes, not a security boundary.** For real isolation, run Paimon inside a container or VM.
111
+ Read and edit modes run a small set of clearly read-only commands (`ls`, `cat`, `git status`, …) without asking; `--strict` turns that off. On Windows, where cmd.exe runs the commands, every command asks. **This is a guardrail against agent mistakes, not a security boundary.** For real isolation, run Paimon inside a container or VM.
105
112
 
106
113
  ## Architecture
107
114
 
108
- `Agent.run` is a UI-agnostic stream of events; the TUI, `--web` and headless mode are three renderers over that one stream. `Supervisor` sits between an agent and the subagents or background commands it starts, and is the permission boundary for both.
115
+ `Agent.run` is a UI-agnostic stream of events; the TUI, `--web` and headless mode are three renderers over that one stream. An agent holds the subagents and background commands it starts. A subagent is another `Agent` running as a task in the same process, and its answer is delivered to its parent as a message.
109
116
 
110
117
  ```mermaid
111
118
  flowchart TD
@@ -135,13 +142,7 @@ flowchart TD
135
142
  ModelWindows["model_windows.py<br/>context window sizes"]
136
143
  Retry["retry.py"]
137
144
  Mentions["mentions.py<br/>@path expansion"]
138
- Aside["aside.py<br/>off-turn question, unrecorded"]
139
- end
140
-
141
- subgraph concurrency["Jobs & subagents"]
142
- Supervisor["supervisor.py<br/>job pool, permissions"]
143
- Jobs["jobs.py<br/>AgentJob / CommandJob"]
144
- AgentTypes["agents.py<br/>subagent types"]
145
+ Jobs["turns.py<br/>turn driver"]
145
146
  end
146
147
 
147
148
  subgraph support["Config & skills"]
@@ -161,11 +162,10 @@ flowchart TD
161
162
  App --> CommandPane
162
163
  App --> Tabs
163
164
  App --> Login
164
- App --> Supervisor
165
165
  App --> Config
166
166
 
167
+ Pane --> Jobs
167
168
  Pane --> AgentLoop
168
- Pane --> Aside
169
169
  Pane --> Diff
170
170
  Pane --> UIWidgets
171
171
  Pane --> LLM
@@ -179,26 +179,18 @@ flowchart TD
179
179
  AgentLoop --> Compaction
180
180
  AgentLoop --> Retry
181
181
  AgentLoop --> Mentions
182
- AgentLoop -. "spawn_agent / run_background" .-> Supervisor
183
-
184
- Aside --> Retry
185
- Aside --> SessionMod
182
+ AgentLoop -. "spawn_agent" .-> AgentLoop
183
+ AgentLoop -. "run_background" .-> CommandPane
186
184
 
187
185
  PromptMod --> Skills
188
186
  Compaction --> ModelWindows
189
187
 
190
- Supervisor --> Jobs
191
- Supervisor --> AgentTypes
192
- Supervisor --> ToolsMod
193
- Supervisor -. "launch callback" .-> App
194
188
  Jobs --> AgentLoop
195
189
 
196
- AgentTypes --> ToolsMod
197
- AgentTypes --> Config
198
190
  Skills --> Config
199
191
  Config --> LLM
200
192
  ```
201
193
 
202
194
  ## Telemetry
203
195
 
204
- Each launch sends one anonymous event to Google Analytics: a random install id, the launch mode, the version, the OS name and the configured provider and model name. Nothing from your sessions, prompts, files or credentials is included. Set `PAIMON_NO_TELEMETRY=1` or `DO_NOT_TRACK=1` to turn it off.
196
+ Each launch sends one anonymous event to Google Analytics: a random install id, the launch mode, the version, the OS name, the language from `LC_ALL`/`LANG`, whether this is the first launch, and the configured provider and model name. Nothing from your sessions, prompts, files or credentials is included. Set `PAIMON_NO_TELEMETRY=1` or `DO_NOT_TRACK=1` to turn it off.
@@ -28,7 +28,11 @@ uvx paimon
28
28
 
29
29
  运行时:`Shift+Tab` 切换 agent 的自主程度(**read** 写文件或执行命令前先询问,**edit** 放行工作目录内的编辑,**yolo** 从不询问,也是默认值),`Esc` 打断当前回合,`Ctrl+P` 打开命令面板,`Ctrl+C` 退出。以 `!` 开头的一行不发给模型,而是直接在 shell 里执行,输出 Paimon 也能看到。`!!` 则不告诉它。
30
30
 
31
- `Ctrl+T` 在新 pane 里打开另一个会话,`Ctrl+W` 关闭当前 pane,`Ctrl+PageUp` 和 `Ctrl+PageDown` 在 pane 之间切换,`Ctrl+G` 跳到正在等待授权的 pane。Paimon 自己也能开 pane:让它同时做两件互不相干的事,它会在新 tab 里起第二个 agent。它也能把一条命令留在单独的 tab 里跑,比如开发服务器或者文件监视,不占着当前回合。
31
+ `Ctrl+T` 在新 pane 里打开另一个会话,`Ctrl+W` 关闭当前 pane,`Ctrl+PageUp` 和 `Ctrl+PageDown` 在 pane 之间切换,`Ctrl+G` 跳到正在等待授权的 pane。Paimon 也能并行干活:让它同时做两件互不相干的事,它会在后台起第二个 agent,做完后结果会回到当前会话里。它也能把一条命令留在单独的 tab 里跑,比如开发服务器或者文件监视,不占着当前回合。
32
+
33
+ ## 网页搜索
34
+
35
+ Paimon 可以搜索网页,不需要 API key。任何权限模式下都不会询问,因为搜索不会改动本机的任何东西。搜索通过元搜索库 [ddgs](https://github.com/deedy5/ddgs) 进行,所以一条 query 可能被发往多个公共搜索引擎中的任意一个。`--no-web-search` 可以在本次运行中去掉这个工具。
32
36
 
33
37
  ## Skills
34
38
 
@@ -88,6 +92,7 @@ paimon log a1b2c3 # 查看会话做了什么,每个事件一行
88
92
  ```bash
89
93
  paimon --mode read # 以更谨慎的权限模式启动(默认为 yolo)
90
94
  paimon --strict # 每条命令都先询问,包括只读命令
95
+ paimon --no-web-search # 本次运行不提供网页搜索工具
91
96
  paimon --web # 在浏览器中使用同一套 UI(--port,默认 8000)
92
97
  paimon -p "what does cli.py do?" # 直接在 stdout 输出回答,不启动 UI
93
98
  cat log.txt | paimon -p "summarize this"
@@ -99,13 +104,13 @@ paimon --profile work # 单独配置的另一个账号
99
104
 
100
105
  ## 配置
101
106
 
102
- 每个 profile 的模型设置保存在 `~/.config/paimon/<name>/config.json`,由首次启动或 `paimon login` 写入。会话存放在 `~/.local/share/paimon/sessions/`。安装 [delta](https://github.com/dandavison/delta) 后文件改动的展示效果更好。
107
+ 每个 profile 的模型设置保存在 `~/.config/paimon/<name>/config.json`,由首次启动或 `paimon login` 写入。会话存放在 `~/.local/share/paimon/sessions/`。
103
108
 
104
- read 和 edit 模式会不经询问执行一小组明确只读的命令(`ls`、`cat`、`git status` 等),`--strict` 可以关掉。**这是防止 agent 失误的护栏,不是安全边界。** 需要真正的隔离时,请在容器或虚拟机中运行 Paimon。
109
+ read 和 edit 模式会不经询问执行一小组明确只读的命令(`ls`、`cat`、`git status` 等),`--strict` 可以关掉。Windows 上命令由 cmd.exe 执行,每条命令都会询问。**这是防止 agent 失误的护栏,不是安全边界。** 需要真正的隔离时,请在容器或虚拟机中运行 Paimon。
105
110
 
106
111
  ## 架构
107
112
 
108
- `Agent.run` 产出一串与 UI 无关的事件流,TUI、`--web` 和无头模式都是这条事件流的渲染器。`Supervisor` 位于 agent 和它启动的子 agent、后台命令之间,是两者共同的权限边界。
113
+ `Agent.run` 产出一串与 UI 无关的事件流,TUI、`--web` 和无头模式都是这条事件流的渲染器。agent 自己持有它启动的子 agent 和后台命令。子 agent 是同一进程里作为任务运行的另一个 `Agent`,它的结果会作为一条消息送回父 agent。
109
114
 
110
115
  ```mermaid
111
116
  flowchart TD
@@ -135,13 +140,7 @@ flowchart TD
135
140
  ModelWindows["model_windows.py<br/>各模型上下文窗口大小"]
136
141
  Retry["retry.py"]
137
142
  Mentions["mentions.py<br/>@path 展开"]
138
- Aside["aside.py<br/>回合外提问,不落盘"]
139
- end
140
-
141
- subgraph concurrency["任务与子 agent"]
142
- Supervisor["supervisor.py<br/>任务池、权限"]
143
- Jobs["jobs.py<br/>AgentJob / CommandJob"]
144
- AgentTypes["agents.py<br/>子 agent 类型"]
143
+ Jobs["turns.py<br/>回合驱动"]
145
144
  end
146
145
 
147
146
  subgraph support["配置与 skills"]
@@ -161,11 +160,10 @@ flowchart TD
161
160
  App --> CommandPane
162
161
  App --> Tabs
163
162
  App --> Login
164
- App --> Supervisor
165
163
  App --> Config
166
164
 
165
+ Pane --> Jobs
167
166
  Pane --> AgentLoop
168
- Pane --> Aside
169
167
  Pane --> Diff
170
168
  Pane --> UIWidgets
171
169
  Pane --> LLM
@@ -179,26 +177,18 @@ flowchart TD
179
177
  AgentLoop --> Compaction
180
178
  AgentLoop --> Retry
181
179
  AgentLoop --> Mentions
182
- AgentLoop -. "spawn_agent / run_background" .-> Supervisor
183
-
184
- Aside --> Retry
185
- Aside --> SessionMod
180
+ AgentLoop -. "spawn_agent" .-> AgentLoop
181
+ AgentLoop -. "run_background" .-> CommandPane
186
182
 
187
183
  PromptMod --> Skills
188
184
  Compaction --> ModelWindows
189
185
 
190
- Supervisor --> Jobs
191
- Supervisor --> AgentTypes
192
- Supervisor --> ToolsMod
193
- Supervisor -. "启动回调" .-> App
194
186
  Jobs --> AgentLoop
195
187
 
196
- AgentTypes --> ToolsMod
197
- AgentTypes --> Config
198
188
  Skills --> Config
199
189
  Config --> LLM
200
190
  ```
201
191
 
202
192
  ## 遥测
203
193
 
204
- 每次启动会向 Google Analytics 发送一条匿名事件:随机生成的安装 id、启动方式、版本号、操作系统名称,以及配置的 provider 和模型名。会话、提示词、文件和密钥一概不上报。设置 `PAIMON_NO_TELEMETRY=1` 或 `DO_NOT_TRACK=1` 可以关闭。
194
+ 每次启动会向 Google Analytics 发送一条匿名事件:随机生成的安装 id、启动方式、版本号、操作系统名称、取自 `LC_ALL`/`LANG` 的语言、是否首次启动,以及配置的 provider 和模型名。会话、提示词、文件和密钥一概不上报。设置 `PAIMON_NO_TELEMETRY=1` 或 `DO_NOT_TRACK=1` 可以关闭。
@@ -0,0 +1,16 @@
1
+ """Disposable process for bounded, cancellable code searches."""
2
+
3
+ import json
4
+ import sys
5
+ from pathlib import Path
6
+
7
+ from .tools import _grep
8
+
9
+
10
+ def main() -> None:
11
+ args, cwd, sandboxed = json.load(sys.stdin)
12
+ sys.stdout.write(json.dumps(_grep(args, Path(cwd), sandboxed=sandboxed)))
13
+
14
+
15
+ if __name__ == "__main__":
16
+ main()