code-workspace-zhuiyi 0.1.0-beta.7 → 0.1.0-beta.9

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 (71) hide show
  1. package/README.md +17 -16
  2. package/README.zh-CN.md +17 -14
  3. package/artifacts/manifest.json +7 -25
  4. package/artifacts/templates/agents/WORKSPACE_GUARD.md.template +9 -10
  5. package/artifacts/templates/agents/skills/code-workspace-resolve-branch/SKILL.md +4 -4
  6. package/artifacts/templates/user-guide/en-US.md +15 -14
  7. package/artifacts/templates/user-guide/zh-CN.md +15 -14
  8. package/bin/code-workspace.js +2 -1
  9. package/docs/extension-architecture.zh-CN.md +21 -4
  10. package/extensions/monitor/1.0.0/assets/i18n-icon.svg +1 -0
  11. package/extensions/monitor/1.0.0/assets/logo-vector.svg +30 -0
  12. package/extensions/monitor/1.0.0/assets/request_tip.mp3 +0 -0
  13. package/extensions/monitor/1.0.0/assets/session_finish.mp3 +0 -0
  14. package/extensions/monitor/1.0.0/init.js +38 -0
  15. package/extensions/monitor/1.0.0/manifest.json +39 -0
  16. package/{src/monitor/index.js → extensions/monitor/1.0.0/monitor.js} +9 -6
  17. package/extensions/monitor/1.0.0/runtime.js +76 -0
  18. package/extensions/monitor/1.1.0/assets/i18n-icon.svg +1 -0
  19. package/extensions/monitor/1.1.0/assets/logo-vector.svg +30 -0
  20. package/extensions/monitor/1.1.0/assets/request_tip.mp3 +0 -0
  21. package/extensions/monitor/1.1.0/assets/session_finish.mp3 +0 -0
  22. package/extensions/monitor/1.1.0/i18n/index.js +33 -0
  23. package/extensions/monitor/1.1.0/i18n/locales/en-US.js +85 -0
  24. package/extensions/monitor/1.1.0/i18n/locales/zh-CN.js +79 -0
  25. package/extensions/monitor/1.1.0/init.js +37 -0
  26. package/extensions/monitor/1.1.0/manifest.json +39 -0
  27. package/extensions/monitor/1.1.0/monitor.js +372 -0
  28. package/extensions/monitor/1.1.0/page.js +118 -0
  29. package/extensions/monitor/1.1.0/runtime.js +105 -0
  30. package/extensions/zhuiyi-opensvn-mcp/0.1.0/artifacts/claude/server.json +1 -1
  31. package/extensions/zhuiyi-opensvn-mcp/0.1.0/artifacts/codex/config.toml +1 -1
  32. package/package.json +2 -3
  33. package/schemas/extension-init-context-v1.json +5 -0
  34. package/schemas/extension-manifest-v3.json +55 -3
  35. package/schemas/extension-runtime-context-v1.json +39 -0
  36. package/schemas/extension-runtime-result-v1.json +37 -0
  37. package/spec/extension/v1/specification.en-US.md +22 -2
  38. package/spec/extension/v1/specification.zh-CN.md +20 -2
  39. package/src/cli/commands/completion.js +3 -3
  40. package/src/cli/commands/ext.js +45 -0
  41. package/src/cli/commands/extension.js +12 -3
  42. package/src/cli/commands/help.js +1 -1
  43. package/src/cli/commands/init.js +7 -9
  44. package/src/cli/commands/project.js +0 -1
  45. package/src/cli/commands/update.js +7 -10
  46. package/src/cli/commands/workspace.js +0 -1
  47. package/src/cli/parser.js +51 -1
  48. package/src/cli/registry.js +3 -4
  49. package/src/cli.js +3 -7
  50. package/src/core/config.js +2 -39
  51. package/src/core/doctor.js +4 -10
  52. package/src/core/extension-artifacts.js +13 -2
  53. package/src/core/extension-runtime-contract.js +159 -0
  54. package/src/core/extension-runtime.js +474 -0
  55. package/src/core/extension-store.js +327 -0
  56. package/src/core/extensions.js +212 -41
  57. package/src/core/init.js +1 -1
  58. package/src/core/initializer.js +3 -20
  59. package/src/core/language.js +1 -1
  60. package/src/core/managed-files.js +5 -10
  61. package/src/core/permissions/claude.js +2 -2
  62. package/src/core/permissions/codex.js +2 -2
  63. package/src/index.js +4 -4
  64. package/src/init/plan.js +1 -2
  65. package/src/init/wizard.js +2 -9
  66. package/artifacts/templates/codex/hooks.json +0 -86
  67. package/src/cli/commands/monitor.js +0 -62
  68. /package/{src/monitor → extensions/monitor/1.0.0}/i18n/index.js +0 -0
  69. /package/{src/monitor → extensions/monitor/1.0.0}/i18n/locales/en-US.js +0 -0
  70. /package/{src/monitor → extensions/monitor/1.0.0}/i18n/locales/zh-CN.js +0 -0
  71. /package/{src/monitor → extensions/monitor/1.0.0}/page.js +0 -0
package/README.md CHANGED
@@ -13,7 +13,7 @@ Code Workspace is a local multi-project registry and safety layer for Claude Cod
13
13
  npm install -g @icebearx-ai/code-workspace
14
14
  ```
15
15
 
16
- The package provides `code-workspace` and the shorter alias `code-w`.
16
+ The package provides the `code-workspace` command and the shorter `codew` alias. The legacy `code-w` alias remains available for compatibility.
17
17
 
18
18
  ## Initialize
19
19
 
@@ -33,7 +33,7 @@ code-workspace init . \
33
33
  --yes
34
34
  ```
35
35
 
36
- Use `--tools claude`, `--tools codex`, or `--tools none` to override the default tool selection. Codex monitoring is enabled by default when Codex is selected; use `--no-monitor` to disable it.
36
+ Use `--tools claude`, `--tools codex`, or `--tools none` to override the default tool selection. Monitoring is not enabled implicitly; install the `monitor` extension with `--extensions monitor` or through the interactive extension picker.
37
37
 
38
38
  Initialization writes only Workspace-owned state and integrations:
39
39
 
@@ -41,7 +41,7 @@ Initialization writes only Workspace-owned state and integrations:
41
41
  - `USER_GUIDE.md`
42
42
  - `CLAUDE.md` and/or `AGENTS.md`
43
43
  - Workspace-specific commands and skills whose names start with `code-workspace-` or use the `/code-workspace` namespace
44
- - `.codex/hooks.json` when monitoring is enabled
44
+ - `.codex/hooks.json` is written by the `monitor` extension when that extension is installed
45
45
 
46
46
  It does not create `openspec/`, install native `/opsx` commands, or install native `openspec-*` skills.
47
47
 
@@ -50,13 +50,13 @@ It does not create `openspec/`, install native `/opsx` commands, or install nati
50
50
  `init` can install integrations from the versioned `extensions/` repository shipped inside this npm package. Select extension names interactively, or pass a comma-separated name list non-interactively. The dedicated install command accepts one or more names; without names it opens the built-in extension multiselect, where ESC exits without changes:
51
51
 
52
52
  ```bash
53
- code-w init . --extensions zhuiyi-jira-mcp --yes
54
- code-w init . --extensions zhuiyi-opensvn-mcp --yes
55
- code-w init . --extensions none --yes
56
- code-w extension install
57
- code-w extension install zhuiyi-jira-mcp --yes
58
- code-w extension install zhuiyi-opensvn-mcp --yes
59
- code-w extension uninstall zhuiyi-jira-mcp --yes
53
+ codew init . --extensions zhuiyi-jira-mcp --yes
54
+ codew init . --extensions zhuiyi-opensvn-mcp --yes
55
+ codew init . --extensions none --yes
56
+ codew extension install
57
+ codew extension install zhuiyi-jira-mcp --yes
58
+ codew extension install zhuiyi-opensvn-mcp --yes
59
+ codew extension uninstall zhuiyi-jira-mcp --yes
60
60
  ```
61
61
 
62
62
  The Workspace operation lock shared by init, extension install, and extension uninstall is configured in the Code Workspace project's `.env` (not in the target Workspace). `CODE_WORKSPACE_INIT_LOCK_UPDATE_MS` defaults to `5000`, and `CODE_WORKSPACE_INIT_LOCK_STALE_MS` defaults to `30000`; process environment variables take precedence. See `.env.example` for the project configuration names.
@@ -67,7 +67,7 @@ Users select names, not versions; `zhuiyi-jira-mcp@0.1.0` is intentionally rejec
67
67
 
68
68
  The bundled `zhuiyi-jira-mcp` and `zhuiyi-opensvn-mcp` extensions configure the Jira and OpenSVN MCP services for the selected Agent tools. They do not create an `openspec/` directory or install native OpenSpec commands.
69
69
 
70
- `zhuiyi-opensvn-mcp` accesses OpenSVN static resources through `opssvn.in.wezhuiyi.com`. Its runtime configuration requires `SVN_AUTHORIZATION` and optionally accepts `SVN_OUTPUT_DIR` and `SVN_MAX_RESOURCES`; credentials are not stored in the extension package and should be supplied through local configuration or the runtime environment.
70
+ `zhuiyi-opensvn-mcp` accesses OpenSVN static resources through `opssvn.in.wezhuiyi.com`. Its bundled configuration sets `SVN_OUTPUT_DIR` to `.mcp-cache-opensvn`, requires `SVN_AUTHORIZATION`, and defaults `SVN_MAX_RESOURCES` to `200`; credentials are not stored in the extension package and should be supplied through local configuration or the runtime environment.
71
71
 
72
72
  Extension entries run in separate Node processes and generate files in temporary staging directories. The host rejects undeclared, missing, symbolic-link, non-file, path-escaping, conflicting, and checksum-mismatched artifacts before transactionally installing them. Per-Workspace state is stored in `.code-workspace/ext-manifest.json`. A failed extension is reported as a warning and does not roll back successful core initialization or stop later extensions; a failed upgrade restores and retains the previous installed version.
73
73
 
@@ -78,7 +78,7 @@ verified by Code Workspace; extensions never patch the real Workspace directly.
78
78
  recorded installed state and does not execute extension code. Unknown changes to extension-owned
79
79
  files or contributions stop the operation instead of being overwritten.
80
80
 
81
- This is fault isolation, not a malicious-code security sandbox. The experimental release trusts only extension code shipped with Code Workspace; network sources, external extension directories, dependencies, arbitrary patches, force uninstall, disable commands, and automatic extension updates through `code-w update` are not supported. The developer contract is in `docs/extensions.md`.
81
+ This is fault isolation, not a malicious-code security sandbox. The experimental release trusts only extension code shipped with Code Workspace; network sources, external extension directories, dependencies, arbitrary patches, force uninstall, disable commands, and automatic extension updates through `codew update` are not supported. The developer contract is in `docs/extensions.md`.
82
82
 
83
83
  ## Register projects
84
84
 
@@ -185,13 +185,14 @@ code-workspace language --json
185
185
 
186
186
  ## Monitor
187
187
 
188
+ Monitor ships as the built-in `monitor` extension. Install it into a workspace and run its dashboard through the generic extension runtime:
189
+
188
190
  ```bash
189
- code-workspace monitor --port 3211
191
+ code-workspace extension install monitor --yes
192
+ code-workspace ext monitor serve --port 3211
190
193
  ```
191
194
 
192
- The monitor binds to loopback, combines events from multiple initialized workspaces, and keeps hook reporting failure-open. Review and trust project hooks in Codex before relying on reports.
193
-
194
- ## Completion
195
+ The monitor binds to loopback, combines events from multiple initialized workspaces, and keeps hook reporting (`codew ext monitor report`) failure-open. Review and trust project hooks in Codex before relying on reports.
195
196
 
196
197
  ```bash
197
198
  code-workspace completion --shell zsh
package/README.zh-CN.md CHANGED
@@ -13,7 +13,7 @@ Code Workspace 是面向 Claude Code 与 Codex 的本地多项目注册表和安
13
13
  npm install -g @icebearx-ai/code-workspace
14
14
  ```
15
15
 
16
- 软件包提供 `code-workspace` 命令及短别名 `code-w`。
16
+ 软件包提供 `code-workspace` 命令及短别名 `codew`。为保持兼容,旧别名 `code-w` 仍然可用。
17
17
 
18
18
  ## 初始化
19
19
 
@@ -33,7 +33,7 @@ code-workspace init . \
33
33
  --yes
34
34
  ```
35
35
 
36
- 可用 `--tools claude`、`--tools codex` 或 `--tools none` 覆盖默认工具选择。选择 Codex 时默认启用监控;可传 `--no-monitor` 关闭。
36
+ 可用 `--tools claude`、`--tools codex` 或 `--tools none` 覆盖默认工具选择。监控不会隐式启用;请通过 `--extensions monitor` 或交互式扩展选择安装 `monitor` 扩展。
37
37
 
38
38
  初始化只写入 Workspace 自有状态和集成:
39
39
 
@@ -41,7 +41,7 @@ code-workspace init . \
41
41
  - `USER_GUIDE.md`
42
42
  - `CLAUDE.md` 和/或 `AGENTS.md`
43
43
  - 名称以 `code-workspace-` 开头或使用 `/code-workspace` 命名空间的 Workspace 专用命令与 Skill
44
- - 启用监控时的 `.codex/hooks.json`
44
+ - 安装 `monitor` 扩展时由扩展写入的 `.codex/hooks.json`
45
45
 
46
46
  它不会创建 `openspec/`,不会安装原生 `/opsx` 命令,也不会安装原生 `openspec-*` Skill。
47
47
 
@@ -50,13 +50,13 @@ code-workspace init . \
50
50
  `init` 可以从 npm 包内随附的版本化 `extensions/` 仓库安装集成。交互模式按扩展名多选;非交互模式传入逗号分隔的扩展名。独立安装命令接受一个或多个扩展名;不传名称时打开内置扩展多选,按 ESC 可无修改退出:
51
51
 
52
52
  ```bash
53
- code-w init . --extensions zhuiyi-jira-mcp --yes
54
- code-w init . --extensions zhuiyi-opensvn-mcp --yes
55
- code-w init . --extensions none --yes
56
- code-w extension install
57
- code-w extension install zhuiyi-jira-mcp --yes
58
- code-w extension install zhuiyi-opensvn-mcp --yes
59
- code-w extension uninstall zhuiyi-jira-mcp --yes
53
+ codew init . --extensions zhuiyi-jira-mcp --yes
54
+ codew init . --extensions zhuiyi-opensvn-mcp --yes
55
+ codew init . --extensions none --yes
56
+ codew extension install
57
+ codew extension install zhuiyi-jira-mcp --yes
58
+ codew extension install zhuiyi-opensvn-mcp --yes
59
+ codew extension uninstall zhuiyi-jira-mcp --yes
60
60
  ```
61
61
 
62
62
  `init`、扩展安装和扩展卸载共享的 Workspace 操作锁配置在 Code Workspace 项目自身的 `.env` 中(不在目标 Workspace 中)。`CODE_WORKSPACE_INIT_LOCK_UPDATE_MS` 默认值为 `5000`,`CODE_WORKSPACE_INIT_LOCK_STALE_MS` 默认值为 `30000`;进程环境变量优先于 `.env`。配置项名称见 `.env.example`。
@@ -67,7 +67,7 @@ code-w extension uninstall zhuiyi-jira-mcp --yes
67
67
 
68
68
  当前随包提供的内置扩展包括 `zhuiyi-jira-mcp` 和 `zhuiyi-opensvn-mcp`,分别用于为选中的 Agent 工具配置 Jira MCP 与 OpenSVN MCP 服务;它们不会创建 `openspec/` 目录,也不会安装 OpenSpec 原生命令。
69
69
 
70
- `zhuiyi-opensvn-mcp` 使用 `opssvn.in.wezhuiyi.com` 访问 OpenSVN 静态资源。运行时必须在对应 Agent 配置中提供 `SVN_AUTHORIZATION`,可选配置 `SVN_OUTPUT_DIR` 和 `SVN_MAX_RESOURCES`;认证信息不会写入扩展包,应通过本地配置或运行环境注入。
70
+ `zhuiyi-opensvn-mcp` 使用 `opssvn.in.wezhuiyi.com` 访问 OpenSVN 静态资源。内置配置将 `SVN_OUTPUT_DIR` 设为 `.mcp-cache-opensvn`,运行时必须提供 `SVN_AUTHORIZATION`,`SVN_MAX_RESOURCES` 默认为 `200`;认证信息不会写入扩展包,应通过本地配置或运行环境注入。
71
71
 
72
72
  扩展入口在独立 Node 进程中运行,只向临时 staging 目录生成文件。Host 会在事务安装前拒绝未声明、缺失、符号链接、非文件、路径逃逸、目标冲突和 hash 不匹配的制品。Workspace 状态存放在 `.code-workspace/ext-manifest.json`。扩展失败以 warning 报告,不回滚已成功的核心初始化,也不阻止后续扩展;升级失败会恢复并保留旧的已安装版本。
73
73
 
@@ -76,7 +76,7 @@ code-w extension uninstall zhuiyi-jira-mcp --yes
76
76
  Workspace 合成和验证,扩展不会直接 patch 真实 Workspace。卸载只使用已安装状态,不执行
77
77
  扩展代码;扩展所有的文件或贡献存在未知修改时会拒绝覆盖或删除。
78
78
 
79
- 这是故障隔离,不是恶意代码安全沙箱。试验版本只信任随 Code Workspace 发布的扩展代码;暂不支持网络源、外部扩展目录、扩展依赖、任意 patch、强制卸载、禁用命令,也不会通过 `code-w update` 自动更新扩展。开发契约见 `docs/extensions.zh-CN.md`。
79
+ 这是故障隔离,不是恶意代码安全沙箱。试验版本只信任随 Code Workspace 发布的扩展代码;暂不支持网络源、外部扩展目录、扩展依赖、任意 patch、强制卸载、禁用命令,也不会通过 `codew update` 自动更新扩展。开发契约见 `docs/extensions.zh-CN.md`。
80
80
 
81
81
  ## 注册项目
82
82
 
@@ -183,11 +183,14 @@ code-workspace language --json
183
183
 
184
184
  ## 监控
185
185
 
186
+ 监控以内置 `monitor` 扩展的形式提供。先在 Workspace 中安装扩展,再通过通用扩展运行时启动面板:
187
+
186
188
  ```bash
187
- code-workspace monitor --port 3211
189
+ code-workspace extension install monitor --yes
190
+ code-workspace ext monitor serve --port 3211
188
191
  ```
189
192
 
190
- 监控服务仅绑定 loopback,可汇总多个已初始化工作区的事件;hook 上报失败不会阻断 Agent。依赖监控前,请在 Codex 中检查并信任项目 hook。
193
+ 监控服务仅绑定 loopback,可汇总多个已初始化工作区的事件;hook 上报(`codew ext monitor report`)失败不会阻断 Agent。依赖监控前,请在 Codex 中检查并信任项目 hook。
191
194
 
192
195
  ## 命令补全
193
196
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "releaseVersion": "0.1.0-beta.7",
3
+ "releaseVersion": "0.1.0-beta.9",
4
4
  "requirements": {
5
5
  "node": ">=20.19.0"
6
6
  },
@@ -13,13 +13,13 @@
13
13
  "id": "workspace-user-guide-en-US",
14
14
  "kind": "asset",
15
15
  "path": "templates/user-guide/en-US.md",
16
- "sha256": "a05c1611df919bcb05843d703a5a08c9d7e312c7dd69d1ac198f8bcfc266ec67"
16
+ "sha256": "a91d45e4fc11b4f3eb3c651a4fcee6d981b0d076d93063e0480c5c3e377ea5d2"
17
17
  },
18
18
  {
19
19
  "id": "workspace-user-guide-zh-CN",
20
20
  "kind": "asset",
21
21
  "path": "templates/user-guide/zh-CN.md",
22
- "sha256": "b4fb6dee108832c02fc09e179c051678406d486f341b3174aa5e57b4053d740a"
22
+ "sha256": "43bfd67f0725c4834cf33bb7ab96cbe090db6f4373f0b58d01276db293cb9598"
23
23
  }
24
24
  ],
25
25
  "managedFiles": [
@@ -49,7 +49,7 @@
49
49
  "allowMissing": true,
50
50
  "desired": {
51
51
  "source": "templates/agents/WORKSPACE_GUARD.md.template",
52
- "sha256": "6510cce83138fad46330d2c175506e56e9c98d5086195a699eafc7cc74163bf3"
52
+ "sha256": "bddb8e2ee25b7a63614b4297453e5803d2740fc475d97f5d8489dbaf17380c2c"
53
53
  },
54
54
  "render": {
55
55
  "variables": [
@@ -72,7 +72,7 @@
72
72
  "allowMissing": true,
73
73
  "desired": {
74
74
  "source": "templates/agents/WORKSPACE_GUARD.md.template",
75
- "sha256": "6510cce83138fad46330d2c175506e56e9c98d5086195a699eafc7cc74163bf3"
75
+ "sha256": "bddb8e2ee25b7a63614b4297453e5803d2740fc475d97f5d8489dbaf17380c2c"
76
76
  },
77
77
  "render": {
78
78
  "variables": [
@@ -86,24 +86,6 @@
86
86
  "kind": "template"
87
87
  }
88
88
  },
89
- {
90
- "id": "workspace-codex-monitor-hooks",
91
- "target": ".codex/hooks.json",
92
- "tools": [
93
- "codex"
94
- ],
95
- "capabilities": [
96
- "monitor"
97
- ],
98
- "allowMissing": true,
99
- "desired": {
100
- "source": "templates/codex/hooks.json",
101
- "sha256": "64d68809a2681b11d4b50bee3ca711fa8f5ea0a297c2281e5c7f8937e968e22e"
102
- },
103
- "provenance": {
104
- "kind": "template"
105
- }
106
- },
107
89
  {
108
90
  "id": "workspace-claude-add-projects-command",
109
91
  "target": ".claude/commands/code-workspace/add-projects.md",
@@ -158,7 +140,7 @@
158
140
  "allowMissing": true,
159
141
  "desired": {
160
142
  "source": "templates/agents/skills/code-workspace-resolve-branch/SKILL.md",
161
- "sha256": "d09b0e1847f5b39e6409ba3ac43f26fa5829a15690a3e216576e51535fb6b161"
143
+ "sha256": "df8c65fbadf917b7247bbd1f40144da8c904a95f2b3ee905a4d2d6176e0a5f1b"
162
144
  },
163
145
  "provenance": {
164
146
  "kind": "template"
@@ -173,7 +155,7 @@
173
155
  "allowMissing": true,
174
156
  "desired": {
175
157
  "source": "templates/agents/skills/code-workspace-resolve-branch/SKILL.md",
176
- "sha256": "d09b0e1847f5b39e6409ba3ac43f26fa5829a15690a3e216576e51535fb6b161"
158
+ "sha256": "df8c65fbadf917b7247bbd1f40144da8c904a95f2b3ee905a4d2d6176e0a5f1b"
177
159
  },
178
160
  "provenance": {
179
161
  "kind": "template"
@@ -9,13 +9,13 @@ The registry is authoritative for project identity, ownership, location, and the
9
9
  If the user explicitly names a registered project, resolve it directly:
10
10
 
11
11
  ```bash
12
- code-w project show "<project.name>" --json
12
+ codew project show "<project.name>" --json
13
13
  ```
14
14
 
15
15
  Only when project ownership cannot be determined, list registry metadata:
16
16
 
17
17
  ```bash
18
- code-w project list --json
18
+ codew project list --json
19
19
  ```
20
20
 
21
21
  Use `name`, `type`, and `context` only to identify relevant candidates and ask the user to choose. Do not inspect candidate repositories while selecting.
@@ -33,27 +33,26 @@ Meta, help, or workspace-tool maintenance tasks that do not depend on registered
33
33
  Before reading or modifying selected project code, run:
34
34
 
35
35
  ```bash
36
- code-w project verify "<project.name>" --json
36
+ codew project verify "<project.name>" --json
37
37
  ```
38
38
 
39
39
  For several explicitly selected projects, use:
40
40
 
41
41
  ```bash
42
- code-w project verify "<project-a>" "<project-b>" --json
42
+ codew project verify "<project-a>" "<project-b>" --json
43
43
  ```
44
44
 
45
45
  - For one project, continue only when the targeted result has `ok: true`. For a multi-project result, evaluate every ordered project result independently: continue passed projects and keep failed projects paused even when the top-level `ok` is false.
46
46
  - On `PROJECT_BRANCH_MISMATCH`, pause affected project work and invoke the installed `code-workspace-resolve-branch` Skill. The Skill may combine mismatches from the explicitly selected scope into one concise question; do not choose a branch direction yourself.
47
- - For any other failure, report the targeted diagnostics and wait for user direction for the affected project; a failure in one batch result does not block unrelated successful selected projects. Do not escalate to full-workspace validation.
48
- - The branch Skill completes after `project branch verify` confirms alignment; it does not own overall project readiness. After its handoff, discard branch-dependent context and rerun targeted `project verify` for the successfully reconciled projects before resuming work.
49
- - If that overall verification fails for a non-branch reason, keep the affected project paused and handle the project-level diagnostic here without treating the branch Skill as failed. If a new `PROJECT_BRANCH_MISMATCH` appears because the branch drifted again, re-enter the Skill. Do not list or verify unrelated projects.
47
+ - For any other failure, report the targeted diagnostics and wait for user direction for the affected project; a failure in one batch result does not block unrelated successful selected projects. Do not escalate to full-workspace validation. Do not list or verify unrelated projects.
48
+ - The branch Skill completes after `project branch verify` confirms alignment; it does not own overall project readiness. After its handoff, proceed directly to `project branch update-latest` without rerunning targeted `project verify`. If update-latest reports a new `PROJECT_BRANCH_MISMATCH`, re-enter the Skill using the new CLI observation.
50
49
  - After branch verification succeeds—including projects whose branches were already aligned—run `project branch update-latest` for the selected projects:
51
50
 
52
51
  ```bash
53
- code-w project branch update-latest "<project-a>" "<project-b>" --json
52
+ codew project branch update-latest "<project-a>" "<project-b>" --json
54
53
  ```
55
54
 
56
- Pass each selected project name as a separate argument; for a single project, pass only that project name. Evaluate each project result independently, including when the batch-level `ok` is `false`: continue only for projects whose individual result has `ok: true`, and treat `disabled` and `already-latest` as successful skips. If an update fails, keep that project paused and do not run ad-hoc `fetch`, `pull`, `reset`, `stash`, or `rebase` commands. For each successful or skipped project, discard pre-update context and rerun targeted `project verify` before starting project work.
55
+ Pass each selected project name as a separate argument; for a single project, pass only that project name. Evaluate each project result independently, including when the batch-level `ok` is `false`: continue only for projects whose individual result has `ok: true`, and treat `disabled` and `already-latest` as successful skips. If an update fails, keep that project paused and do not run ad-hoc `fetch`, `pull`, `reset`, `stash`, or `rebase` commands. Do not rerun targeted `project verify` after update-latest. For each `fastForwarded: true` result, discard pre-update context and re-read the project files and instructions before starting project work; `disabled` and `already-latest` results may continue with the existing context.
57
56
 
58
57
  ## Workspace Write Boundary
59
58
 
@@ -63,7 +62,7 @@ The AI/Agent MUST NOT directly create, edit, move, or delete Workspace-owned fil
63
62
  - `.codex/config.toml`
64
63
  - `CLAUDE.md`, `AGENTS.md`, or other managed workspace files
65
64
 
66
- AI/Agent registry changes must use an approved `code-w` command. Users may manually edit `.code-workspace/config.yaml` and are responsible for the resulting configuration; AI/Agent must not imitate that edit with a script or direct file write. The CLI owns confirmation, concurrency checks, persistence or safe external effects, postconditions, rollback/compensation, and structured output. This boundary does not prevent user-requested production-code changes inside the selected external `project.location`.
65
+ AI/Agent registry changes must use an approved `codew` command. Users may manually edit `.code-workspace/config.yaml` and are responsible for the resulting configuration; AI/Agent must not imitate that edit with a script or direct file write. The CLI owns confirmation, concurrency checks, persistence or safe external effects, postconditions, rollback/compensation, and structured output. This boundary does not prevent user-requested production-code changes inside the selected external `project.location`.
67
66
 
68
67
  ## Responsibilities
69
68
 
@@ -12,7 +12,7 @@ Resolve only the already selected registered project or projects. This Skill own
12
12
  Run one command from the Workspace for all selected projects whose targeted verification reported `PROJECT_BRANCH_MISMATCH`. Pass each project name as a separate argument; do not join names with commas:
13
13
 
14
14
  ```bash
15
- code-w project branch inspect "<project-a>" "<project-b>" --json
15
+ codew project branch inspect "<project-a>" "<project-b>" --json
16
16
  ```
17
17
 
18
18
  For one project, require the existing standard envelope whose `data` contains all of: `project.name`, `project.location`, `registeredBranch`, `actualBranch`, `matches`, `worktreeClean`, `registeredBranchExists`, and `remoteBranchCandidates`. For several projects, read the ordered `data.results`; each successful result contains those facts in its `data`, while failed results are explained by the top-level diagnostics. Do not infer or independently inspect missing values.
@@ -67,8 +67,8 @@ Ask rules:
67
67
 
68
68
  ## Apply valid choices through the CLI
69
69
 
70
- - Group every project that selected choice 1 into one `code-w project branch use-registered "<project-a>" "<project-b>" --allow-remote --yes --json` invocation. Include only projects for which choice 1 is available. `--allow-remote` is harmless for projects whose local registered branch already exists and permits creation only from an existing unique remote-tracking branch.
71
- - Group every project that selected choice 2 into one `code-w project branch accept-actual "<project-a>" "<project-b>" --yes --json` invocation.
70
+ - Group every project that selected choice 1 into one `codew project branch use-registered "<project-a>" "<project-b>" --allow-remote --yes --json` invocation. Include only projects for which choice 1 is available. `--allow-remote` is harmless for projects whose local registered branch already exists and permits creation only from an existing unique remote-tracking branch.
71
+ - Group every project that selected choice 2 into one `codew project branch accept-actual "<project-a>" "<project-b>" --yes --json` invocation.
72
72
  - For choice 3, keep that project paused until the user confirms manual resolution is complete. Do not reuse any pre-resolution branch facts.
73
73
 
74
74
  If the registered branch is absent both locally and from remote-tracking refs, do not add `--remote` automatically. Tell the user that an explicit direct CLI invocation such as `project branch use-registered <name> --remote origin --yes --json` is required to authorize network fetch.
@@ -80,7 +80,7 @@ After all choices are valid and complete, run each non-empty automatic direction
80
80
  After both automatic direction groups finish, collect projects whose operations succeeded or skipped together with projects that were already matching during inspection, discard their cached branch-dependent context, and run one branch-only verification. After the user confirms one or more manual resolutions, verify those confirmed projects the same way:
81
81
 
82
82
  ```bash
83
- code-w project branch verify "<project-a>" "<project-b>" --json
83
+ codew project branch verify "<project-a>" "<project-b>" --json
84
84
  ```
85
85
 
86
86
  Use each result independently. A successful result means branch reconciliation is complete and branch alignment has been verified for that project; a failed result remains unresolved. Complete all independent automatic operations and branch verification before giving one consolidated report of inspected failures, successful changes, skips, branch-verification failures, and projects awaiting manual handling.
@@ -24,8 +24,8 @@ Upgrade the global package, update the current workspace's managed files, then v
24
24
 
25
25
  ```bash
26
26
  npm install -g @icebearx-ai/code-workspace@latest
27
- code-w update
28
- code-w doctor
27
+ codew update
28
+ codew doctor
29
29
  ```
30
30
 
31
31
  `update` refreshes managed instructions, Workspace skills, hooks, and this guide. It stops if a managed file contains unknown local changes. Review the file first; use `--force` only when replacing those changes is intentional.
@@ -35,24 +35,25 @@ code-w doctor
35
35
  Choose the Workspace language during initialization, or pass it explicitly:
36
36
 
37
37
  ```bash
38
- code-w init --language en-US
39
- code-w language
38
+ codew init --language en-US
39
+ codew language
40
40
  ```
41
41
 
42
42
  The selected preference is stored at `workspace.language` in `.code-workspace/config.yaml`. Change an initialized workspace with:
43
43
 
44
44
  ```bash
45
- code-w update --language en-US
45
+ codew update --language en-US
46
46
  ```
47
47
 
48
48
  This also switches this managed guide. Existing project context is not translated.
49
49
 
50
50
  ## Use the Agent monitor
51
51
 
52
- Start one global monitor for all workspaces:
52
+ Monitoring ships as the built-in `monitor` extension. Install it in a workspace and start one global monitor for all workspaces:
53
53
 
54
54
  ```bash
55
- code-w monitor
55
+ codew extension install monitor --yes
56
+ codew ext monitor
56
57
  ```
57
58
 
58
59
  Open the printed local URL. The dashboard shows workspaces, execution state, pending approvals, completed turns, and live signals. Monitor language is selected on the page and is independent of `workspace.language`.
@@ -60,26 +61,26 @@ Open the printed local URL. The dashboard shows workspaces, execution state, pen
60
61
  Use another port when necessary:
61
62
 
62
63
  ```bash
63
- code-w monitor --port 8080
64
+ codew ext monitor serve --port 8080
64
65
  ```
65
66
 
66
- Each participating workspace must use the same URL in `.code-workspace/config.yaml`. After initialization, review and trust the project hooks with `/hooks` in Codex.
67
+ The extension reports to the URL recorded in `.code-workspace/monitor-reporting.json`. After installation, review and trust the project hooks with `/hooks` in Codex.
67
68
 
68
69
  ## Practical commands
69
70
 
70
71
  ```bash
71
72
  # Check installation and workspace health
72
- code-w doctor
73
+ codew doctor
73
74
 
74
75
  # Update all managed files
75
- code-w update
76
+ codew update
76
77
 
77
78
  # Apply Agent project directory authorization
78
- code-w permissions apply --yes
79
+ codew permissions apply --yes
79
80
 
80
81
  # Validate local projects
81
- code-w project verify
82
- code-w project verify <project-name>
82
+ codew project verify
83
+ codew project verify <project-name>
83
84
  ```
84
85
 
85
86
  Directory access is authorized by the user. Code Workspace shows the requested changes, applies and verifies them, and reports the result. `permissions apply` grants missing registered-project access without revoking additional directories. Ordinary `update` does not change authorization.
@@ -24,8 +24,8 @@ Claude Code:
24
24
 
25
25
  ```bash
26
26
  npm install -g @icebearx-ai/code-workspace@latest
27
- code-w update
28
- code-w doctor
27
+ codew update
28
+ codew doctor
29
29
  ```
30
30
 
31
31
  `update` 会更新托管指令、Workspace 技能、Hook 和本指南。如果托管文件包含未知的本地修改,更新会停止。请先检查文件;只有明确要覆盖这些修改时才使用 `--force`。
@@ -35,24 +35,25 @@ code-w doctor
35
35
  初始化时可选择 Workspace 语言,也可以显式指定:
36
36
 
37
37
  ```bash
38
- code-w init --language zh-CN
39
- code-w language
38
+ codew init --language zh-CN
39
+ codew language
40
40
  ```
41
41
 
42
42
  所选偏好保存在 `.code-workspace/config.yaml` 的 `workspace.language`。已有工作区可通过以下命令切换语言:
43
43
 
44
44
  ```bash
45
- code-w update --language zh-CN
45
+ codew update --language zh-CN
46
46
  ```
47
47
 
48
48
  该操作也会切换本托管指南。已有项目 context 不会自动翻译。
49
49
 
50
50
  ## 使用 Agent Monitor
51
51
 
52
- 为所有工作区启动一个全局 Monitor:
52
+ 监控以内置 `monitor` 扩展的形式提供。先在 Workspace 中安装扩展,再为所有工作区启动一个全局 Monitor:
53
53
 
54
54
  ```bash
55
- code-w monitor
55
+ codew extension install monitor --yes
56
+ codew ext monitor
56
57
  ```
57
58
 
58
59
  打开命令输出的本地地址。面板会显示工作区、执行状态、待授权请求、已完成轮次和实时信号。Monitor 语言在页面中单独选择,与 `workspace.language` 相互独立。
@@ -60,26 +61,26 @@ code-w monitor
60
61
  必要时可使用其他端口:
61
62
 
62
63
  ```bash
63
- code-w monitor --port 8080
64
+ codew ext monitor serve --port 8080
64
65
  ```
65
66
 
66
- 所有参与监控的工作区都必须在 `.code-workspace/config.yaml` 中使用相同 URL。初始化后,请在 Codex 中使用 `/hooks` 检查并信任项目 Hook。
67
+ 扩展会向 `.code-workspace/monitor-reporting.json` 中记录的 URL 上报。安装后,请在 Codex 中使用 `/hooks` 检查并信任项目 Hook。
67
68
 
68
69
  ## 实用命令
69
70
 
70
71
  ```bash
71
72
  # 检查安装和工作区健康状态
72
- code-w doctor
73
+ codew doctor
73
74
 
74
75
  # 更新所有托管文件
75
- code-w update
76
+ codew update
76
77
 
77
78
  # 应用 Agent 项目目录授权
78
- code-w permissions apply --yes
79
+ codew permissions apply --yes
79
80
 
80
81
  # 校验本地项目
81
- code-w project verify
82
- code-w project verify <project-name>
82
+ codew project verify
83
+ codew project verify <project-name>
83
84
  ```
84
85
 
85
86
  目录访问由用户授权。Code Workspace 负责展示请求的变更、实施并验证变更,以及报告结果。`permissions apply` 只补齐已注册项目缺失的授权,不撤销额外目录。普通 `update` 不会改变授权。
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { main } = require("../src/cli");
4
+ const { hostJsonRequested } = require("../src/cli/parser");
4
5
  const { renderResult } = require("../src/cli/renderer");
5
6
  const { failure } = require("../src/cli/result");
6
7
 
7
- const json = process.argv.some((arg) => arg === "--json" || arg.startsWith("--json="));
8
+ const json = hostJsonRequested(process.argv);
8
9
 
9
10
  main(process.argv)
10
11
  .then((result) => renderResult(result, { json }))
@@ -93,6 +93,12 @@ extensions/<extension-id>/<version>/
93
93
 
94
94
  Host 明确声明自己支持的 Extension Spec 版本集合,只有 manifest 的 `extensionSpecVersion` 属于该集合时才会执行扩展。静态 manifest 用于发现、规划、冲突预检和用户确认。它不描述扩展业务实现,不包含需要由 Host 理解的下载 URL、npm 包信息或归档格式。
95
95
 
96
+ manifest 还可以声明独立的 `runtime` 入口。Runtime Host 只负责按 Store 中的精确版本校验
97
+ 入口、创建最小 context、管理 oneshot 或 service 进程生命周期;扩展 ID 后的参数由扩展自行
98
+ 解释。`workspace` runtime 依赖当前 Workspace activation,`global` runtime 不依赖全局
99
+ Workspace,也不因此获得任意 Workspace 路径或凭证。Runtime 子进程与初始化子进程一样属于
100
+ 可信代码执行,不是安全沙箱。
101
+
96
102
  入口可能继续读取扩展包内的辅助代码、模板和私有元数据,因此仅校验 `init.js` 不能冻结完整执行输入。Host 在规划时还需要计算整个扩展版本目录的规范摘要,并在执行前重新验证,以防 manifest、入口、辅助代码或模板在计划确认后发生变化。
97
103
 
98
104
  ### 4.5 初始化入口
@@ -175,13 +181,23 @@ installed manifest 是 Host 持久化的最终安装事实,保存在 Workspace
175
181
  - 卸载前验证文件未发生未知修改;
176
182
  - 验证成功后删除该文件。
177
183
 
178
- ### 6.2 独占目录
184
+ ### 6.2 种子文件(seeded)
185
+
186
+ `seeded` 是 `file` 的一种特殊所有权:Host 只在目标文件缺失时写入扩展提供的默认内容(种子),之后把该文件视为用户所有。Host 负责:
187
+
188
+ - 首次安装且目标缺失时写入默认内容;
189
+ - 升级时永不覆盖已存在的用户内容,也不做漂移检查;
190
+ - 卸载时直接删除该文件,即使内容已被用户修改。
191
+
192
+ 该能力用于「随扩展安装、之后归用户拥有」的本地配置文件(例如 monitor 的上报地址与开关)。
193
+
194
+ ### 6.3 独占目录
179
195
 
180
196
  一个扩展独占一个 Workspace 相对目录目标。它用于安装包含多个文件的运行时,例如预构建的 Jira MCP 包。
181
197
 
182
198
  Host 将目录视为一个制品,使用规范化目录摘要检测漂移,并通过 staging、备份和 rename 完成可恢复提交。目录摘要算法必须固定路径规则、排序、文件类型和文件内容计算方式。
183
199
 
184
- ### 6.3 共享文本块
200
+ ### 6.4 共享文本块
185
201
 
186
202
  扩展提供一个文本片段,Host 使用稳定的扩展 id 和输出 id 标记,将其合成到声明的共享文本目标中。
187
203
 
@@ -194,7 +210,7 @@ Host 负责:
194
210
 
195
211
  该能力覆盖当前 Codex TOML 配置需求,但协议不包含 Codex 或 MCP 业务字段。
196
212
 
197
- ### 6.4 JSON 对象成员
213
+ ### 6.5 JSON 对象成员
198
214
 
199
215
  扩展提供一个 JSON 值,并在静态 manifest 中声明目标文件和唯一成员位置。Host 只拥有该成员,不拥有整个 JSON 文件。
200
216
 
@@ -208,7 +224,7 @@ Host 负责:
208
224
 
209
225
  该能力覆盖 `.mcp.json` 中单个 MCP server 的需求,但核心不验证 server 的 Jira 业务含义。
210
226
 
211
- ### 6.5 暂不增加的输出
227
+ ### 6.6 暂不增加的输出
212
228
 
213
229
  基础版不增加 `remote-archive` 之类的下载型制品。下载和解压是扩展准备候选目录的实现过程,不是 Host 的安装制品语义。
214
230
 
@@ -371,6 +387,7 @@ node init.js --context <context-file> --output <staging-directory> --result <res
371
387
 
372
388
  - 独占目标同时只能由一个扩展拥有。
373
389
  - 共享目标由 Host 管理多个局部 contribution 的所有权。
390
+ - 种子文件目标在首次安装后视为用户所有,升级不覆盖、卸载删除、不参与漂移检查。
374
391
  - 静态 manifest 是安装意图,不是已安装事实。
375
392
  - 初始化结果是扩展声明,不是可信事实。
376
393
  - installed manifest 是 Host 验证后的事实来源。
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewBox="0 0 24 24" class="vt-locales-btn-icon" data-v-6229553e=""><path d="M0 0h24v24H0z" fill="none"></path><path d=" M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z " class="css-c4d79v"></path></svg>
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg"
3
+ width="1254" height="1254" viewBox="0 0 1254 1254"
4
+ role="img" aria-label="Geometric teal-blue logo">
5
+ <defs>
6
+ <linearGradient id="logoGradient" x1="320" y1="175" x2="860" y2="1080" gradientUnits="userSpaceOnUse">
7
+ <stop offset="0" stop-color="#19AEB8"/>
8
+ <stop offset="0.48" stop-color="#087DA5"/>
9
+ <stop offset="1" stop-color="#07528C"/>
10
+ </linearGradient>
11
+ </defs>
12
+
13
+ <g fill="none"
14
+ stroke="url(#logoGradient)"
15
+ stroke-width="118"
16
+ stroke-linecap="butt"
17
+ stroke-linejoin="round">
18
+ <path d="M 794 289
19
+ L 630 184
20
+ L 291 394
21
+ L 291 786
22
+ L 630 1020
23
+ L 973 786
24
+ L 973 393
25
+ L 914 354"/>
26
+ <path d="M 850 386
27
+ L 617 526
28
+ L 617 850"/>
29
+ </g>
30
+ </svg>