Commit Graph

5111 Commits

Author SHA1 Message Date
jkomyno b52dd3c0af refactor(e2e): share docker env args and add the install-image race retry 2026-08-03 20:32:36 +05:30
jkomyno 9afe5a7f81 test(cli): deduplicate harness env setup and the SIGTERM download scenario 2026-08-03 20:32:36 +05:30
jkomyno c41217bff2 test(cli): pin the three uninstall file lists together against drift 2026-08-03 20:32:36 +05:30
jkomyno 367db3b069 ci(cli): pin the installer preview comment to the tested head commit 2026-08-03 20:32:36 +05:30
jkomyno 03c326a19a fix(cli): install the CLI bundle via staged renames to survive busy binaries 2026-08-03 20:32:36 +05:30
jkomyno ba4fa222ab test(cli): exercise the installer extraction-failure branch in the install e2e 2026-08-03 20:32:36 +05:30
jkomyno 648e95727a fix(cli): exit non-zero when shell setup aborts
Both abort branches (unsafe or relative resolved bin dir) printed an error
and returned, so the effect succeeded and the process exited 0. install.sh
gates its inline PATH fallback on a non-zero exit from 'composio install',
so an aborted setup looked green and left the user with no PATH setup at
all. Raise a typed ShellSetupAbortError after printing the abort reason;
cli-main.ts maps it to exit code 1 without printing anything further, so
install.sh now takes its fallback branch.
2026-08-03 20:29:52 +05:30
jkomyno 48f3ebe2a1 refactor(cli): type the install test helper's shell param with the Shell union
The helper widened shell to string and cast it back to the union, bypassing
the checker. Export Shell from install.cmd.ts and use it directly.
2026-08-03 20:26:09 +05:30
jkomyno 021125b7a8 fix(cli): create the rc tmp copy with the preserved file mode
The tmp copy was written with the default 0644 mode and only chmod'd to the
target's mode afterwards, so a 0600 private rc's contents sat world-readable
in <target>.composio-tmp for the duration of the window. Create the tmp file
with the preserved mode from the start; open(2) masks that mode with the
umask (only ever clearing bits), so the follow-up chmod stays to pin the
exact mode before the rename.
2026-08-03 20:25:37 +05:30
jkomyno 184404a4af test(cli): run the bashism sweep with grep so it cannot silently skip 2026-08-03 20:24:45 +05:30
jkomyno 2b9c02aea3 test(cli): close the drift-guard bypass for duplicated requested_shell() 2026-08-03 20:24:30 +05:30
jkomyno 5d007da225 fix(ci): accept the legacy PATH block when verifying installed shell config
The shell-config assertions only passed for binaries that write the new
CLI-managed PATH line, but every leg of this workflow installs a published
release binary: workflow_dispatch re-verification of existing releases,
workflow_call with the default 'latest', and promote-stable rebuilds of an
older beta all install pre-change binaries that write the legacy
COMPOSIO_INSTALL_DIR block (as does install.sh's own fallback). Accept
either working PATH layout, fail only when neither is present, and keep
rejecting a mixed state where the new PATH line coexists with a persisted
COMPOSIO_INSTALL_DIR.
2026-08-03 20:24:07 +05:30
jkomyno b381210c2d test(cli): align the installer analytics guard with the shell-delegation flow 2026-08-03 20:23:55 +05:30
jkomyno 6d0e14f155 fix(cli): only prefer ~/.local/bin when its composio entry is this executable
A bare exists-check let any leftover ~/.local/bin/composio (e.g. a pip or
pipx install) win bin-dir resolution, so the PATH line pointed shells at a
foreign program while the installer reported success. Prefer ~/.local/bin
only when its entry realpath-resolves, following symlinks, to the running
executable; otherwise fall through to the runtime executable's directory.
The COMPOSIO_BIN_DIR override stays highest precedence.
2026-08-03 20:23:14 +05:30
Alberto Schiabel 61aafbc9d3 refactor(docs): parse untyped data with zod and forbid explicit any (#3967)
This PR:

- builds on top of https://github.com/ComposioHQ/composio/pull/3966
- enables `typescript/no-explicit-any` (error, `fixToUnknown`) for docs
in `docs/.oxlintrc.json` and removes every remaining explicit `any` in
docs code
- parses untyped/external data once at the boundary with zod v4 schemas
and lets `z.infer` types flow downstream — no hand-rolled `'x' in obj`
guard chains, no `as`-casts of untyped page data, no
`docs/lib/unknown-value.ts`
- adds domain schema modules: `docs/lib/toolkit-schema.ts` (recursive
JSON-Schema node, raw tool/trigger payloads, list envelopes) and
`docs/lib/reference-page-data.ts` (fumadocs reference page data for both
reference routes)
- rewrites `validate-links.ts`, `generate-toolkits.ts`,
`generate-meta-tools.ts`, the `llms.mdx` route, and
`deprecated-api-sidebar.tsx` on those schemas with identical validation
outcomes
- carries the pure typing improvements from the earlier attempt (typed
reference source in `source.ts`, `LLMPage`/`PageLike`, typed
`ClientLogo[]` in `logo-bar.tsx`, component `any` removals)
- adds `tests/static/toolkit-schema.test.ts` and
`tests/static/generate-toolkits.test.ts` pinning the transform shapes;
no changeset (docs is not published)

## Context

Second of the three-PR split of #3958, replacing its rejected
structural-guard approach with zod schemas at the data boundaries.
Verified with `bun run lint`, `bun run types:check`, `bun test
tests/static/` (125 pass), `bun run lint:links`, and a full `next
build`.

## Review follow-up

Addressed the regressions reported in [the Zod boundary
re-review](https://github.com/ComposioHQ/composio/pull/3967#issuecomment-5105279224):
scalar JSON Schema enums and auth defaults are preserved as strings,
malformed toolkit page envelopes abort generation, and the pre-refactor
empty-string fallbacks are restored. Regression coverage lives in
`tests/static/toolkit-schema.test.ts` and
`tests/static/generate-toolkits.test.ts`.

Verified on `2f26c40be` with `bun test tests/static/` (125 pass), `bun
run types:check`, and `bun run lint` (0 errors; existing warnings only).
2026-08-03 19:52:04 +05:30
jkomyno aaf2d250cf fix(installer): configure a login-mode startup file for bash
A login bash reads /etc/profile and then only the first existing of
~/.bash_profile, ~/.bash_login, ~/.profile; it never reads ~/.bashrc.
macOS Terminal.app starts exactly such a shell, so a terminal opened
after installation could not resolve composio even though the installer
reported success.

Always configure a login-mode startup file alongside ~/.bashrc: reuse an
existing ~/.bash_profile or ~/.bash_login, otherwise create
~/.bash_profile seeded to keep sourcing ~/.profile, which it shadows.
~/.profile itself is never rewritten.

Also refine the shell setup reporting:

- capture the delegated `composio install --shell` output so the
  installer keeps sole ownership of its presentation, replaying it under
  COMPOSIO_DEBUG so failures stay diagnosable
- drop the internal (cli)/(fallback) labels from user-facing output
- name the configured startup files from both the delegated and inline
  paths, so piped installs disclose which files changed
2026-08-03 19:24:51 +05:30
Rajarshi Datta 578d358b74 Merge branch 'next' into fix/version-check-fetch-timeout 2026-08-03 19:23:03 +05:30
Alberto Schiabel 10e93add6b fix(cli): address bugbot review findings from the guardrails stack (#3886)
Follow-up to https://github.com/ComposioHQ/composio/pull/3885, which is
now merged into `next`.

This PR:
- reports pending-login cache read failures as I/O errors instead of
masking them as decode failures (`composio login --poll`)
- restores pairwise polarity assertions for the `semverComparator`
Array.sort compatibility case
- consolidates the duplicated ephemeral HTTP server test helper in
`test/__utils__/http-server.ts`
- makes server-owned connected-account statuses forward-compatible while
preserving the credential-stripping schema allowlist
- redacts raw payload values from connected-account parse warnings and
adds regression coverage for unknown statuses and secret-bearing
malformed payloads
- documents why the client-singleton test re-derives the consumer cache
cwd hash

## Rebase notes

Rebased onto `origin/next` at `ef1ec9148`.

- Dropped the empty `GITHUB_*` compatibility commit; that contract is
already present on `next` through
https://github.com/ComposioHQ/composio/pull/3880.
- Adapted the connected-account decoder rename to the service extracted
upstream in `connected-account-selection.ts`.

## Context

Fix-forward PR for actionable Cursor Bugbot findings on the guardrails
stack (#3877–#3885). The stale decode-error string match and unused
release helper were already resolved upstream, and the `vi.stubEnv(...,
undefined)` concern is not actionable on Vitest 4.1.10.
@composio/cli@0.3.2-beta.331
2026-08-03 19:20:45 +05:30
jkomyno 2ac6ad320a fix(core): complete version check timeout guard 2026-08-03 18:53:18 +05:30
jkomyno 55de1cad7e Merge remote-tracking branch 'origin/next' into fix/version-check-fetch-timeout-review 2026-08-03 18:51:28 +05:30
jkomyno 0c2ab3c250 docs(cli): clarify installer review details 2026-08-03 18:17:47 +05:30
jkomyno fde92b67a0 fix(installer): address shell setup review feedback 2026-08-03 18:10:37 +05:30
jkomyno 611f4e648a fix(deps): restore Workers-compatible Mastra 2026-08-03 18:05:04 +05:30
jkomyno 7198144863 fix(e2e): restore runtime compatibility coverage 2026-08-03 18:04:45 +05:30
jkomyno d5b425bd56 fix(review): harden inline rewrite, delegation trust, and reconciliation
Apply verified code-review findings: write through symlinked startup
files with preserved mode and a per-process tmp name; verify delegated
CLI setup actually reconciled the managed block before trusting exit 0;
make managed-block reconciliation assignment-aware so annotated blocks
never lose user content or PATH precedence; clean up the CLI's tmp file
when an atomic write fails; assert the auto contract in the install
health-check canary; recommend composio install --shell in generated
release docs; record the new default in the CLI changelog.
2026-08-03 17:48:04 +05:30
jkomyno 32b414305c refactor(cli): deduplicate setup-failure warning and atomic writes
Also track the installer plan documents that the KD-tagged comments in
install.sh and the shell harness reference.
2026-08-03 17:18:17 +05:30
jkomyno abf8fb351d chore: remove advisor plans 2026-08-03 17:15:04 +05:30
jkomyno 2ff9d9f97e feat(cli): make automatic shell setup the installer default
COMPOSIO_INSTALL_SHELL grows auto (the new default) and none. auto
infers the login shell from $SHELL and always runs idempotent setup
for recognized shells; none keeps install-only behavior for CI and
dotfile managers. Final output follows the KD4 state matrix against a
pre-install PATH snapshot with physical-path identity, setup failures
never fail the install, and the managed PATH block reconciles stale
bin directories.
2026-08-03 17:08:54 +05:30
jkomyno 48fe9acd9b docs: clarify pending dependency validation 2026-08-03 17:05:23 +05:30
jkomyno d5ed670bf5 docs: update Dependabot remediation status 2026-08-03 17:05:23 +05:30
jkomyno 3ac7f86010 chore(dependabot): preserve compatibility lanes 2026-08-03 17:05:23 +05:30
jkomyno e5c9adabc8 chore(deps): migrate OpenAI runtime to v7 2026-08-03 17:05:23 +05:30
jkomyno a8d7401b73 test(openai): cover v6 and v7 consumers 2026-08-03 17:05:20 +05:30
jkomyno 4ceaede87a chore(deps): refresh runtime support dependencies 2026-08-03 17:05:20 +05:30
jkomyno d1c2e12e33 chore(deps): refresh agent framework dependencies 2026-08-03 17:05:16 +05:30
jkomyno 32fdddd197 chore(deps): align AI SDK dependencies 2026-08-03 17:04:44 +05:30
jkomyno a59a409204 chore(cli): align Effect dependencies 2026-08-03 17:04:44 +05:30
jkomyno a850f2c1c1 chore(deps-dev): refresh development tooling 2026-08-03 17:04:43 +05:30
jkomyno 4fcb67aa37 chore(deps): bump actions/stale to v11 2026-08-03 17:04:43 +05:30
jkomyno e313ee4161 docs: add Dependabot remediation plans 2026-08-03 17:04:43 +05:30
jkomyno b7c17458ab feat(cli): reconcile managed PATH blocks and defer final messaging to installer 2026-08-03 16:56:00 +05:30
jkomyno ec9d5b936b test(cli): cover auto shell setup default in installer e2e 2026-08-03 16:54:22 +05:30
jkomyno bd6582a266 docs(cli): describe automatic shell setup as the installer default 2026-08-03 16:52:34 +05:30
jkomyno 970562cf9d ci(cli): align installer workflows with auto shell-setup default 2026-08-03 16:50:38 +05:30
Rajarshi Datta ef1ec91486 fix(core): name @composio/core in the upgrade notice instead of the v2 composio-core package (#4031)
Fixes #4030

## Problem

`checkForLatestVersionFromNPM` queried the right package but named the
wrong one in the notice it printed:

```ts
// ts/packages/core/src/utils/version.ts:29
const packageName = '@composio/core';
...
// ts/packages/core/src/utils/version.ts:52
`🚀 Upgrade available! Your composio-core version (${currentVersionFromPackageJson}) is behind. …`
```

`composio-core` is the v2 npm package. A v3 user saw a notice naming a
package they had not installed, and the obvious next step — `npm i
composio-core@latest` — installs the legacy package. That is a downgrade
path, not just a wording slip.

Leftover string from the v2 SDK: the surrounding code was migrated to
`@composio/core`, the message was not.

## Fix

One line — interpolate the constant already in scope, as the issue
suggested:

```diff
-`🚀 Upgrade available! Your composio-core version (${currentVersionFromPackageJson}) is behind. …`
+`🚀 Upgrade available! Your ${packageName} version (${currentVersionFromPackageJson}) is behind. …`
```

I used the constant rather than hardcoding `@composio/core` so the
notice and the registry URL now derive from a single source and cannot
drift apart again.

## Verification

Ran the issue's reproduction against the fix, with the registry response
stubbed and `CI`/`DEVELOPMENT` unset:

```text
🚀 Upgrade available! Your @composio/core version (0.14.1) is behind. Latest version: 0.99.0.
registry URL actually queried: https://registry.npmjs.org/@composio/core/latest
```

The name in the message and the package actually queried now match
exactly.

| Check | Result |
|---|---|
| `tsc --noEmit` | exit 0 |
| Full core suite | 1037 passed / 3 failed — identical to unmodified
`next` |

The 3 failures are pre-existing and environmental on the Windows machine
used here: two `EPERM: symlink` (needs Developer Mode) and one POSIX
path-separator assumption in `fileUtils.test.ts`. Confirmed by stashing
and re-running against `next`.

## Notes

- No test added. Interpolating the constant makes this class of drift
structurally impossible, which is a stronger guarantee than asserting
exact log text. There is also a practical cost: #4026's branch
introduces `ts/packages/core/test/utils/version.test.ts`, so adding that
same new file here would create an add/add conflict between two open
PRs. Happy to add coverage as a follow-up once that one lands.
- Related, deliberately left out of scope.
`ts/packages/cli/src/effects/find-composio-core-generated.ts:38` has the
same stale name, and arguably worse:

```ts
const fix = `Install \`composio-core\` with \`${installCmd} composio-core\`, …`;
```

- The code twelve lines below probes `import composio` — the v3 Python
package — so a user following that message runs `uv pip install
composio-core`, installs v2, and the check still fails. I left it alone
because `@composio/cli` is a separate package with its own release
process (it is excluded from changesets), and the two are independent
string literals with no shared function, so there is no single root to
fix. Worth its own issue.
- I checked the other `composio-core` references repo-wide: the
changelog entries and `docs/content/docs/migration-guide/new-sdk.mdx`
correctly cite v2 as history, and the remainder are CLI test-fixture
directory names. Nothing else needed changing.
2026-08-03 16:43:01 +05:30
Rajarshi Datta 677508f17b docs(core): correct getToolkitVersionsFromEnv precedence in JSDoc (#4033)
Fixes #4032

## Problem

The JSDoc on `getToolkitVersionsFromEnv` documented a precedence order
the function does not implement:

```ts
// ts/packages/core/src/utils/sdk.ts:65-69
 * 2. Environment variables (COMPOSIO_TOOLKIT_VERSION_<TOOLKIT_NAME>)
 * 3. User-provided toolkit version mappings (defaultVersions object)
```

The implementation spreads user-provided values last, so they win:

```ts
const toolkitVersions = {
  ...toolkitVersionsFromEnv,
  ...userProvidedToolkitVersions,
};
```

Three independent sources already agreed the code is right and the JSDoc
was the outlier:

1. The inline comment two lines above the spread — "user provided values
act as overrides" (`sdk.ts:91`).
2. `test/core/versions.test.ts:150` (`'should prioritize user-provided
versions over environment variables'`) and `:395` (`'should demonstrate
priority order: user object > env vars > fallback'`).
3. The Python SDK's docstring for the equivalent `get_toolkit_versions`,
which had the order correct.

This misleads anyone debugging a version pin: someone whose
`COMPOSIO_TOOLKIT_VERSION_GITHUB` appears to be ignored reads this and
concludes the env-var handling is broken, when the real cause is their
own `toolkitVersions` object overriding it.

## Fix

Swapped the two lines. Comment-only — no runtime behaviour changes.

```diff
- * 2. Environment variables (COMPOSIO_TOOLKIT_VERSION_<TOOLKIT_NAME>)
- * 3. User-provided toolkit version mappings (defaultVersions object)
+ * 2. User-provided toolkit version mappings (defaultVersions object)
+ * 3. Environment variables (COMPOSIO_TOOLKIT_VERSION_<TOOLKIT_NAME>)
```

I kept this to a pure swap rather than also rewording. The Python
docstring is the parity target, and the two lists are now item-for-item
identical:

1. If `defaultVersions` is a string, use it as global version for all
toolkits
2. User-provided toolkit version mappings (`defaultVersions` object)
3. Environment variables (`COMPOSIO_TOOLKIT_VERSION_<TOOLKIT_NAME>`)
4. Fallback to `'latest'` if no versions are configured

Adding clarifying prose on the TypeScript side alone would have traded
one cross-SDK drift for another.

## Verification

Exercised all four documented items against real behaviour, not just the
one in the report:

```text
env   : COMPOSIO_TOOLKIT_VERSION_GITHUB=from_env_20250101_00, _SLACK=slack_from_env
user  : { github: "from_user_20260101_00" }
result: { github: 'from_user_20260101_00', slack: 'slack_from_env' }

github winner : from_user_20260101_00   <- user-provided (doc item 2)
slack  winner : slack_from_env          <- env var, untouched by user (doc item 3)
string form   : 20260101_00             <- doc item 1
empty form    : latest                  <- doc item 4
```

The slack case is the one worth noting: items 2 and 3 are not a strict
either/or fallback — the two maps merge per toolkit, and env vars still
apply for toolkits the user's object does not mention. The numbered list
describes that correctly now, since what it orders is precedence.

| Check | Result |
|---|---|
| `tsc --noEmit` | exit 0 |
| `test/core/versions.test.ts` | 32 passed |

I ran the targeted suite rather than the full one: the change is a
comment and cannot affect anything outside this file, and those 32 tests
are exactly the ones asserting this precedence.

## Notes

- No changeset — comments only, nothing in the published output changes.
- No test added: the existing tests at `versions.test.ts:150` and `:395`
already lock this behaviour in. They are what proved the code was
correct and the doc was wrong, so the doc is now covered by them too.
2026-08-03 16:39:40 +05:30
Alberto Schiabel 51056129ee fix(core): detect filesystem case sensitivity for uploads (#4036)
This PR:
- fixes #4024
- supersedes #4025 with target-filesystem detection instead of
unconditional case folding
- uses `is-fs-case-sensitive` on the nearest existing directory so mixed
mounts and case-sensitive filesystem configurations are handled
correctly
- preserves exact matching on case-sensitive filesystems and falls back
to conservative case-insensitive matching when detection fails
- keeps Node-only detection behind `#platform` and mirrors its runtime
dependency in `@composio/slim`, preserving the workerd-safe bundle and
Slim import
- adds focused Node, workerd, and matcher regressions plus an
`@composio/core` patch changeset
- verifies 1,044 core tests, five CLI upload tests, the Slim
build/import smoke, typecheck, build, ATTW, publint, lint, formatting,
frozen install, and changeset validation
2026-08-03 16:32:40 +05:30
Alberto Schiabel 03291bfaa4 fix(ci): use locked Node version for Cloudflare E2E (#4035)
This PR:
- supersedes https://github.com/ComposioHQ/composio/pull/4010 and
credits @MGPOCKY for identifying the stale Cloudflare E2E Node override
- lets Cloudflare E2E resolve the exact Node.js version from mise.lock
through the shared setup action
- retains the release job's explicit Node.js 24.17.0 publishing pin and
corrects its outdated explanation
- verifies the release workflow guard, workflow YAML parsing,
formatting, and whitespace checks

Co-authored-by: MGPOCKY <kkm1447@naver.com>
2026-08-03 15:45:24 +05:30
palash-c 46e79aa579 docs: use support@composio.dev on Composio Connect (#3985)
The **I still need help** section of Composio Connect points users at
`tech@composio.dev`.

It's the only place in the docs that does. Every other reference uses
`support@composio.dev`:

- `docs/content/reference/errors.mdx`
- `docs/content/reference/v3/errors.mdx`
- `docs/content/changelog/12-30-25.mdx`
- `docs/content/changelog/01-29-26-sdk-major-update.mdx`
- `docs/content/changelog/03-25-26-mcp-endpoint-removed.mdx`

Composio Connect is the page consumer users land on when wiring up an
MCP client, so this was the most visible instance of the wrong address.

One line changed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com>
2026-08-03 15:05:58 +05:30
jkomyno 0c768c3203 refactor(cli): select installer shell via COMPOSIO_INSTALL_SHELL
Replace the base installer's --shell flag with a COMPOSIO_INSTALL_SHELL
environment variable, matching the COMPOSIO_INSTALL_VERSION precedent
and reading more naturally in the curl-pipe form:

  curl -fsSL https://composio.dev/install | COMPOSIO_INSTALL_SHELL=zsh sh

The variable is validated before any network call. Shell variants set
it explicitly when invoking the base installer, so the route stays
authoritative over any inherited value. The composio install --shell
CLI flag and the delegation/fallback behavior are unchanged.
2026-08-03 14:11:28 +05:30