agentsmesh 0.3.1 → 0.6.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 CHANGED
@@ -1,6 +1,114 @@
1
1
  # Changelog
2
2
 
3
- ## Next version
3
+ ## 0.6.0 - 2026-04-25
4
+
5
+ ### Added
6
+
7
+ - **Full plugin parity with built-in targets** — plugin targets now have access to the same runtime capabilities as built-in targets:
8
+ - **Conversion support**: plugins can declare `supportsConversion: { commands: true, agents: true }` and users can configure `commands_to_skills` / `agents_to_skills` for plugin target IDs in `agentsmesh.yaml`. The conversion schema now accepts arbitrary target IDs alongside hardcoded builtins. Conversion values support per-scope control: `foo-ide: { project: true, global: false }` or the shorthand `foo-ide: true` for both scopes.
9
+ - **Global mode**: plugin descriptors that define `global` or `globalSupport` layouts, `globalCapabilities`, and `globalDetectionPaths` are fully resolved by the engine — `generate --global`, `import --global`, `lint --global`, and `matrix --global` all work with plugin targets.
10
+ - **Scoped settings emission**: `emitScopedSettings` hooks on plugin descriptors are now called during generation (previously only checked on builtins).
11
+ - **Hook post-processing**: `postProcessHookOutputs` hooks on plugin descriptors are now called during the hook generation pass.
12
+ - **Per-feature lint hooks**: `lint.commands`, `lint.mcp`, `lint.permissions`, `lint.hooks`, and `lint.ignore` on plugin descriptors receive `{ scope }` context for project vs global differentiation.
13
+ - **Unified generator resolution**: a single code path (`resolveTargetFeatureGenerator`) resolves generators for both builtins and plugins, removing duplicate resolution logic from the engine.
14
+ - **Plugin support in all CLI commands** — `diff`, `check`, `matrix`, and `import --from <plugin-id>` now bootstrap and resolve plugin targets. Previously only `generate` and `lint` supported plugins.
15
+ - **Richer target scaffold** — `agentsmesh target scaffold` now generates descriptors with global layout, `globalCapabilities`, `globalDetectionPaths`, `supportsConversion`, per-feature lint hook stubs, and `rewriteGeneratedPath` for global path rewriting.
16
+ - **Comprehensive plugin test fixture** (`tests/fixtures/plugins/rich-plugin/`) — covers 100% of `TargetDescriptor` fields including all 8 feature generators, per-feature lint hooks, project and global layouts with output families, shared artifacts, scope extras, scoped settings, hook post-processing, and conversion support.
17
+ - **Typed root barrel export** — `import { generate, importFrom, loadCanonical, registerTargetDescriptor } from 'agentsmesh'` now resolves to a proper `.d.ts` under strict TypeScript. The root `exports."."` is a conditional block with `types`, `import`, and `default`, pointing at a new public barrel (`src/public/index.ts`). Closes `TS7016: Could not find a declaration file for module 'agentsmesh'` that appeared for any downstream TS consumer.
18
+ - **Typed error taxonomy exported from the public API** — `AgentsMeshError` base class plus 8 concrete subclasses (`ConfigNotFoundError`, `ConfigValidationError`, `TargetNotFoundError`, `ImportError`, `GenerationError`, `RemoteFetchError`, `LockAcquisitionError`, `FileSystemError`), each carrying a stable `code` field (`AM_CONFIG_NOT_FOUND`, `AM_CONFIG_INVALID`, `AM_TARGET_NOT_FOUND`, `AM_IMPORT_FAILED`, `AM_GENERATION_FAILED`, `AM_REMOTE_FETCH_FAILED`, `AM_LOCK_ACQUISITION_FAILED`, `AM_FILESYSTEM`). Programmatic consumers can branch on `err instanceof ConfigNotFoundError` or `err.code === 'AM_CONFIG_INVALID'` without parsing error message strings. Error throw sites in `src/config/core/loader.ts` and `src/utils/filesystem/fs.ts` now emit typed errors; stack-trace context and `cause` chains preserved.
19
+ - **Canonical domain types in the public barrel** — 14 types (`CanonicalFiles`, `CanonicalRule`, `CanonicalCommand`, `CanonicalAgent`, `CanonicalSkill`, `SkillSupportingFile`, `Permissions`, `IgnorePatterns`, `McpServer`, `StdioMcpServer`, `UrlMcpServer`, `McpConfig`, `Hooks`, `HookEntry`) are now exported from `agentsmesh` and `agentsmesh/canonical`. Programmatic consumers can finally type the result of `loadCanonical()` without reaching into internal modules.
20
+ - **Process-level lock for concurrent `generate`** — `agentsmesh generate` acquires an atomic mkdir-based lock at `.agentsmesh/.generate.lock` before writing. Concurrent generates serialize cleanly; stale locks (dead PID on the same host, or age > 60 seconds) are evicted automatically; `SIGINT`/`SIGTERM`/normal exit release the lock idempotently. Dry-run and check-only modes skip the lock. Watch mode's lock-file ignore list was extended so self-triggered generate passes do not retrigger the watcher.
21
+ - **Cross-platform CI matrix** — quality gates now run on `ubuntu-latest` × Node 20/22/24, plus `windows-latest` × Node 22 and `macos-latest` × Node 22. Previously only `ubuntu-latest` × Node 22. E2E tests run on Linux and macOS; Windows runs lint/typecheck/unit/build.
22
+ - **Packaging guards in CI** — three new gates run on every push in a dedicated `smoke` job:
23
+ - `publint` — package.json metadata sanity (exports ordering, `files`, module type).
24
+ - `@arethetypeswrong/cli` with the `esm-only` profile — verifies every public entrypoint resolves to types under `node16 (from ESM)` and `bundler` module resolution.
25
+ - `tests/consumer-smoke/` — packs the tarball, installs it into a throwaway strict-mode TS project, and runs `tsc --noEmit` against every public symbol (runtime functions, canonical types, target-descriptor types, and error classes). Catches `TS7016` and type-resolution regressions that packaging-metadata checks miss.
26
+ - Also runnable locally via `pnpm publint`, `pnpm attw`, `pnpm consumer-smoke`.
27
+ - **Post-pack smoke test in CI** — the `smoke` job installs the packed tarball with `npm install -g` and verifies `agentsmesh --version`, `agentsmesh --help`, `amsh --version`, and `agentsmesh init --yes` all succeed in a clean temp project. Catches broken shebangs, missing files from the `files` array, and bin misconfiguration before publish.
28
+ - **`docs/add-new-target-playbook.md`** — self-contained guide for adding a new target (built-in or external plugin, project and global mode) designed to be handed to an AI coding agent. Covers research checklist, scaffold workflow, descriptor filling, realistic fixtures, strict-assertion test patterns, registration file wiring, matrix/docs updates, and a verification one-liner. Referenced by the canonical `add-agent-target` skill as the authoritative workflow document.
29
+ - **Boot-time guard against ambiguous shared-artifact ownership** — `BUILTIN_TARGETS` initialization now runs `assertSharedArtifactOwnersUnique()` (`src/targets/catalog/shared-artifact-owner.ts`) and throws if two descriptors claim the same or overlapping `sharedArtifacts: { '<prefix>': 'owner' }` entry. Previously the rewriter would silently pick the first match by iteration order, so a misconfigured plugin or future builtin could quietly route global skill writes to the wrong target. The error names both target IDs and both prefixes and suggests changing one role to `'consumer'` or namespacing the prefix. Covered by `tests/unit/targets/catalog/shared-artifact-owner.test.ts` (9 cases including identical-prefix conflicts, prefix-overlap conflicts, owner-vs-consumer non-conflicts, and the live builtin set).
30
+ - **Cross-process race coverage for the generate lock** — `tests/integration/generate-process-lock.integration.test.ts` now proves two parallel `node dist/cli.js generate` invocations against the same project serialize via the existing process lock, both exit `0`, produce deterministic output, and release `.agentsmesh/.generate.lock` after the run. Complements the existing unit tests that exercise `acquireProcessLock` directly.
31
+ - **End-to-end Copilot dual-mirror coverage** — `tests/unit/targets/copilot/global-layout.test.ts` adds two engine-level assertions that prove Copilot's `mirrorGlobalPath` emits the exact set `.copilot/skills/<name>/`, `.agents/skills/<name>/`, and `.claude/skills/<name>/` in global mode when codex-cli is not active, and skips the `.agents/skills/` mirror when codex-cli is generated alongside (so codex-cli's `'owner'` claim wins).
32
+ - **Programmatic API: complete `lint`, `diff`, `check`, and config-loader surface** — every CLI capability is now callable as a typed function. New exports from `agentsmesh` and `agentsmesh/engine`:
33
+ - `loadConfig(projectRoot)` and `loadConfigFromDirectory(configDir)` — load + validate `agentsmesh.yaml` (merging `agentsmesh.local.yaml`) and return `{ config: ValidatedConfig, configDir }`. Throws `ConfigNotFoundError` / `ConfigValidationError` with stable `code` fields.
34
+ - `lint(opts)` — runs target linters, returns `{ diagnostics, hasErrors }`. Pure: no I/O, no logging.
35
+ - `diff(ctx)` — runs generate internally, returns `{ results, diffs, summary }`. Plus `computeDiff(results)` and `formatDiffSummary(summary)` helpers for callers that already have generate results.
36
+ - `check(opts)` — pure lock-vs-current drift detection backed by the new shared `src/core/check/lock-sync.ts` module. Returns a structured `LockSyncReport` (`inSync`, `hasLock`, `modified`, `added`, `removed`, `extendsModified`, `lockedViolations`). The `agentsmesh check` CLI command was refactored to use the same helper so CLI and Programmatic API can never drift.
37
+ - New types: `ValidatedConfig`, `TargetLayoutScope`, `LintOptions`, `LintResult`, `LintDiagnostic`, `ComputeDiffResult`, `DiffEntry`, `DiffSummary`, `CheckLockSyncOptions`, `LockSyncReport`.
38
+ - **Programmatic API runtime coverage** — new `tests/integration/programmatic-api.integration.test.ts` (21 strict assertions) exercises every public function and every error class against real fixture state: shape inventory, `loadConfig` happy/missing/invalid-schema paths, `loadCanonical`, `generate` with exact-paths assertion, `targetFilter` narrowing, `registerTargetDescriptor` plugin wiring through `generate`, `importFrom` end-to-end, `lint` shape, `diff` + `computeDiff` summary parity, `check` for `hasLock=false` / `inSync=true` / modified-drift, catalog inspection, `resolveOutputCollisions`. Replaces the previous shallow `public-export-smoke.integration.test.ts` (which only checked `typeof === 'function'` and used loose `length > 0` assertions).
39
+ - **Programmatic API type contract coverage** — `tests/consumer-smoke/src/smoke.ts` extended to import every new symbol (`loadConfig`, `loadConfigFromDirectory`, `lint`, `diff`, `check`, `computeDiff`, `formatDiffSummary`, `ValidatedConfig`, `LintOptions`, `LintResult`, `CheckLockSyncOptions`, `LockSyncReport`, `ComputeDiffResult`, `DiffEntry`, `DiffSummary`) and exercise them with no `unknown` casts (the previous `as unknown as ValidatedConfig` hack is gone now that the type is public). `pnpm consumer-smoke` packs the tarball, installs into a strict-mode TS project, and `tsc --noEmit`s the full surface — catches `TS7016` and signature regressions before publish.
40
+ - **Dedicated Programmatic API reference page** at `website/src/content/docs/reference/programmatic-api.mdx` — entrypoint table, the canonical 4-line generate pattern, per-function signatures and examples for `loadConfig` / `loadCanonical` / `generate` / `importFrom` / `lint` / `diff` / `check` / `registerTargetDescriptor` / catalog inspection, full error taxonomy table, canonical types, target-descriptor types, and stability guarantees. Linked from the landing page and sidebar Reference section. README "Programmatic API" section rewritten so the example actually compiles (the previous snippet omitted the required `config` and `canonical` fields of `GenerateContext`).
41
+
42
+ ### Changed
43
+
44
+ - **Production-grade build output** — `tsup.config.ts` reworked with a split policy that matches the two artifact families:
45
+ - **CLI binary (`dist/cli.js`)**: minified with `keepNames: true` so stack traces still reference real function/class names. Sourcemap no longer shipped to npm — with `keepNames` the minified stack traces remain debuggable from error text alone, and the 1.6 MB sourcemap was dead weight for the 99% of users who never debug into CLI internals (maintainers reproduce locally with sourcemap on).
46
+ - **Library entries (`dist/{index,engine,canonical,targets}.js`)**: unminified (consumers' bundlers minify their own output — standard convention used by React, Vue, Vitest, tsup itself), sourcemaps shipped (consumers stepping into library code from their own debugger get a usable experience).
47
+ - Explicit `treeshake: true` on both bundle families.
48
+ - Net effect: `dist/cli.js` 643 KB → 325 KB (-49%); compressed npm tarball 1.21 MB → 923 KB (-24%); unpacked install 6.0 MB → 4.75 MB (-21%). CLI cold-start parse time drops correspondingly.
49
+ - **Conversion config schema**: inner `commands_to_skills` and `agents_to_skills` objects changed from `.strict()` to `.passthrough()`, allowing plugin target IDs without validation errors. The outer `conversions` object remains strict. Conversion values now accept either `boolean` (both scopes) or `{ project?: boolean, global?: boolean }` for per-scope control.
50
+ - **Conversion helpers**: `shouldConvertCommandsToSkills` and `shouldConvertAgentsToSkills` accept optional `defaultEnabled` and `scope` parameters. Per-scope config values are resolved against the active scope, with missing scope keys falling back to builtin defaults.
51
+ - **Builtin-targets module**: five lookup functions (`getTargetCapabilities`, `getTargetDetectionPaths`, `getTargetLayout`, `getEffectiveTargetSupportLevel`, `resolveTargetFeatureGenerator`) now fall back to the plugin registry via `getDescriptor()` when no builtin match is found.
52
+ - **Registry**: `builtinDescriptors` map is now lazily initialized to avoid circular-dependency crashes between `builtin-targets.ts` and `registry.ts`.
53
+ - **JSON Schema**: `schemas/agentsmesh.json` updated — conversion inner objects now use `"additionalProperties": {}` (passthrough) instead of `"additionalProperties": false`.
54
+ - **`agentsmesh generate --global` log output** — generated file paths now display with a `~/` prefix (e.g. `✓ updated ~/.claude/settings.json`) so users cannot mistake a home-directory write for a project-local write. Applies to dry-run, check-only, and success output. Project-mode display is unchanged.
55
+ - **`writeFileAtomic` safety hardening** — orphaned `.tmp` sidecars are now removed on rename failure. Target paths that already exist as directories throw `FileSystemError` with `errnoCode: 'EISDIR'` instead of leaking the raw rename error. Readable error messages preserved with original errors as `cause`.
56
+ - **Remote tar extraction hardening** — `tar.extract` for GitHub tarballs now runs with `strict: true` (promotes warnings to errors) and explicitly rejects `Link` and `SymbolicLink` entries in addition to the existing zip-slip `..` / absolute-path filter. Defense-in-depth against malicious remote packs.
57
+ - **Package metadata**: `main` and `types` point at `./dist/index.{js,d.ts}`; root `exports."."` is a full conditional block. `@arethetypeswrong/cli` and `publint` added as devDependencies. New npm scripts: `publint`, `attw`, `consumer-smoke`.
58
+ - **README**: new **Programmatic API** section with typed import examples for the root barrel and the three subpath entrypoints (`agentsmesh/engine`, `agentsmesh/canonical`, `agentsmesh/targets`).
59
+ - **`--global` commands now throw a scope-aware error when `~/.agentsmesh/agentsmesh.yaml` is missing.** The message points at the exact missing path and suggests `agentsmesh init --global` to create the global canonical root, or dropping `--global` to operate on the current project. Applies uniformly to `generate`, `import`, `lint`, `check`, `diff`, `watch`, and `matrix`. Previously a generic "config not found" error left first-time global users guessing. Covered by `tests/unit/config/scope.test.ts`.
60
+ - **`ConfigNotFoundError` constructor accepts an optional `message` override** (`{ cause?, message? }`) so wrappers can supply scope-aware copy without losing the typed error class, `code`, or `path`. Existing callers that pass only `path` (and optional `cause`) are unchanged.
61
+
62
+ ### Removed
63
+
64
+ - **Native Windows support deferred to a later release.** `package.json` now declares `"os": ["darwin", "linux"]`, the CI matrix dropped `windows-latest`, and the README's Install section calls this out with WSL2 as a workaround. The deferral path and re-enablement checklist are tracked in `docs/roadmap.md` under "Windows support (deferred)". Three POSIX-correctness fixes that landed in this release as defense-in-depth — `installs.yaml` `source` field always written as POSIX (`src/install/source/parse-install-local.ts`), plugin file-URL conversion via `fileURLToPath` instead of `URL.pathname` (`src/plugins/load-plugin.ts`), and `path.join` used in the canonical extend-load test expectations — already pave the way for the eventual re-enablement.
65
+
66
+ ### Fixed
67
+
68
+ - **`TS7016` on root import** — `import { ... } from 'agentsmesh'` previously resolved to `./dist/cli.js`, which was built with `dts: false`. Root exports now point at the typed library barrel, and `attw` + `publint` + consumer-smoke guards prevent regression.
69
+ - **Stale coverage exclusion paths in `vitest.config.ts`** — 15 excluded files referenced stale paths after a folder restructure (`src/utils/fs.ts` → `src/utils/filesystem/fs.ts`, `src/config/lock.ts` → `src/config/core/lock.ts`, `src/install/git-pin.ts` → `src/install/source/git-pin.ts`, and others). Paths corrected; one entry for a deleted file (`src/install/local-source.ts`) removed.
70
+ - **Canonical `add-agent-target` skill** — restored mangled prose references (``` `../../` ``` back to ``` `.agentsmesh/` ```); updated stale code touchpoints (`src/config/schema.ts` → `src/config/core/schema.ts`, `src/cli/help.ts` → `src/cli/help-data.ts`, `src/core/matrix/matrix.ts` → `src/core/matrix/data.ts`); added missing registration-file pointers (`target-ids.ts`, `builtin-targets.ts`, `import-maps/index.ts`); named the `agentsmesh target scaffold <id>` scaffold command as the starting step; referenced `docs/add-new-target-playbook.md` for the step-by-step workflow; added `pnpm matrix:verify`, `pnpm publint`, `pnpm attw`, and `pnpm consumer-smoke` to the required verification list.
71
+
72
+ ## 0.5.0 - 2026-04-23
73
+
74
+ ### Added
75
+
76
+ - **JSON Schema for all config files** — `agentsmesh.yaml`, `agentsmesh.local.yaml`, `.agentsmesh/permissions.yaml`, `.agentsmesh/hooks.yaml`, `.agentsmesh/mcp.json`, and `.agentsmesh/packs/*/pack.yaml` now ship with JSON Schemas derived directly from Zod source schemas. Enables full IDE autocomplete, enum validation, and hover docs in VS Code, JetBrains, and any YAML/JSON Language Server with zero user configuration. Schemas are published to `schemas/` in the npm package and accessible at `https://unpkg.com/agentsmesh/schemas/*.json`. Run `pnpm schemas:generate` to regenerate after schema changes.
77
+ - **`$schema` comment in generated config files** — `agentsmesh init` now writes a `# yaml-language-server: $schema=...` comment as the first line of both `agentsmesh.yaml` and `agentsmesh.local.yaml`, activating IDE validation without any manual setup.
78
+ - **Global mode** (`--global`, canonical `~/.agentsmesh/`) for **all** built-in targets — Claude Code, Cursor, Copilot, Continue, Junie, Kiro, Gemini CLI, Cline, Codex CLI, Windsurf, Antigravity, and Roo Code. Each target has a `descriptor.global` layout with project→user path rewriting, import/generate alignment, optional `~/.agents/skills/` mirroring when Codex CLI is not a global target, reference/link rewriting, and comprehensive test coverage.
79
+ - **Roo Code agents → custom modes**: canonical agents now generate `.roomodes` (project) and `settings/custom_modes.yaml` (global) with a `customModes` YAML structure. Roo Code agents capability upgraded from `—` to `partial`.
80
+ - **Copilot global extras**: `~/.copilot/AGENTS.md` is now generated in global mode as a root-instructions compat file.
81
+ - **Continue global config**: global mode generates `~/.continue/config.yaml` (aggregating rules as `rules:`, commands as `prompts:`, MCP as `mcpServers:`) and `~/.continue/AGENTS.md`.
82
+ - **Copilot global skill mirror**: skills are now mirrored to both `~/.agents/skills/` and `~/.claude/skills/` in global mode.
83
+ - **Cline global hooks round-trip**: `agentsmesh import --from cline` now reads hook scripts from `~/Documents/Cline/Hooks/` (global mode) and `.clinerules/hooks/` (project mode). Hook scripts embed a `# agentsmesh-event: <event>` metadata comment for lossless round-trip; the generator also includes this comment going forward.
84
+ - `sharedArtifacts` field added to target descriptor — enables collision-free generation when multiple targets share an output path (e.g. `.agents/skills/`).
85
+ - Lint hooks wired to all target descriptors.
86
+ - Contributor skill **`add-global-mode-target`** for scoped work when extending or validating one target’s global-mode behavior.
87
+ - Comprehensive structure validation test coverage for all 12 targets in both project and global modes.
88
+ - Shared validation helpers library (`tests/unit/targets/validation-helpers.ts`) with reusable helpers for JSON, Markdown, YAML, frontmatter, and file structure validation.
89
+
90
+ ### Fixed
91
+
92
+ - **Claude Code output-styles**: generated output-style files no longer carry `agent-` / `command-` filename prefixes — now `{name}.md` as documented.
93
+ - **Windsurf**: `src/AGENTS.md` removed from `managedOutputs` (was incorrectly tracked as a managed file).
94
+ - **Cline**: `.clinerules/` directory added to `managedOutputs.dirs` for correct stale-artifact cleanup after `generate`.
95
+ - **Copilot global instructions**: path-specific instructions now aggregate into `~/.copilot/copilot-instructions.md` in global mode (previously suppressed).
96
+ - **Windsurf MCP capability**: both project and global scopes now consistently `partial` (global was incorrectly `native`).
97
+ - **Codex CLI detection**: detection paths expanded to include `AGENTS.md`, `AGENTS.override.md`, `.codex/config.toml`, `.codex/agents`, and `.codex/rules`.
98
+ - **Link rebaser**: `.agentsmesh/` anchor preserved correctly in generated prose.
99
+
100
+ ### Changed
101
+
102
+ - **Init scaffold:** example files created by `agentsmesh init` are now prefixed with `_` (`_example.md`, `skills/_example/SKILL.md`). Files and directories with a `_` prefix are excluded from generation, so the starter templates serve as visible reference only and do not produce tool-specific output. `_root.md` remains the sole `_`-prefixed file that is always included in generation.
103
+ - **Documentation:** README and website updated to reflect Roo Code agents support, Copilot and Continue global extras, and the new `schemas/` package contents. `generate.mdx` documents global mode path resolution (how `--global` maps to `homedir()` as `projectRoot`).
104
+
105
+ ### Refactored
106
+
107
+ - Extracted `mirrorSkillsToAgents()` shared helper (`src/targets/catalog/skill-mirror.ts`) — replaces repeated `!activeTargets.includes(‘codex-cli’)` guards inline across 8 target files.
108
+ - Consolidated import map builders; removed duplicate validation tests.
109
+ - Extracted shared skill-import pipeline; deleted obsolete `skills-helpers` files.
110
+ - Improved link rebaser resolution and managed embedding.
111
+ - Removed unused `COPILOT_GLOBAL_MCP` / `COPILOT_GLOBAL_CONFIG` constants.
4
112
 
5
113
  ## 0.3.1 - 2026-04-12
6
114
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
 
3
- # AgentsMesh
3
+ # AgentsMesh — One AI Coding Config for Every Tool
4
4
 
5
5
  [![CI](https://github.com/sampleXbro/agentsmesh/actions/workflows/ci.yml/badge.svg)](https://github.com/sampleXbro/agentsmesh/actions/workflows/ci.yml)
6
6
  [![npm version](https://img.shields.io/npm/v/agentsmesh.svg)](https://www.npmjs.com/package/agentsmesh)
@@ -12,8 +12,11 @@
12
12
  [![Docs](https://img.shields.io/badge/docs-website-brightgreen.svg)](https://samplexbro.github.io/agentsmesh)
13
13
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/sampleXbro/agentsmesh/pulls)
14
14
 
15
+ **One canonical `.agentsmesh/` directory replaces scattered rules, prompts, agents, skills, MCP servers, hooks, ignore files, and permissions across every major AI coding tool.**
15
16
 
16
- AgentsMesh maintains a single canonical configuration in `.agentsmesh/` and syncs it bidirectionally to Claude Code, Cursor, Copilot, Continue, Junie, Kiro, Gemini CLI, Cline, Codex CLI, Windsurf, Antigravity, and Roo Code. Rules, commands, agents, skills, MCP servers, hooks, ignore patterns, and permissions -- all from one source of truth.
17
+ Edit once generate `CLAUDE.md`, `AGENTS.md`, `.cursor/rules`, `.github/copilot-instructions.md`, `.gemini/settings.json`, `.windsurf/rules`, `.codex/config.toml`, `.kiro/steering`, and more from the same source. Bidirectional import so you can adopt it on existing projects with one command.
18
+
19
+ **Works with** Claude Code · Cursor · GitHub Copilot · Gemini CLI · Windsurf · Continue · Cline · Kiro · Codex CLI · Junie · Roo Code · Antigravity — and new tools as the ecosystem grows. See the [full feature matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/).
17
20
 
18
21
  </div>
19
22
 
@@ -23,97 +26,246 @@ AgentsMesh maintains a single canonical configuration in `.agentsmesh/` and sync
23
26
 
24
27
  ## Why AgentsMesh
25
28
 
26
- - **One source of truth** -- edit `.agentsmesh/`, generate everywhere. No more copy-pasting rules between tool directories.
27
- - **Bidirectional sync** -- import existing configs into canonical form and generate back out. No data loss, no manual reformatting.
28
- - **Team-safe collaboration** -- lock files track generated state, `check` catches drift in CI, `merge` resolves conflicts after `git merge`.
29
- - **Lossless feature projection** -- when a tool lacks native support for a feature, AgentsMesh projects it as an embedded skill with enough metadata to round-trip on re-import.
29
+ - **One source of truth** edit `.agentsmesh/`, generate everywhere. No more copy-pasting rules between tool directories.
30
+ - **Bidirectional sync** import existing configs into canonical form and generate back out. Lossless round-trip, no manual reformatting.
31
+ - **Project + Global modes** sync team config via project-local `.agentsmesh/` *and* personal config via user-level `~/.agentsmesh/`.
32
+ - **Plugin system** add support for any AI coding tool via an npm package. No fork, no core PR.
33
+ - **Team-safe collaboration** — lock files track generated state, `check` catches drift in CI, `merge` resolves conflicts after `git merge`.
34
+ - **Community packs** — install shared skills, rules, agents, and commands from GitHub / GitLab / git URLs.
35
+ - **Growing tool coverage** — new AI coding tools are added as the ecosystem evolves. See the [matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/).
30
36
 
31
37
  ---
32
38
 
33
- ## Installation
39
+ ## Install
34
40
 
35
- Requires **Node.js 20** or later.
41
+ Requires **Node.js 20+**. Supported platforms: **Linux** and **macOS**. Native Windows support is deferred — track [the Windows support roadmap entry](docs/roadmap.md) for status. WSL2 works as a workaround.
36
42
 
37
43
  ```bash
38
- # npm
39
- npm install -D agentsmesh
40
-
41
- # pnpm
42
- pnpm add -D agentsmesh
43
-
44
- # yarn
45
- yarn add -D agentsmesh
46
-
47
- # or run directly
48
- npx agentsmesh --help
44
+ npm install -D agentsmesh # or: pnpm add -D / yarn add -D
45
+ npx agentsmesh --help # run without installing
49
46
  ```
50
47
 
51
- The CLI is available as both `agentsmesh` and `amsh`.
48
+ CLI aliases: `agentsmesh` and `amsh`.
52
49
 
53
50
  ---
54
51
 
55
- ## Quick Start
52
+ ## Quick start
56
53
 
57
54
  ### New project
58
55
 
59
56
  ```bash
60
- # Scaffold the canonical config directory
61
- agentsmesh init
57
+ agentsmesh init # scaffold .agentsmesh/
58
+ # edit .agentsmesh/rules/_root.md
59
+ agentsmesh generate # produce configs for every enabled tool
60
+ ```
62
61
 
63
- # Edit your root rule
64
- # vi .agentsmesh/rules/_root.md
62
+ ### Existing project adopt with one import
65
63
 
66
- # Generate configs for all enabled targets
64
+ ```bash
65
+ agentsmesh import --from cursor # or claude-code, copilot, codex-cli, ...
67
66
  agentsmesh generate
68
67
  ```
69
68
 
70
- ### Existing project with tool configs already in place
69
+ ### Personal global config
71
70
 
72
71
  ```bash
73
- # Import your existing Cursor config (or any supported tool)
74
- agentsmesh import --from cursor
72
+ agentsmesh init --global
73
+ agentsmesh import --global --from claude-code
74
+ agentsmesh generate --global # writes to ~/.claude/, ~/.cursor/, etc.
75
+ ```
75
76
 
76
- # Generate output for all configured targets
77
- agentsmesh generate
77
+ ---
78
+
79
+ ## Features
80
+
81
+ ### One config, every AI coding tool
82
+
83
+ AgentsMesh generates native configuration for every major AI coding assistant. Each tool's files are produced from a single `.agentsmesh/` directory with support for **rules, commands, agents, skills, MCP servers, hooks, ignore patterns, and permissions**:
84
+
85
+ | Tool | Main files generated |
86
+ |------|---------------------|
87
+ | **Claude Code** | `CLAUDE.md`, `.claude/agents/`, `.claude/skills/`, `.claude/commands/`, `.claude/settings.json`, `.claude/hooks.json`, MCP via `.claude.json` |
88
+ | **Cursor** | `.cursor/rules/*.mdc`, `AGENTS.md`, `.cursor/mcp.json`, `.cursor/hooks.json`, `.cursorignore` |
89
+ | **GitHub Copilot** | `.github/copilot-instructions.md`, `.github/instructions/*.instructions.md`, `.github/agents/`, `.github/prompts/` |
90
+ | **Gemini CLI** | `GEMINI.md`, `.gemini/settings.json` (MCP + hooks), `.gemini/commands/*.toml`, `.gemini/agents/` |
91
+ | **Windsurf** | `.windsurf/rules/*.md`, `.windsurf/workflows/`, `.windsurf/mcp_config.json`, `.windsurf/hooks.json` |
92
+ | **Continue** | `.continue/rules/`, `.continue/prompts/`, `.continue/mcpServers/`, `.continue/config.yaml` |
93
+ | **Cline** | `.clinerules/`, `.cline/skills/`, `.cline/cline_mcp_settings.json`, hooks |
94
+ | **Kiro** | `.kiro/steering/`, `.kiro/skills/`, `.kiro/hooks/*.kiro.hook`, `.kiro/settings/mcp.json` |
95
+ | **Codex CLI** | `AGENTS.md`, `.codex/config.toml`, `.codex/agents/*.toml`, `.codex/rules/` |
96
+ | **Junie** | `AGENTS.md`, `.junie/agents/`, `.junie/commands/`, `.junie/skills/`, `.junie/mcp/mcp.json` |
97
+ | **Roo Code** | `.roo/rules/`, `.roomodes` (agents → custom modes), `.roo/commands/`, `.roo/skills/` |
98
+ | **Antigravity** | `.agents/rules/general.md`, `.agents/skills/`, `.agents/workflows/`, `.agents/mcp_config.json` |
99
+
100
+ When a tool lacks native support for a feature, AgentsMesh embeds it with round-trip metadata — no data loss on re-import. See the [supported tools matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/) for per-tool native vs. embedded breakdown.
101
+
102
+ ### Global mode — personal setup, same workflow
103
+
104
+ `.agentsmesh/` at the project level is for teams. `~/.agentsmesh/` at the home level is for personal setup across every repo you touch:
105
+
106
+ ```bash
107
+ agentsmesh init --global
108
+ agentsmesh import --global --from claude-code
109
+ agentsmesh generate --global # writes ~/.claude/CLAUDE.md, ~/.cursor/, ~/.codex/, ~/.windsurf/, etc.
78
110
  ```
79
111
 
80
- That's it. Your `.agentsmesh/` directory is now the single source of truth, and the generated files for each tool stay in sync with it.
112
+ Every built-in target and every plugin supports global mode. Every CLI command (`diff`, `lint`, `watch`, `check`, `merge`, `matrix`) accepts `--global`. [Global mode paths per tool →](https://samplexbro.github.io/agentsmesh/reference/supported-tools/#global-mode)
113
+
114
+ ### Plugins — add any AI tool
115
+
116
+ Ship new target support as a standalone npm package — no fork, no core PR:
117
+
118
+ ```bash
119
+ agentsmesh plugin add agentsmesh-target-my-tool
120
+ agentsmesh generate # plugin targets run alongside built-ins
121
+ agentsmesh generate --global # global mode works for plugins too
122
+ ```
123
+
124
+ Plugins have full parity with built-in targets: project + global layouts, feature conversions, scoped settings, per-feature lint hooks, and hook post-processing. [Build a plugin →](https://samplexbro.github.io/agentsmesh/guides/building-plugins/)
125
+
126
+ ### Team-safe collaboration & CI drift detection
127
+
128
+ - **`agentsmesh check`** — CI gate that exits 1 if generated files drifted from the lock
129
+ - **`agentsmesh diff`** — preview what the next `generate` would change
130
+ - **`agentsmesh merge`** — recover from three-way `.lock` conflicts after `git merge`
131
+ - **Collaboration config** — `lock_features` and `strategy` prevent accidental overrides
132
+
133
+ ### Community packs
134
+
135
+ Install shared skills, rules, agents, and commands from any git repo:
136
+
137
+ ```bash
138
+ agentsmesh install github:org/shared-config@v1.0.0
139
+ agentsmesh install --path rules --as rules github:team/standards
140
+ agentsmesh install --sync # restore all packs after clone
141
+ ```
142
+
143
+ Packs live in `.agentsmesh/packs/`, track in `installs.yaml`, and merge into canonical config on every `generate`.
144
+
145
+ ### Extending AgentsMesh
146
+
147
+ - **`agentsmesh target scaffold foo-ide`** — generate a built-in target skeleton (10 files, ready to contribute upstream) with global mode, conversion support, and lint hooks pre-wired
148
+ - **`agentsmesh plugin add <pkg>`** — load third-party npm packages as runtime targets with full built-in parity
149
+
150
+ [Extending guide →](https://samplexbro.github.io/agentsmesh/guides/extending/) · [Building plugins →](https://samplexbro.github.io/agentsmesh/guides/building-plugins/)
151
+
152
+ ---
153
+
154
+ ## Supported tools — feature matrix
155
+
156
+ ### Project scope (`agentsmesh generate`)
157
+
158
+ <!-- agentsmesh:support-matrix:project -->
159
+ | Feature | Claude Code | Cursor | Copilot | Continue | Junie | Kiro | Gemini CLI | Cline | Codex CLI | Windsurf | Antigravity | Roo Code |
160
+ |---|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|
161
+ | Rules | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native |
162
+ | Additional Rules | Native | Embedded | Native | Native | Native | Native | Embedded | Native | Native | Native | Native | Native |
163
+ | Commands | Native | Native | Native | Embedded | Native | — | Native | Native (workflows) | Embedded | Native (workflows) | Partial (workflows) | Native |
164
+ | Agents | Native | Native | Native | — | Native | Native | Native | Embedded | Native | Embedded | — | Partial |
165
+ | Skills | Native | Native | Native | Embedded | Native | Native | Native | Native | Native | Native | Native | Native |
166
+ | MCP Servers | Native | Native | — | Native | Native | Native | Native | Native | Native | Partial | — | Native |
167
+ | Hooks | Native | Native | Partial | — | — | Native | Partial | Native | — | Native | — | — |
168
+ | Ignore | Native | Native | — | — | Native | Native | Native (settings-embedded) | Native | — | Native | — | Native |
169
+ | Permissions | Native | Partial | — | — | — | — | Partial | — | — | — | — | — |
170
+ <!-- /agentsmesh:support-matrix:project -->
171
+
172
+ ### Global scope (`agentsmesh generate --global`)
173
+
174
+ <!-- agentsmesh:support-matrix:global -->
175
+ | Feature | Claude Code | Cursor | Copilot | Continue | Junie | Kiro | Gemini CLI | Cline | Codex CLI | Windsurf | Antigravity | Roo Code |
176
+ |---|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|
177
+ | Rules | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native |
178
+ | Additional Rules | Native | Embedded | Native | Native | Embedded | Native | Embedded | Native | Embedded | Partial | Embedded | Native |
179
+ | Commands | Native | Native | Native | Native | Native | — | Native | Native (workflows) | Embedded | Native (workflows) | Partial (workflows) | Native |
180
+ | Agents | Native | Native | Native | — | Native | Native | Native | Embedded | Native | Embedded | — | Partial |
181
+ | Skills | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native |
182
+ | MCP Servers | Native | Native | — | Native | Native | Native | Native | Native | Native | Partial | Native | Native |
183
+ | Hooks | Native | Native | — | — | — | — | Partial | Native | — | Native | — | — |
184
+ | Ignore | Native | Native | — | — | — | Native | — | Native | — | Native | — | Native |
185
+ | Permissions | Native | — | — | — | — | — | — | — | — | — | — | — |
186
+ <!-- /agentsmesh:support-matrix:global -->
187
+
188
+ See the [full feature matrix docs](https://samplexbro.github.io/agentsmesh/reference/supported-tools/) for native vs. embedded support details and per-tool global paths.
81
189
 
82
190
  ---
83
191
 
84
- ## Supported Tools
192
+ ## Programmatic API
193
+
194
+ AgentsMesh is also importable as a typed ESM library, so you can drive every CLI capability — `generate`, `import`, `lint`, `diff`, `check` — from scripts, IDE extensions, MCP servers, or CI without spawning the CLI. Public entrypoints: `agentsmesh` (full surface), `agentsmesh/engine`, `agentsmesh/canonical`, `agentsmesh/targets`.
195
+
196
+ ```ts
197
+ import {
198
+ loadConfig,
199
+ loadCanonical,
200
+ generate,
201
+ lint,
202
+ diff,
203
+ check,
204
+ importFrom,
205
+ registerTargetDescriptor,
206
+ type GenerateResult,
207
+ type LintResult,
208
+ type LockSyncReport,
209
+ type TargetDescriptor,
210
+ } from 'agentsmesh';
211
+
212
+ // Canonical 4-line generate pattern: load config → load canonical → call engine.
213
+ const { config } = await loadConfig(process.cwd());
214
+ const canonical = await loadCanonical(process.cwd());
215
+ const results: GenerateResult[] = await generate({
216
+ config,
217
+ canonical,
218
+ projectRoot: process.cwd(),
219
+ scope: 'project',
220
+ });
221
+
222
+ // Lint — pure, returns structured diagnostics + hasErrors.
223
+ const lintResult: LintResult = await lint({ config, canonical, projectRoot: process.cwd() });
224
+
225
+ // Diff — runs generate internally, returns unified diffs + summary.
226
+ const { diffs, summary } = await diff({ config, canonical, projectRoot: process.cwd() });
227
+
228
+ // Check — lock-file vs current canonical drift report.
229
+ const drift: LockSyncReport = await check({
230
+ config,
231
+ configDir: process.cwd(),
232
+ canonicalDir: `${process.cwd()}/.agentsmesh`,
233
+ });
234
+
235
+ // Import a tool's native config back into canonical form (writes to disk).
236
+ await importFrom('claude-code', { root: process.cwd() });
237
+
238
+ // Register a custom target descriptor at runtime (same shape plugins ship).
239
+ const myDescriptor: TargetDescriptor = /* ... */;
240
+ registerTargetDescriptor(myDescriptor);
241
+ ```
85
242
 
86
- | Feature | Claude Code | Cursor | Copilot | Continue | Junie | Kiro | Gemini CLI | Cline | Codex CLI | Windsurf | Antigravity | Roo Code |
87
- |---------------|:-----------:|:-------:|:-------:|:--------:|:--------:|:------:|:----------:|:-------:|:---------:|:--------:|:-----------:|:--------:|
88
- | Rules | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native | Native |
89
- | Commands | Native | Native | Native | Embedded | Embedded | -- | Native | Native | Embedded | Native | Partial | Native |
90
- | Agents | Native | Native | Native | -- | Embedded | -- | Native | Embedded| Native | Embedded | -- | -- |
91
- | Skills | Native | Native | Native | Embedded | Embedded | Native | Native | Native | Native | Native | Native | Native |
92
- | MCP Servers | Native | Native | -- | Native | Native | Native | Native | Native | Native | Partial | -- | Native |
93
- | Hooks | Native | Native | Partial | -- | -- | Native | Partial | -- | -- | Native | -- | -- |
94
- | Ignore | Native | Native | -- | -- | Native | Native | Native | Native | -- | Native | -- | Native |
95
- | Permissions | Native | Partial | -- | -- | -- | -- | Partial | -- | -- | -- | -- | -- |
243
+ Subpath imports are available when you want narrower bundles:
96
244
 
97
- See the [full feature matrix docs](https://samplexbro.github.io/agentsmesh/reference/supported-tools/) for details on native vs. embedded support.
245
+ ```ts
246
+ import { generate, lint, diff, check, loadConfig } from 'agentsmesh/engine';
247
+ import { loadCanonical } from 'agentsmesh/canonical';
248
+ import { getAllDescriptors } from 'agentsmesh/targets';
249
+ ```
98
250
 
99
- **Note:** The canonical root rule always lives at `.agentsmesh/rules/_root.md`. Some targets write that content to a tool-specific main file named `general` (for example `.continue/rules/general.md` and `.agents/rules/general.md` for Antigravity) instead of `_root.md` on disk.
251
+ Every public symbol resolves to a real `.d.ts` under strict TypeScript. Full reference at [agentsmesh.dev/reference/programmatic-api](https://samplexbro.github.io/agentsmesh/reference/programmatic-api/) entrypoint table, every function signature, the typed error taxonomy, and the canonical/target type lists. ESM-only; requires Node.js 20+.
100
252
 
101
253
  ---
102
254
 
103
255
  ## Documentation
104
256
 
105
- The documentation site covers everything in detail:
257
+ - **[Getting Started](https://samplexbro.github.io/agentsmesh/getting-started/installation/)** installation, quick start
258
+ - **[Canonical Config](https://samplexbro.github.io/agentsmesh/canonical-config/)** — rules, commands, agents, skills, MCP, hooks, ignore, permissions
259
+ - **[CLI Reference](https://samplexbro.github.io/agentsmesh/cli/)** — `init`, `generate`, `import`, `install`, `diff`, `lint`, `watch`, `check`, `merge`, `matrix`, `plugin`, `target`
260
+ - **[Configuration](https://samplexbro.github.io/agentsmesh/configuration/agentsmesh-yaml/)** — `agentsmesh.yaml`, local overrides, extends, collaboration, conversions
261
+ - **[Guides](https://samplexbro.github.io/agentsmesh/guides/existing-project/)** — adopting in existing projects · multi-tool teams · sharing config · CI drift detection · community packs · **building plugins**
262
+ - **[Reference](https://samplexbro.github.io/agentsmesh/reference/generation-pipeline/)** — supported tools matrix · generation pipeline · managed embedding
106
263
 
107
- - **[Getting Started](https://samplexbro.github.io/agentsmesh/getting-started/installation/)** -- installation, quick start
108
- - **[Canonical Config](https://samplexbro.github.io/agentsmesh/canonical-config/)** -- rules, commands, agents, skills, MCP, hooks, ignore, permissions
109
- - **[CLI Reference](https://samplexbro.github.io/agentsmesh/cli/)** -- all commands: init, generate, import, install, diff, lint, watch, check, merge, matrix
110
- - **[Configuration](https://samplexbro.github.io/agentsmesh/configuration/agentsmesh-yaml/)** -- agentsmesh.yaml, local overrides, extends, collaboration, conversions
111
- - **[Guides](https://samplexbro.github.io/agentsmesh/guides/existing-project/)** -- adopting in existing projects, multi-tool teams, sharing config, CI drift detection, community packs
112
- - **[Reference](https://samplexbro.github.io/agentsmesh/reference/generation-pipeline/)** -- how the generation pipeline works
264
+ ---
113
265
 
114
266
  ## Contributing
115
267
 
116
- Contributions are welcome. Keep changes small, test them, and prefer editing canonical `.agentsmesh/` sources over generated files.
268
+ Contributions welcome. Keep changes small, test them, and prefer editing canonical `.agentsmesh/` sources over generated files.
117
269
 
118
270
  ```bash
119
271
  pnpm install
@@ -0,0 +1,146 @@
1
+ /** Hook definition */
2
+ interface HookEntry {
3
+ matcher: string;
4
+ command: string;
5
+ timeout?: number;
6
+ type?: 'command' | 'prompt';
7
+ prompt?: string;
8
+ }
9
+ interface Hooks {
10
+ PreToolUse?: HookEntry[];
11
+ PostToolUse?: HookEntry[];
12
+ Notification?: HookEntry[];
13
+ UserPromptSubmit?: HookEntry[];
14
+ SubagentStart?: HookEntry[];
15
+ SubagentStop?: HookEntry[];
16
+ [key: string]: HookEntry[] | undefined;
17
+ }
18
+
19
+ interface BaseMcpServer {
20
+ description?: string;
21
+ type: string;
22
+ env: Record<string, string>;
23
+ }
24
+ /** Stdio MCP server configuration */
25
+ interface StdioMcpServer extends BaseMcpServer {
26
+ command: string;
27
+ args: string[];
28
+ }
29
+ /** URL-based MCP server configuration (HTTP/SSE/streamable HTTP) */
30
+ interface UrlMcpServer extends BaseMcpServer {
31
+ url: string;
32
+ headers: Record<string, string>;
33
+ }
34
+ /** MCP server configuration */
35
+ type McpServer = StdioMcpServer | UrlMcpServer;
36
+ interface McpConfig {
37
+ mcpServers: Record<string, McpServer>;
38
+ }
39
+
40
+ /** A parsed rule from .agentsmesh/rules/ (glob: *.md) */
41
+ interface CanonicalRule {
42
+ /** Source file path (for error reporting) */
43
+ source: string;
44
+ /** If true, this is the root/always-applied rule */
45
+ root: boolean;
46
+ /** Which targets receive this rule. Empty = all */
47
+ targets: string[];
48
+ /** Human description for AI context */
49
+ description: string;
50
+ /** Glob patterns for file scoping */
51
+ globs: string[];
52
+ /** Markdown body content */
53
+ body: string;
54
+ /** Activation mode hint for tools that support it (e.g. Windsurf) */
55
+ trigger?: 'always_on' | 'model_decision' | 'glob' | 'manual';
56
+ /**
57
+ * Codex CLI: `advisory` (default) → nested `AGENTS.md` / `AGENTS.override.md`.
58
+ * `execution` → `.codex/rules/{slug}.rules` body must be Starlark (`prefix_rule`, …).
59
+ * @see docs/agent-structures/codex-cli-project-level-advanced.md §6.2, §6.10
60
+ */
61
+ codexEmit?: 'advisory' | 'execution';
62
+ /**
63
+ * Codex nested instruction filename: `override` → `AGENTS.override.md` (advisory only).
64
+ */
65
+ codexInstructionVariant?: 'default' | 'override';
66
+ }
67
+ /** A parsed command from .agentsmesh/commands/ (glob: *.md) */
68
+ interface CanonicalCommand {
69
+ source: string;
70
+ /** Command name (derived from filename) */
71
+ name: string;
72
+ description: string;
73
+ /** Tool permissions: ["Read", "Grep", "Bash(git diff)"] */
74
+ allowedTools: string[];
75
+ /** When true, also emit ~/.claude/output-styles/{name}.md in Claude global mode */
76
+ outputStyle?: boolean;
77
+ body: string;
78
+ }
79
+ /** A parsed subagent from .agentsmesh/agents/ (glob: *.md) */
80
+ interface CanonicalAgent {
81
+ source: string;
82
+ name: string;
83
+ description: string;
84
+ /** Tools this agent can use */
85
+ tools: string[];
86
+ /** Tools explicitly denied */
87
+ disallowedTools: string[];
88
+ /** AI model preference */
89
+ model: string;
90
+ /** Permission mode */
91
+ permissionMode: string;
92
+ /** Max conversation turns */
93
+ maxTurns: number;
94
+ /** MCP servers available to this agent */
95
+ mcpServers: string[];
96
+ /** Hooks specific to this agent */
97
+ hooks: Hooks;
98
+ /** Skills available to this agent */
99
+ skills: string[];
100
+ /** Memory file path */
101
+ memory: string;
102
+ /** System prompt (markdown body) */
103
+ body: string;
104
+ /** When true, also emit ~/.claude/output-styles/{name}.md in Claude global mode */
105
+ outputStyle?: boolean;
106
+ }
107
+ /** Supporting file for a skill */
108
+ interface SkillSupportingFile {
109
+ relativePath: string;
110
+ absolutePath: string;
111
+ /** File content (utf-8) for generation; empty if unreadable */
112
+ content: string;
113
+ }
114
+ /** A parsed skill from .agentsmesh/skills/{name}/SKILL.md */
115
+ interface CanonicalSkill {
116
+ source: string;
117
+ /** Skill name (derived from directory name) */
118
+ name: string;
119
+ description: string;
120
+ /** SKILL.md content */
121
+ body: string;
122
+ /** Paths to supporting files (relative to skill dir) */
123
+ supportingFiles: SkillSupportingFile[];
124
+ }
125
+ /** Permission allow/deny/ask lists */
126
+ interface Permissions {
127
+ allow: string[];
128
+ deny: string[];
129
+ /** Present in parsed YAML; omitted in some legacy fixtures */
130
+ ask?: string[];
131
+ }
132
+ /** Ignore patterns (gitignore syntax lines) */
133
+ type IgnorePatterns = string[];
134
+ /** All canonical files loaded from .agentsmesh/ */
135
+ interface CanonicalFiles {
136
+ rules: CanonicalRule[];
137
+ commands: CanonicalCommand[];
138
+ agents: CanonicalAgent[];
139
+ skills: CanonicalSkill[];
140
+ mcp: McpConfig | null;
141
+ permissions: Permissions | null;
142
+ hooks: Hooks | null;
143
+ ignore: IgnorePatterns;
144
+ }
145
+
146
+ export type { CanonicalAgent as C, HookEntry as H, IgnorePatterns as I, McpConfig as M, Permissions as P, SkillSupportingFile as S, UrlMcpServer as U, CanonicalCommand as a, CanonicalFiles as b, CanonicalRule as c, CanonicalSkill as d, Hooks as e, McpServer as f, StdioMcpServer as g };
@@ -0,0 +1,24 @@
1
+ import { b as CanonicalFiles } from './canonical-types-CZwrJoBX.js';
2
+ export { C as CanonicalAgent, a as CanonicalCommand, c as CanonicalRule, d as CanonicalSkill, H as HookEntry, e as Hooks, I as IgnorePatterns, M as McpConfig, f as McpServer, P as Permissions, S as SkillSupportingFile, g as StdioMcpServer, U as UrlMcpServer } from './canonical-types-CZwrJoBX.js';
3
+
4
+ /**
5
+ * Load all canonical files from a canonical directory into CanonicalFiles.
6
+ */
7
+
8
+ /**
9
+ * Load all canonical files from a canonical directory or project root.
10
+ * Missing directories/files yield empty arrays or null as per each parser.
11
+ *
12
+ * @param canonicalDirOrProjectRoot - Absolute path to canonical directory or project root
13
+ * @returns CanonicalFiles with all parsed data
14
+ */
15
+ declare function loadCanonicalFiles(canonicalDirOrProjectRoot: string): Promise<CanonicalFiles>;
16
+
17
+ /**
18
+ * Public API — canonical loading (package.json "exports"."./canonical").
19
+ */
20
+
21
+ /** Load `.agentsmesh/` from a project root (or an explicit canonical directory). */
22
+ declare function loadCanonical(projectRoot: string): Promise<CanonicalFiles>;
23
+
24
+ export { CanonicalFiles, loadCanonical, loadCanonicalFiles };