agentsmesh 0.41.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +2 -2
- package/dist/canonical.js +369 -194
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +267 -258
- package/dist/engine.d.ts +6 -1
- package/dist/engine.js +505 -262
- package/dist/engine.js.map +1 -1
- package/dist/index.js +625 -320
- package/dist/index.js.map +1 -1
- package/dist/lessons.d.ts +5 -0
- package/dist/lessons.js +170 -107
- package/dist/lessons.js.map +1 -1
- package/dist/targets.js +437 -252
- package/dist/targets.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.42.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c921385: **Upgrade notes.** This release fixes data loss on import and adoption, three security issues, and several generated formats. Most projects need to do nothing, but check these after you upgrade:
|
|
8
|
+
- Run `agentsmesh generate` once. Some generated files change format, so `agentsmesh generate --check` reports drift until you regenerate: Claude Code rules scope files with `paths:` (the field Claude Code reads) instead of `globs:`; Windsurf rules use `globs:` instead of `glob:` and a scoped rule is written once (`generate` removes the old `.windsurf/rules/<dir>.md` copy; you can delete an old `<dir>/AGENTS.md` it wrote for Windsurf only); Codex CLI and Codebuff write each rule in a nested `<dir>/AGENTS.md` with an `agentsmesh:embedded-rule` marker.
|
|
9
|
+
- If an earlier `import --from codex-cli`, `codebuff` or `windsurf` cycle created a folder rule such as `.agentsmesh/rules/src.md` that repeats another rule's text, delete it once.
|
|
10
|
+
- `agentsmesh init` without `--yes` now stops with exit code 1 when it finds existing config for a tool it would enable, because it would not import that config. Use `agentsmesh init --yes`, or `--targets` to leave that tool out.
|
|
11
|
+
- `agentsmesh check` now fails after `agentsmesh generate --targets …` left an enabled target out of date (the lock lists it under `stale_targets`). Run a full `agentsmesh generate`. `check()` and `check --json` report these targets as `staleTargets`.
|
|
12
|
+
- Importing a second tool now adds to `.agentsmesh/permissions.yaml`, `.agentsmesh/ignore` and `.agentsmesh/mcp.json` instead of replacing them, and never removes an entry; edit those files to remove one. In one `agentsmesh init --yes` run, two tools' rules, commands or agents with the same name and different text are both kept, the later one as `<name>-<tool>.md` (listed as `sameNameCopies` in `init --json`).
|
|
13
|
+
- A `root: true` rule from an installed pack or an `extends` source no longer replaces your own `.agentsmesh/rules/_root.md`; it is used as a normal rule, with a warning.
|
|
14
|
+
- The MCP server runs tool calls one at a time, in the order they arrive.
|
|
15
|
+
- Old lessons stores (`index.yaml` + `topics/` + `journal.md`, up to 0.22): the migration keeps `journal.md`, never runs from the recall hook, and stops with nothing changed if a topic file has a list item outside a `## Rules` or `## Lessons` section.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 0878dcd: `agentsmesh check` no longer passes after `agentsmesh generate --targets …` left other targets out of date. Before, a filtered run recorded the new canonical checksums in `.agentsmesh/.lock` even though the targets it skipped were not regenerated, so the CI gate said "Lock file is in sync." while, for example, `CLAUDE.md` was stale. Now, when the canonical sources changed, the lock lists the enabled targets the run left out under a new `stale_targets` key, and `check` fails and names them (`staleTargets` in `--json`, the MCP `check` tool and the `check()` API) until each is generated again. A full `agentsmesh generate` clears the list, and the lock does not change for projects that never use `--targets`.
|
|
20
|
+
- 75daebd: Claude Code rules keep their file scope. Claude Code scopes a rule in `.claude/rules/*.md` with `paths:`, the only field it reads from a rule. `agentsmesh import --from claude-code` ignored `paths` (the canonical rule got `globs: []`), and `agentsmesh generate` wrote a canonical rule's `globs` as `globs:`, which Claude Code ignores, so scoped rules applied to every file. Now import reads `paths` (a YAML list or a comma-separated string) into `globs`, older generated files with `globs:` still import, and generate writes `paths:`.
|
|
21
|
+
- aaeeabe: Importing generated Codex CLI or Codebuff output back no longer adds duplicate rules. A scoped rule, for example `globs: ["src/**/*.ts"]`, is written to a nested `src/AGENTS.md`. `agentsmesh import --from codex-cli` (or `codebuff` or `windsurf`) read that file as a new rule `.agentsmesh/rules/src.md`, and each import and generate cycle then repeated the rule text in `src/AGENTS.md` and copied it to every other target. Now each rule in a nested `AGENTS.md` is written as an `agentsmesh:embedded-rule` entry that names its canonical source, so import restores the original rule (with its globs and Codex instruction variant) and only hand-written text becomes a directory rule. If an earlier cycle already created such a rule, such as `.agentsmesh/rules/src.md`, delete it once.
|
|
22
|
+
- e61d957: Importing a second tool no longer drops the settings the first one brought in. Before, `agentsmesh import --from cursor` after `agentsmesh import --from claude-code` replaced `.agentsmesh/permissions.yaml` and `.agentsmesh/ignore` with Cursor's values, so Claude Code `deny` rules that protect secrets were lost without a word, and the next `generate` removed them from `.claude/settings.json`. Some importers (Gemini CLI, Cline, Windsurf, Crush) also replaced `.agentsmesh/mcp.json`. Now each import adds its permissions (`allow`, `deny`, `ask`), ignore patterns and MCP servers to the canonical files and keeps the ones already there; for an MCP server with the same name, the later import wins. This works the same for `import`, `init --yes`, the `importFrom()` API, the MCP `import` tool, and plugin targets. Import never removes an entry from these files; to drop one, edit the canonical file.
|
|
23
|
+
- 1b6e186: `agentsmesh init` no longer sets up a silent overwrite of your existing tool config. In a script or CI shell (no wizard) and without `--yes`, `init` used to find existing config, print only a hint to import it, and still enable that tool, so the next `agentsmesh generate` replaced it: in `--global` mode your `~/.claude/CLAUDE.md` and the MCP servers in `~/.claude.json`, which git cannot restore. Now `init` stops with exit code 1 and writes nothing when a tool it would enable already has config. Run `agentsmesh init --yes` to import that config first, or pass `--targets` to leave the tool out. The interactive wizard is unchanged.
|
|
24
|
+
- 982f61d: `agentsmesh init --yes` no longer loses a rule, command or agent when two tools have one with the same name. Before, the later tool's file replaced the earlier one in `.agentsmesh/`, with the earlier file's frontmatter mixed in, and the next `generate` wrote that text over the first tool's own file. Now, if both texts are the same, one canonical file is kept. If they differ, the first tool's file keeps its name, and the later tool's version is saved as `<name>-<tool>.md` (for example `.agentsmesh/rules/typescript-cursor.md`), each with only its own frontmatter. Init prints a warning for each copy, and `init --json` lists them in `sameNameCopies`. The interactive wizard works the same way. Separate `agentsmesh import --from` runs stay last-import-wins.
|
|
25
|
+
- ad0a72b: The one-time migration of the old lessons store (`index.yaml` + `topics/*.md` + `journal.md`, used up to 0.22) no longer loses lessons. Before, it kept only single-line numbered rules under a `## Rules` heading, dropped bullet rules, rules under other headings and the rest of wrapped rules, never read `journal.md`, and then deleted all the old files, even when started silently by the recall hook. Now every list item under a `## Rules` or `## Lessons` heading becomes a lesson, numbered or bullet, with the lines that wrap onto it, and rules with the same number in two sections are both kept. If a topic file has a list item under any other heading, the migration stops, names the file and line, and changes nothing. `journal.md` is kept for you to review, and the recall hook never migrates: the first `lessons` command you run does, and says so.
|
|
26
|
+
- e66d8df: The MCP server no longer loses changes when a client sends several write calls at once. Each write tool reads a file, changes it and writes it back, so parallel calls such as three `add_mcp_server`, `update_permissions` (append), `update_ignore` (append) or `update_config` calls kept only one change while all of them reported success. `agentsmesh mcp` now runs tool calls one at a time, in the order they arrive.
|
|
27
|
+
- f7a5e11: The MCP `create_*` and `update_*` tools for rules, commands and skills now store the body exactly as sent. Before, with empty `frontmatter`, a body that started with a `---` block was saved so that the block became the file's frontmatter. `get_*` then returned different metadata, and body text could set fields such as `root: true`, `allowed-tools` or `name` for `generate`. Now an empty frontmatter block is written before such a body, and the MCP server reads files with the same frontmatter rules as the canonical loader.
|
|
28
|
+
- b4ba0fa: The MCP `install` and `uninstall` tools no longer write plain-text notices into the JSON-RPC stream. When an installed skill had a broken link, or an uninstalled pack had locally changed files, `agentsmesh mcp` printed those notices on stdout, which stricter MCP clients cannot parse. They now go to stderr like every other message from the server. With `--json`, the CLI no longer prints them into the JSON output either.
|
|
29
|
+
- 00e6337: `install` (including `install --sync` and `refresh`) and `uninstall` now refuse a `.agentsmesh/packs` folder, or a single pack folder, that resolves outside the project, for example through a symlink committed to the repository. Before, they followed the link and could write, replace or delete a folder outside the project. The check runs before anything is read or written, also under `--dry-run`, and the error names where the path really points. The MCP `install` and `uninstall` tools get the same protection.
|
|
30
|
+
|
|
31
|
+
Lessons get the same protection: when `.agentsmesh/lessons` (or `.agentsmesh`) resolves outside the project, `lessons add` and every other lessons write, `init --lessons` and the MCP lessons tools refuse with a clear error instead of writing `lessons.json`, its lock or its logs there. The recall hook keeps working and simply skips its logs. A link to a folder inside the project still works.
|
|
32
|
+
|
|
33
|
+
- 8b51999: An installed pack or an extended source can no longer replace your root instructions. Before, a pack rule with `root: true` (under any name other than `_root.md`) silently became the root rule, so `CLAUDE.md`, `AGENTS.md` and Cursor's root rule showed only the pack's text, and `check` still passed. This worked even for remote packs, whose hooks, MCP servers and permissions are stripped as untrusted. Now there is exactly one root rule: your own, else an installed pack's, else an extended source's. Any other `root: true` rule is used as a normal rule, and `generate` prints a warning naming it.
|
|
34
|
+
- 1dc629f: `agentsmesh generate` no longer fails when the root rule links to another rule and two enabled targets write the same `AGENTS.md` (for example Codex CLI and Cursor, Codex CLI and Gemini CLI, or Cursor and Windsurf). The shared `AGENTS.md` keeps canonical references so both copies stay the same, but a relative link such as `[TS rule](./typescript.md)` was left unchanged and pointed to nothing, so the broken-link check stopped the run. Now such Markdown links point to the canonical file (`.agentsmesh/rules/typescript.md`); every other path in the shared file stays exactly as written.
|
|
35
|
+
- 7a8aea3: A skill whose `SKILL.md` is a symlink is now skipped, like every other symlinked canonical file. Before, `install`, `generate` and pack loading followed the link and copied the file it pointed to into `.agentsmesh/packs/` and the generated `.claude/skills/` and `.cursor/skills/` folders, so a skills repository could pull a local file into folders that usually get committed. The other skills in the same source are still installed.
|
|
36
|
+
- bacd901: Windsurf rules with a single glob now activate. Windsurf reads a rule's scope from `globs:` (one string, several patterns joined by commas), but `agentsmesh generate` wrote a single pattern as `glob:`, which Windsurf ignores, and several patterns as a YAML list. Now every scoped rule in `.windsurf/rules/*.md` gets `globs: <pattern>` or `globs: <a>,<b>`. `agentsmesh import --from windsurf` also got sturdier: it reads `globs` as a string or a list and still reads the older `glob:`, keeps a brace pattern like `src/**/*.{ts,tsx}` whole, accepts the unquoted form from Windsurf's docs (`globs: **/*.test.ts`), which used to stop the whole import with a YAML error, and skips a rule it still cannot read with a warning instead of failing.
|
|
37
|
+
- 543b348: Windsurf now gets each scoped rule once. For a rule with `globs: ["src/**/*.ts"]`, `agentsmesh generate` wrote `.windsurf/rules/typescript.md`, an identical `.windsurf/rules/src.md`, and `src/AGENTS.md`, so Windsurf loaded the rule several times, `src/AGENTS.md` applied it to every file in `src/`, and `agentsmesh import --from windsurf` added a duplicate `.agentsmesh/rules/src.md`. Now only `.windsurf/rules/typescript.md` (`trigger: glob`) is written; the next `generate` removes the old `.windsurf/rules/src.md`, and import ignores an old `src/AGENTS.md` that holds the same text as a Windsurf rule, so a generate and import round trip no longer adds rules. You can delete such an old `src/AGENTS.md` if no other tool uses it. A nested `AGENTS.md` you wrote yourself is still imported as a folder rule.
|
|
38
|
+
|
|
3
39
|
## 0.41.0
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ agentsmesh generate # write each tool's native config from the one source
|
|
|
56
56
|
agentsmesh check # CI drift gate against .agentsmesh/.lock
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
On a terminal, `init` runs a short wizard: pick targets, import detected configs (`.cursor/`, `.claude/`, `.github/copilot-instructions.md`, and more), enable lessons, and optionally generate right away. Nothing is written until you finish. Use `--yes` for the non-interactive default, `--global` for your user-level config under `~/.agentsmesh/`, and `npx agentsmesh` if you installed it as a dev dependency.
|
|
59
|
+
On a terminal, `init` runs a short wizard: pick targets, import detected configs (`.cursor/`, `.claude/`, `.github/copilot-instructions.md`, and more), enable lessons, and optionally generate right away. Nothing is written until you finish. Use `--yes` for the non-interactive default (in a script, `init` without `--yes` stops when it finds existing tool config, so `generate` never replaces config you have not imported), `--global` for your user-level config under `~/.agentsmesh/`, and `npx agentsmesh` if you installed it as a dev dependency.
|
|
60
60
|
|
|
61
61
|
`init` enables the tools you actually use, not all of them: whatever this project already has config for, else whatever is installed on your machine, else a minimal set of Claude Code, Cursor and Copilot. It prints what it picked. Pass `--targets a,b` to choose, or `--all-targets` for everything.
|
|
62
62
|
|
|
@@ -145,7 +145,7 @@ Built to be depended on: 12,000+ tests on Linux, macOS, and Windows CI, JSON-Sch
|
|
|
145
145
|
|
|
146
146
|
- **Lossless two-way sync.** When a tool has no native slot for a feature, it is embedded with round-trip metadata instead of dropped. [Managed embedding](https://samplexbro.github.io/agentsmesh/reference/managed-embedding/)
|
|
147
147
|
- **Automatic link rebasing.** `.agentsmesh/skills/api-gen/template.hbs` becomes `.claude/skills/...` or `.cursor/skills/...` in each generated file. [Generation pipeline](https://samplexbro.github.io/agentsmesh/reference/generation-pipeline/)
|
|
148
|
-
- **Safe adoption.** `import`, then `diff`, then `generate`, then `check`; nothing is overwritten blind. When several tools have a root rule, they are merged into one `_root.md` rather than the last one winning. [Existing-project guide](https://samplexbro.github.io/agentsmesh/guides/existing-project/)
|
|
148
|
+
- **Safe adoption.** `import`, then `diff`, then `generate`, then `check`; nothing is overwritten blind. When several tools have a root rule, they are merged into one `_root.md` rather than the last one winning, their permissions, ignore patterns and MCP servers add up instead of replacing each other, and `init --yes` keeps both versions of a same-name rule, command or agent. [Existing-project guide](https://samplexbro.github.io/agentsmesh/guides/existing-project/)
|
|
149
149
|
- **Output directory safety.** `generate` and `convert` reject output directories that resolve outside the project (or home directory with `--global`), checked before any write and under `--dry-run` too. Stale-file cleanup enforces the same boundary.
|
|
150
150
|
- **Safe updates.** Explicitly empty Claude permission, hook, and MCP configurations clear their generated entries. MCP edits preserve untouched server fields and reject malformed files; skill updates validate supporting files before writing.
|
|
151
151
|
- **Migrate between tools.** `convert --from <a> --to <b>` rewrites one tool's config directly into another's. [convert](https://samplexbro.github.io/agentsmesh/cli/convert/)
|