agentsmesh 0.6.0 → 0.7.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 +26 -4
- package/README.md +13 -20
- package/dist/canonical.d.ts +22 -5
- package/dist/canonical.js +12893 -56
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +146 -144
- package/dist/engine.d.ts +26 -17
- package/dist/engine.js +5752 -2893
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5502 -2929
- package/dist/index.js.map +1 -1
- package/dist/{canonical-types-CZwrJoBX.d.ts → schema-B7ZSqkrS.d.ts} +110 -1
- package/dist/{target-descriptor-DjHhww11.d.ts → target-descriptor-COp3nil6.d.ts} +13 -132
- package/dist/targets.d.ts +3 -3
- package/dist/targets.js +4072 -2224
- package/dist/targets.js.map +1 -1
- package/package.json +2 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5179de0: Native Windows support is now first-class. `windows-latest` × Node 22 joins `ubuntu-latest` × Node 20/22/24 and `macos-latest` × Node 22 in the CI quality matrix, the `os: ["darwin", "linux"]` restriction is removed from `package.json`, and the README/website call out Linux, macOS, and Windows as equally supported platforms.
|
|
8
|
+
|
|
9
|
+
The install/pack persistence layer is now separator-agnostic: `installs.yaml` `source`/`path`/`paths` and `pack.yaml` local-source fields are always serialized as POSIX through the new `src/install/core/portable-paths.ts` helper, regardless of the host separator. `agentsmesh install <local-path>` parses Windows paths (including cross-drive sources and `.agentsmesh/` segments split by backslashes) into portable manifest entries, and legacy manifests written on Windows are normalized on read so existing repos converge without migration. `agentsmesh import --from windsurf` and `--from codex-cli` now detect nested `AGENTS.md` / `AGENTS.override.md` via `basename(srcPath)`; the previous `srcPath.endsWith('/AGENTS.md')` check silently skipped nested rules on Windows because `readDirRecursive` returns native separators. `scripts/flake-check.ts` resolves `pnpm.cmd` on `win32`, and `tests/helpers/node-bin.ts` is the single source for `node_modules/.bin/<name>` shim resolution across platforms.
|
|
10
|
+
|
|
11
|
+
A new Windows path-safety contract (`src/utils/filesystem/windows-path-safety.ts` plus `tests/contract/windows-path-safety.matrix.test.ts`) asserts that every generated artifact path emitted by every builtin target — in both project and global scope — survives a Windows clone/checkout/write cycle. Reserved device names (case-insensitive `CON`/`PRN`/`AUX`/`NUL`/`COM1-9`/`LPT1-9`), reserved characters (`<>:"|?*` plus ASCII control chars), trailing dots/spaces, and case-only collisions on default NTFS / APFS volumes are now regression-locked across 48 contract assertions.
|
|
12
|
+
|
|
13
|
+
`agentsmesh lint` warns when `hooks.yaml` is non-empty for `cline` or `copilot`, because both targets emit `.sh` wrapper scripts (`.clinerules/hooks/*.sh`, `.github/hooks/scripts/*.sh`) with `#!/usr/bin/env bash` headers that need a POSIX shell (git-bash or WSL) to execute on Windows. Other targets (claude-code, cursor, windsurf, kiro, gemini-cli) embed the user's `command` string directly into JSON config and stay fully portable. The Windows portability story for hooks is documented in `website/src/content/docs/canonical-config/hooks.mdx`.
|
|
14
|
+
|
|
15
|
+
Also fixed: `tests/integration/lint.integration.test.ts` stops hardcoding `shell: '/bin/sh'` plus `2>&1` for stderr capture (which ENOENTed on Windows runners) — it now spawns `process.execPath` via `spawnSync` and concatenates the captured streams.
|
|
16
|
+
|
|
17
|
+
Fixed a long-latent race in `acquireProcessLock` (`src/utils/filesystem/process-lock.ts`) that surfaced the test failure `ENOENT: rename .agentsmesh/.lock.tmp -> .agentsmesh/.lock` under parallel `agentsmesh generate` invocations. Between `mkdir(lockPath)` succeeding and `writeFile(holder.json)` completing, a competing acquirer would treat the metadata-less lock dir as orphaned, evict it, and silently steal the mutex — letting both processes into the critical section and racing their `writeFileAtomic` writes. The lock now treats lock dirs younger than a 2-second grace window as held even when `holder.json` is missing, and only evicts genuinely orphaned older directories. Covered by `tests/integration/generate-process-lock.integration.test.ts` plus a new unit test in `tests/unit/utils/process-lock.test.ts`.
|
|
18
|
+
|
|
19
|
+
Fixed a generator-side Windows path bug surfaced by the Windows CI matrix: rule slug extraction in `src/targets/{claude-code,codex-cli,copilot,cursor,continue,catalog}/...` used `rule.source.split('/').pop()!.replace(/\.md$/, '')`, which on Windows where `rule.source` uses `\` separators returned the _entire absolute path_ and produced `.cursor\rules\C:\Users\...\.agentsmesh\rules` ENOENT crashes during `writeFileAtomic`. All 10 occurrences across 8 files now use `basename(rule.source, '.md')` from `node:path`, which is platform-aware. Watch mode in `src/cli/commands/watch.ts` now sets `usePolling: process.platform === 'win32'` because Windows native `ReadDirectoryChangesW` misses events for files newly created in just-watched subdirectories under the GitHub Actions `AppData\Local\Temp` short-name path.
|
|
20
|
+
|
|
21
|
+
Fixed a second Windows path bug in the reference rewriter: `buildArtifactPathMap`, `addPackSkillArtifactMappings`, `applyCopilotInstructionArtifactRefs`, `collectPlannedPaths`, and the validator in `src/core/reference/validate-generated-markdown-links.ts` were using native `node:path.join`/`normalize` directly. The rebaser itself uses `pathApi(projectRoot)` which picks `win32` or `posix` based on the _path format_, not the host platform. Synthetic POSIX project roots (used in unit tests) and real Windows project roots could produce mismatched keys vs. lookups, so the rewriter silently no-op'd. All five sites now share one `pathApi(projectRoot)` so map keys and lookups always agree.
|
|
22
|
+
|
|
3
23
|
## 0.6.0 - 2026-04-25
|
|
4
24
|
|
|
5
25
|
### Added
|
|
@@ -31,13 +51,14 @@
|
|
|
31
51
|
- **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
52
|
- **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
53
|
- `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.
|
|
54
|
+
- `loadProjectContext(projectRoot, options?)` — loads the same execution context the CLI uses: scoped config, plugin descriptors, `extends`, packs, and local canonical content. The returned object is directly usable with `generate`, `lint`, and `diff`.
|
|
34
55
|
- `lint(opts)` — runs target linters, returns `{ diagnostics, hasErrors }`. Pure: no I/O, no logging.
|
|
35
56
|
- `diff(ctx)` — runs generate internally, returns `{ results, diffs, summary }`. Plus `computeDiff(results)` and `formatDiffSummary(summary)` helpers for callers that already have generate results.
|
|
36
57
|
- `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
58
|
- 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` (
|
|
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
|
|
59
|
+
- **Programmatic API runtime coverage** — new `tests/integration/programmatic-api.integration.test.ts` (26 strict assertions) exercises every public function and every error class against real fixture state: shape inventory, `loadConfig` happy/missing/invalid-schema paths, `loadCanonical`, `loadProjectContext` CLI-parity loading, `generate` with exact-paths assertion, `targetFilter` narrowing, `registerTargetDescriptor` plugin wiring through `generate`, plugin `importFrom` end-to-end, `lint` shape, `diff` + `computeDiff` summary parity, `check` for `hasLock=false` / `inSync=true` / modified-drift, immutable catalog inspection, `resolveOutputCollisions`. Replaces the previous shallow `public-export-smoke.integration.test.ts` (which only checked `typeof === 'function'` and used loose `length > 0` assertions).
|
|
60
|
+
- **Programmatic API type contract coverage** — `tests/consumer-smoke/src/smoke.ts` extended to import every new symbol (`loadProjectContext`, `loadConfig`, `loadConfigFromDirectory`, `loadCanonical`, `loadCanonicalFiles`, `lint`, `diff`, `check`, `computeDiff`, `formatDiffSummary`, `ProjectContext`, `LoadProjectContextOptions`, `LoadCanonicalOptions`, `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.
|
|
61
|
+
- **Dedicated Programmatic API reference page** at `website/src/content/docs/reference/programmatic-api.mdx` — entrypoint table, the recommended `loadProjectContext` generate pattern, per-function signatures and examples for `loadProjectContext` / `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 and matches CLI setup for plugins, `extends`, and packs.
|
|
41
62
|
|
|
42
63
|
### Changed
|
|
43
64
|
|
|
@@ -65,9 +86,10 @@
|
|
|
65
86
|
|
|
66
87
|
### Fixed
|
|
67
88
|
|
|
89
|
+
- **Programmatic API parity gaps** — `loadCanonical()` now mirrors CLI canonical loading by merging `extends` and packs when config is available (`loadCanonicalFiles()` remains the local-only helper); public `importFrom()` now resolves registered plugin descriptors as well as built-ins; plugin `buildImportPaths()` hooks now participate in shared import reference normalization; `getTargetCatalog()` returns immutable catalog snapshots instead of the live built-in array; descriptor registration now rejects non-`none` capabilities that do not have a generator or settings sidecar emitter.
|
|
68
90
|
- **`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
91
|
- **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 (
|
|
92
|
+
- **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
93
|
|
|
72
94
|
## 0.5.0 - 2026-04-23
|
|
73
95
|
|
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ Edit once — generate `CLAUDE.md`, `AGENTS.md`, `.cursor/rules`, `.github/copil
|
|
|
38
38
|
|
|
39
39
|
## Install
|
|
40
40
|
|
|
41
|
-
Requires **Node.js 20+**. Supported platforms: **Linux** and **
|
|
41
|
+
Requires **Node.js 20+**. Supported platforms: **Linux**, **macOS**, and **Windows**.
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
44
|
npm install -D agentsmesh # or: pnpm add -D / yarn add -D
|
|
@@ -195,8 +195,7 @@ AgentsMesh is also importable as a typed ESM library, so you can drive every CLI
|
|
|
195
195
|
|
|
196
196
|
```ts
|
|
197
197
|
import {
|
|
198
|
-
|
|
199
|
-
loadCanonical,
|
|
198
|
+
loadProjectContext,
|
|
200
199
|
generate,
|
|
201
200
|
lint,
|
|
202
201
|
diff,
|
|
@@ -209,30 +208,24 @@ import {
|
|
|
209
208
|
type TargetDescriptor,
|
|
210
209
|
} from 'agentsmesh';
|
|
211
210
|
|
|
212
|
-
//
|
|
213
|
-
const
|
|
214
|
-
const
|
|
215
|
-
const results: GenerateResult[] = await generate({
|
|
216
|
-
config,
|
|
217
|
-
canonical,
|
|
218
|
-
projectRoot: process.cwd(),
|
|
219
|
-
scope: 'project',
|
|
220
|
-
});
|
|
211
|
+
// CLI-parity generate pattern: config, plugins, extends, packs, then generation.
|
|
212
|
+
const project = await loadProjectContext(process.cwd());
|
|
213
|
+
const results: GenerateResult[] = await generate(project);
|
|
221
214
|
|
|
222
215
|
// Lint — pure, returns structured diagnostics + hasErrors.
|
|
223
|
-
const lintResult: LintResult = await lint(
|
|
216
|
+
const lintResult: LintResult = await lint(project);
|
|
224
217
|
|
|
225
218
|
// Diff — runs generate internally, returns unified diffs + summary.
|
|
226
|
-
const { diffs, summary } = await diff(
|
|
219
|
+
const { diffs, summary } = await diff(project);
|
|
227
220
|
|
|
228
221
|
// Check — lock-file vs current canonical drift report.
|
|
229
222
|
const drift: LockSyncReport = await check({
|
|
230
|
-
config,
|
|
231
|
-
configDir:
|
|
232
|
-
canonicalDir:
|
|
223
|
+
config: project.config,
|
|
224
|
+
configDir: project.configDir,
|
|
225
|
+
canonicalDir: project.canonicalDir,
|
|
233
226
|
});
|
|
234
227
|
|
|
235
|
-
// Import a
|
|
228
|
+
// Import a built-in or registered plugin target back into canonical form.
|
|
236
229
|
await importFrom('claude-code', { root: process.cwd() });
|
|
237
230
|
|
|
238
231
|
// Register a custom target descriptor at runtime (same shape plugins ship).
|
|
@@ -243,8 +236,8 @@ registerTargetDescriptor(myDescriptor);
|
|
|
243
236
|
Subpath imports are available when you want narrower bundles:
|
|
244
237
|
|
|
245
238
|
```ts
|
|
246
|
-
import { generate, lint, diff, check,
|
|
247
|
-
import { loadCanonical } from 'agentsmesh/canonical';
|
|
239
|
+
import { generate, lint, diff, check, loadProjectContext } from 'agentsmesh/engine';
|
|
240
|
+
import { loadCanonical, loadCanonicalFiles } from 'agentsmesh/canonical';
|
|
248
241
|
import { getAllDescriptors } from 'agentsmesh/targets';
|
|
249
242
|
```
|
|
250
243
|
|
package/dist/canonical.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { b as CanonicalFiles } from './
|
|
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 './
|
|
1
|
+
import { b as CanonicalFiles, V as ValidatedConfig } from './schema-B7ZSqkrS.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 './schema-B7ZSqkrS.js';
|
|
3
|
+
import 'zod';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Load all canonical files from a canonical directory into CanonicalFiles.
|
|
@@ -18,7 +19,23 @@ declare function loadCanonicalFiles(canonicalDirOrProjectRoot: string): Promise<
|
|
|
18
19
|
* Public API — canonical loading (package.json "exports"."./canonical").
|
|
19
20
|
*/
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
interface LoadCanonicalOptions {
|
|
23
|
+
/** Preloaded config. Must be provided together with `configDir`. */
|
|
24
|
+
readonly config?: ValidatedConfig;
|
|
25
|
+
/** Directory containing `agentsmesh.yaml`. Must be provided together with `config`. */
|
|
26
|
+
readonly configDir?: string;
|
|
27
|
+
/** Override canonical directory; defaults to `<configDir>/.agentsmesh`. */
|
|
28
|
+
readonly canonicalDir?: string;
|
|
29
|
+
/** Defaults to true when config is available. Set false for local-only `.agentsmesh/`. */
|
|
30
|
+
readonly includeExtends?: boolean;
|
|
31
|
+
/** Refresh remote extend cache before loading. */
|
|
32
|
+
readonly refreshRemoteCache?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Load canonical content for a project. When an `agentsmesh.yaml` can be found,
|
|
36
|
+
* this mirrors CLI generation by merging extends and installed packs before
|
|
37
|
+
* local `.agentsmesh/` content. Use `loadCanonicalFiles()` for local-only reads.
|
|
38
|
+
*/
|
|
39
|
+
declare function loadCanonical(projectRoot: string, options?: LoadCanonicalOptions): Promise<CanonicalFiles>;
|
|
23
40
|
|
|
24
|
-
export { CanonicalFiles, loadCanonical, loadCanonicalFiles };
|
|
41
|
+
export { CanonicalFiles, type LoadCanonicalOptions, loadCanonical, loadCanonicalFiles };
|