mirror of
https://github.com/software-mansion/argent.git
synced 2026-09-14 19:27:14 +08:00
6355620c4d
## Summary - Splits the monolithic `packages/mcp` package into five focused packages: - `argent` — the user-facing CLI entry (`argent` binary, init/uninstall/update flows, bundled-paths, scripts). - `argent-cli` — CLI runner internals (flag-parser, run, server, tools). - `argent-installer` — `init`/`update`/`uninstall` flows, MCP config adapters, skills installer. - `argent-mcp` — MCP server itself (mcp-server, tool-mapping, auto-screenshot, content adapters). - `argent-tools-client` — HTTP client + launcher for the tool-server. - Adds Gemini agent definitions, VSCode MCP config, and per-package `tsconfig.json` / `vitest.config.ts`. - Updates root `tsconfig.json`, `scripts/dev.cjs`, CI workflows, and `package.json` to wire the new packages together. ## Test plan - [ ] `npm install` resolves the new workspaces cleanly - [ ] `npm run build` succeeds across all packages - [ ] `npm test` passes (renamed test files keep their assertions) - [ ] `npx argent init` still produces the expected MCP config in a sample project - [ ] `npx argent update` / `argent uninstall` exercise the installer package - [ ] CI workflows (`publish.yml`, `unit-tests.yml`) run on this branch
35 lines
843 B
JavaScript
35 lines
843 B
JavaScript
#!/usr/bin/env node
|
|
// @ts-check
|
|
"use strict";
|
|
|
|
// Runs automatically after `npm install @swmansion/argent`.
|
|
// Set ARGENT_SKIP_POSTINSTALL=1 to suppress the init message (used by `argent update`).
|
|
|
|
const os = require("os");
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
// Always kill any running tool-server so the new binary takes effect on next use.
|
|
const stateFile = path.join(os.homedir(), ".argent", "tool-server.json");
|
|
try {
|
|
const state = JSON.parse(fs.readFileSync(stateFile, "utf8"));
|
|
if (state && state.pid) {
|
|
try {
|
|
process.kill(state.pid, "SIGTERM");
|
|
} catch {}
|
|
}
|
|
fs.unlinkSync(stateFile);
|
|
} catch {}
|
|
|
|
if (process.env.ARGENT_SKIP_POSTINSTALL === "1") {
|
|
process.exit(0);
|
|
}
|
|
|
|
console.log(`
|
|
@swmansion/argent installed.
|
|
|
|
To set up your workspace (MCP server, skills, rules), run:
|
|
|
|
argent init
|
|
`);
|