Commit Graph

24 Commits

Author SHA1 Message Date
Kshitij Jhunjhunwala fb5e97749d feat(cli): install detected agent plugins 2026-07-14 15:54:36 -07:00
Rahul Tarak 99324d5a0d fix(install): resolve latest CLI release from assets (#3411)
## Summary
- Resolve the default CLI install version from GitHub Releases instead
of git tags.
- Require the selected CLI release to include the current platform
archive asset and fall back to older stable CLI releases when the newest
release is missing that asset.
- Add a mocked install.sh regression test covering missing release
assets, ignored beta/provider releases, and tag-only versions with no
release.

## Tests
- `bash -n install.sh test/install-sh-release-resolution.test.sh`
- `pnpm run test:install-sh`
- `git diff --check`
- Parsed `.github/workflows/cli.test-installation.yml` with Ruby YAML
- Parsed `package.json` with Node JSON.parse
- Manual real install smoke test with temporary
HOME/COMPOSIO_INSTALL_DIR selected `@composio/cli@0.2.28`

## Notes
- This prevents the install health check from selecting tag-only
versions like `@composio/cli@0.2.29` when no GitHub release/asset exists
yet.
2026-05-12 13:36:41 -07:00
Rahul Tarak fab54828d8 fix(install): prefer stable CLI releases by default (#3323)
## Summary
- make `install.sh` choose the latest stable `@composio/cli@x.y.z` tag
by default instead of prerelease beta tags
- add a clearer `--agent` setup failure message for users already signed
in as a regular Composio user

## Tests
- `bash -n install.sh`
- verified the release-tag selection pipeline resolves
`@composio/cli@0.2.28` instead of `@composio/cli@0.2.28-beta.223`
2026-05-01 15:47:29 -07:00
Rahul Tarak 8505dc330f feat(cli): add agent signup and claim support (#3317)
## Summary
- add `composio signup`, `composio login --agent`, and `composio agent
signup` flows backed by agents.composio.dev
- make signup messaging explicit that `composio signup` creates/signs
into a Composio agent and that the flow is non-interactive
- add `composio agent login <composio_agent_key>` for restoring an
existing agent when the key was saved
- add `composio agent whoami`, `claim`, and JSON-only `inbox` commands
using the stored `~/.composio/agent.json` agent identity
- guard agent flows so a regular human CLI login cannot run `composio
agent ...` or overwrite itself with agent signup without logging out
first
- show expected agent-auth issues as a softer warning with next steps
instead of the global crash-style error panel
- warn and confirm before agent logout removes `~/.composio/agent.json`
/ `composio_agent_key`; `logout --force` skips the prompt
- update `install.sh --agent` to sign up/log in as an agent after
install

## Tests
- `pnpm --filter @composio/cli build`
- `pnpm --filter @composio/cli test --
test/src/commands/agent.cmd.test.ts`
- `pnpm --filter @composio/cli test --
test/src/commands/agent.cmd.test.ts test/src/commands/logout.cmd.test.ts
test/src/commands/login.cmd.test.ts`
- `pnpm lint` (passes with existing warnings only)

## CI
- GitHub checks are rerunning on the latest push.
2026-05-01 15:05:39 -07:00
Rahul Tarak 456ee40e58 fix(cli): bundle mcp server into subagent helper (#3049)
## Summary
- replace runtime MCP SDK path resolution with static imports in the
structured-output helper
- ensure the helper works when shipped next to the standalone CLI binary
without repo-local node_modules

## Verification
- pnpm --filter @composio/cli run typecheck:src
- pnpm --filter @composio/cli test
test/src/services/run-subagent-acp.test.ts
- built and executed the bundled helper from a temp directory outside
the repo
2026-03-27 10:12:09 -07:00
Rahul Tarak 8a0ce7d96b Harden run subAgent output handling and skip zsh completions on install (#3050)
## Summary
- Hardened `composio run` subagent execution to preserve structured
output and recover more reliably when the primary prompt result is
malformed.
- Added a dedicated MCP helper for structured output so helper runs can
write results through a file-backed path instead of relying only on
stderr/stdout parsing.
- Propagated run log and artifact paths through helper context so
subagent logs land in the run log file consistently.
- Skipped zsh completion installation in `install.sh` and the CLI
installer to avoid broken completion wiring for zsh users.
- Refreshed the CLI lockfile and bundled the new MCP runtime dependency
into the CLI package.

## Testing
- `Not run`
2026-03-27 06:04:18 -07:00
Rahul Tarak 2eee65d091 [codex] Repair missing run companion modules (#3042)
## Summary

This changes `composio run` so an installed binary can recover missing
`run-subagent-*.mjs` companion modules at runtime instead of failing
immediately.

## What changed

- add run-time companion repair in `composio run`
- persist the installed release tag so `run` can fetch the matching
release asset when repair is needed
- update binary upgrade flow to keep that release metadata current
- add CLI coverage for companion install metadata and missing companion
detection
- include a patch changeset for `@composio/cli`

## Root cause

`composio run` launches a child Bun process that imports helper modules
from disk. If the installed binary was missing the companion `.mjs`
files, the command failed with `Cannot find module ...
run-subagent-shared.mjs` before any user code ran.

## Impact

- future CLI binaries with this change can self-heal missing companion
modules during `composio run`
- install and upgrade flows now record the release tag needed for
deterministic repair
- already-shipped older binaries still need one reinstall to get this
repair logic

## Validation

- `pnpm --filter @composio/cli test -- run.cmd.test.ts`
- `pnpm --filter @composio/cli run build:binary`
- verified a binary-only temp install containing just `composio` plus
`release-tag.txt`; `composio run 'console.log("healed")'` restored the
three companion modules and executed successfully
2026-03-27 03:43:59 -07:00
Rahul Tarak 9538903fc6 feat: fix bundling for run (#3040)
run bundling was not working for some shared scripts in certain envs

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 03:21:13 -07:00
Rahul Tarak 603b8e4930 [codex] fix CLI binary release workflow (#3041)
## What changed

- make `build:binary:cross` emit the `run-subagent-*.mjs` companion
modules alongside the compiled CLI binary
- update the `Build CLI Binaries` workflow to include those companion
modules in the published release archives
- make `install.sh` copy companion modules when they are present, while
remaining backward compatible with older archives that only contain
`composio`
- fix the CLI installation workflow assertions to match the actual
installer behavior and paths

## Why

`composio run` launches a separate Bun runtime that imports the
`run-subagent-*` helpers from disk. The main binary alone is not
sufficient. The previous release workflow zipped only the `composio`
binary, so prerelease assets installed successfully but failed at
runtime with missing-module errors.

The installation test workflow also had stale expectations for
`~/.composio/bin/composio` and `COMPOSIO_INSTALL`, which caused false
negatives even when installation itself succeeded.

## Impact

- newly built CLI release assets will contain the files required for
`composio run`
- `install.sh` will install sidecars for new releases and ignore them
for older releases
- the installation workflow will validate the real install layout
instead of the stale `bin/` path

## Validation

- `pnpm --filter @composio/cli run build:binary:cross --target
bun-darwin-arm64` from the existing checkout emitted:
  - `dist/binaries/composio-darwin-aarch64`
  - `dist/binaries/companions/run-subagent-shared.mjs`
  - `dist/binaries/companions/run-subagent-acp.mjs`
  - `dist/binaries/companions/run-subagent-legacy.mjs`
- simulated the GitHub Actions archive step and verified the zip
contains `composio` plus all three companion modules
- earlier local binary/package validation on the main fix branch
confirmed the extracted binary runs `composio run
'console.log("hello")'` successfully once those files are packaged
2026-03-27 02:56:30 -07:00
jkomyno 7a28923617 fix(install): validate COMPOSIO_GITHUB_* env vars to prevent supply-chain attacks
The install script accepts COMPOSIO_GITHUB_URL, COMPOSIO_GITHUB_OWNER,
and COMPOSIO_GITHUB_REPO from the environment to construct the download
URL. A malicious override could redirect the download to an attacker-
controlled server, bypassing checksum verification (since checksums.txt
is fetched from the same source).

Fix:
- Require COMPOSIO_GITHUB_URL to start with https://
- Require COMPOSIO_GITHUB_OWNER and COMPOSIO_GITHUB_REPO to match
  safe identifier patterns (alphanumeric, hyphens, underscores, dots)
2026-03-09 16:06:22 +04:00
jkomyno 87d1783c1d fix(cli): prevent shell injection via COMPOSIO_INSTALL_DIR in rc files
The install command writes COMPOSIO_INSTALL_DIR into shell rc files
(.zshrc, .bashrc, config.fish). Previously the value was unquoted,
allowing shell metacharacters (;, `, $, |, etc.) to inject arbitrary
commands that execute every time the user opens a terminal.

Fix:
- Quote the install directory value in all path blocks (bash, zsh, fish)
- Add isUnsafePath validation that rejects paths with metacharacters
- Quote the value in the manual setup note for unknown shells
- Quote the fish and zsh fallback paths in install.sh
- Add test for unsafe path rejection
2026-03-09 16:05:24 +04:00
jkomyno 067c67b695 fix(install): show CLI output on success and always display post-install guidance
- Replace 2>/dev/null with a temp file capture so the CLI's TerminalUI
  output (written to stderr) is shown when the command succeeds, but
  suppressed on failure to avoid noise.
- Move the "To get started" guidance block outside the if/else so it
  always displays regardless of which code path ran.
2026-03-09 09:29:37 +04:00
jkomyno 0192b2ba83 fix(install): use exact line matching for shell config marker detection
grep -qF does substring matching, so the PATH marker "# Composio CLI"
would falsely match "# Composio CLI completions". Switch to grep -qxF
to require full-line matches, consistent with the TS fileContains logic.
2026-03-09 09:28:18 +04:00
jkomyno a181c00abc feat(cli): improve install.sh + shell integration 2026-03-06 02:43:52 +04:00
jkomyno 4854a540ca chore: chmod+x on install.sh 2026-02-27 18:23:38 +04:00
jkomyno 5b8e7abdf3 feat(cli): add checksums, cross-compilation, and simplified install
- Add cross-compilation scripts (build-binary-cross.ts, build-all-binaries.ts)
  using Bun's --target flag, enabling all platforms to build from ubuntu-latest
- Add package-binaries.ts and generate-checksums.ts for release artifact preparation
- Restructure CI workflow into build + release jobs; release job aggregates
  artifacts and generates checksums.txt
- Simplify install.sh: use git ls-remote refspec filter for version detection,
  add SHA-256 checksum verification with graceful fallback, use mktemp/trap
  for temp file cleanup, remove dead musl detection code
- Add checksum verification to composio upgrade command via fetchChecksums
  and verifyChecksum helpers in upgrade-binary.ts
2026-02-27 18:19:30 +04:00
Musthaq Ahamad 4fda636aba chore(cli): migrate binary release tags and docs (#2719)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-25 16:29:04 -08:00
Musthaq Ahamad 36d2a1e9c7 Fix CLI intstallation tests (#2078) 2025-10-22 12:07:21 +05:30
jkomyno 70094d67c3 feat\(ci\): programmatically retrieve latest release starting with "v*" 2025-08-30 23:44:35 +02:00
Rahul Tarak 7af5d1a9a3 fix install script 2025-06-26 03:49:27 -07:00
Rahul Tarak 1978804131 maybe fix pathing 2025-06-26 03:23:00 -07:00
Rahul Tarak 83c6a4d360 fix install 2025-06-26 03:14:09 -07:00
Rahul Tarak 1e74a218a5 fix install 2025-06-26 03:02:07 -07:00
Rahul Tarak b839f65492 feat: add install script (#1706) 2025-06-26 01:21:02 -07:00