Files
composiohq__composio/.oxlintrc.json
T
Alberto Schiabel 0abc629f5d refactor(cli): migrate to Effect 4 (4.0.0-rc.112) (#3901)
Rebuilds the Effect v4 port on top of `next` at `effect@4.0.0-rc.112`
(the newest release that clears the repository's 3-day
`minimumReleaseAge` gate). The three v3-compatible preparation PRs
(#4358, #4359, #4360) already landed on `next`, so this PR is now only
the cutover.

## What changes

- Pins `effect`, `@effect/platform-bun`, and `@effect/vitest` to exact
`4.0.0-rc.112`; drops `@effect/cli`, `@effect/platform`,
`@effect/platform-node`, and the `toml` override that existed only for
`@effect/cli`. The `ts/vendor/effect` source oracle moves to the
`effect@4.0.0-rc.112` release commit.
- Services become `Context.Service` classes with explicit `Default`
layers; `Either` becomes `Result`; `ParseResult` becomes
`Schema.SchemaError`; platform modules come from `effect/FileSystem`,
`effect/Path`, `effect/PlatformError`, `effect/unstable/process`, and
`effect/unstable/http`.
- The runner drives `Command.runWith` with v4's default help and error
rendering. `CliError.ShowHelp` carries its own exit code, help for
non-explicit invocations renders on stderr, and "Did you mean?"
suggestions render. `command-introspection.ts` is gone: v4 renders the
resolved command's help and the "missing value" tip itself.
- `composio --version`, `composio -v`, and `composio version` print the
same bare semver (`GlobalFlag.Version` is not enabled; the flag
spellings are rewritten to the `version` command before parsing).
- Root `--log-level` is a shared flag applied after the subcommand tree
is attached, so `composio --log-level Debug <subcommand>` both parses
and takes effect.
- Every `Flag.boolean` carries an explicit default, because rc.112 makes
boolean flags required when omitted.
- A `Result` is not an `Effect` at runtime in rc.112 even though the
type checker accepts `yield*` on it (the fiber dies with "Not a valid
effect"); every `Result` is lifted with `Effect.fromResult`, and the
skill/AGENTS guidance says so.
- Every `ChildProcess.make` site passes `extendEnv: true`, because
rc.112 no longer inherits the parent environment by default.
- `--log-level` and `COMPOSIO_LOG_LEVEL` are exact-match on the
`LogLevel` names (`All`, `Fatal`, `Error`, `Warn`, `Info`, `Debug`,
`Trace`, `None`) with no case folding, per the earlier review decision;
README updated.
- Spawned children pass `extendEnv: true`, because rc.112's
`ChildProcess` no longer inherits the parent environment by default.
- ISO timestamps decode through `Schema.DateTimeUtcFromString`;
`Schema.DateTimeUtc` is no longer a string codec in rc.112.
- `ConfigProvider.fromEnv()` snapshots the environment at construction
in v4, so providers that must observe later changes are built per read
(`plugin-hint.ts`, `install.cmd.ts`, `config.ts`) and tests use a
live-env provider helper.
- `cli-keyring` and `json-schema-to-effect-schema` are ported alongside
(the latter on `Schema.makeFilter`).
- The `effect-v4` skill, the `cli-command` and `typescript-testing`
references, `ts/packages/cli/AGENTS.md`, and the oxlint config are
updated to the rc.112 reality. The skill's example checker
(`.agents/skills/effect-v4/scripts/check-examples.mjs`, lifted from
#3851) compiles every TypeScript block in the skill against the pinned
packages.
- The `js-yaml` overrides move to the 4.3.2 / 3.15.2 lines that
GHSA-2883-xcg3-v3hh requires; `pnpm audit --prod` is clean apart from
the already-ignored `extract-zip` advisory.

## Behaviour notes

- `composio <unknown> --help` now prints the root help with exit 0 (v4's
global `--help` handling); `composio <unknown>` without `--help` still
fails with the unknown-subcommand error.

## Validation

- `pnpm --filter @composio/cli typecheck` (src + test): 0 errors
- `pnpm --filter @composio/cli test`: 127 files, 1325 tests pass, 1
skipped; `validate:boundaries` and `validate:skills` pass
- `@composio/cli-keyring` and `@composio/json-schema-to-effect-schema`
typecheck, test, and build pass
- `pnpm validate:agent-skills` and `pnpm validate:skill-routing` pass
(19 skills)
- oxlint clean on `ts/packages/cli`, `cli-keyring`,
`json-schema-to-effect-schema`
- CLI bundle and standalone binary build; smoke-checked `version`,
`--version`, `-v`, `--help`, unknown subcommand, unrecognized flag,
missing flag value
- Docker CLI e2e suites pass against an image built from this branch:
`version`, `toolkits-list`, `toolkits-info`, `toolkits-search`,
`setup-plugins`, `run`. `whoami` (needs an API key), `install` (needs a
release dir), and `upgrade` (needs network) were not run.

No changeset: `@composio/cli` is Changesets-ignored and the ported
sibling packages are private. Human-facing notes are in
`ts/packages/cli/CHANGELOG.md`.

https://claude.ai/code/session_01AW7ZPhfZuni6PrCJ9X86DX
2026-09-10 17:47:14 +02:00

421 lines
18 KiB
JSON

{
"$schema": "./node_modules/oxlint/configuration_schema.json",
// Ported from eslint.config.mjs (see git history). Native oxlint rules cover
// everything except no-restricted-syntax, which runs through the
// oxlint-plugin-eslint JS plugin as eslint-js/no-restricted-syntax.
"plugins": ["typescript", "unicorn", "oxc"],
"jsPlugins": [{ "name": "eslint-js", "specifier": "oxlint-plugin-eslint" }],
"categories": {
"correctness": "error"
},
"env": {
"browser": true
},
"ignorePatterns": [
"**/.venv/**",
"**/.next/**",
"**/dist/**",
"**/site-packages/**",
// The docs site has its own Bun dependency tree and nested oxlint config.
"docs/**",
"ts/vendor/**",
"ts/packages/cli-local-tools/vendor/**",
"ts/packages/core/generated/**",
"ts/packages/core/pack/generated/**",
"ts/packages/slim/generated/**",
"ts/packages/**/.generated/**",
"ts/packages/**/acp-adapters/**",
"node_modules/**",
"ts/examples/**/dist-worker/**",
"ts/examples/cloudflare-wrangler/worker-configuration.d.ts",
// ESLint only linted .ts/.tsx (--ext .ts,.tsx); keep that scope.
"**/*.js",
"**/*.mjs",
"**/*.cjs",
"**/*.jsx"
],
"rules": {
// tseslint.configs.recommended rules that oxlint's correctness category
// does not enable by default; re-enabled explicitly to keep the migration
// behavior-preserving in this direction too.
"typescript/no-namespace": "error",
"no-array-constructor": "error",
"typescript/no-unnecessary-type-constraint": "error",
// Rules oxlint enables by default that the previous ESLint setup did not
// enforce. Turned off to keep the migration behavior-preserving; each is a
// candidate to enable (and burn down) in a follow-up.
"no-useless-escape": "off",
"no-control-regex": "off",
"no-useless-catch": "off",
"typescript/no-unnecessary-parameter-property-assignment": "off",
"unicorn/no-useless-spread": "off",
"unicorn/no-useless-fallback-in-spread": "off",
"unicorn/no-thenable": "off",
"unicorn/no-empty-file": "off",
"no-restricted-globals": ["error", "Buffer"],
"no-restricted-imports": [
"error",
{
"paths": [
{ "name": "crypto", "message": "Use Web Crypto API instead." },
{ "name": "node:crypto", "message": "Use Web Crypto API instead." },
{ "name": "buffer", "message": "Use Uint8Array instead." },
{ "name": "node:buffer", "message": "Use Uint8Array instead." }
]
}
],
"typescript/no-require-imports": "warn",
"typescript/no-unsafe-function-type": "off",
"no-prototype-builtins": "off",
"max-lines-per-function": ["error", 250],
"typescript/ban-ts-comment": "warn",
"no-constant-condition": "off",
"no-ex-assign": "off",
"no-constant-binary-expression": "off",
"typescript/no-empty-object-type": "warn",
"typescript/no-non-null-asserted-optional-chain": "off",
"no-unsafe-optional-chaining": "off",
"no-extra-boolean-cast": "off",
"no-var": "warn",
"prefer-const": "warn",
"no-console": "warn",
"typescript/no-explicit-any": "error",
"no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
]
},
"overrides": [
{
// These files still enforce the repository-wide no-any rule, but are
// exempt from source-only policies that do not fit test helpers, large
// suites, scripts, fixtures, or ambient declarations.
"files": [
"**/__fixtures__/**/*.{ts,tsx,mts,cts}",
"**/__mocks__/**/*.{ts,tsx,mts,cts}",
"**/fixtures/**/*.{ts,tsx,mts,cts}",
"scripts/**/*.{ts,tsx,mts,cts}",
"test/**/*.{ts,tsx,mts,cts}",
"ts/e2e-tests/**/*.{ts,tsx,mts,cts}",
"ts/packages/**/test/**/*.{ts,tsx,mts,cts}",
"ts/packages/**/*.d.ts",
"ts/scripts/**/*.{ts,tsx,mts,cts}"
],
"rules": {
"max-lines-per-function": "off",
"no-console": "off",
"no-restricted-globals": "off",
"no-restricted-imports": "off",
"no-unused-vars": "off",
"prefer-const": "off",
"require-yield": "off",
"typescript/ban-ts-comment": "off",
"typescript/no-empty-object-type": "off",
"typescript/no-namespace": "off"
}
},
{
"files": ["ts/packages/cli/src/**/*.{ts,tsx}"],
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{ "name": "crypto", "message": "Use Web Crypto API instead." },
{ "name": "node:crypto", "message": "Use Web Crypto API instead." },
{ "name": "buffer", "message": "Use Uint8Array instead." },
{ "name": "node:buffer", "message": "Use Uint8Array instead." },
{
"name": "child_process",
"message": "Use ChildProcess from effect/unstable/process instead."
},
{
"name": "node:child_process",
"message": "Use ChildProcess from effect/unstable/process instead."
},
{
"name": "fs",
"message": "Use FileSystem from effect/FileSystem instead."
},
{
"name": "node:fs",
"message": "Use FileSystem from effect/FileSystem instead."
},
{
"name": "os",
"message": "Use an Effect service instead of importing node:os directly."
},
{
"name": "node:os",
"message": "Use an Effect service instead of importing node:os directly."
},
{ "name": "path", "message": "Use Path from effect/Path instead." },
{ "name": "node:path", "message": "Use Path from effect/Path instead." },
{
"name": "@effect/platform-bun",
"message": "Import the module by subpath, e.g. @effect/platform-bun/BunFileSystem; the package barrel is not part of the Effect v4 layout."
}
],
"patterns": [
{
"group": ["fs/*", "node:fs/*"],
"message": "Use FileSystem from effect/FileSystem instead."
}
]
}
],
"eslint-js/no-restricted-syntax": [
"error",
{
"selector": "TryStatement",
"message": "Use Effect.try, Effect.tryPromise, or typed Effect error recovery instead of try/catch."
},
{
"selector": "MemberExpression[object.name='process'][computed=false][property.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "MemberExpression[object.name='process'][computed=true][property.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "MemberExpression[object.name='process'][property.name='stdout']",
"message": "Write output and read terminal capabilities through TerminalUI."
},
{
"selector": "MemberExpression[object.name='process'][property.name='stderr']",
"message": "Write errors and read terminal capabilities through TerminalUI."
}
]
}
},
{
"files": ["ts/packages/cli/test/src/**/*.{ts,tsx}"],
"rules": {
"max-lines-per-function": "off",
"eslint-js/no-restricted-syntax": [
"error",
{
"selector": "MemberExpression[object.name='Effect'][property.name=/^run/]",
"message": "Run Effects through @effect/vitest (it.effect, it.live) instead of Effect.run* in tests."
},
{
"selector": "CallExpression[callee.object.name='Date'][callee.property.name='now']",
"message": "Tests must be deterministic: pin time with vi.setSystemTime / TestClock-relative fixtures, use crypto.randomUUID() for unique names."
}
]
}
},
{
"files": ["ts/packages/cli/src/services/tool-input-validation.ts"],
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{ "name": "crypto", "message": "Use Web Crypto API instead." },
{ "name": "node:crypto", "message": "Use Web Crypto API instead." },
{ "name": "buffer", "message": "Use Uint8Array instead." },
{ "name": "node:buffer", "message": "Use Uint8Array instead." },
{
"name": "child_process",
"message": "Use ChildProcess from effect/unstable/process instead."
},
{
"name": "node:child_process",
"message": "Use ChildProcess from effect/unstable/process instead."
},
{
"name": "fs",
"message": "Use FileSystem from effect/FileSystem instead."
},
{
"name": "node:fs",
"message": "Use FileSystem from effect/FileSystem instead."
},
{
"name": "os",
"message": "Use an Effect service instead of importing node:os directly."
},
{
"name": "node:os",
"message": "Use an Effect service instead of importing node:os directly."
},
{ "name": "path", "message": "Use Path from effect/Path instead." },
{ "name": "node:path", "message": "Use Path from effect/Path instead." },
{
"name": "@effect/platform-bun",
"message": "Import the module by subpath, e.g. @effect/platform-bun/BunFileSystem; the package barrel is not part of the Effect v4 layout."
},
{ "name": "zod", "message": "Use Schema from effect for tool input validation." }
],
"patterns": [
{
"group": ["fs/*", "node:fs/*"],
"message": "Use FileSystem from effect/FileSystem instead."
},
{ "group": ["zod/*"], "message": "Use Schema from effect for tool input validation." }
]
}
],
"eslint-js/no-restricted-syntax": [
"error",
{
"selector": "TryStatement",
"message": "Use Effect.try, Effect.tryPromise, or typed Effect error recovery instead of try/catch."
},
{
"selector": "MemberExpression[object.name='process'][computed=false][property.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "MemberExpression[object.name='process'][computed=true][property.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "MemberExpression[object.name='process'][property.name='stdout']",
"message": "Write output and read terminal capabilities through TerminalUI."
},
{
"selector": "MemberExpression[object.name='process'][property.name='stderr']",
"message": "Write errors and read terminal capabilities through TerminalUI."
},
{
"selector": "ImportExpression[source.value=/^zod(?:\\/|$)/]",
"message": "Use Schema from effect for tool input validation."
},
{
"selector": "CallExpression[callee.name='require'][arguments.0.value=/^zod(?:\\/|$)/]",
"message": "Use Schema from effect for tool input validation."
}
]
}
},
{
"files": ["ts/packages/cli/src/services/terminal-ui.ts"],
"rules": {
// TerminalUI is the sole CLI boundary for Node's stdout and stderr streams.
"eslint-js/no-restricted-syntax": [
"error",
{
"selector": "TryStatement",
"message": "Use Effect.try, Effect.tryPromise, or typed Effect error recovery instead of try/catch."
},
{
"selector": "MemberExpression[object.name='process'][computed=false][property.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "MemberExpression[object.name='process'][computed=true][property.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.name='env']",
"message": "Read environment variables through effect/Config instead of process.env."
},
{
"selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.value='env']",
"message": "Read environment variables through effect/Config instead of process.env."
}
]
}
},
{
// Examples are console-driven references. Keep type-safety rules
// (no-explicit-any, unused-vars) but drop console noise. The Buffer/crypto
// restrictions above target SDK/Workers source; Node example scripts may
// legitimately use Node built-ins, so relax them here (see KTD6).
"files": ["ts/examples/**/*.ts"],
"rules": {
"no-console": "off",
"no-restricted-globals": "off",
"no-restricted-imports": "off"
}
},
{
// This factory intentionally assembles the complete pi session-tool surface
// in one closure so every hook shares the same normalized capabilities.
"files": ["ts/packages/experimental/src/pi/session-tools.ts"],
"rules": {
"max-lines-per-function": "off"
}
},
{
// The Cloudflare Workers entry stays portable: no Node globals even though
// nodejs_compat is enabled. Re-apply the restriction dropped just above.
"files": ["ts/examples/**/cloudflare.ts"],
"rules": {
"no-restricted-globals": ["error", "Buffer"]
}
}
]
}