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.
@@ -1,3 +1,5 @@
1
+ import { z } from 'zod';
2
+
1
3
  /** Hook definition */
2
4
  interface HookEntry {
3
5
  matcher: string;
@@ -143,4 +145,111 @@ interface CanonicalFiles {
143
145
  ignore: IgnorePatterns;
144
146
  }
145
147
 
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 };
148
+ /** Zod schema for agentsmesh.yaml config validation */
149
+ declare const configSchema: z.ZodObject<{
150
+ version: z.ZodLiteral<1>;
151
+ targets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
152
+ "claude-code": "claude-code";
153
+ cursor: "cursor";
154
+ copilot: "copilot";
155
+ continue: "continue";
156
+ junie: "junie";
157
+ kiro: "kiro";
158
+ "gemini-cli": "gemini-cli";
159
+ cline: "cline";
160
+ "codex-cli": "codex-cli";
161
+ windsurf: "windsurf";
162
+ antigravity: "antigravity";
163
+ "roo-code": "roo-code";
164
+ }>>>;
165
+ features: z.ZodDefault<z.ZodArray<z.ZodEnum<{
166
+ rules: "rules";
167
+ commands: "commands";
168
+ agents: "agents";
169
+ skills: "skills";
170
+ mcp: "mcp";
171
+ hooks: "hooks";
172
+ ignore: "ignore";
173
+ permissions: "permissions";
174
+ }>>>;
175
+ extends: z.ZodDefault<z.ZodArray<z.ZodObject<{
176
+ name: z.ZodString;
177
+ source: z.ZodString;
178
+ version: z.ZodOptional<z.ZodString>;
179
+ target: z.ZodOptional<z.ZodEnum<{
180
+ "claude-code": "claude-code";
181
+ cursor: "cursor";
182
+ copilot: "copilot";
183
+ continue: "continue";
184
+ junie: "junie";
185
+ kiro: "kiro";
186
+ "gemini-cli": "gemini-cli";
187
+ cline: "cline";
188
+ "codex-cli": "codex-cli";
189
+ windsurf: "windsurf";
190
+ antigravity: "antigravity";
191
+ "roo-code": "roo-code";
192
+ }>>;
193
+ features: z.ZodArray<z.ZodEnum<{
194
+ rules: "rules";
195
+ commands: "commands";
196
+ agents: "agents";
197
+ skills: "skills";
198
+ mcp: "mcp";
199
+ hooks: "hooks";
200
+ ignore: "ignore";
201
+ permissions: "permissions";
202
+ }>>;
203
+ path: z.ZodOptional<z.ZodString>;
204
+ pick: z.ZodOptional<z.ZodObject<{
205
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
206
+ commands: z.ZodOptional<z.ZodArray<z.ZodString>>;
207
+ rules: z.ZodOptional<z.ZodArray<z.ZodString>>;
208
+ agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
209
+ }, z.core.$strict>>;
210
+ }, z.core.$strip>>>;
211
+ overrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
212
+ collaboration: z.ZodDefault<z.ZodObject<{
213
+ strategy: z.ZodDefault<z.ZodEnum<{
214
+ merge: "merge";
215
+ lock: "lock";
216
+ "last-wins": "last-wins";
217
+ }>>;
218
+ lock_features: z.ZodDefault<z.ZodArray<z.ZodString>>;
219
+ }, z.core.$strip>>;
220
+ conversions: z.ZodOptional<z.ZodObject<{
221
+ commands_to_skills: z.ZodOptional<z.ZodObject<{
222
+ 'codex-cli': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
223
+ project: z.ZodOptional<z.ZodBoolean>;
224
+ global: z.ZodOptional<z.ZodBoolean>;
225
+ }, z.core.$strict>]>>;
226
+ }, z.core.$loose>>;
227
+ agents_to_skills: z.ZodOptional<z.ZodObject<{
228
+ 'gemini-cli': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
229
+ project: z.ZodOptional<z.ZodBoolean>;
230
+ global: z.ZodOptional<z.ZodBoolean>;
231
+ }, z.core.$strict>]>>;
232
+ cline: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
233
+ project: z.ZodOptional<z.ZodBoolean>;
234
+ global: z.ZodOptional<z.ZodBoolean>;
235
+ }, z.core.$strict>]>>;
236
+ 'codex-cli': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
237
+ project: z.ZodOptional<z.ZodBoolean>;
238
+ global: z.ZodOptional<z.ZodBoolean>;
239
+ }, z.core.$strict>]>>;
240
+ windsurf: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
241
+ project: z.ZodOptional<z.ZodBoolean>;
242
+ global: z.ZodOptional<z.ZodBoolean>;
243
+ }, z.core.$strict>]>>;
244
+ }, z.core.$loose>>;
245
+ }, z.core.$strict>>;
246
+ plugins: z.ZodDefault<z.ZodArray<z.ZodObject<{
247
+ id: z.ZodString;
248
+ source: z.ZodString;
249
+ version: z.ZodOptional<z.ZodString>;
250
+ }, z.core.$strict>>>;
251
+ pluginTargets: z.ZodDefault<z.ZodArray<z.ZodString>>;
252
+ }, z.core.$strip>;
253
+ type ValidatedConfig = z.infer<typeof configSchema>;
254
+
255
+ 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 };
@@ -1,5 +1,4 @@
1
- import { b as CanonicalFiles, c as CanonicalRule } from './canonical-types-CZwrJoBX.js';
2
- import { z } from 'zod';
1
+ import { b as CanonicalFiles, c as CanonicalRule, V as ValidatedConfig } from './schema-B7ZSqkrS.js';
3
2
 
4
3
  /** Result of generating files for a target */
5
4
  interface GenerateResult {
@@ -37,113 +36,6 @@ interface LintDiagnostic {
37
36
  /** Feature support level per target */
38
37
  type SupportLevel = 'native' | 'embedded' | 'partial' | 'none';
39
38
 
40
- /** Zod schema for agentsmesh.yaml config validation */
41
- declare const configSchema: z.ZodObject<{
42
- version: z.ZodLiteral<1>;
43
- targets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
44
- "claude-code": "claude-code";
45
- cursor: "cursor";
46
- copilot: "copilot";
47
- continue: "continue";
48
- junie: "junie";
49
- kiro: "kiro";
50
- "gemini-cli": "gemini-cli";
51
- cline: "cline";
52
- "codex-cli": "codex-cli";
53
- windsurf: "windsurf";
54
- antigravity: "antigravity";
55
- "roo-code": "roo-code";
56
- }>>>;
57
- features: z.ZodDefault<z.ZodArray<z.ZodEnum<{
58
- rules: "rules";
59
- commands: "commands";
60
- agents: "agents";
61
- skills: "skills";
62
- mcp: "mcp";
63
- hooks: "hooks";
64
- ignore: "ignore";
65
- permissions: "permissions";
66
- }>>>;
67
- extends: z.ZodDefault<z.ZodArray<z.ZodObject<{
68
- name: z.ZodString;
69
- source: z.ZodString;
70
- version: z.ZodOptional<z.ZodString>;
71
- target: z.ZodOptional<z.ZodEnum<{
72
- "claude-code": "claude-code";
73
- cursor: "cursor";
74
- copilot: "copilot";
75
- continue: "continue";
76
- junie: "junie";
77
- kiro: "kiro";
78
- "gemini-cli": "gemini-cli";
79
- cline: "cline";
80
- "codex-cli": "codex-cli";
81
- windsurf: "windsurf";
82
- antigravity: "antigravity";
83
- "roo-code": "roo-code";
84
- }>>;
85
- features: z.ZodArray<z.ZodEnum<{
86
- rules: "rules";
87
- commands: "commands";
88
- agents: "agents";
89
- skills: "skills";
90
- mcp: "mcp";
91
- hooks: "hooks";
92
- ignore: "ignore";
93
- permissions: "permissions";
94
- }>>;
95
- path: z.ZodOptional<z.ZodString>;
96
- pick: z.ZodOptional<z.ZodObject<{
97
- skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
- commands: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
- rules: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
- agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
101
- }, z.core.$strict>>;
102
- }, z.core.$strip>>>;
103
- overrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
104
- collaboration: z.ZodDefault<z.ZodObject<{
105
- strategy: z.ZodDefault<z.ZodEnum<{
106
- merge: "merge";
107
- lock: "lock";
108
- "last-wins": "last-wins";
109
- }>>;
110
- lock_features: z.ZodDefault<z.ZodArray<z.ZodString>>;
111
- }, z.core.$strip>>;
112
- conversions: z.ZodOptional<z.ZodObject<{
113
- commands_to_skills: z.ZodOptional<z.ZodObject<{
114
- 'codex-cli': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
115
- project: z.ZodOptional<z.ZodBoolean>;
116
- global: z.ZodOptional<z.ZodBoolean>;
117
- }, z.core.$strict>]>>;
118
- }, z.core.$loose>>;
119
- agents_to_skills: z.ZodOptional<z.ZodObject<{
120
- 'gemini-cli': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
121
- project: z.ZodOptional<z.ZodBoolean>;
122
- global: z.ZodOptional<z.ZodBoolean>;
123
- }, z.core.$strict>]>>;
124
- cline: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
125
- project: z.ZodOptional<z.ZodBoolean>;
126
- global: z.ZodOptional<z.ZodBoolean>;
127
- }, z.core.$strict>]>>;
128
- 'codex-cli': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
129
- project: z.ZodOptional<z.ZodBoolean>;
130
- global: z.ZodOptional<z.ZodBoolean>;
131
- }, z.core.$strict>]>>;
132
- windsurf: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
133
- project: z.ZodOptional<z.ZodBoolean>;
134
- global: z.ZodOptional<z.ZodBoolean>;
135
- }, z.core.$strict>]>>;
136
- }, z.core.$loose>>;
137
- }, z.core.$strict>>;
138
- plugins: z.ZodDefault<z.ZodArray<z.ZodObject<{
139
- id: z.ZodString;
140
- source: z.ZodString;
141
- version: z.ZodOptional<z.ZodString>;
142
- }, z.core.$strict>>>;
143
- pluginTargets: z.ZodDefault<z.ZodArray<z.ZodString>>;
144
- }, z.core.$strip>;
145
- type ValidatedConfig = z.infer<typeof configSchema>;
146
-
147
39
  /** Serialization / projection variant for a canonical feature (see architecture review §3.3). */
148
40
  type FeatureFlavor = 'standard' | 'workflows' | 'settings-embedded' | 'projected-skills' | 'gh-actions-lite' | string;
149
41
  /** Normalized capability entry: support level plus optional serialization flavor. */
@@ -212,6 +104,11 @@ interface TargetOutputFamily {
212
104
  /** Explicit paths for additional root mirrors (Cursor, Gemini compat). */
213
105
  readonly explicitPaths?: readonly string[];
214
106
  }
107
+ interface ExtraRuleOutputContext {
108
+ readonly refs: ReadonlyMap<string, string>;
109
+ readonly scope: TargetLayoutScope;
110
+ }
111
+ type ExtraRuleOutputResolver = (rule: CanonicalFiles['rules'][number], context: ExtraRuleOutputContext) => readonly string[];
215
112
  /**
216
113
  * Path resolvers for the output reference map.
217
114
  * Each method returns a relative output path, or null to skip.
@@ -235,14 +132,10 @@ interface TargetManagedOutputs {
235
132
  interface TargetLayout {
236
133
  /** Primary root instruction artifact for this scope, if any. */
237
134
  readonly rootInstructionPath?: string;
238
- /**
239
- * Extra generated paths that should receive the same AgentsMesh root appendix as
240
- * `rootInstructionPath` (for example Cursor `AGENTS.md` / `.cursor/AGENTS.md`, Gemini `AGENTS.md`).
241
- * @deprecated Prefer `outputFamilies` with `kind: 'additional'`.
242
- */
243
- readonly additionalRootDecorationPaths?: readonly string[];
244
135
  /** Output families for rewrite cache keys and root decoration (see `layout-outputs.ts`). */
245
136
  readonly outputFamilies?: readonly TargetOutputFamily[];
137
+ /** Additional generated rule paths that share source ownership for reference rewriting. */
138
+ readonly extraRuleOutputPaths?: ExtraRuleOutputResolver;
246
139
  /** Optional renderer for scope-specific primary root instruction content. */
247
140
  readonly renderPrimaryRootInstruction?: (canonical: CanonicalFiles) => string;
248
141
  /** Target-native skills directory for this scope, if any. */
@@ -277,6 +170,7 @@ type RuleLinter = (canonical: CanonicalFiles, projectRoot: string, projectFiles:
277
170
  }) => LintDiagnostic[];
278
171
  /** Feature-specific lint hook signature. */
279
172
  type FeatureLinter = (canonical: CanonicalFiles, options?: unknown) => LintDiagnostic[];
173
+ type GeneratedOutputMerger = (existing: string | null, pending: GenerateResult | undefined, newContent: string, resolvedPath: string) => string | null;
280
174
  /** Optional per-feature lint hooks for target-specific validation. */
281
175
  interface TargetLintHooks {
282
176
  readonly commands?: FeatureLinter;
@@ -297,10 +191,8 @@ interface TargetDescriptor {
297
191
  readonly generators: TargetGenerators;
298
192
  /** Feature support levels */
299
193
  readonly capabilities: TargetCapabilities;
300
- /** Consolidated global-mode metadata (preferred over bare `global*` fields). */
194
+ /** Consolidated global-mode metadata. */
301
195
  readonly globalSupport?: GlobalTargetSupport;
302
- /** Optional global-scope feature support levels when they differ from project mode */
303
- readonly globalCapabilities?: TargetCapabilities;
304
196
  /** Message shown when import finds nothing for this target */
305
197
  readonly emptyImportMessage: string;
306
198
  /** Optional linter for canonical files */
@@ -309,8 +201,6 @@ interface TargetDescriptor {
309
201
  readonly lint?: TargetLintHooks;
310
202
  /** Project-scope target layout metadata */
311
203
  readonly project: TargetLayout;
312
- /** Optional global-scope layout (use `globalSupport.layout` when `globalSupport` is set). */
313
- readonly global?: TargetLayout;
314
204
  /**
315
205
  * Declares which embedded-capability features support user-configured conversion.
316
206
  * When the corresponding conversion is disabled in config, the feature generator is skipped.
@@ -319,21 +209,10 @@ interface TargetDescriptor {
319
209
  readonly commands?: true;
320
210
  readonly agents?: true;
321
211
  };
322
- /**
323
- * Optional hook for generating scope-specific extras beyond the standard feature loop.
324
- * Prefer `globalSupport.scopeExtras` for global-only extras.
325
- */
326
- readonly generateScopeExtras?: ScopeExtrasFn;
327
- /** @deprecated Use project.skillDir */
328
- readonly skillDir?: string;
329
- /** @deprecated Use project.paths */
330
- readonly paths?: TargetPathResolvers;
331
212
  /** Import reference map builder */
332
213
  readonly buildImportPaths: ImportPathBuilder;
333
214
  /** Filesystem paths used to detect this target during `init` */
334
215
  readonly detectionPaths: readonly string[];
335
- /** Optional filesystem paths used to detect this target in global scope during `init --global` */
336
- readonly globalDetectionPaths?: readonly string[];
337
216
  /**
338
217
  * Declares which shared artifact paths this target owns or consumes.
339
218
  * Used by the reference rewriter to select the correct artifact map for shared outputs.
@@ -349,6 +228,8 @@ interface TargetDescriptor {
349
228
  readonly path: string;
350
229
  readonly content: string;
351
230
  }[];
231
+ /** Optional target-specific merge strategy for generated outputs. */
232
+ readonly mergeGeneratedOutputContent?: GeneratedOutputMerger;
352
233
  /**
353
234
  * Async post-pass for hook generator outputs (e.g. Copilot hook script assets under `.github/hooks/`).
354
235
  */
@@ -361,4 +242,4 @@ interface TargetDescriptor {
361
242
  }[]>;
362
243
  }
363
244
 
364
- export type { FeatureLinter as F, GenerateResult as G, ImportPathBuilder as I, LintDiagnostic as L, RuleLinter as R, ScopeExtrasFn as S, TargetCapabilities as T, ValidatedConfig as V, GlobalTargetSupport as a, ImportResult as b, TargetDescriptor as c, TargetGenerators as d, TargetLayout as e, TargetLayoutScope as f, TargetLintHooks as g, TargetManagedOutputs as h, TargetOutputFamily as i, TargetPathResolvers as j };
245
+ export type { ExtraRuleOutputContext as E, FeatureLinter as F, GenerateResult as G, ImportPathBuilder as I, LintDiagnostic as L, RuleLinter as R, ScopeExtrasFn as S, TargetCapabilities as T, ExtraRuleOutputResolver as a, GeneratedOutputMerger as b, GlobalTargetSupport as c, ImportResult as d, TargetDescriptor as e, TargetGenerators as f, TargetLayout as g, TargetLayoutScope as h, TargetLintHooks as i, TargetManagedOutputs as j, TargetOutputFamily as k, TargetPathResolvers as l };
package/dist/targets.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { c as TargetDescriptor } from './target-descriptor-DjHhww11.js';
2
- export { F as FeatureLinter, a as GlobalTargetSupport, I as ImportPathBuilder, R as RuleLinter, S as ScopeExtrasFn, T as TargetCapabilities, d as TargetGenerators, e as TargetLayout, f as TargetLayoutScope, g as TargetLintHooks, h as TargetManagedOutputs, i as TargetOutputFamily, j as TargetPathResolvers } from './target-descriptor-DjHhww11.js';
3
- import './canonical-types-CZwrJoBX.js';
1
+ import { e as TargetDescriptor } from './target-descriptor-COp3nil6.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, h as TargetLayoutScope, i as TargetLintHooks, j as TargetManagedOutputs, k as TargetOutputFamily, l as TargetPathResolvers } from './target-descriptor-COp3nil6.js';
3
+ import './schema-B7ZSqkrS.js';
4
4
  import 'zod';
5
5
 
6
6
  /** Register a full target descriptor (for plugins). */