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

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 (53) hide show
  1. package/README.md +10 -10
  2. package/README.zh-CN.md +10 -10
  3. package/artifacts/manifest.json +8 -8
  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/codex/hooks.json +7 -7
  7. package/artifacts/templates/user-guide/en-US.md +12 -12
  8. package/artifacts/templates/user-guide/zh-CN.md +12 -12
  9. package/bin/code-workspace.js +2 -1
  10. package/docs/extension-architecture.zh-CN.md +6 -0
  11. package/extensions/monitor/1.0.0/assets/i18n-icon.svg +1 -0
  12. package/extensions/monitor/1.0.0/assets/logo-vector.svg +30 -0
  13. package/extensions/monitor/1.0.0/assets/request_tip.mp3 +0 -0
  14. package/extensions/monitor/1.0.0/assets/session_finish.mp3 +0 -0
  15. package/extensions/monitor/1.0.0/i18n/index.js +33 -0
  16. package/extensions/monitor/1.0.0/i18n/locales/en-US.js +85 -0
  17. package/extensions/monitor/1.0.0/i18n/locales/zh-CN.js +79 -0
  18. package/extensions/monitor/1.0.0/init.js +38 -0
  19. package/extensions/monitor/1.0.0/manifest.json +39 -0
  20. package/extensions/monitor/1.0.0/monitor.js +347 -0
  21. package/extensions/monitor/1.0.0/page.js +118 -0
  22. package/extensions/monitor/1.0.0/runtime.js +75 -0
  23. package/extensions/zhuiyi-opensvn-mcp/0.1.0/artifacts/claude/server.json +1 -1
  24. package/extensions/zhuiyi-opensvn-mcp/0.1.0/artifacts/codex/config.toml +1 -1
  25. package/package.json +2 -1
  26. package/schemas/extension-init-context-v1.json +5 -0
  27. package/schemas/extension-manifest-v3.json +49 -1
  28. package/schemas/extension-runtime-context-v1.json +39 -0
  29. package/schemas/extension-runtime-result-v1.json +37 -0
  30. package/spec/extension/v1/specification.en-US.md +15 -2
  31. package/spec/extension/v1/specification.zh-CN.md +14 -2
  32. package/src/cli/commands/completion.js +3 -3
  33. package/src/cli/commands/ext.js +45 -0
  34. package/src/cli/commands/extension.js +15 -4
  35. package/src/cli/commands/help.js +1 -1
  36. package/src/cli/commands/init.js +8 -1
  37. package/src/cli/commands/monitor.js +42 -31
  38. package/src/cli/commands/project.js +0 -1
  39. package/src/cli/commands/update.js +4 -4
  40. package/src/cli/parser.js +51 -1
  41. package/src/cli/registry.js +2 -0
  42. package/src/cli.js +2 -0
  43. package/src/core/config.js +1 -1
  44. package/src/core/doctor.js +2 -2
  45. package/src/core/extension-runtime-contract.js +159 -0
  46. package/src/core/extension-runtime.js +423 -0
  47. package/src/core/extension-store.js +327 -0
  48. package/src/core/extensions.js +202 -34
  49. package/src/core/init.js +1 -1
  50. package/src/core/language.js +1 -1
  51. package/src/core/permissions/claude.js +2 -2
  52. package/src/core/permissions/codex.js +2 -2
  53. package/src/index.js +4 -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
 
@@ -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
 
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
 
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "releaseVersion": "0.1.0-beta.7",
3
+ "releaseVersion": "0.1.0-beta.8",
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": "919217e7d7a1c59775f13803a1bf7645b48c01ba53bbb2cea9d666022c7ce7fc"
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": "c41dd91cfeef475b48785f19253e1213fe14b3208b12c9dfd3e7aa7dad13a4a7"
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": [
@@ -98,7 +98,7 @@
98
98
  "allowMissing": true,
99
99
  "desired": {
100
100
  "source": "templates/codex/hooks.json",
101
- "sha256": "64d68809a2681b11d4b50bee3ca711fa8f5ea0a297c2281e5c7f8937e968e22e"
101
+ "sha256": "ecba346e0ce73d931802615dd798b952f1d0afabef3c67d7d1ee21f81b133b46"
102
102
  },
103
103
  "provenance": {
104
104
  "kind": "template"
@@ -158,7 +158,7 @@
158
158
  "allowMissing": true,
159
159
  "desired": {
160
160
  "source": "templates/agents/skills/code-workspace-resolve-branch/SKILL.md",
161
- "sha256": "d09b0e1847f5b39e6409ba3ac43f26fa5829a15690a3e216576e51535fb6b161"
161
+ "sha256": "df8c65fbadf917b7247bbd1f40144da8c904a95f2b3ee905a4d2d6176e0a5f1b"
162
162
  },
163
163
  "provenance": {
164
164
  "kind": "template"
@@ -173,7 +173,7 @@
173
173
  "allowMissing": true,
174
174
  "desired": {
175
175
  "source": "templates/agents/skills/code-workspace-resolve-branch/SKILL.md",
176
- "sha256": "d09b0e1847f5b39e6409ba3ac43f26fa5829a15690a3e216576e51535fb6b161"
176
+ "sha256": "df8c65fbadf917b7247bbd1f40144da8c904a95f2b3ee905a4d2d6176e0a5f1b"
177
177
  },
178
178
  "provenance": {
179
179
  "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.
@@ -6,7 +6,7 @@
6
6
  "hooks": [
7
7
  {
8
8
  "type": "command",
9
- "command": "code-w monitor report",
9
+ "command": "codew monitor report",
10
10
  "timeout": 1
11
11
  }
12
12
  ]
@@ -18,7 +18,7 @@
18
18
  "hooks": [
19
19
  {
20
20
  "type": "command",
21
- "command": "code-w monitor report",
21
+ "command": "codew monitor report",
22
22
  "timeout": 1
23
23
  }
24
24
  ]
@@ -30,7 +30,7 @@
30
30
  "hooks": [
31
31
  {
32
32
  "type": "command",
33
- "command": "code-w monitor report",
33
+ "command": "codew monitor report",
34
34
  "timeout": 1
35
35
  }
36
36
  ]
@@ -42,7 +42,7 @@
42
42
  "hooks": [
43
43
  {
44
44
  "type": "command",
45
- "command": "code-w monitor report",
45
+ "command": "codew monitor report",
46
46
  "timeout": 1
47
47
  }
48
48
  ]
@@ -54,7 +54,7 @@
54
54
  "hooks": [
55
55
  {
56
56
  "type": "command",
57
- "command": "code-w monitor report",
57
+ "command": "codew monitor report",
58
58
  "timeout": 1
59
59
  }
60
60
  ]
@@ -65,7 +65,7 @@
65
65
  "hooks": [
66
66
  {
67
67
  "type": "command",
68
- "command": "code-w monitor report",
68
+ "command": "codew monitor report",
69
69
  "timeout": 1
70
70
  }
71
71
  ]
@@ -76,7 +76,7 @@
76
76
  "hooks": [
77
77
  {
78
78
  "type": "command",
79
- "command": "code-w monitor report",
79
+ "command": "codew monitor report",
80
80
  "timeout": 1
81
81
  }
82
82
  ]
@@ -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,14 +35,14 @@ 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.
@@ -52,7 +52,7 @@ This also switches this managed guide. Existing project context is not translate
52
52
  Start one global monitor for all workspaces:
53
53
 
54
54
  ```bash
55
- code-w monitor
55
+ codew monitor
56
56
  ```
57
57
 
58
58
  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,7 +60,7 @@ Open the printed local URL. The dashboard shows workspaces, execution state, pen
60
60
  Use another port when necessary:
61
61
 
62
62
  ```bash
63
- code-w monitor --port 8080
63
+ codew monitor --port 8080
64
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.
@@ -69,17 +69,17 @@ Each participating workspace must use the same URL in `.code-workspace/config.ya
69
69
 
70
70
  ```bash
71
71
  # Check installation and workspace health
72
- code-w doctor
72
+ codew doctor
73
73
 
74
74
  # Update all managed files
75
- code-w update
75
+ codew update
76
76
 
77
77
  # Apply Agent project directory authorization
78
- code-w permissions apply --yes
78
+ codew permissions apply --yes
79
79
 
80
80
  # Validate local projects
81
- code-w project verify
82
- code-w project verify <project-name>
81
+ codew project verify
82
+ codew project verify <project-name>
83
83
  ```
84
84
 
85
85
  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,14 +35,14 @@ 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 不会自动翻译。
@@ -52,7 +52,7 @@ code-w update --language zh-CN
52
52
  为所有工作区启动一个全局 Monitor:
53
53
 
54
54
  ```bash
55
- code-w monitor
55
+ codew monitor
56
56
  ```
57
57
 
58
58
  打开命令输出的本地地址。面板会显示工作区、执行状态、待授权请求、已完成轮次和实时信号。Monitor 语言在页面中单独选择,与 `workspace.language` 相互独立。
@@ -60,7 +60,7 @@ code-w monitor
60
60
  必要时可使用其他端口:
61
61
 
62
62
  ```bash
63
- code-w monitor --port 8080
63
+ codew monitor --port 8080
64
64
  ```
65
65
 
66
66
  所有参与监控的工作区都必须在 `.code-workspace/config.yaml` 中使用相同 URL。初始化后,请在 Codex 中使用 `/hooks` 检查并信任项目 Hook。
@@ -69,17 +69,17 @@ code-w monitor --port 8080
69
69
 
70
70
  ```bash
71
71
  # 检查安装和工作区健康状态
72
- code-w doctor
72
+ codew doctor
73
73
 
74
74
  # 更新所有托管文件
75
- code-w update
75
+ codew update
76
76
 
77
77
  # 应用 Agent 项目目录授权
78
- code-w permissions apply --yes
78
+ codew permissions apply --yes
79
79
 
80
80
  # 校验本地项目
81
- code-w project verify
82
- code-w project verify <project-name>
81
+ codew project verify
82
+ codew project verify <project-name>
83
83
  ```
84
84
 
85
85
  目录访问由用户授权。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 初始化入口
@@ -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>
@@ -0,0 +1,33 @@
1
+ const fs = require("node:fs");
2
+ const path = require("node:path");
3
+
4
+ const LOCALES_DIRECTORY = path.join(__dirname, "locales");
5
+ const MONITOR_LOCALES = Object.freeze(
6
+ fs.readdirSync(LOCALES_DIRECTORY)
7
+ .filter((file) => file.endsWith(".js"))
8
+ .sort()
9
+ .map((file) => require(path.join(LOCALES_DIRECTORY, file)))
10
+ .sort((left, right) => left.code.localeCompare(right.code))
11
+ );
12
+ const LOCALES_BY_CODE = new Map(MONITOR_LOCALES.map((locale) => [locale.code, locale]));
13
+
14
+ if (MONITOR_LOCALES.length === 0) throw new Error("At least one monitor locale must be registered");
15
+ if (LOCALES_BY_CODE.size !== MONITOR_LOCALES.length) throw new Error("Duplicate monitor locale code");
16
+ for (const locale of MONITOR_LOCALES) {
17
+ if (!locale?.code || !locale.label || !locale.messages) throw new Error(`Invalid monitor locale: ${locale?.code || "<missing>"}`);
18
+ }
19
+ const defaults = MONITOR_LOCALES.filter((locale) => locale.default === true);
20
+ if (defaults.length !== 1) throw new Error("Exactly one monitor locale must be the default");
21
+
22
+ const DEFAULT_MONITOR_LANGUAGE = defaults[0].code;
23
+ const MONITOR_MESSAGES = Object.freeze(Object.fromEntries(
24
+ MONITOR_LOCALES.map((locale) => [locale.code, locale.messages])
25
+ ));
26
+
27
+ function getMonitorLocale(code) {
28
+ const locale = LOCALES_BY_CODE.get(String(code || "").trim());
29
+ if (!locale) throw new Error(`Unsupported monitor locale: ${code || "<missing>"}`);
30
+ return locale;
31
+ }
32
+
33
+ module.exports = { DEFAULT_MONITOR_LANGUAGE, MONITOR_LOCALES, MONITOR_MESSAGES, getMonitorLocale };
@@ -0,0 +1,85 @@
1
+ module.exports = {
2
+ code: "en-US",
3
+ label: "English",
4
+ default: true,
5
+ messages: {
6
+ title: "Code Workspace Monitor",
7
+ eyebrow: "Local runtime center",
8
+ language: "Language",
9
+ summary: "Monitor summary",
10
+ workspaces: "Workspaces",
11
+ sessions: "Sessions",
12
+ turns: "Turns",
13
+ active: "Active sessions",
14
+ execution: "Execution",
15
+ signals: "Live signals",
16
+ waitingData: "Waiting for data",
17
+ nodes: "{count} nodes",
18
+ pending: " · {count} to review",
19
+ events: "{count} events",
20
+ updated: "Updated {value}",
21
+ never: "never",
22
+ justNow: "just now",
23
+ seconds: "{count} seconds ago",
24
+ minutes: "{count} minutes ago",
25
+ hours: "{count} hours ago",
26
+ workspaceMeta: "{active} active / {sessions} total sessions · {signals} signals · {updated}",
27
+ approval: "Approval {count}",
28
+ complete: "Complete {count}",
29
+ actions: "actions",
30
+ removeWorkspace: "Remove workspace",
31
+ removeSession: "Delete session",
32
+ emptyWorkspaces: "No workspace signals yet",
33
+ waitingAgent: "Waiting for Agent signals",
34
+ waitingAgentDetail:
35
+ "Enable monitoring in a workspace and trust its Codex hooks.",
36
+ session: "Session",
37
+ lastSignal: "Last signal {value}",
38
+ inactiveReason: "No signal received for more than 10 minutes",
39
+ turn: "Turn",
40
+ tool: "Tool",
41
+ signalsCount: "{count} signals",
42
+ noSessions: "No session records.",
43
+ noTurns: "No turn details yet.",
44
+ noEvents: "No events",
45
+ soundUnavailable: "Notification sound unavailable",
46
+ soundWarning: "Unable to enable monitor sound:",
47
+ soundLoadingTitle: "Loading notification sound",
48
+ soundFirstUse:
49
+ "Sound is on; interact with the page once to enable playback",
50
+ soundDisable: "Disable notification sound",
51
+ soundEnable: "Enable notification sound",
52
+ soundLoading: "Loading sound",
53
+ soundOn: "Sound on",
54
+ soundOff: "Sound off",
55
+ removeConfirm:
56
+ "Remove “{name}” from the monitor? It will return automatically when a new signal arrives.",
57
+ removeSessionConfirm:
58
+ "Delete session “{id}” and its related signals?",
59
+ removeActiveSessionConfirm:
60
+ "Session “{id}” is still active. Delete it? It will return when a new signal arrives.",
61
+ live: "Live",
62
+ connecting: "Connecting",
63
+ reconnecting: "Reconnecting",
64
+ status: {
65
+ IDLE: "Idle",
66
+ RUNNING: "Running",
67
+ WAITING_APPROVAL: "Waiting approval",
68
+ RECENT_COMPLETE: "Just completed",
69
+ STOPPED: "Stopped",
70
+ ACTIVE: "Active",
71
+ INACTIVE: "Inactive",
72
+ ENDED: "Ended",
73
+ SESSION_ENDED: "Session ended",
74
+ },
75
+ event: {
76
+ "turn.started": "Turn started",
77
+ "approval.requested": "Approval requested",
78
+ "tool.completed": "Tool completed",
79
+ "subagent.started": "Subagent started",
80
+ "subagent.stopped": "Subagent stopped",
81
+ "turn.stopped": "Turn completed",
82
+ "session.ended": "Session ended",
83
+ },
84
+ },
85
+ };