agentsmesh 0.22.0 → 0.24.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.
@@ -145,6 +145,14 @@ interface CanonicalFiles {
145
145
  ignore: IgnorePatterns;
146
146
  }
147
147
 
148
+ /** Cherry-pick resource names within array features (extends.install + merge). */
149
+ declare const extendPickSchema: z.ZodObject<{
150
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
151
+ commands: z.ZodOptional<z.ZodArray<z.ZodString>>;
152
+ rules: z.ZodOptional<z.ZodArray<z.ZodString>>;
153
+ agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
154
+ }, z.core.$strict>;
155
+ type ExtendPick = z.infer<typeof extendPickSchema>;
148
156
  /**
149
157
  * Zod schema for `agentsmesh.yaml` config validation.
150
158
  *
@@ -305,4 +313,4 @@ declare const configSchema: z.ZodObject<{
305
313
  }, z.core.$strip>;
306
314
  type ValidatedConfig = z.infer<typeof configSchema>;
307
315
 
308
- export type { CanonicalAgent as C, HookEntry as H, IgnorePatterns as I, McpConfig as M, Permissions as P, SkillSupportingFile as S, UrlMcpServer as U, ValidatedConfig as V, CanonicalCommand as a, CanonicalFiles as b, CanonicalRule as c, CanonicalSkill as d, Hooks as e, McpServer as f, StdioMcpServer as g };
316
+ export type { CanonicalAgent as C, ExtendPick as E, HookEntry as H, IgnorePatterns as I, McpConfig as M, Permissions as P, SkillSupportingFile as S, UrlMcpServer as U, ValidatedConfig as V, CanonicalCommand as a, CanonicalFiles as b, CanonicalRule as c, CanonicalSkill as d, Hooks as e, McpServer as f, StdioMcpServer as g };
@@ -1,4 +1,4 @@
1
- import { b as CanonicalFiles, c as CanonicalRule, V as ValidatedConfig } from './schema-CLmR2JOb.js';
1
+ import { b as CanonicalFiles, c as CanonicalRule, V as ValidatedConfig, E as ExtendPick } from './schema-CzaoYJlG.js';
2
2
 
3
3
  /** Result of generating files for a target */
4
4
  interface GenerateResult {
@@ -171,6 +171,11 @@ interface ImportFeatureSpec {
171
171
  readonly markAsRoot?: boolean;
172
172
  /** For `flatFile` and `mcpJson`: canonical destination filename. */
173
173
  readonly canonicalFilename?: string;
174
+ /**
175
+ * For `mcpJson` mode: the top-level JSON key holding the server map in the
176
+ * source file. Defaults to `mcpServers`. VS Code / Copilot use `servers`.
177
+ */
178
+ readonly mcpServersKey?: string;
174
179
  }
175
180
  interface TargetImporterDescriptor {
176
181
  readonly rules?: ImportFeatureSpec | readonly ImportFeatureSpec[];
@@ -289,6 +294,54 @@ interface TargetMetadata {
289
294
  /** One-line description used in tool lists and tables. */
290
295
  readonly shortDescription: string;
291
296
  }
297
+ /**
298
+ * How a native-install pick rule derives canonical entity names from the files
299
+ * found under its directory.
300
+ * - `basename`: recursively collect files ending in `suffix`; name = basename
301
+ * minus `suffix` (e.g. `.md`, `.mdc`).
302
+ * - `skillDir`: skill tree — `{name}/SKILL.md` plus flat top-level `*.md`.
303
+ * - `firstSegment`: the single segment after the rule prefix is the name
304
+ * (e.g. `.claude/skills/{name}/...`).
305
+ */
306
+ type NativePickStrategy = {
307
+ readonly kind: 'basename';
308
+ readonly suffix: string;
309
+ } | {
310
+ readonly kind: 'skillDir';
311
+ } | {
312
+ readonly kind: 'firstSegment';
313
+ };
314
+ /** Maps a native directory prefix to a canonical feature + name strategy. */
315
+ interface NativePickRule {
316
+ /** POSIX path prefix under the repo root; matches the dir or any subpath. */
317
+ readonly prefix: string;
318
+ /** Canonical feature the matched files contribute to. */
319
+ readonly feature: 'commands' | 'rules' | 'agents' | 'skills';
320
+ /** How to derive entity names from the matched directory. */
321
+ readonly strategy: NativePickStrategy;
322
+ }
323
+ /** Frontmatter-dialect hint for `.mdc` flat-file target inference. */
324
+ interface NativeDialectHint {
325
+ /** Frontmatter key whose presence identifies this target. */
326
+ readonly frontmatterKey: string;
327
+ }
328
+ /**
329
+ * Descriptor-driven data for the install subsystem's native-path inference.
330
+ * Replaces the per-target `if (target === '…')` ladders (arch §3.1): each
331
+ * target declares its own pick paths / dialect hints instead.
332
+ */
333
+ interface NativeInstallSupport {
334
+ /** Ordered pick-path rules; the first matching prefix wins. */
335
+ readonly pickPaths?: readonly NativePickRule[];
336
+ /**
337
+ * Escape hatch for irreducibly custom inference (e.g. Gemini's `:`-namespaced
338
+ * command names, Copilot's overlapping `.github/*` dirs). When present it
339
+ * fully owns inference for this target and `pickPaths` is ignored.
340
+ */
341
+ readonly inferPick?: (repoRoot: string, posixPath: string) => Promise<ExtendPick>;
342
+ /** Frontmatter-dialect hints for `.mdc` flat-file target inference. */
343
+ readonly dialectHints?: readonly NativeDialectHint[];
344
+ }
292
345
  /**
293
346
  * Full self-describing target descriptor.
294
347
  * Bundles everything needed to generate, import, lint, and detect a target.
@@ -347,10 +400,22 @@ interface TargetDescriptor {
347
400
  readonly sharedArtifacts?: {
348
401
  readonly [pathPrefix: string]: 'owner' | 'consumer';
349
402
  };
403
+ /**
404
+ * Descriptor-driven native-install inference data (extends.pick from native
405
+ * files, `.mdc` dialect hints). Consumed by `src/install/native` and
406
+ * `src/install/manual` so those modules carry no target-id literals.
407
+ */
408
+ readonly nativeInstall?: NativeInstallSupport;
350
409
  /**
351
410
  * Optional native settings sidecar (e.g. Gemini `.gemini/settings.json` when embedded features are on).
411
+ *
412
+ * `enabledFeatures` is the active feature set for this generate run. Emitters
413
+ * MUST gate every settings key on its corresponding feature (mcpServers ->
414
+ * `mcp`, hooks -> `hooks`, agents -> `agents`, permissions -> `permissions`,
415
+ * ignore-derived keys -> `ignore`) so a disabled feature never leaks into the
416
+ * sidecar.
352
417
  */
353
- readonly emitScopedSettings?: (canonical: CanonicalFiles, scope: TargetLayoutScope) => readonly {
418
+ readonly emitScopedSettings?: (canonical: CanonicalFiles, scope: TargetLayoutScope, enabledFeatures: ReadonlySet<string>) => readonly {
354
419
  readonly path: string;
355
420
  readonly content: string;
356
421
  }[];
package/dist/targets.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { e as TargetDescriptor, h as TargetLayoutScope, C as ContentNormalizer, d as ImportResult } from './target-descriptor-CkLWz3Xk.js';
2
- export { E as ExtraRuleOutputContext, a as ExtraRuleOutputResolver, F as FeatureLinter, b as GeneratedOutputMerger, c as GlobalTargetSupport, I as ImportPathBuilder, R as RuleLinter, S as ScopeExtrasFn, T as TargetCapabilities, f as TargetGenerators, g as TargetLayout, i as TargetLintHooks, j as TargetManagedOutputs, k as TargetOutputFamily, l as TargetPathResolvers } from './target-descriptor-CkLWz3Xk.js';
3
- import './schema-CLmR2JOb.js';
1
+ import { e as TargetDescriptor, h as TargetLayoutScope, C as ContentNormalizer, d as ImportResult } from './target-descriptor-ItDY3NR0.js';
2
+ export { E as ExtraRuleOutputContext, a as ExtraRuleOutputResolver, F as FeatureLinter, b as GeneratedOutputMerger, c as GlobalTargetSupport, I as ImportPathBuilder, R as RuleLinter, S as ScopeExtrasFn, T as TargetCapabilities, f as TargetGenerators, g as TargetLayout, i as TargetLintHooks, j as TargetManagedOutputs, k as TargetOutputFamily, l as TargetPathResolvers } from './target-descriptor-ItDY3NR0.js';
3
+ import './schema-CzaoYJlG.js';
4
4
  import 'zod';
5
5
 
6
6
  /** Register a full target descriptor (for plugins). */