Write, review, or upgrade Effect v4 code in the Composio CLI, cli-keyring, and json-schema-to-effect-schema packages, all pinned exactly to effect@4.0.0-rc.115
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-effect-v4-47b06faec168 ,按照其中的说明把「effect-v4」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
The CLI, @composio/cli-keyring, and @composio/json-schema-to-effect-schema run on
Effect v4 (release candidate). Every claim below is grounded in the migrated source, not memory of v3.
effect, @effect/platform-bun, and @effect/vitest
are pinned to the same exact 4.0.0-rc.115 — never ^, @next, or a mismatched
prerelease across packages. @effect/cli and @effect/platform no longer exist as
dependencies; their surfaces are consolidated into effect and effect/unstable/*.
See versions.json for the full matrix (also typescript, vitest).
Effect.gen and Effect.fn, and the v3→v4 rename table
(labeled historical, for recognizing stale patterns).effect/unstable/cli:
Command, Flag, Argument, GlobalFlag, CliConfig, the custom
CliOutput.Formatter, and the runner's double-print rule.Code excerpts in those references are short quotes from real, currently-compiling repo files (path cited at each excerpt) — not standalone examples. The compile-checked source of truth is always the cited file itself; when it and a reference disagree, trust the file and fix the reference.
Effect.gen(function* () {...}) for effect values — the dominant form, including named
module consts — and (params) => Effect.gen(...) for parameterized helpers.
Effect.fn(...) is the function form whose effects carry stack-frame annotations (its
optional name string adds a per-call tracing span), worth it for service members and
combinator callbacks that should be attributable in error reports. All forms re-run
their body per execution. See "Effect.gen vs Effect.fn" in core-patterns.Context.Service and an explicit static readonly Default/layer
layer built with Layer.succeed/Layer.effect/Layer.provide. V4 does not generate a
layer for you.Schema.TaggedError (or a plain Data.TaggedError
when no Schema fields are needed) and recover with Effect.catchTag/catchTags/Match,
never manual _tag string comparisons.Effect.tryPromise({ try, catch }); Effect.promise turns
rejection into a defect. No async/await or try/catch inside Effect workflows —
ESLint bans them in ts/packages/cli/src.ts/vendor/effect (read-only source oracle — never edit or import from it) and the
installed effect@4.0.0-rc.115 typings. Source may be ahead of the published package;
the compiler is the compatibility gate.pnpm typecheck
pnpm --filter @composio/cli test
Run pnpm validate:agent-skills and pnpm validate:skill-routing after editing this
skill or its descriptions, and compile the TypeScript blocks in this skill and in
typescript-testing/references/effect-v4-cli.md against the pinned packages with:
node .agents/skills/effect-v4/scripts/check-examples.mjs
Blocks that quote repo files with unresolvable imports carry a no-check fence info string.