@langgexyz/anycode 0.0.0-stage → 0.4.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.
package/README.md CHANGED
@@ -1,3 +1,130 @@
1
- # Temporary Holding Version
1
+ # AnyCode
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ AnyCode 是原子 capability 执行层。它负责能力注册、项目 binding、Provider
4
+ 调用、幂等记录和 evidence;宿主负责组合、调度和最终交付判断。
5
+
6
+ ## 唯一运行路径
7
+
8
+ ```text
9
+ Native host session (OpenCode / Claude Code / other host)
10
+ -> host adapter
11
+ -> anycode capability invoke
12
+ -> atomic catalog
13
+ -> project binding
14
+ -> provider
15
+ -> result + evidence
16
+ ```
17
+
18
+ 一次调用只包含请求、项目配置和原子输入。OpenCode、Claude Code 和其他宿主使用各自的
19
+ Host Adapter 和同一 capability protocol;AnyCode 不提供宿主编排入口。
20
+
21
+ ## 原子调用
22
+
23
+ ```bash
24
+ anycode capability invoke \
25
+ --protocol-version anycode.capability.invoke.v1 \
26
+ --request-id <request-id> \
27
+ --contract-version <contract-version> \
28
+ --session-id <native-session-id> \
29
+ --execution-root <workspace-directory> \
30
+ --capability <domain.capability> \
31
+ --config-root <project>/.anycode \
32
+ --target <target> \
33
+ --component <component> \
34
+ --idempotency-key <key> \
35
+ --timeout-ms 30000 < input.json
36
+ ```
37
+
38
+ `execution-root` 是 provider 执行时使用的 workspace/worktree 目录,不是权限边界。
39
+ AnyCode 校验项目配置、target binding 和 capability 输入;workspace 内文件操作不做
40
+ 应用层权限判断。结果使用稳定协议:
41
+
42
+ ```json
43
+ {
44
+ "status": "pass | na | blocked | failed",
45
+ "certainty": "confirmed | unknown",
46
+ "side_effect": "none | possible | confirmed",
47
+ "output": {},
48
+ "evidence": []
49
+ }
50
+ ```
51
+
52
+ `certainty=unknown` 表示 Provider 可能已经产生副作用但结果未确认,AnyCode 不自动
53
+ 重放;由宿主决定查询、重试或暂停。
54
+
55
+ ## 配置与安装
56
+
57
+ 项目配置位于 `.anycode/`,由宿主或 Connector 作为 capability request 的输入提供;runtime
58
+ 不再维护第二套高层 CLI。安装和更新通过 anycode.me 的原生发布包完成,能力执行统一使用
59
+ `capability invoke`。
60
+
61
+ 组合、并发、取消、重试和结果聚合由宿主原生机制负责。OpenCode runtime 对 Provider 错误
62
+ 只做统一分类并提示安全的下一步,不在失败后盲目重放或偷偷切换模型;其他宿主只需适配同一
63
+ 原子协议。
64
+
65
+ 产品安装与宿主接入:
66
+
67
+ ```bash
68
+ curl -fsSL https://anycode.me/install.sh | sh
69
+ curl -fsSL https://anycode.me/install.sh | ANYCODE_VERSION=<version> sh
70
+ anycode --help
71
+ anycode doctor
72
+ ```
73
+
74
+ 发布渠道提供 stable 和 rc。稳定版发布完成后,站点更新
75
+ `https://anycode.me/releases/latest.json`;不指定版本默认安装 stable。发布包支持 macOS 和 Linux 的 `arm64`、`x64` 以及 Windows `x64`;安装器支持
76
+ macOS 和 Linux,Windows 用户从 `https://anycode.me/releases/v<版本>/` 手动下载。安装目录为
77
+ `~/.local/share/anycode`,启动器为 `~/.local/bin/anycode`。本地工程操作不要求登录;需要访问
78
+ AnyCode 账户的操作使用 `anycode login`,升级使用 `anycode update`;Windows 暂不支持自动更新,需手动下载指定版本。
79
+
80
+ 仓库内没有 workflow 推送 tag;维护者从具备仓库写权限的 Git 环境推送 tag,测试机只用于构建与测试。
81
+
82
+ 发版前使用 `release-prepare` 取得版本号,脚本会刷新远端 tags,并读取标题包含“发布 AnyCode
83
+ <版本号>”的 open PR。正式模式在写入 `package.json` 前再次读取这两类占用状态,发现竞争时自动重新取号;
84
+ `--dry-run` 只输出计划。输出为单行 JSON,便于脚本消费:
85
+
86
+ ```bash
87
+ bun scripts/release-prepare.ts --channel rc --dry-run
88
+ bun scripts/release-prepare.ts --channel rc
89
+ bun scripts/release-prepare.ts --channel stable
90
+ ```
91
+
92
+ 正式模式写入版本后,按 JSON 中的 `commands` 创建分支、提交并发起版本 PR;创建 PR 前应再次确认远端没有
93
+ 新增同版本 tag 或 open 版本 PR。输出 JSON 的 `status` 为 `ready` 表示已确认并写入版本;若连续 10 次复核
94
+ 都检测到版本号竞争,脚本以 `status: "blocked"`、`version: null`、空 `commands` 和非零退出码结束,且不改动
95
+ `package.json`,此时应等待竞争版本落地后重试。
96
+
97
+ 新机器的依赖、Harness 接入、`doctor`、升级和回滚流程见
98
+ [安装与首次启动](docs/installation.md)。
99
+
100
+ Agent 安装后的 Harness 接入、渐进式 Connector/账号引导和任务启动/完成门禁见
101
+ [Agent onboarding and Harness usage](docs/agent-onboarding.md)。
102
+
103
+ 安装只替换单一 immutable 安装目录;Host Adapter 由对应 Harness 的原生安装机制管理,并通过
104
+ 已安装版本提供的稳定 entrypoint/manifest 接入,不依赖源码路径,不创建 workspace 权限或工作流状态。
105
+
106
+ ## 验证
107
+
108
+ ```bash
109
+ npm run catalog:check
110
+ npm run typecheck
111
+ npm run architecture:doctor
112
+ bun scripts/run-bounded-test.ts --max-concurrency=4
113
+ ```
114
+
115
+ 当前完整测试覆盖原子 catalog、workspace 执行上下文、幂等/不确定结果、Provider、配置和
116
+ delivery capability。发布时必须同时验证 capability protocol、实际 CLI 和 immutable package。
117
+
118
+ ## 维护 capability catalog 文档
119
+
120
+ `docs/capability-catalog.md` 由 `runtime/providers/src/catalog.ts` 生成,禁止手工编辑生成段落。
121
+ 任何改动 `catalog.ts`(新增/删除/重命名能力,或修改 domain、inputs、outputs、effect、
122
+ providerKind、evidence、compensation)的 PR,都必须在更新后的 main 上重新生成并提交文档:
123
+
124
+ ```bash
125
+ npm run catalog:generate
126
+ npm run catalog:check
127
+ ```
128
+
129
+ `npm run catalog:check` 已接入 `.github/workflows/ci.yml`,未重新生成文档的 PR 会因
130
+ catalog 漂移而 CI 失败。合并前请先 rebase/merge 最新 main 再重跑上述两条命令,避免与并行改动冲突。
package/npm/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # `@langgexyz/anycode`
2
+
3
+ The primary install channel for AnyCode is `anycode.me`. The npm package is an
4
+ additional channel: it bootstraps the same verified native runtime, and any
5
+ non-`install` command is forwarded to the activated native runtime.
6
+
7
+ ## npm / npx
8
+
9
+ ```bash
10
+ # Download, verify, and activate the native runtime for this platform
11
+ npx @langgexyz/anycode install
12
+ npx @langgexyz/anycode install --version <version> --harness opencode-v1
13
+ npx @langgexyz/anycode install --version <version> --harness opencode-v2
14
+ npx @langgexyz/anycode install --version <version> --harness claude
15
+ npx @langgexyz/anycode install --version <version> --harness pi
16
+
17
+ # Global install
18
+ npm install -g @langgexyz/anycode
19
+
20
+ # Forward any command to the installed native runtime
21
+ npx @langgexyz/anycode <command>
22
+ ```
23
+
24
+ `--harness` accepts `opencode-v1`, `opencode-v2`, `claude`, or `pi`.
25
+
26
+ ## anycode.me
27
+
28
+ ```bash
29
+ curl -fsSL https://anycode.me/install.sh | sh
30
+ curl -fsSL https://anycode.me/install.sh | ANYCODE_VERSION=<version> sh
31
+ anycode update
32
+ ```
33
+
34
+ The release packages support macOS and Linux on `arm64` and `x64`, plus Windows
35
+ `x64`. The installer supports macOS and Linux; Windows users can manually
36
+ download the `windows-x64` package from
37
+ `https://anycode.me/releases/v<version>/`. During preview, the default install
38
+ command resolves the stable manifest published by the release workflow. The
39
+ installer places the launcher at
40
+ `~/.local/bin/anycode` and the runtime at `~/.local/share/anycode`. Windows does
41
+ not support automatic `anycode update`; manually download a versioned package.