@muyichengshayu/promptx 0.1.8 → 0.1.10

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 (67) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.en.md +216 -0
  3. package/README.md +232 -43
  4. package/apps/runner/src/codex.js +554 -0
  5. package/apps/runner/src/engines/claudeCodeRunner.js +537 -0
  6. package/apps/runner/src/engines/codexRunner.js +14 -0
  7. package/apps/runner/src/engines/index.js +35 -0
  8. package/apps/runner/src/engines/openCodeRunner.js +545 -0
  9. package/apps/runner/src/index.js +151 -0
  10. package/apps/runner/src/internalAuth.js +34 -0
  11. package/apps/runner/src/processControl.js +384 -0
  12. package/apps/runner/src/runManager.js +748 -0
  13. package/apps/runner/src/serverClient.js +118 -0
  14. package/apps/server/src/agents/openCodeRunner.js +86 -6
  15. package/apps/server/src/assetRoutes.js +102 -0
  16. package/apps/server/src/codexRoutes.js +305 -0
  17. package/apps/server/src/codexRuns.js +291 -15
  18. package/apps/server/src/db.js +86 -0
  19. package/apps/server/src/gitDiff.js +57 -0
  20. package/apps/server/src/gitDiffClient.js +310 -0
  21. package/apps/server/src/gitDiffWorker.js +78 -0
  22. package/apps/server/src/index.js +317 -861
  23. package/apps/server/src/internalAuth.js +34 -0
  24. package/apps/server/src/internalRoutes.js +80 -0
  25. package/apps/server/src/maintenance.js +279 -0
  26. package/apps/server/src/processControl.js +123 -7
  27. package/apps/server/src/relayClient.js +139 -9
  28. package/apps/server/src/relayServer.js +162 -0
  29. package/apps/server/src/repository.js +347 -14
  30. package/apps/server/src/runDispatchService.js +210 -0
  31. package/apps/server/src/runEventIngest.js +163 -0
  32. package/apps/server/src/runRecovery.js +162 -0
  33. package/apps/server/src/runnerClient.js +126 -0
  34. package/apps/server/src/runnerDispatch.js +110 -0
  35. package/apps/server/src/systemConfig.js +96 -0
  36. package/apps/server/src/systemRoutes.js +143 -0
  37. package/apps/server/src/taskAutomation.js +589 -0
  38. package/apps/server/src/taskRoutes.js +339 -0
  39. package/apps/server/src/webAppRoutes.js +23 -0
  40. package/apps/web/dist/assets/CodexSessionManagerDialog-BbS67-19.js +1 -0
  41. package/apps/web/dist/assets/TaskDiffReviewDialog-BNF6rrst.js +12 -0
  42. package/apps/web/dist/assets/WorkbenchSettingsDialog-BRvpf4VN.js +26 -0
  43. package/apps/web/dist/assets/WorkbenchView-CNmiMvb0.js +236 -0
  44. package/apps/web/dist/assets/index-DnOzjxzw.js +25 -0
  45. package/apps/web/dist/assets/index-gJE-amF1.css +1 -0
  46. package/apps/web/dist/assets/{info-DHkbhyky.js → info-BibVhe8O.js} +1 -1
  47. package/apps/web/dist/index.html +2 -2
  48. package/docs/assets/readme-diff-glass.png +0 -0
  49. package/docs/assets/readme-execution-focus-glass.png +0 -0
  50. package/docs/assets/readme-mobile-remote-glass.png +0 -0
  51. package/docs/assets/readme-project-manager-glass.png +0 -0
  52. package/docs/assets/readme-settings-relay-glass.png +0 -0
  53. package/docs/assets/readme-settings-system-glass.png +0 -0
  54. package/docs/assets/readme-settings-theme-glass.png +0 -0
  55. package/docs/assets/readme-workbench-glass.png +0 -0
  56. package/docs/runner-split-plan.md +428 -0
  57. package/docs/runner-split-test-plan.md +181 -0
  58. package/package.json +17 -2
  59. package/packages/shared/src/index.js +73 -0
  60. package/scripts/service.mjs +154 -109
  61. package/apps/server/src/codexRunRuntime.js +0 -245
  62. package/apps/web/dist/assets/CodexSessionManagerDialog-DjmBdgil.js +0 -1
  63. package/apps/web/dist/assets/TaskDiffReviewDialog-DCcoVMmm.js +0 -12
  64. package/apps/web/dist/assets/WorkbenchSettingsDialog-Bk2NQ2H3.js +0 -21
  65. package/apps/web/dist/assets/WorkbenchView-COApDo0z.js +0 -216
  66. package/apps/web/dist/assets/index-B3UXxmEa.js +0 -25
  67. package/apps/web/dist/assets/index-BpuKxoB2.css +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.10
4
+
5
+ - 重构执行链路为 `server + runner` 双进程架构:`server` 专注 HTTP API、任务/项目存储与 SSE,`runner` 专注 agent 子进程生命周期、事件流、stop/kill/超时回收,显著降低长任务拖垮主服务的风险。
6
+ - 新增 runner 全局并发控制与排队能力,默认真实 agent 最大并发提升到 `3`,并支持在“设置 -> 系统”里热更新并发上限;排队中的任务在扩容后可立即启动。
7
+ - 补齐运行态诊断与控制面韧性:增加 server/runner 内部 HTTP 超时、queued/stopping 心跳、失联恢复与 stop 原因分类,并在系统设置页展示 active/tracked/queued、终态计数、stop timeout 阶段等实时诊断信息。
8
+ - 收口服务端热路径与路由结构,拆分 `tasks / codex / system / internal / assets / webApp` 路由模块,降低 `apps/server/src/index.js` 复杂度,同时把 git diff 等低频重操作继续隔离出热接口。
9
+ - 新增真实 E2E 回归覆盖:验证多任务并发、真实长任务 stop/回收,以及浏览器设置页里动态调大并发后 queued 任务立即启动,Codex / OpenCode 两条链路均已跑通。
10
+ - 修复编辑区长提示词刷新后高度不自动撑开、以及双滚动条的问题,保证长输入场景下的编辑体验稳定。
11
+ - 新增定式任务能力,补齐相关工作流与交互细节,便于按固定结构复用任务模板。
12
+ - 收口主题系统与毛玻璃皮肤细节,修复删除确认弹窗按钮不可见、主题项冗余色条、主题名称与说明乱码等问题。
13
+ - 新增 `Ink Mist` 主题,补齐独立的冷雾水墨风格,并在移动端默认禁用高开销毛玻璃主题以保证性能稳定。
14
+ - 优化项目管理体验,修复“从执行中的项目进入后所有项目都不能删除”的错误禁用逻辑,并让任务列表在刷新、执行和状态变化时保持稳定顺序。
15
+ - 修复 Codex 回复区列表样式,恢复有序/无序列表 marker,并补齐嵌套列表层级样式与间距。
16
+ - 增强 Relay 稳定性与诊断能力:增加 ping/pong 心跳、超时重连、client/server 关键日志与 recent events,以及本地设置页一键复制诊断信息。
17
+ - 新增任务级“代办”收纳箱:支持把编辑区内容暂存为代办、在弹层中统一管理、二次确认后回填或删除,并随任务一起持久化保存。
18
+
19
+ ## 0.1.9
20
+
21
+ - 新增 `PromptX Glass Light` 毛玻璃主题,统一覆盖工作台主容器、任务列表、设置面板、弹窗、下拉、状态标签与图片预览层。
22
+ - 优化执行区视觉层次,补齐提示词 / 执行过程 / 回复三类消息卡片,以及 Markdown 中引用、代码块、表格等内容样式。
23
+ - 单独收敛手机端观感:压低玻璃强度与阴影,收紧任务卡、详情头部、设置页导航与表单布局。
24
+ - 修复 Markdown 表格在新主题下布局错乱的问题,改为使用外层滚动容器承载表格边框与横向滚动。
25
+ - 编辑区右上角主按钮在任务执行中保持“发送”文案并禁用,不再切换成“停止”,减少误触和语义跳变。
26
+
3
27
  ## 0.1.8
4
28
 
5
29
  - 新增 OpenCode 执行引擎接入,补齐 runner、契约测试、Doctor 检查与文档说明,并支持在项目配置里直接选择 OpenCode。
package/README.en.md ADDED
@@ -0,0 +1,216 @@
1
+ # PromptX
2
+
3
+ [中文 README](README.md)
4
+
5
+ PromptX is a local AI agent workspace built for long-running coding tasks.
6
+
7
+ It helps `Codex`, `Claude Code`, and `OpenCode` feel less like isolated CLI sessions and more like a structured workflow with better inputs, better outputs, and reusable context.
8
+
9
+ - Organize requirements, screenshots, notes, `md`, `txt`, and `pdf` before sending
10
+ - Bind each task to a stable project and working directory
11
+ - Review execution logs, final replies, run history, and code diffs in one place
12
+
13
+ If you already like agent CLIs but want a cleaner way to manage context, review code changes, and continue work across multiple rounds, PromptX is built for that.
14
+
15
+ ```text
16
+ Task -> Project -> Directory -> Thread -> Run -> Diff
17
+ ```
18
+
19
+ ## At A Glance
20
+
21
+ - Keep using the agent you already prefer: `Codex`, `Claude Code`, or `OpenCode`
22
+ - Let PromptX organize tasks, projects, directories, threads, and run history
23
+ - Prepare context first, then send a better request
24
+ - Review process logs, final output, and code diffs on the same screen
25
+ - Extend from local use to remote access when needed
26
+
27
+ ## What You Get
28
+
29
+ - A task workspace for ongoing collaboration, not a one-shot prompt box
30
+ - A reusable project layer that keeps the same working directory and agent thread together
31
+ - A persistent run history you can revisit later
32
+ - Built-in diff review for code-generating tasks
33
+ - Remote access options, including self-hosted Relay and an author-hosted service
34
+
35
+ ## Why It Works Well For Codex / Claude Code / OpenCode Users
36
+
37
+ ### Better Input Experience
38
+
39
+ - Tasks are durable context containers, not temporary prompts
40
+ - You can assemble text, screenshots, imported files, notes, and todos before sending
41
+ - Each task can be bound to a PromptX project, and each project can be bound to a fixed working directory
42
+ - Reuse the same project and thread for the same repo instead of repeating environment setup every round
43
+ - The input area supports text, images, `md`, `txt`, and `pdf`
44
+
45
+ ### Better Output Experience
46
+
47
+ - Execution logs are visible in the center panel instead of being buried in terminal scrollback
48
+ - Every run keeps its prompt, event log, final reply, and summary
49
+ - Built-in code diff review makes it easier to inspect what the agent actually changed
50
+ - System diagnostics show runner concurrency, queueing, recovery, and stop-related states
51
+
52
+ ### One Workspace For Multiple Engines
53
+
54
+ - PromptX currently supports `Codex`, `Claude Code`, and `OpenCode`
55
+ - The same task, project, event, and run UI works across all of them
56
+ - More engines can be added without changing the overall workflow
57
+
58
+ ## Screenshots
59
+
60
+ All screenshots below use the `Glass Light` theme.
61
+
62
+ ### Workspace Overview
63
+
64
+ Manage tasks on the left, inspect execution in the center, and prepare inputs on the right.
65
+
66
+ ![PromptX workspace overview](docs/assets/readme-workbench-glass.png)
67
+
68
+ ### Execution Focus
69
+
70
+ Review process logs, turn summaries, and final replies in one continuous view.
71
+
72
+ ![PromptX execution focus](docs/assets/readme-execution-focus-glass.png)
73
+
74
+ ### Code Diff Review
75
+
76
+ Inspect code changes by workspace, accumulated task history, or a single run.
77
+
78
+ ![PromptX code diff review](docs/assets/readme-diff-glass.png)
79
+
80
+ ### Project Manager
81
+
82
+ Bind tasks to a fixed project, working directory, and engine so context stays stable.
83
+
84
+ ![PromptX project manager](docs/assets/readme-project-manager-glass.png)
85
+
86
+ ### Remote Relay Settings
87
+
88
+ Configure remote access directly from the settings panel.
89
+
90
+ ![PromptX relay settings](docs/assets/readme-settings-relay-glass.png)
91
+
92
+ ### Mobile Remote Usage
93
+
94
+ PromptX can also be accessed remotely on mobile devices, which is a major highlight for many people who want to keep an eye on `Codex`, `Claude Code`, or `OpenCode` runs away from their desk.
95
+
96
+ ![PromptX mobile remote access](docs/assets/readme-mobile-remote-glass.png)
97
+
98
+ ## Core Workflow
99
+
100
+ ### 1. Organize First, Then Send
101
+
102
+ Instead of dumping a large prompt into the agent immediately, collect the task goal, supporting files, screenshots, logs, and constraints first.
103
+
104
+ ### 2. Bind The Task To A Stable Project
105
+
106
+ Projects keep the working directory and engine session stable, so future rounds do not need the same environment explanation again and again.
107
+
108
+ ### 3. Review Process, Result, And Diff Together
109
+
110
+ PromptX makes one run easier to inspect by splitting it into three visible layers:
111
+
112
+ - Process: what the agent did
113
+ - Result: what the agent replied with
114
+ - Diff: what changed in the codebase
115
+
116
+ ### 4. Continue Long Tasks Without Losing Structure
117
+
118
+ Long-running tasks keep their task context, project binding, and run history in place, instead of being scattered across terminal tabs and notes.
119
+
120
+ ## Remote Access
121
+
122
+ PromptX supports full remote access workflows, not just temporary LAN exposure.
123
+
124
+ You can choose between:
125
+
126
+ - Local-only access for personal desktop use
127
+ - Self-hosted Relay on your own server
128
+ - The hosted remote service maintained by the author
129
+
130
+ For setup details, see:
131
+
132
+ - `docs/relay-quickstart.md`
133
+
134
+ ### Self-Hosted Relay
135
+
136
+ Recommended if you want full control over your own domain, data flow, and access strategy.
137
+
138
+ - Good for users with a server and basic ops knowledge
139
+ - Suitable for personal long-term use or small internal teams
140
+ - Current docs already cover startup, tenants, domains, Nginx, and troubleshooting
141
+
142
+ ### Author-Hosted Remote Service
143
+
144
+ If you do not want to deploy your own Relay, the author is already running a hosted remote service.
145
+
146
+ - Good for trying remote PromptX quickly
147
+ - Good for users who want mobile access without self-hosting first
148
+ - Limited seats are available; contact the author if you want an account
149
+
150
+ This hosted option is best treated as a convenience offering. If you need long-term guaranteed capacity, self-hosting is still the better path.
151
+
152
+ ## Best Use Cases
153
+
154
+ - Prepare requirements, screenshots, and docs before sending a coding task
155
+ - Reuse the same working directory and thread across many rounds
156
+ - Review execution logs, final output, and code changes together
157
+ - Access PromptX remotely from a phone or another device
158
+ - Run PromptX on a remote machine for always-on personal usage
159
+
160
+ ## Installation
161
+
162
+ ```bash
163
+ npm install -g @muyichengshayu/promptx
164
+ promptx doctor
165
+ ```
166
+
167
+ ## Start
168
+
169
+ Default URL: `http://127.0.0.1:3000`
170
+
171
+ ```bash
172
+ promptx start
173
+ promptx status
174
+ promptx stop
175
+ promptx relay start
176
+ ```
177
+
178
+ ## Development
179
+
180
+ ```bash
181
+ pnpm install
182
+ pnpm dev
183
+ pnpm build
184
+ ```
185
+
186
+ Workspace structure:
187
+
188
+ - `apps/web`: Vue 3 + Vite frontend
189
+ - `apps/server`: Fastify backend
190
+ - `apps/runner`: standalone runner process
191
+ - `packages/shared`: shared constants and event protocol
192
+
193
+ Screenshot generator used for the README:
194
+
195
+ - `scripts/capture-readme-screenshots.mjs`
196
+
197
+ ## Supported Engines
198
+
199
+ - `Codex`
200
+ - `Claude Code`
201
+ - `OpenCode`
202
+
203
+ Related docs:
204
+
205
+ - `docs/agent-run-protocol.md`
206
+ - `docs/relay-quickstart.md`
207
+
208
+ ## Notes
209
+
210
+ - PromptX is currently optimized for local-first, mostly single-user workflows
211
+ - Different engines may expose different tool capabilities and event richness
212
+ - Restricted engine permissions will directly affect file edits, command execution, and automation
213
+
214
+ ## License
215
+
216
+ PromptX is licensed under `Apache-2.0`. See `LICENSE`.
package/README.md CHANGED
@@ -1,42 +1,186 @@
1
1
  # PromptX
2
2
 
3
- PromptX 是一个面向本机 AI 协作的轻量工作台。
3
+ [English README](README.en.md)
4
4
 
5
- 它适合先整理需求、截图、文本、PDF、禅道 Bug 等上下文,再持续发送给本机 AI Agent,在同一页里查看执行过程和多轮结果。
5
+ PromptX 是一个面向本机 AI Agent 协作的工作台。
6
6
 
7
- ## 核心能力
7
+ `Codex`、`Claude Code`、`OpenCode` 不只是“能跑起来”,而是能在长期任务里更顺手地输入、更清楚地输出、更稳定地复用上下文。
8
8
 
9
- - 左侧管理任务,中间查看项目执行过程,右侧整理输入内容
10
- - 支持文本、图片、`md`、`txt`、`pdf`
11
- - 支持为任务绑定本机项目,并持续复用同一个执行引擎线程
12
- - 支持多执行引擎,当前已接入 `Codex`、`Claude Code`、`OpenCode`
13
- - 支持查看执行过程、代码变更和最终回复
14
- - 支持公开页与 Raw 导出
15
- - 内置禅道 Chrome 扩展,可一键把 Bug 内容带入工作台
9
+ 它不是把 `Codex`、`Claude Code`、`OpenCode` 简单塞进一个网页,而是把你和 agent 的协作过程整理成一套更顺手的输入输出流程:
16
10
 
17
- ## 项目截图
11
+ - 输入前,先按任务整理需求、截图、文本、`md`、`txt`、`pdf`
12
+ - 发送时,为任务绑定固定项目和工作目录,持续复用同一条 agent 线程
13
+ - 输出后,在同一页同时看执行过程、最终回复、历史 run 和代码变更
18
14
 
19
- ### 工作台
15
+ 如果你平时已经习惯用 agent CLI,但又希望把多轮上下文、项目绑定、变更审查和远程访问整理得更清楚,PromptX 就是为这类场景准备的。
20
16
 
21
- ![PromptX 工作台](docs/assets/workbench-overview.jpg)
17
+ ```text
18
+ 任务 -> 项目 -> 目录 -> 线程 -> Run -> Diff
19
+ ```
20
+
21
+ ## 一眼看懂 PromptX
22
+
23
+ - 你继续用熟悉的 `Codex`、`Claude Code`、`OpenCode`
24
+ - PromptX 负责把任务、项目、目录、线程和 run 历史整理成一个稳定工作台
25
+ - 输入侧更适合先整理上下文再发
26
+ - 输出侧更适合同页看过程、回复和 diff
27
+ - 对长期、多轮、要落代码的任务,比纯 CLI 窗口更省切换成本
28
+
29
+ ## 你会得到什么
30
+
31
+ - 一个适合长期协作的任务工作台,而不是一次性 prompt 输入框
32
+ - 一个可复用的项目层,把工作目录和 agent 线程稳定绑在一起
33
+ - 一个能回看历史 run 的输出面板,不只看到最终一句回答
34
+ - 一个随手就能审查代码改动的 diff 视图
35
+ - 一个可以继续扩展到远程访问、通知和自动化的本机控制台
36
+ - 一套可选的远程访问能力:既支持自建 Relay,也支持接入作者已部署的远程服务
37
+
38
+ ## 为什么更适合 Codex / Claude Code / OpenCode 用户
39
+
40
+ ### 更好的输入体验
41
+
42
+ - 任务不是一段临时 prompt,而是一份可持续维护的上下文容器
43
+ - 可以把文本、截图、导入文件、补充说明和待办项集中整理后再发给 agent
44
+ - 一个任务可以绑定一个 PromptX 项目;一个项目再绑定固定工作目录
45
+ - 同一个目录可以复用同一个项目和线程,减少每轮重新交代环境的成本
46
+ - 输入区支持文本、图片、`md`、`txt`、`pdf`,适合把零散上下文先压成一轮高质量输入
47
+
48
+ ### 更好的输出体验
49
+
50
+ - 中间面板直接展示执行过程,不用只盯着 CLI 输出
51
+ - 每次运行都会留下完整 run 记录,方便回看 prompt、过程日志和最终回复
52
+ - 内置代码变更视图,适合在改动落地后快速审查 workspace diff
53
+ - 系统面板能看到 runner 并发、排队、恢复和 stop 相关诊断
54
+ - 对“让 agent 改代码”这类任务,能更清楚地区分它想了什么、做了什么、改了什么
55
+
56
+ ### 多引擎统一协作
57
+
58
+ - 当前已接入 `Codex`、`Claude Code`、`OpenCode`
59
+ - 前端统一用一套任务、项目、run、事件面板来承接多引擎协作
60
+ - 后续扩展更多 agent 时,输入区、过程面板和历史记录可以继续复用
61
+
62
+ ## 系统截图
63
+
64
+ 以下截图统一使用 `Glass Light` 毛玻璃主题,方便展示工作台层次和信息密度。
65
+
66
+ ### 工作台总览
67
+
68
+ 左侧管理任务,中间查看项目执行过程,右侧整理输入内容。
69
+
70
+ ![PromptX 工作台总览](docs/assets/readme-workbench-glass.png)
71
+
72
+ ### 执行过程聚焦
73
+
74
+ 把 agent 的过程日志、回合总结和最终回复放在一条连续视图里,更适合审查一轮 run 到底做了什么。
75
+
76
+ ![PromptX 执行过程聚焦](docs/assets/readme-execution-focus-glass.png)
77
+
78
+ ### 代码变更审查
79
+
80
+ 除了过程日志和最终回复,还可以直接按工作区、任务累计或单次 run 查看代码改动。
81
+
82
+ ![PromptX 代码变更审查](docs/assets/readme-diff-glass.png)
83
+
84
+ ### 项目管理
85
+
86
+ 给任务绑定固定项目、固定目录和执行引擎,把 Codex / Claude Code / OpenCode 的上下文真正沉淀下来。
87
+
88
+ ![PromptX 项目管理](docs/assets/readme-project-manager-glass.png)
89
+
90
+ ### 主题设置
91
+
92
+ 内置多套主题,不只是简单深浅模式;截图里的毛玻璃皮肤就是 `Glass Light`。
93
+
94
+ ![PromptX 主题设置](docs/assets/readme-settings-theme-glass.png)
95
+
96
+ ### Relay 远程访问
97
+
98
+ 如果你希望在手机或外部网络访问自己电脑上的 PromptX,可以直接在设置里接入 Relay。
99
+
100
+ ![PromptX Relay 设置](docs/assets/readme-settings-relay-glass.png)
101
+
102
+ ### 移动端远程操作
103
+
104
+ PromptX 支持通过远程访问在手机上直接查看和继续操作任务,这也是很多 `Codex`、`Claude Code`、`OpenCode` 用户很在意的一点:离开电脑后,仍然能继续看执行状态、回看结果、继续推动任务。
105
+
106
+ ![PromptX 移动端远程操作](docs/assets/readme-mobile-remote-glass.png)
107
+
108
+ ### 系统诊断
109
+
110
+ 可以直接查看 runner 并发、排队、恢复、stop 统计等运行状态。
111
+
112
+ ![PromptX 系统诊断](docs/assets/readme-settings-system-glass.png)
113
+
114
+ ## 核心工作流
22
115
 
23
- ### 设置
116
+ ### 1. 先整理,再发送
24
117
 
25
- ![PromptX 设置](docs/assets/settings-panel.jpg)
118
+ 不要急着把一大段 prompt 直接糊给 agent。先把需求、截图、补充文档、日志和待办整理进任务里,再发出去,通常会更稳。
26
119
 
27
- ### 手机端
120
+ ### 2. 把任务绑定到固定项目
28
121
 
29
- ![PromptX 手机端](docs/assets/mobile-remote.jpg)
122
+ 项目会绑定工作目录和执行引擎。这样你下一轮回来时,不需要再从头解释“在哪个仓库、哪个目录、继续哪个线程”。
123
+
124
+ ### 3. 同页回看过程、结果和代码变更
125
+
126
+ PromptX 把一次 run 拆成三类输出:
127
+
128
+ - 执行过程:agent 做了哪些动作
129
+ - 最终回复:这一轮交付了什么
130
+ - 代码变更:实际改了哪些文件、哪些 patch
131
+
132
+ 对日常工程协作来说,这比只在终端里看滚动输出更容易判断质量。
133
+
134
+ ### 4. 长任务继续滚动推进
135
+
136
+ 当一个任务需要多轮推进时,PromptX 会把任务、项目、run 历史继续留在原地。你不会因为切了一次终端窗口,就把上下文结构打散。
137
+
138
+ ## 适合什么场景
139
+
140
+ - 先整理需求、截图、日志、文件,再交给 `Codex` / `Claude Code` / `OpenCode`
141
+ - 一个项目要反复多轮协作,希望稳定复用同一个工作目录和线程
142
+ - 想把 agent 的执行过程、最终回答和代码改动放在同一页回看
143
+ - 想把本机工作台通过 Relay 或 Tailscale 暴露给手机或其他设备使用
144
+ - 想把 PromptX 放到远端长期在线使用,或给自己/小团队配一套固定远程入口
145
+ - 想把禅道 Bug、一段文档或一批文件快速转成可执行任务
146
+
147
+ ## PromptX 帮你补上的,不是模型能力,而是协作层
148
+
149
+ | 你在 CLI 里常见的问题 | PromptX 怎么补上 |
150
+ | --- | --- |
151
+ | 多轮任务散在终端和笔记里 | 用任务把上下文、待办、导入文件集中起来 |
152
+ | 每次都要重新交代目录和项目背景 | 用固定项目绑定工作目录和线程 |
153
+ | 跑完以后很难系统回看 | 保留 run 历史、过程日志和最终回复 |
154
+ | 改了代码还要自己切回 git 看 | 直接在工作台里看代码变更 |
155
+ | 想从手机或别的设备继续看 | 通过 Relay / Tailscale 继续访问 |
156
+ | 想长期放到远端机器上使用 | 支持自建远程服务,也支持接入现成 Relay |
157
+
158
+ ## 对不同 agent 用户分别意味着什么
159
+
160
+ ### 对 Codex 用户
161
+
162
+ - 更适合把需求、附图和补充文件提前整理好,再发起一轮更完整的编码任务
163
+ - 更适合回看 thread 对应的 run 历史,不容易丢失上下文
164
+
165
+ ### 对 Claude Code 用户
166
+
167
+ - 更适合在前端改版、文案整理、重构说明这类需要上下文组织的任务里使用
168
+ - 可以把“目标、约束、参考稿、附件”先变成任务,再交给 Claude Code 执行
169
+
170
+ ### 对 OpenCode 用户
171
+
172
+ - 更适合把 runner 并发、执行过程和最终 diff 放到一个面板里审查
173
+ - 对本地实验型、多轮改动型任务更友好
30
174
 
31
175
  ## 运行前提
32
176
 
33
- - 已安装 Node,支持 `20`、`22`、`24`,推荐 `22`
177
+ - Node `>=20.19.0 <21`、`>=22.13.0 <23` 或 `>=24 <25`
34
178
  - 本机至少安装一个可用执行引擎
35
- - 当前支持:
179
+ - 当前支持检查:
36
180
  - `codex --version`
37
181
  - `claude --version`
38
182
  - `opencode --version`
39
- - 如使用 Codex,建议开启高权限并使用满血模式
183
+ - 如使用 Codex,建议开启较高权限,避免文件读写和自动修改能力受限
40
184
 
41
185
  ## 安装
42
186
 
@@ -47,9 +191,7 @@ promptx doctor
47
191
 
48
192
  ## 启动
49
193
 
50
- 默认地址:
51
-
52
- - `http://127.0.0.1:3000`
194
+ 默认地址:`http://127.0.0.1:3000`
53
195
 
54
196
  ```bash
55
197
  promptx start
@@ -58,22 +200,45 @@ promptx stop
58
200
  promptx relay start
59
201
  ```
60
202
 
203
+ 其中:
204
+
205
+ - `promptx start`:启动本机 PromptX 工作台
206
+ - `promptx status`:查看当前服务状态
207
+ - `promptx stop`:停止本机服务
208
+ - `promptx relay start`:启动 Relay 接入流程,适合远程访问或自建中转
209
+
210
+ ## 源码开发
211
+
61
212
  ```bash
62
- promptx doctor
213
+ pnpm install
214
+ pnpm dev
215
+ pnpm build
63
216
  ```
64
217
 
65
- 其中:
218
+ 工作区结构:
66
219
 
67
- - `promptx start`:启动本机 PromptX 工作台
68
- - `promptx relay start`:启动公网中转服务,适合部署到你自己的云服务器
220
+ - `apps/web`:Vue 3 + Vite 前端工作台
221
+ - `apps/server`:Fastify 服务端
222
+ - `apps/runner`:独立 runner 进程
223
+ - `packages/shared`:前后端共享常量与事件协议
224
+
225
+ README 截图生成脚本:`scripts/capture-readme-screenshots.mjs`
69
226
 
70
227
  ## 使用方式
71
228
 
72
- 1. 打开工作台,新建或选择一个任务
73
- 2. 在右侧整理文本、图片、文件等上下文
74
- 3. 在中间选择一个 PromptX 项目
75
- 4. 为项目选择执行引擎,并点击发送
76
- 5. 在中间继续查看执行过程,并按需多轮发送
229
+ 1. 新建一个任务,按主题整理你要给 agent 的上下文
230
+ 2. 在右侧输入区补充文本、截图、文件或导入 PDF
231
+ 3. 在中间为当前任务选择一个 PromptX 项目
232
+ 4. 给项目绑定工作目录和执行引擎
233
+ 5. 点击发送,让 agent 在固定目录里继续工作
234
+ 6. 在同一页查看执行过程、最终回复、历史 run 和代码变更
235
+
236
+ 如果你希望更像“写给 agent 的执行单”,推荐的使用习惯是:
237
+
238
+ 1. 先在任务里把目标、约束、上下文、附件放齐
239
+ 2. 再绑定项目和目录
240
+ 3. 再发送第一轮
241
+ 4. 后续每轮都沿着同一个任务和项目继续推进
77
242
 
78
243
  ## 当前支持的执行引擎
79
244
 
@@ -81,19 +246,25 @@ promptx doctor
81
246
  - `Claude Code`
82
247
  - `OpenCode`
83
248
 
84
- PromptX 内部已经开始使用统一的 agent run 事件协议,后续继续扩展其他执行引擎时,前端展示层和执行过程面板可以尽量复用。
85
-
86
- 如需查看这套协议约定,可参考:
249
+ 如需查看统一事件协议,可参考:
87
250
 
88
251
  - `docs/agent-run-protocol.md`
89
252
 
90
- ## 远程访问 Relay(预览)
253
+ ## 远程访问 Relay
91
254
 
92
- 如果你希望在手机上远程访问自己电脑上的 PromptX,或想在云端部署多租户 Relay,请直接查看:
255
+ PromptX 现在已经支持完整的远程访问方案,不只是局域网临时打开一下页面。
256
+
257
+ 你可以按自己的情况选择三种方式:
258
+
259
+ - 本机访问:默认只监听本机地址,适合个人日常使用
260
+ - 自建远程服务:把 Relay 部署到云服务器,给自己或小团队提供稳定入口
261
+ - 接入现成远程服务:作者自己维护了一套可用的远程服务,适合不想自己折腾部署的用户
262
+
263
+ 如果你希望在手机上访问自己电脑上的 PromptX,或想把 Relay 部署到云服务器,请直接看:
93
264
 
94
265
  - `docs/relay-quickstart.md`
95
266
 
96
- 文档里已经整理好这些内容:
267
+ 文档中已经覆盖:
97
268
 
98
269
  - 本地 PromptX 接入 Relay
99
270
  - 云端 Relay 启动与后台管理
@@ -102,14 +273,32 @@ PromptX 内部已经开始使用统一的 agent run 事件协议,后续继续
102
273
  - `promptx relay start/stop/restart/status`
103
274
  - Nginx、DNS、健康检查与常见排查
104
275
 
276
+ ### 自建远程服务
277
+
278
+ 如果你希望完全掌控数据、域名和访问策略,推荐自建 Relay。
279
+
280
+ - 适合有云服务器、域名和基本运维能力的用户
281
+ - 可以给自己长期使用,也可以给小团队做内部入口
282
+ - 当前文档已经覆盖了启动、租户、多域名、Nginx 和常见排查
283
+
284
+ ### 作者提供的远程服务
285
+
286
+ 如果你不想自己部署,作者本人已经在线上维护了一套可用的远程服务。
287
+
288
+ - 可以更快体验远程访问能力
289
+ - 适合先试用,再决定是否自建
290
+ - 当前名额有限,如有需要可以联系作者申请开通账号
291
+
292
+ 这一部分更偏体验支持,不保证长期无限量开放,建议有长期稳定需求的用户后续自建一套。
293
+
105
294
  ## 禅道扩展
106
295
 
107
296
  仓库内置了禅道 Chrome 扩展:`apps/zentao-extension`
108
297
 
109
298
  注意:
110
299
 
111
- - 目前 `npm install -g @muyichengshayu/promptx` 安装的正式包不包含这个扩展目录
112
- - 如需使用禅道扩展,请先下载或克隆本仓库源码,再按下面方式手动加载
300
+ - `npm install -g @muyichengshayu/promptx` 安装的正式包不包含该扩展目录
301
+ - 如需使用禅道扩展,请先克隆仓库源码,再按下面方式手动加载
113
302
 
114
303
  1. 打开 `chrome://extensions`
115
304
  2. 开启开发者模式
@@ -121,9 +310,9 @@ PromptX 内部已经开始使用统一的 agent run 事件协议,后续继续
121
310
  ## 注意事项
122
311
 
123
312
  - 当前以本机单用户使用为主,不包含账号体系和团队权限
124
- - 默认仅监听本机地址;如需跨设备访问,建议通过 Tailscale
125
- - 如果执行引擎运行在受限权限下,文件读写和自动修改能力会明显受限
126
- - 不同执行引擎的工具能力、输出事件丰富度和稳定性可能会有差异
313
+ - 默认仅监听本机地址;如需跨设备访问,建议配合 Tailscale、作者提供的远程服务或自建 Relay
314
+ - 不同执行引擎的工具能力、输出事件丰富度和稳定性会有差异
315
+ - 如果执行引擎运行在受限权限下,文件读写、修改和命令执行能力会明显受限
127
316
 
128
317
  ## 本地数据目录
129
318