@moretea-labs/forge 1.5.0-rc.1 → 1.5.1

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 (264) hide show
  1. package/AGENTS.md +9 -11
  2. package/CHANGELOG.md +27 -1
  3. package/CLAUDE.md +8 -10
  4. package/DESIGN.md +278 -0
  5. package/README.md +70 -90
  6. package/README.zh-CN.md +52 -55
  7. package/SKILL.md +8 -11
  8. package/THIRD_PARTY_NOTICES.md +9 -3
  9. package/assets/branding/README.md +4 -2
  10. package/assets/hooks/lib/workflow-state.sh +19 -18
  11. package/assets/hooks/post-edit-guard.sh +6 -75
  12. package/assets/hooks/prompt-guard.sh +24 -12
  13. package/assets/hooks/session-start-context.sh +17 -17
  14. package/assets/hooks/stop-orchestrator.sh +2 -2
  15. package/assets/partials/04-project-structure.partial.md +6 -6
  16. package/assets/partials/05-workflow.partial.md +6 -6
  17. package/assets/partials/07-footer.partial.md +1 -1
  18. package/assets/partials/08-orchestration.partial.md +2 -2
  19. package/assets/partials-agents/02-operating-mode.partial.md +5 -5
  20. package/assets/partials-agents/03-orchestration.partial.md +3 -3
  21. package/assets/partials-agents/04-task-protocol.partial.md +3 -3
  22. package/assets/partials-agents/08-deep-docs.partial.md +1 -1
  23. package/assets/reference-configs/agentic-development-flow.md +49 -86
  24. package/assets/reference-configs/external-tooling.md +21 -61
  25. package/assets/reference-configs/handoff-protocol.md +25 -20
  26. package/assets/reference-configs/harness-overview.md +8 -8
  27. package/assets/skill-version.json +2 -2
  28. package/assets/templates/helpers/archive-workflow.sh +0 -1
  29. package/assets/templates/helpers/capture-plan.sh +3 -3
  30. package/assets/templates/helpers/check-task-workflow.sh +2 -2
  31. package/assets/templates/helpers/codex-handoff-resume.sh +5 -5
  32. package/assets/templates/helpers/ensure-task-workflow.sh +37 -35
  33. package/assets/templates/helpers/new-plan.sh +1 -1
  34. package/assets/templates/helpers/plan-to-todo.sh +2 -2
  35. package/assets/templates/helpers/prepare-codex-handoff.sh +2 -2
  36. package/assets/templates/helpers/prepare-handoff.sh +9 -9
  37. package/assets/templates/helpers/refresh-current-status.sh +2 -2
  38. package/assets/templates/helpers/ship-worktrees.sh +1 -1
  39. package/assets/templates/helpers/sprint-backlog.sh +1 -1
  40. package/assets/templates/helpers/verify-sprint.sh +7 -7
  41. package/assets/templates/helpers/workstream-sync.sh +1 -1
  42. package/assets/templates/plan.template.md +1 -1
  43. package/assets/workflow-contract.v1.json +6 -3
  44. package/docs/architecture/current/README.md +10 -9
  45. package/docs/architecture/current/approved-target-architecture.zh-CN.md +2 -2
  46. package/docs/architecture/current/architecture-invariants.md +2 -2
  47. package/docs/architecture/current/automation-and-schedule-engine.md +15 -15
  48. package/docs/architecture/current/codegraph-context-provider.md +2 -2
  49. package/docs/architecture/current/control-plane-authority-inventory.md +12 -0
  50. package/docs/architecture/current/dispatch-and-agent-strategy.md +11 -11
  51. package/docs/architecture/current/entity-model.md +0 -27
  52. package/docs/architecture/current/failure-recovery.md +0 -24
  53. package/docs/architecture/current/governance.md +1 -1
  54. package/docs/architecture/current/implementation-status.md +1 -1
  55. package/docs/architecture/current/legacy-governance.md +58 -0
  56. package/docs/architecture/current/multi-repository-execution.md +1 -1
  57. package/docs/architecture/current/peer-supercontroller-runtime.md +1 -1
  58. package/docs/architecture/current/personal-assistant-plugin-baseline.md +4 -5
  59. package/docs/architecture/current/scheduler-and-resource-claims.md +0 -10
  60. package/docs/architecture/current/target-requirements-traceability.md +2 -2
  61. package/docs/architecture/current/thin-harness-governance-policy.md +1 -1
  62. package/docs/architecture/current/thin-harness-v1.md +9 -11
  63. package/docs/architecture/domains/runtime-harness.md +1 -1
  64. package/docs/forge-autonomous-goal-loop.md +3 -1
  65. package/docs/forge-chatgpt-mcp-setup.md +67 -176
  66. package/docs/images/forge-banner-cn.svg +26 -1
  67. package/docs/images/forge-banner.svg +26 -1
  68. package/docs/operations/features.md +1 -1
  69. package/docs/operations/homebrew.md +3 -3
  70. package/docs/operations/mcp-tool-exposure.md +5 -5
  71. package/docs/operations/platform-support.md +45 -37
  72. package/docs/operations/platform-support.zh-CN.md +40 -38
  73. package/docs/operations/releasing.md +3 -3
  74. package/docs/operations/releasing.zh-CN.md +3 -3
  75. package/docs/operations/troubleshooting.md +11 -6
  76. package/docs/operations/troubleshooting.zh-CN.md +11 -6
  77. package/docs/public-usage-guide.md +28 -21
  78. package/docs/public-usage-guide.zh-CN.md +28 -21
  79. package/docs/tutorials/01-install-and-start.md +58 -35
  80. package/docs/tutorials/01-install-and-start.zh-CN.md +58 -35
  81. package/docs/tutorials/02-connect-chatgpt.md +118 -46
  82. package/docs/tutorials/02-connect-chatgpt.zh-CN.md +119 -45
  83. package/docs/wiki/Architecture.md +1 -1
  84. package/docs/wiki/Installation.md +2 -2
  85. package/docs/wiki/Quick-Start.md +1 -1
  86. package/docs/wiki/Work-Lifecycle.md +1 -1
  87. package/install.ps1 +4 -5
  88. package/install.sh +4 -6
  89. package/package.json +15 -5
  90. package/scripts/archive-workflow.sh +0 -1
  91. package/scripts/benchmark-thin-harness-mcp-e2e.ts +27 -14
  92. package/scripts/build-controller-ui.ts +28 -0
  93. package/scripts/capture-plan.sh +4 -4
  94. package/scripts/check-agent-tooling.sh +12 -1
  95. package/scripts/check-platform-support.mjs +2 -2
  96. package/scripts/check-public-docs.sh +16 -5
  97. package/scripts/check-release-readiness.sh +5 -11
  98. package/scripts/check-runtime-architecture.mjs +14 -22
  99. package/scripts/check-tarball-install-smoke.sh +3 -2
  100. package/scripts/check-task-workflow.sh +2 -2
  101. package/scripts/codex-handoff-resume.sh +5 -5
  102. package/scripts/create-project-dirs.sh +3 -3
  103. package/scripts/ensure-task-workflow.sh +45 -35
  104. package/scripts/init-project.sh +4 -4
  105. package/scripts/install-desktop-operator-registration.ts +2 -2
  106. package/scripts/lib/project-init-lib.sh +46 -44
  107. package/scripts/migrate-project-template.sh +7 -4
  108. package/scripts/new-plan.sh +1 -1
  109. package/scripts/plan-to-todo.sh +2 -2
  110. package/scripts/prepare-codex-handoff.sh +2 -2
  111. package/scripts/prepare-handoff.sh +9 -9
  112. package/scripts/refresh-current-status.sh +2 -2
  113. package/scripts/setup-plugins.sh +3 -3
  114. package/scripts/ship-worktrees.sh +1 -1
  115. package/scripts/sprint-backlog.sh +5 -5
  116. package/scripts/sync-codex-installed-copies.sh +2 -3
  117. package/scripts/verify-sprint.sh +7 -7
  118. package/scripts/workstream-sync.sh +1 -1
  119. package/src/cli/chatgpt-browser/bridge-extension.ts +1 -1
  120. package/src/cli/chatgpt-browser/bridge-provider.ts +29 -0
  121. package/src/cli/chatgpt-browser/file-policy.ts +3 -1
  122. package/src/cli/commands/chatgpt.ts +51 -0
  123. package/src/cli/commands/doctor.ts +1 -1
  124. package/src/cli/commands/init-hook.ts +213 -70
  125. package/src/cli/commands/init.ts +5 -6
  126. package/src/cli/commands/mcp.ts +31 -5
  127. package/src/cli/commands/runtime.ts +61 -8
  128. package/src/cli/commands/setup-profile.ts +472 -0
  129. package/src/cli/controller/check-runner.ts +20 -3
  130. package/src/cli/controller/codex-continuation.ts +4 -7
  131. package/src/cli/controller/context-pack.ts +118 -14
  132. package/src/cli/controller/operational-plan.ts +4 -4
  133. package/src/cli/controller/task-ledger.ts +10 -10
  134. package/src/cli/controller/work-mode.ts +6 -13
  135. package/src/cli/index.ts +14 -35
  136. package/src/cli/local-bridge/connector-freshness.ts +1 -1
  137. package/src/cli/local-bridge/console-assets.ts +17 -0
  138. package/src/cli/local-bridge/console-automations.ts +160 -0
  139. package/src/cli/local-bridge/dashboard.ts +8 -1303
  140. package/src/cli/local-bridge/facade-api.ts +16 -7
  141. package/src/cli/local-bridge/frontend/src/App.tsx +10 -0
  142. package/src/cli/local-bridge/frontend/src/components/Button.tsx +1 -0
  143. package/src/cli/local-bridge/frontend/src/components/DetailPane.tsx +3 -0
  144. package/src/cli/local-bridge/frontend/src/components/SearchField.tsx +1 -0
  145. package/src/cli/local-bridge/frontend/src/components/SectionHeader.tsx +1 -0
  146. package/src/cli/local-bridge/frontend/src/components/Segmented.tsx +1 -0
  147. package/src/cli/local-bridge/frontend/src/components/StatusText.tsx +3 -0
  148. package/src/cli/local-bridge/frontend/src/design/icons.tsx +11 -0
  149. package/src/cli/local-bridge/frontend/src/design/tokens.css +8 -0
  150. package/src/cli/local-bridge/frontend/src/features/automations/AutomationsView.tsx +3 -0
  151. package/src/cli/local-bridge/frontend/src/features/capabilities/CapabilitiesView.tsx +4 -0
  152. package/src/cli/local-bridge/frontend/src/features/overview/OverviewView.tsx +3 -0
  153. package/src/cli/local-bridge/frontend/src/features/repositories/RepositoriesView.tsx +2 -0
  154. package/src/cli/local-bridge/frontend/src/features/settings/SettingsView.tsx +2 -0
  155. package/src/cli/local-bridge/frontend/src/features/system/SystemView.tsx +2 -0
  156. package/src/cli/local-bridge/frontend/src/features/work/WorkView.tsx +3 -0
  157. package/src/cli/local-bridge/frontend/src/lib/api.ts +23 -0
  158. package/src/cli/local-bridge/frontend/src/lib/format.ts +4 -0
  159. package/src/cli/local-bridge/frontend/src/lib/routes.ts +7 -0
  160. package/src/cli/local-bridge/frontend/src/main.tsx +1 -0
  161. package/src/cli/local-bridge/frontend/src/shell/AppShell.tsx +1 -0
  162. package/src/cli/local-bridge/frontend/src/shell/CommandBar.tsx +2 -0
  163. package/src/cli/local-bridge/frontend/src/shell/Sidebar.tsx +3 -0
  164. package/src/cli/local-bridge/frontend/src/styles.css +12 -0
  165. package/src/cli/local-bridge/frontend/src/types.ts +14 -0
  166. package/src/cli/local-bridge/frontend/src/vite-env.d.ts +1 -0
  167. package/src/cli/local-bridge/frontend/vite.config.ts +27 -0
  168. package/src/cli/local-bridge/server.ts +45 -0
  169. package/src/cli/local-bridge/ui-dist/app.css +1 -0
  170. package/src/cli/local-bridge/ui-dist/app.js +11094 -0
  171. package/src/cli/mcp/auth.ts +2 -0
  172. package/src/cli/mcp/instructions.ts +3 -3
  173. package/src/cli/mcp/legacy-tool-service.ts +27 -23
  174. package/src/cli/mcp/multi-repository.ts +2 -0
  175. package/src/cli/mcp/policy.ts +7 -5
  176. package/src/cli/mcp/repository-tools.ts +53 -14
  177. package/src/cli/mcp/server.ts +5 -10
  178. package/src/cli/mcp/setup.ts +220 -276
  179. package/src/cli/mcp/tool-capability-cache.ts +1 -1
  180. package/src/cli/mcp/toolset-names.ts +1 -1
  181. package/src/cli/mcp/toolset.ts +0 -1
  182. package/src/cli/mcp/transports/http.ts +51 -4
  183. package/src/cli/repositories/branch-name-policy.ts +0 -7
  184. package/src/cli/repositories/controller-home.ts +110 -3
  185. package/src/cli/repositories/safe-patch.ts +1 -1
  186. package/src/cli/repositories/selected-path-actions.ts +26 -24
  187. package/src/core/adoption/gitignore-plan.ts +2 -3
  188. package/src/core/adoption/plan.ts +4 -1
  189. package/src/runtime/control-plane/execution/edit-validation-coordinator.ts +556 -0
  190. package/src/runtime/control-plane/execution/work-handle-store.ts +128 -1
  191. package/src/runtime/control-plane/execution/work-validation-reconciler.ts +277 -0
  192. package/src/runtime/control-plane/execution/work-verification-snapshot.ts +169 -0
  193. package/src/runtime/control-plane/facade/capability-registry.ts +0 -10
  194. package/src/runtime/control-plane/facade/handoff-inbox-store.ts +44 -25
  195. package/src/runtime/control-plane/facade/suggested-actions.ts +7 -1
  196. package/src/runtime/control-plane/facade/types.ts +0 -1
  197. package/src/runtime/control-plane/global-scheduler/scheduler.ts +30 -8
  198. package/src/runtime/control-plane/launcher/chatgpt-work-binding-store.ts +114 -0
  199. package/src/runtime/control-plane/launcher/chatgpt-work-continuation.ts +175 -0
  200. package/src/runtime/control-plane/launcher/launch-reservation-store.ts +161 -0
  201. package/src/runtime/control-plane/launcher/provider-mcp-bootstrap.ts +64 -0
  202. package/src/runtime/control-plane/launcher/thin-launcher.ts +117 -24
  203. package/src/runtime/control-plane/routing/route-policy.ts +14 -14
  204. package/src/runtime/control-plane/runtime-cleanup.ts +0 -1
  205. package/src/runtime/evidence/event-ledger.ts +1 -1
  206. package/src/runtime/{workflow/campaigns/workspace.ts → execution/managed-workspace.ts} +41 -43
  207. package/src/runtime/execution/process-runtime/check-facade.ts +6 -0
  208. package/src/runtime/execution/process-runtime/check-result.ts +45 -0
  209. package/src/runtime/execution/process-runtime/check-runner-sidecar.ts +42 -16
  210. package/src/runtime/execution/process-runtime/command-facade.ts +4 -2
  211. package/src/runtime/execution/process-runtime/gc.ts +1 -1
  212. package/src/runtime/execution/process-runtime/index.ts +3 -0
  213. package/src/runtime/execution/process-runtime/interactive-admission.ts +14 -5
  214. package/src/runtime/execution/process-runtime/persisted-check.ts +285 -0
  215. package/src/runtime/execution/process-runtime/resource-claims.ts +30 -0
  216. package/src/runtime/execution/process-runtime/runtime.ts +18 -1
  217. package/src/runtime/execution/process-runtime/store.ts +1 -19
  218. package/src/runtime/execution/process-runtime/types.ts +4 -0
  219. package/src/runtime/execution/thin-harness/execution-router.ts +0 -1
  220. package/src/runtime/execution/thin-harness/fast-executor.ts +1 -1
  221. package/src/runtime/execution/thin-harness/lightweight-lanes.ts +1 -2
  222. package/src/runtime/execution/thin-harness/types.ts +0 -1
  223. package/src/runtime/execution/workers/executor.ts +1 -1
  224. package/src/runtime/gateway/mcp/execution-tools.ts +1 -1
  225. package/src/runtime/gateway/mcp/persisted-check-process.ts +3 -255
  226. package/src/runtime/gateway/mcp/process-tools.ts +16 -3
  227. package/src/runtime/gateway/mcp/resource-policy.ts +0 -9
  228. package/src/runtime/gateway/mcp/router.ts +117 -182
  229. package/src/runtime/gateway/mcp/runtime-tools.ts +331 -409
  230. package/src/runtime/gateway/mcp/work-validation-reconciler.ts +1 -219
  231. package/src/runtime/plugins/browser-adapter.ts +5 -0
  232. package/src/runtime/plugins/desktop-operator-registration.ts +1 -1
  233. package/src/runtime/plugins/store.ts +14 -6
  234. package/src/runtime/plugins/types.ts +1 -1
  235. package/src/runtime/projections/materialized-view.ts +1 -23
  236. package/src/runtime/recovery/maintenance-executor.ts +9 -0
  237. package/src/runtime/resources/ownership.ts +0 -1
  238. package/src/runtime/root/gateway-adapter.ts +2 -0
  239. package/src/runtime/root/mcp-transport.ts +10 -2
  240. package/src/runtime/root/package-connector-service.ts +136 -0
  241. package/src/runtime/root/package-runtime-release.ts +161 -0
  242. package/src/runtime/root/package-runtime-service.ts +185 -0
  243. package/src/runtime/root/release-materialize.ts +19 -0
  244. package/src/runtime/root/runtime.ts +2 -1
  245. package/src/runtime/root/scheduler.ts +5 -0
  246. package/src/runtime/root/service.ts +18 -5
  247. package/src/runtime/standalone-recovery/core.ts +65 -16
  248. package/src/runtime/workflow/findings/store.ts +145 -106
  249. package/src/runtime/workflow/findings/types.ts +22 -0
  250. package/src/runtime/workflow/schedules/engine.ts +132 -2
  251. package/src/runtime/workflow/schedules/pending-activation.ts +139 -0
  252. package/src/runtime/workflow/schedules/work-continuation.ts +218 -0
  253. package/docs/CHANGELOG.md +0 -978
  254. package/docs/README.zh-CN.md +0 -58
  255. package/scripts/smoke-chatgpt-supervised-automation.ts +0 -208
  256. package/src/cli/commands/controller.ts +0 -680
  257. package/src/runtime/workflow/campaigns/cleanup.ts +0 -263
  258. package/src/runtime/workflow/campaigns/engine.ts +0 -112
  259. package/src/runtime/workflow/campaigns/normalize.ts +0 -100
  260. package/src/runtime/workflow/campaigns/review.ts +0 -315
  261. package/src/runtime/workflow/campaigns/store.ts +0 -526
  262. package/src/runtime/workflow/campaigns/supervisor.ts +0 -112
  263. package/src/runtime/workflow/campaigns/types.ts +0 -290
  264. /package/src/runtime/{workflow/campaigns → execution}/workspace-agent.ts +0 -0
@@ -1,35 +1,35 @@
1
- # 教程 1:安装并启动
1
+ # 教程 1:安装并选择主控
2
2
 
3
- 本教程完成 CLI 安装、用户级运行时初始化、环境检查和第一个仓库注册。
3
+ 本教程把 Forge 从 package 安装带到可恢复的初始化流程。Forge **自己没有 AI 大脑**:始终由一个外部主控判断下一步,Forge 负责有边界的执行、持久状态、权限与证据。
4
4
 
5
- ## 1. 平台与基础环境
5
+ ## 1. 选择平台路径
6
6
 
7
- - macOS / Linux:完整支持。
8
- - Windows:完整工作流推荐 WSL2。
9
- - Windows 原生 PowerShell:预览支持安装、doctor、仓库注册/读取和可移植 Controller 操作。
7
+ - **macOS:** 支持;Package Runtime 使用 launchd 做用户级持久运行。
8
+ - **现代 Linux:** 支持;优先使用 `systemd --user`,不可用时会明确退化为当前会话的 portable 模式。
9
+ - **Windows + WSL2:** Windows 推荐路径;在 WSL2 内按 Linux 流程运行。
10
+ - **Windows 原生:** 预览;支持 CLI、setup、portable Runtime、MCP 和有边界的可移植能力,但暂不宣称重启后 Runtime 持久化与所有 Provider 组合都完整支持。
10
11
 
11
- 需要 Git、Node.js 20.10 或更高版本、npm 和可写的用户目录。Bun 1.0+ 是可选项,推荐用于源码开发和完整测试。
12
+ 基础安装只需要 **Node.js 20.10 或更高版本**、npm(或 Bun)和可写用户目录。**Git 只在启用仓库/软件开发能力时才需要。** Codex、Claude、`gh`、Cloudflare、Tailscale、CodeGraph 和各服务账号都是按能力选装,不是 Forge 的安装前置条件。
12
13
 
13
14
  ```bash
14
- git --version
15
15
  node --version
16
16
  npm --version
17
17
  ```
18
18
 
19
19
  详细范围见[平台支持说明](../operations/platform-support.zh-CN.md)。
20
20
 
21
- ## 2. 安装 CLI
21
+ ## 2. 安装 Forge
22
22
 
23
- 发布候选版本使用 npm 的 `next` channel:
23
+ Release Candidate 使用 npm `next`:
24
24
 
25
25
  ```bash
26
- npm install -g @moretea-labs/forge@next
26
+ npm install -g @moretea-labs/forge
27
27
  # 或
28
- bun add -g @moretea-labs/forge@next
28
+ bun add -g @moretea-labs/forge
29
29
  forge --version
30
30
  ```
31
31
 
32
- 需要参与 Forge 源码开发时,再从仓库安装:
32
+ 只有参与 Forge 源码开发时才需要源码安装:
33
33
 
34
34
  ```bash
35
35
  git clone https://github.com/moretea-labs/forge.git
@@ -38,56 +38,79 @@ npm ci --ignore-scripts --no-audit --no-fund
38
38
  npm install -g . --omit=optional --no-audit --no-fund
39
39
  ```
40
40
 
41
- 该 package 只提供 `forge`、`forge-hook` 与 `forge-runtime`。候选版本使用 `next`,稳定版本使用 `latest`。
41
+ 发布 package 提供 `forge`、`forge-hook`、`forge-runtime`。普通 package 用户启动用户级 Runtime **不需要** Forge Git checkout、Bun 编译、CodeGraph 或 Standalone Recovery。
42
42
 
43
- ## 3. 打开引导式配置会话
43
+ ## 3. 开始引导式 setup
44
44
 
45
45
  ```bash
46
- forge --version
47
- forge setup open --target both
46
+ forge setup
48
47
  ```
49
48
 
50
- `forge setup open` 会在 `~/.forge/setup/` 下创建或恢复同一个用户级配置会话,执行就绪检查,并且每次只给出一个下一步配置动作。完成该动作后继续执行:
49
+ 首次执行会先选择外部主控。推荐 ChatGPT,但不是强制:
51
50
 
52
51
  ```bash
53
- forge setup next
52
+ forge setup configure --controller chatgpt --tunnel auto
53
+ # 也可以:
54
+ # forge setup configure --controller codex
55
+ # forge setup configure --controller claude
56
+ # forge setup configure --controller mcp
54
57
  ```
55
58
 
56
- 反复执行 `forge setup next`,直到状态变成 `ready`,然后关闭会话:
59
+ 可以预配置多个控制入口,但只有一个 primary controller:
57
60
 
58
61
  ```bash
59
- forge setup close
62
+ forge setup configure \
63
+ --controller chatgpt \
64
+ --add-controller codex \
65
+ --add-controller claude \
66
+ --tunnel auto
60
67
  ```
61
68
 
62
- 可使用 `forge setup status` 查看持久化进度,使用 `forge setup check` 获取一次性只读报告。只使用一个 host 时可改为 `--target codex` 或 `--target claude`。配置会话不会静默执行远程写入、读取秘密、破坏性操作或服务安装。
69
+ 机器上即使已经安装 Codex/Claude,只要没有明确选择,Forge 就不会把它们当成 readiness 依赖。
70
+
71
+ ## 4. 每次只完成一个 Next 动作
72
+
73
+ ```bash
74
+ forge setup next
75
+ ```
76
+
77
+ setup 进度保存在用户级 Forge 目录,可以退出终端后继续。根据主控类型,流程会依次处理:
78
+
79
+ 1. 主控注册;
80
+ 2. Package Runtime;
81
+ 3. 远程主控需要的安全 HTTPS;
82
+ 4. 只能由用户完成的登录/浏览器认证;
83
+ 5. 连接验证。
63
84
 
64
- ## 4. 接入或注册仓库
85
+ `forge setup status` 查看持久化进度;`forge setup check` 只读检查;ready 后使用 `forge setup close`。
65
86
 
66
- macOS、Linux、WSL2 先预览再执行完整接入:
87
+ 普通用户的 Runtime 路径是:
67
88
 
68
89
  ```bash
69
- forge adopt --repo /path/to/your-project --dry-run
70
- forge adopt --repo /path/to/your-project
90
+ forge runtime service install-package
71
91
  ```
72
92
 
73
- 所有平台均可显式注册:
93
+ 对 ChatGPT,package 安装会同时维护两个本地服务边界:内部 bearer-only Canonical Runtime,以及供 Secure Tunnel/HTTPS connector 使用的 loopback OAuth Gateway。不要把 tunnel 直接指向内部 Runtime 端口,以 setup 输出的本地 OAuth endpoint 为准。
94
+
95
+ 旧的 `forge runtime service install --repo ...` 会构建 Git/source immutable Runtime,属于**高级维护路径**;Standalone Recovery 同样不是普通用户初始化的前置条件。
96
+
97
+ ## 5. 首次 setup 不要求仓库
98
+
99
+ 只使用授权目录、浏览器/桌面或服务插件时,不需要先 adopt Git 仓库。需要软件开发能力时再接入项目:
74
100
 
75
101
  ```bash
76
- forge repo register /path/to/your-project --name my-project --json
102
+ forge adopt --repo /path/to/your-project --dry-run
103
+ forge adopt --repo /path/to/your-project
77
104
  forge repo list --json
78
105
  ```
79
106
 
80
- 保存返回的 `repoId`,它是 ChatGPT 和 Controller 使用的稳定仓库身份。
107
+ 从这一步开始,仓库工作流才需要 Git。
81
108
 
82
- ## 5. 确认环境就绪
109
+ ## 6. 验证基础环境
83
110
 
84
111
  ```bash
85
112
  forge setup status
86
113
  forge doctor
87
- forge status --json
88
- forge repo list --json
89
114
  ```
90
115
 
91
- 运行态应保存在 Controller Home 和被忽略的仓库链接中,不应进入公开源码。不要提交 token、MCP runtime 文件、Local Job、日志或 worktree。
92
-
93
- 下一步阅读[教程 2:连接 ChatGPT](02-connect-chatgpt.zh-CN.md),出现问题时看[故障排查](../operations/troubleshooting.zh-CN.md)。
116
+ 选择 ChatGPT 做主控时,继续阅读[教程 2:连接 ChatGPT](02-connect-chatgpt.zh-CN.md)。出现问题时看[故障排查](../operations/troubleshooting.zh-CN.md)。
@@ -1,82 +1,154 @@
1
1
  # Tutorial 2: Connect ChatGPT
2
2
 
3
- This tutorial starts the local MCP service, publishes only its MCP endpoint through HTTPS, and verifies the default facade tools.
3
+ This tutorial connects ChatGPT as the external controller for Forge. Forge stays local and loopback-bound; ChatGPT reaches it through either OpenAI Secure MCP Tunnel or an explicitly chosen HTTPS tunnel.
4
4
 
5
- ## 1. Before you start
5
+ ## 1. Check ChatGPT availability first
6
6
 
7
- You need:
7
+ ChatGPT MCP availability is controlled by your ChatGPT plan/workspace and can change independently of Forge. Check OpenAI's current [Developer mode and MCP apps](https://help.openai.com/en/articles/12584461-developer-mode-apps-and-full-mcp-connectors-in-chatgpt-beta) documentation before setup.
8
8
 
9
- - a repository already registered with `forge repo register`;
10
- - a healthy `forge doctor` result;
11
- - a stable public HTTPS address ending in `/mcp`;
12
- - ChatGPT access to Developer Mode and custom MCP connectors.
9
+ At the time this guide was updated, full MCP including write/modify actions is a beta capability for ChatGPT Business, Enterprise, and Edu on web. Pro supports developer-mode MCP with read/fetch scope rather than full write MCP. Workspace administrators may also need to enable developer mode/RBAC.
13
10
 
14
- Coding agents are not required. Install Codex or Claude only when you intend to delegate implementation.
11
+ Forge does not bypass those product permissions.
15
12
 
16
- Windows users should run the Controller and tunnel inside WSL2 for the full supported workflow. Native PowerShell operation remains preview scope.
13
+ ## 2. Let Forge prepare the local side
17
14
 
18
- ## 2. Generate the MCP configuration
15
+ Start or resume the user-level setup flow:
19
16
 
20
17
  ```bash
21
- forge mcp setup chatgpt --repo /path/to/your-project
18
+ forge setup configure --controller chatgpt --tunnel auto
19
+ forge setup next
22
20
  ```
23
21
 
24
- The local endpoint is loopback-only:
22
+ Follow the single `Next` action until the local Package Runtime is ready. The normal user path uses:
23
+
24
+ ```bash
25
+ forge mcp setup chatgpt --user-level
26
+ forge runtime service install-package
27
+ ```
28
+
29
+ The MCP listener remains loopback-only, normally:
25
30
 
26
31
  ```text
27
32
  http://127.0.0.1:8765/mcp
28
33
  ```
29
34
 
30
- Do not expose the local Controller UI at port 8766.
35
+ Fresh user-level setup keeps the repository-centric Utility Console disabled until you configure a repository/workbench target. When enabled later it uses a separate loopback port (normally `8766`). **Never expose the Utility Console to the internet.**
36
+
37
+ A repository is not required to connect ChatGPT. Add repositories, folders, browser capabilities, and service plugins later as needed.
38
+
39
+ ## 3. Choose the remote connection
31
40
 
32
- ## 3. Verify the canonical Runtime service
41
+ Run `forge setup next`. Forge supports these connection providers:
33
42
 
34
- `forge mcp setup chatgpt` installs or updates the configuration consumed by the single `forge-runtime`. Install the macOS service owner with `forge runtime service install`; launchd then owns startup and unexpected-exit restart of that one root process. There is no MCP KeepAlive wrapper or component-level lifecycle command.
43
+ ### A. OpenAI Secure MCP Tunnel — preferred when available
44
+
45
+ Secure MCP Tunnel lets an OpenAI-hosted product reach the local MCP server through an outbound tunnel, without creating public inbound access. `--tunnel auto` treats this as the first-choice ChatGPT transport and does not silently choose Cloudflare/Tailscale merely because those CLIs are installed. See OpenAI's [Secure MCP Tunnel guide](https://developers.openai.com/api/docs/guides/secure-mcp-tunnels) and the official [`openai/tunnel-client`](https://github.com/openai/tunnel-client).
46
+
47
+ You need a tunnel ID and tunnel-use permission from OpenAI Platform. Record only the non-secret tunnel ID in Forge:
35
48
 
36
49
  ```bash
37
- forge runtime service install \
38
- --controller-home /path/to/controller-home \
39
- --repo /path/to/forge-source-or-runtime-root \
40
- --host 127.0.0.1 \
41
- --port 8765 \
42
- --auth-token-file /path/to/controller-home/mcp/runtime-token
43
- forge runtime status --controller-home /path/to/controller-home --json
44
- forge mcp doctor --repo /path/to/your-project
50
+ forge setup configure \
51
+ --controller chatgpt \
52
+ --tunnel openai \
53
+ --tunnel-id tunnel_0123456789abcdef0123456789abcdef
54
+ forge setup next
45
55
  ```
46
56
 
47
- Publish only the configured loopback MCP endpoint through a stable Tailscale or Cloudflare HTTPS tunnel. Temporary tunnel URLs are suitable for testing but are poor long-lived Connector identities. Enable Codex or Claude only after their CLIs are installed and authenticated; provider availability does not change the Runtime process topology.
57
+ Forge never asks for or stores the tunnel runtime API key. Keep it in the environment used by the official tunnel client:
48
58
 
49
- ## 4. Add the Connector in ChatGPT
59
+ ```bash
60
+ export CONTROL_PLANE_API_KEY='...'
61
+ ```
50
62
 
51
- 1. Open **Settings → Apps & Connectors → Advanced settings**.
52
- 2. Enable Developer Mode.
53
- 3. Create a custom MCP Connector.
54
- 4. Enter the public HTTPS URL ending in `/mcp`.
55
- 5. Add the Connector to a new conversation.
63
+ When `tunnel-client` is installed, setup guides the official supervised runtime path. Conceptually it is:
56
64
 
57
- ## 5. Verify the safe default surface
65
+ ```bash
66
+ tunnel-client runtimes connect \
67
+ --alias forge \
68
+ --tunnel-id tunnel_0123456789abcdef0123456789abcdef \
69
+ --runtime-api-key env:CONTROL_PLANE_API_KEY \
70
+ --mcp-server-url http://127.0.0.1:8767/mcp
58
71
 
59
- The core Connector should expose:
72
+ tunnel-client runtimes status forge --json
73
+ ```
74
+
75
+ Forge reports this provider ready only when `tunnel-client` reports the managed runtime as running, healthy, and ready.
76
+
77
+ #### What address changes?
78
+
79
+ With Secure Tunnel there is no public Forge `/mcp` address to paste. The ChatGPT App selects the `tunnel_id`; `tunnel-client` forwards commands to Forge's **loopback OAuth Gateway** (default `127.0.0.1:8767/mcp`), which proxies to the internal bearer-only Runtime (default `127.0.0.1:8765/mcp`). If you customize ports, use the OAuth endpoint printed by `forge mcp setup chatgpt --user-level`.
80
+
81
+ The App/connector identity and Forge tool schema are separate from the transport. Switching from Cloudflare/HTTPS to Secure Tunnel changes the network path, not the 19-tool Forge schema. A fresh chat is useful for isolated A/B testing, but it is not required merely because transport changed when the same App is already connected.
60
82
 
61
- - `rh_status` — runtime and repository readiness;
62
- - `rh_context` — bounded context for the selected repository;
63
- - `rh_work` — start or continue bounded work;
64
- - `rh_inbox` — decisions, approvals, and items requiring attention.
83
+ ### B. Cloudflare Tunnel
65
84
 
66
- It also exposes a few repository bootstrap and selection tools. Do not switch to `full` merely to see more names; `advanced` and `full` are maintainer and compatibility surfaces.
85
+ Choose this when you need a stable public HTTPS endpoint and control the Cloudflare account/domain:
67
86
 
68
- Test in this order:
87
+ ```bash
88
+ forge setup configure --controller chatgpt --tunnel cloudflare
89
+ forge setup next
90
+ ```
91
+
92
+ Setup detects `cloudflared` and the current platform. On macOS it can suggest Homebrew when present; Linux/WSL2 and Windows receive their platform-specific official installation path. After creating a stable named tunnel, record only the resulting `/mcp` URL:
93
+
94
+ ```bash
95
+ forge setup configure \
96
+ --controller chatgpt \
97
+ --tunnel existing \
98
+ --endpoint https://forge.example.com/mcp
99
+ ```
100
+
101
+ ### C. Tailscale Funnel
102
+
103
+ If you already use Tailscale, choose:
104
+
105
+ ```bash
106
+ forge setup configure --controller chatgpt --tunnel tailscale
107
+ forge setup next
108
+ ```
109
+
110
+ Forge detects the Tailscale CLI and guides Funnel setup for the current platform. Record the final HTTPS `/mcp` URL when available.
111
+
112
+ ### D. Existing HTTPS endpoint or defer
113
+
114
+ ```bash
115
+ forge setup configure \
116
+ --controller chatgpt \
117
+ --tunnel existing \
118
+ --endpoint https://forge.example.com/mcp
119
+
120
+ # Or keep local setup only for now:
121
+ forge setup configure --controller chatgpt --tunnel none
122
+ ```
123
+
124
+ Cloudflare/Tailscale/existing HTTPS make the MCP endpoint public or internet-reachable by design. OpenAI Secure MCP Tunnel is the private-outbound option when your OpenAI organization supports it.
125
+
126
+ ## 4. Create the ChatGPT app/connector
127
+
128
+ The ChatGPT UI changes over time, so follow the current OpenAI developer-mode instructions rather than relying on screenshots in this repository.
129
+
130
+ For a Secure MCP Tunnel connection, choose the **Tunnel** connection type and select/paste the tunnel ID. For an HTTPS connection, use the stable HTTPS URL ending in `/mcp` and the OAuth flow generated by Forge.
131
+
132
+ After creating the app/connector, scan/refresh tools. Do not switch Forge to an exhaustive compatibility toolset simply to expose more names; the bounded default surface is intentional.
133
+
134
+ ## 5. Verify a real Forge call
135
+
136
+ Start with a read-only prompt:
69
137
 
70
138
  ```text
71
- Use Forge. Check system readiness with rh_status. Then load bounded context for my registered repository with rh_context. Do not make changes yet.
139
+ Use Forge. Call rh_status and tell me whether the Forge Runtime is ready.
140
+ Do not modify anything yet.
72
141
  ```
73
142
 
74
- ## 6. Security checks
143
+ Then, after granting a repository or local folder, verify bounded context/read access. A successful setup means ChatGPT actually made a Forge tool call; a saved tunnel ID or a running local process alone is not proof of end-to-end connectivity.
144
+
145
+ ## 6. Security rules
75
146
 
76
- - Keep MCP bound to loopback and publish it only through a controlled HTTPS endpoint.
77
- - Keep the local UI private.
78
- - Start read-only, then authorize bounded writes when needed.
79
- - Remote Git, GitHub, email, destructive cleanup, and publication remain separately authorized.
80
- - Never paste MCP tokens or OAuth secrets into chat.
147
+ - Keep Forge MCP and the Utility Console bound to loopback.
148
+ - Prefer Secure MCP Tunnel when private outbound connectivity is available and appropriate.
149
+ - If using a public HTTPS tunnel, expose only MCP—not the local Utility Console.
150
+ - Never paste MCP tokens, OAuth secrets, tunnel runtime API keys, or admin keys into chat or Forge setup state.
151
+ - Remote Git, GitHub, email, destructive cleanup, publication, and secret access remain separately authorized by Forge.
152
+ - Codex/Claude are not installed or enabled unless you explicitly configure them as controller/execution entries.
81
153
 
82
- Continue with [Tutorial 3: First Repository Task](03-first-repository-task.md). Use [Troubleshooting](../operations/troubleshooting.md) if the Connector or tool surface is not healthy.
154
+ Continue with [Tutorial 3: First Repository Task](03-first-repository-task.md) when you want software-work capabilities. Use [Troubleshooting](../operations/troubleshooting.md) when the Runtime, tunnel, connector, or tool surface is not healthy.
@@ -1,80 +1,154 @@
1
1
  # 教程 2:连接 ChatGPT
2
2
 
3
- 本教程启动本地 MCP 服务,只通过 HTTPS 公开 MCP endpoint,并验证默认 facade 工具。
3
+ 本教程把 ChatGPT 接成 Forge 的外部主控。Forge 和 MCP 仍只监听本机 loopback;ChatGPT 通过 OpenAI Secure MCP Tunnel,或用户明确选择的 HTTPS tunnel 访问它。
4
4
 
5
- ## 1. 开始前需要
5
+ ## 1. 先确认 ChatGPT 当前支持范围
6
6
 
7
- - 已通过 `forge repo register` 注册仓库;
8
- - `forge doctor` 状态正常;
9
- - 一个稳定、以 `/mcp` 结尾的公网 HTTPS 地址;
10
- - ChatGPT Developer Mode 和自定义 MCP Connector 权限。
7
+ ChatGPT 的 MCP 能力由套餐、工作区和管理员策略决定,会独立于 Forge 变化。开始前请查看 OpenAI 当前的[开发者模式和 MCP 应用](https://help.openai.com/zh-hans-cn/articles/12584461-developer-mode-and-mcp-apps-in-chatgpt-beta)说明。
11
8
 
12
- 编码 Agent 不是必需环境。只有准备委派实现时才安装 Codex 或 Claude。
9
+ 本文更新时,包含写入/修改的完整 MCP 正在 ChatGPT Business、Enterprise、Edu 网页版中以 beta 提供;Pro 的开发者模式 MCP 当前是 read/fetch 范围。工作区还可能要求管理员开启 Developer Mode / RBAC。
13
10
 
14
- Windows 用户建议在 WSL2 内运行 Controller 和隧道;Windows 原生 PowerShell 仍属于预览范围。
11
+ Forge 不会绕过这些 ChatGPT 产品权限。
15
12
 
16
- ## 2. 生成 MCP 配置
13
+ ## 2. 让 Forge 准备本地运行环境
17
14
 
18
15
  ```bash
19
- forge mcp setup chatgpt --repo /path/to/your-project
16
+ forge setup configure --controller chatgpt --tunnel auto
17
+ forge setup next
20
18
  ```
21
19
 
22
- 本地 endpoint 只监听 loopback:
20
+ 每次只按一个 `Next` 动作继续。普通用户的本地路径最终会使用:
21
+
22
+ ```bash
23
+ forge mcp setup chatgpt --user-level
24
+ forge runtime service install-package
25
+ ```
26
+
27
+ MCP 默认只监听:
23
28
 
24
29
  ```text
25
30
  http://127.0.0.1:8765/mcp
26
31
  ```
27
32
 
28
- 不要把 8766 端口的本地 Controller UI 暴露到公网。
33
+ 首次 user-level setup 会保持 repository-centric Utility Console 关闭,直到你之后配置仓库/工作台目标;启用后它使用独立 loopback 端口(通常是 `8766`)。**不要把 Utility Console 暴露到公网。**
34
+
35
+ 连接 ChatGPT 不要求先注册 Git 仓库。仓库、普通目录、Browser、Gmail 等能力可以之后按需配置。
36
+
37
+ ## 3. 选择远程连接方式
38
+
39
+ 执行 `forge setup next`,Forge 支持以下 provider。
40
+
41
+ ### A. OpenAI Secure MCP Tunnel——有权限时优先
42
+
43
+ Secure MCP Tunnel 通过出站连接把本机/private MCP 接到 OpenAI 托管产品,不要求给 Forge 开公网入站。 `--tunnel auto` 会把它作为 ChatGPT 的第一优先传输,不会仅仅因为机器上装了 cloudflared/Tailscale 就静默改用公网方案。详见 OpenAI 的 [Secure MCP Tunnel](https://developers.openai.com/api/docs/guides/secure-mcp-tunnels) 与官方 [`openai/tunnel-client`](https://github.com/openai/tunnel-client)。
44
+
45
+ 需要先在 OpenAI Platform 获得 tunnel ID 和使用权限。Forge 只记录**非秘密**的 tunnel ID:
46
+
47
+ ```bash
48
+ forge setup configure \
49
+ --controller chatgpt \
50
+ --tunnel openai \
51
+ --tunnel-id tunnel_0123456789abcdef0123456789abcdef
52
+ forge setup next
53
+ ```
54
+
55
+ Forge 不要求、读取或保存 tunnel runtime API key。把它留在运行官方 tunnel-client 的环境中:
56
+
57
+ ```bash
58
+ export CONTROL_PLANE_API_KEY='...'
59
+ ```
60
+
61
+ 安装 `tunnel-client` 后,setup 会引导官方的受管 runtime 路径,本质上是:
62
+
63
+ ```bash
64
+ tunnel-client runtimes connect \
65
+ --alias forge \
66
+ --tunnel-id tunnel_0123456789abcdef0123456789abcdef \
67
+ --runtime-api-key env:CONTROL_PLANE_API_KEY \
68
+ --mcp-server-url http://127.0.0.1:8767/mcp
69
+
70
+ tunnel-client runtimes status forge --json
71
+ ```
72
+
73
+ 只有 tunnel-client 返回 `process_running + healthy + ready` 后,Forge 才把这个连接判为 ready。
74
+
75
+ #### 地址到底变成什么?
29
76
 
30
- ## 3. 验证唯一 Forge Runtime 服务
77
+ 使用 Secure Tunnel 后,不再需要给 Forge 准备一个公网 `/mcp` 地址。ChatGPT App 选择 `tunnel_id`;本机 `tunnel-client` 把命令转发到 Forge 的 **loopback OAuth Gateway**(默认 `127.0.0.1:8767/mcp`),再由 Gateway 代理到内部 bearer-only Runtime(默认 `127.0.0.1:8765/mcp`)。如果改过端口,以 `forge mcp setup chatgpt --user-level` 输出的 OAuth endpoint 为准。
31
78
 
32
- `forge mcp setup chatgpt` 会安装或更新唯一 `forge-runtime` 使用的配置。通过 `forge runtime service install` 安装 macOS 服务后,launchd 负责该根进程的开机启动与异常退出自动拉起;系统不再提供 MCP KeepAlive 包装器或组件级生命周期命令。
79
+ App/connector 身份及 Forge 工具 schema 与网络传输层是两件事。Cloudflare/HTTPS 切到 Secure Tunnel 改变的是网络路径,不会生成另一套 19-tool Forge schema。同一个 App 已连接且 schema 没变化时,单纯切换网络不要求新开会话;新会话主要用于隔离 A/B 或排查客户端缓存。
80
+
81
+ ### B. Cloudflare Tunnel
82
+
83
+ 需要稳定公网 HTTPS、并且你管理 Cloudflare 账号/域名时使用:
33
84
 
34
85
  ```bash
35
- forge runtime service install \
36
- --controller-home /path/to/controller-home \
37
- --repo /path/to/forge-source-or-runtime-root \
38
- --host 127.0.0.1 \
39
- --port 8765 \
40
- --auth-token-file /path/to/controller-home/mcp/runtime-token
41
- forge runtime status --controller-home /path/to/controller-home --json
42
- forge mcp doctor --repo /path/to/your-project
86
+ forge setup configure --controller chatgpt --tunnel cloudflare
87
+ forge setup next
43
88
  ```
44
89
 
45
- 只将配置好的 loopback MCP endpoint 通过稳定的 Tailscale 或 Cloudflare HTTPS tunnel 发布。Codex/Claude CLI 安装并登录后才启用对应 provider,但 provider 可用性不会改变 Runtime 进程拓扑。
90
+ setup 会检测当前平台与 `cloudflared`。macOS 有 Homebrew 时可直接给出安装命令;Linux/WSL2 与 Windows 会给对应的官方安装路径,不会假设所有机器都是 Mac。
46
91
 
47
- ## 4. 在 ChatGPT 添加 Connector
92
+ named tunnel 建好后,只记录最终 `/mcp` URL:
48
93
 
49
- 1. 打开 **Settings → Apps & Connectors → Advanced settings**。
50
- 2. 开启 Developer Mode。
51
- 3. 创建自定义 MCP Connector。
52
- 4. 填入以 `/mcp` 结尾的公网 HTTPS URL。
53
- 5. 在新会话中添加该 Connector。
94
+ ```bash
95
+ forge setup configure \
96
+ --controller chatgpt \
97
+ --tunnel existing \
98
+ --endpoint https://forge.example.com/mcp
99
+ ```
54
100
 
55
- ## 5. 验证默认安全工具面
101
+ ### C. Tailscale Funnel
56
102
 
57
- core Connector 应显示:
103
+ 已有 Tailscale 时可以选择:
58
104
 
59
- - `rh_status`:运行时和仓库就绪状态;
60
- - `rh_context`:当前仓库的有界上下文;
61
- - `rh_work`:开始或继续有边界工作;
62
- - `rh_inbox`:需要决定、审批或处理的事项。
105
+ ```bash
106
+ forge setup configure --controller chatgpt --tunnel tailscale
107
+ forge setup next
108
+ ```
63
109
 
64
- 此外只会暴露少量仓库初始化和选择工具。不要为了“工具更多”直接切到 `full`;`advanced` 和 `full` 是维护/兼容工具面。
110
+ Forge 检查当前平台的 Tailscale CLI 并引导 Funnel;获得最终 HTTPS `/mcp` URL 后再记录。
65
111
 
66
- 按以下顺序测试:
112
+ ### D. 已有 HTTPS 或暂缓远程连接
113
+
114
+ ```bash
115
+ forge setup configure \
116
+ --controller chatgpt \
117
+ --tunnel existing \
118
+ --endpoint https://forge.example.com/mcp
119
+
120
+ # 暂时只完成本地配置:
121
+ forge setup configure --controller chatgpt --tunnel none
122
+ ```
123
+
124
+ Cloudflare/Tailscale/已有 HTTPS 本质上会让 MCP endpoint 成为公网或互联网可达地址;OpenAI Secure MCP Tunnel 是组织有权限时的私有出站方案。
125
+
126
+ ## 4. 在 ChatGPT 创建 App / Connector
127
+
128
+ ChatGPT UI 会变化,所以以 OpenAI 当前 Developer Mode 文档为准,不在 Forge 文档中固定截图路径。
129
+
130
+ 使用 Secure MCP Tunnel 时选择 **Tunnel** 连接方式并选择/填入 tunnel ID;使用 HTTPS 时填入稳定、以 `/mcp` 结尾的 URL,并走 Forge 生成的 OAuth 流程。
131
+
132
+ 创建后扫描/刷新工具。不要为了看到更多工具名而直接切到 exhaustive compatibility toolset;默认收敛工具面是安全和可用性设计的一部分。
133
+
134
+ ## 5. 验证真实调用
135
+
136
+ 先从只读提示开始:
67
137
 
68
138
  ```text
69
- 使用 Forge。先用 rh_status 检查系统状态,再用 rh_context 获取当前注册仓库的有界上下文,暂时不要修改文件。
139
+ 使用 Forge。调用 rh_status,告诉我 Forge Runtime 是否 ready。
140
+ 先不要做任何修改。
70
141
  ```
71
142
 
72
- ## 6. 安全检查
143
+ 之后再授权一个仓库或普通目录做读取验证。**真正 setup 成功的证据是 ChatGPT 已经实际调用 Forge**;只保存了 tunnel ID,或本机进程在运行,都不等于端到端已经连通。
144
+
145
+ ## 6. 安全规则
73
146
 
74
- - MCP 保持监听 loopback,只通过受控 HTTPS 地址公开。
75
- - 本地 UI 不公开。
76
- - 先只读,确有需要时再授权有边界写入。
77
- - 远程 Git、GitHub、邮件、破坏性清理和发布仍分别授权。
78
- - 不要把 MCP token 或 OAuth secret 粘贴到聊天中。
147
+ - Forge MCP 与 Utility Console 都保持 loopback。
148
+ - 条件允许时优先使用私有出站的 Secure MCP Tunnel。
149
+ - 使用公网 HTTPS tunnel 时只暴露 MCP,不暴露本地 Utility Console。
150
+ - 不要把 MCP token、OAuth secret、tunnel runtime API key、admin key 发到聊天或写入 Forge setup state。
151
+ - 远程 Git、GitHub、邮件、破坏性清理、发布和密钥仍分别授权。
152
+ - Codex/Claude 只有明确选择为主控或执行入口时才配置。
79
153
 
80
- 下一步阅读[教程 3:完成第一个仓库任务](03-first-repository-task.zh-CN.md)。Connector 或工具面异常时看[故障排查](../operations/troubleshooting.zh-CN.md)。
154
+ 需要软件开发能力时继续[教程 3:第一个仓库任务](03-first-repository-task.zh-CN.md)。Runtime、tunnel、Connector 或工具面异常时查看[故障排查](../operations/troubleshooting.zh-CN.md)。
@@ -47,7 +47,7 @@ Every registered-repository execution is bound to a stable `repoId` and an expli
47
47
 
48
48
  ### Direct versus durable work
49
49
 
50
- Investigation is not itself a reason to create Work. A small, understood change can stay Direct. Durable Work, worktrees, campaigns, or workers are introduced when recovery, dependency tracking, isolation, long-running execution, or real risk requires them.
50
+ Investigation is not itself a reason to create Work. A small, understood change can stay Direct. Durable Work, worktrees, or workers are introduced when recovery, dependency tracking, isolation, long-running execution, or real risk requires them.
51
51
 
52
52
  ### Process Runtime
53
53
 
@@ -16,13 +16,13 @@ npm install -g . --omit=optional --no-audit --no-fund
16
16
  After the package is visibly published to npm:
17
17
 
18
18
  ```bash
19
- npm install -g @moretea-labs/forge@next
19
+ npm install -g @moretea-labs/forge
20
20
  ```
21
21
 
22
22
  Bun installs the same npm artifact:
23
23
 
24
24
  ```bash
25
- bun add -g @moretea-labs/forge@next
25
+ bun add -g @moretea-labs/forge
26
26
  ```
27
27
 
28
28
  Do not infer npm publication from a GitHub tag or prerelease alone.
@@ -17,7 +17,7 @@ Requirements: Git, Node.js 20.10+, npm, and a writable user directory. Bun is re
17
17
 
18
18
  ```bash
19
19
  forge --version
20
- forge init --target both
20
+ forge install --target both
21
21
  forge doctor
22
22
  ```
23
23
 
@@ -6,7 +6,7 @@ Resolve the repository and checkout, read current status, and check whether an I
6
6
 
7
7
  ## 2. Plan the smallest safe unit
8
8
 
9
- Use direct edits for bounded changes. Use durable Tasks, isolated worktrees, or campaigns when work is long-running, parallel, dependency-aware, or high risk.
9
+ Use direct edits for bounded changes. Use durable Tasks, isolated worktrees, or Goal Workloop coordination when work is long-running, parallel, dependency-aware, or high risk.
10
10
 
11
11
  ## 3. Execute with ownership
12
12
 
package/install.ps1 CHANGED
@@ -16,7 +16,6 @@ function Add-PathEntry([string]$PathEntry) { if ($PathEntry -and (Test-Path $Pat
16
16
  function Refresh-InstallerPath { Add-PathEntry $BunBin; if ($env:APPDATA) { Add-PathEntry (Join-Path $env:APPDATA "npm") }; if (Test-Command "npm") { $npmPrefix = (& npm config get prefix 2>$null | Select-Object -First 1).Trim(); Add-PathEntry $npmPrefix } }
17
17
  function Assert-Prerequisites {
18
18
  if ($PSVersionTable.PSVersion -lt [version]"5.1") { throw "PowerShell 5.1 or newer is required. PowerShell 7 is recommended." }
19
- if (-not (Test-Command "git")) { throw "Git is required. Install Git for Windows, reopen PowerShell, and rerun this installer." }
20
19
  if (-not (Test-Command "node")) { throw "Node.js 20.10 or newer is required because the published Forge launcher uses Node." }
21
20
  $nodeText = (& node -p "process.versions.node").Trim(); if ($LASTEXITCODE -ne 0 -or -not $nodeText) { throw "Node.js is present, but its version could not be read." }
22
21
  if ([version]$nodeText -lt $MinimumNodeVersion) { throw "Node.js 20.10 or newer is required; found $nodeText." }
@@ -30,7 +29,7 @@ function Select-InstallRuntime {
30
29
  default { throw "Invalid FORGE_INSTALL_RUNTIME=$InstallRuntime. Expected auto, bun, or node." }
31
30
  }
32
31
  }
33
- if ($DryRun -or $env:FORGE_DRY_RUN -eq "1") { Write-Host "DRY RUN: would require Git and Node.js 20.10+, choose runtime ($InstallRuntime), install $PackageName@$PackageVersion, and verify the Forge CLI."; exit 0 }
32
+ if ($DryRun -or $env:FORGE_DRY_RUN -eq "1") { Write-Host "DRY RUN: would require Node.js 20.10+ and npm/Bun, install $PackageName@$PackageVersion, and verify the Forge CLI. Git is optional until repository features are enabled."; exit 0 }
34
33
  Refresh-InstallerPath
35
34
  Assert-Prerequisites
36
35
  $Runtime = Select-InstallRuntime
@@ -43,6 +42,6 @@ $Version = (& forge --version | Select-Object -First 1).Trim(); if ($LASTEXITCOD
43
42
  & forge doctor --help *> $null; if ($LASTEXITCODE -ne 0) { throw "Forge installed, but the doctor command could not be loaded." }
44
43
  Write-Host "Forge $Version installed."
45
44
  Write-Host "Next:"
46
- Write-Host " forge install --no-cli"
47
- Write-Host " forge doctor"
48
- Write-Host " forge adopt --repo C:\path\to\your-project --dry-run"
45
+ Write-Host " forge setup"
46
+ Write-Host ""
47
+ Write-Host "Git is only needed when you enable repository/software-work features."