agentsmesh 0.6.0 → 0.8.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 +45 -4
- package/README.md +91 -57
- package/dist/canonical.d.ts +22 -5
- package/dist/canonical.js +13018 -56
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +159 -156
- package/dist/engine.d.ts +26 -17
- package/dist/engine.js +12477 -9317
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +12542 -9668
- package/dist/index.js.map +1 -1
- package/dist/{canonical-types-CZwrJoBX.d.ts → schema-BeGiBqbB.d.ts} +110 -1
- package/dist/{target-descriptor-DjHhww11.d.ts → target-descriptor-Cb9PXaxr.d.ts} +113 -130
- package/dist/targets.d.ts +3 -3
- package/dist/targets.js +10178 -8205
- package/dist/targets.js.map +1 -1
- package/package.json +6 -7
- package/schemas/agentsmesh.json +24 -24
- package/schemas/pack.json +8 -8
|
@@ -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
|
-
|
|
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
|
+
antigravity: "antigravity";
|
|
153
|
+
"claude-code": "claude-code";
|
|
154
|
+
cline: "cline";
|
|
155
|
+
"codex-cli": "codex-cli";
|
|
156
|
+
continue: "continue";
|
|
157
|
+
copilot: "copilot";
|
|
158
|
+
cursor: "cursor";
|
|
159
|
+
"gemini-cli": "gemini-cli";
|
|
160
|
+
junie: "junie";
|
|
161
|
+
kiro: "kiro";
|
|
162
|
+
"roo-code": "roo-code";
|
|
163
|
+
windsurf: "windsurf";
|
|
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
|
+
antigravity: "antigravity";
|
|
181
|
+
"claude-code": "claude-code";
|
|
182
|
+
cline: "cline";
|
|
183
|
+
"codex-cli": "codex-cli";
|
|
184
|
+
continue: "continue";
|
|
185
|
+
copilot: "copilot";
|
|
186
|
+
cursor: "cursor";
|
|
187
|
+
"gemini-cli": "gemini-cli";
|
|
188
|
+
junie: "junie";
|
|
189
|
+
kiro: "kiro";
|
|
190
|
+
"roo-code": "roo-code";
|
|
191
|
+
windsurf: "windsurf";
|
|
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 './
|
|
2
|
-
import { z } from 'zod';
|
|
1
|
+
import { b as CanonicalFiles, c as CanonicalRule, V as ValidatedConfig } from './schema-BeGiBqbB.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. */
|
|
@@ -192,6 +84,93 @@ interface TargetGenerators {
|
|
|
192
84
|
lint?(files: CanonicalFiles): LintDiagnostic[];
|
|
193
85
|
}
|
|
194
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Descriptor-driven importer contract.
|
|
89
|
+
*
|
|
90
|
+
* Each target may declare an `importer: TargetImporterDescriptor` block on its
|
|
91
|
+
* descriptor. The shared runner walks the spec, resolves sources for the active
|
|
92
|
+
* scope, and dispatches to existing helpers (`importFileDirectory`,
|
|
93
|
+
* `importDirectorySkill`, …). Scope variance is expressed as data — features
|
|
94
|
+
* with no `global` source are silently skipped in global mode, eliminating the
|
|
95
|
+
* `if (scope === 'global')` branches that previously leaked into importer bodies.
|
|
96
|
+
*
|
|
97
|
+
* Targets with custom parsing (codex-cli rule splitter, windsurf workflows,
|
|
98
|
+
* gemini-cli policies) keep their own `generators.importFrom` and may also
|
|
99
|
+
* delegate the declarable parts of their flow to the runner.
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Per-scope source paths. Omit `global` to make the feature project-only — the
|
|
104
|
+
* runner skips it under `--global` instead of every importer guarding with
|
|
105
|
+
* `if (scope === 'global')`.
|
|
106
|
+
*/
|
|
107
|
+
interface ImportSourcePaths {
|
|
108
|
+
readonly project?: readonly string[];
|
|
109
|
+
readonly global?: readonly string[];
|
|
110
|
+
}
|
|
111
|
+
type ImportFeatureKind = 'rules' | 'commands' | 'agents' | 'skills' | 'mcp' | 'hooks' | 'permissions' | 'ignore';
|
|
112
|
+
/**
|
|
113
|
+
* Mapping modes:
|
|
114
|
+
* - `singleFile` — try each `source` path in order, take the first that
|
|
115
|
+
* exists, write to `${canonicalDir}/${canonicalRootFilename}`.
|
|
116
|
+
* Used for root rule files (`AGENTS.md`, `CLAUDE.md`, …).
|
|
117
|
+
* - `directory` — recurse `source` paths and run a per-entry mapper. Built
|
|
118
|
+
* on top of the existing `importFileDirectory` helper.
|
|
119
|
+
* - `flatFile` — copy a single file verbatim (with `trimEnd`) to a fixed
|
|
120
|
+
* canonical destination. Used for `ignore`.
|
|
121
|
+
* - `mcpJson` — parse a JSON MCP servers file and write canonical
|
|
122
|
+
* `mcp.json`.
|
|
123
|
+
*/
|
|
124
|
+
type ImportFeatureMode = 'singleFile' | 'directory' | 'flatFile' | 'mcpJson';
|
|
125
|
+
interface ImportEntryContext {
|
|
126
|
+
readonly absolutePath: string;
|
|
127
|
+
readonly relativePath: string;
|
|
128
|
+
readonly content: string;
|
|
129
|
+
readonly destDir: string;
|
|
130
|
+
readonly normalizeTo: (destinationFile: string) => string;
|
|
131
|
+
}
|
|
132
|
+
interface ImportEntryMapping {
|
|
133
|
+
readonly destPath: string;
|
|
134
|
+
readonly toPath: string;
|
|
135
|
+
readonly content: string;
|
|
136
|
+
}
|
|
137
|
+
type ImportEntryMapper = (ctx: ImportEntryContext) => Promise<ImportEntryMapping | null> | ImportEntryMapping | null;
|
|
138
|
+
/** Optional declarative frontmatter post-processing for the default mappers. */
|
|
139
|
+
type FrontmatterRemap = (frontmatter: Record<string, unknown>) => Record<string, unknown>;
|
|
140
|
+
interface ImportFeatureSpec {
|
|
141
|
+
readonly feature: ImportFeatureKind;
|
|
142
|
+
readonly mode: ImportFeatureMode;
|
|
143
|
+
readonly source: ImportSourcePaths;
|
|
144
|
+
/** Tried after `source` in the same scope when the primary chain finds nothing (singleFile only). */
|
|
145
|
+
readonly fallbacks?: ImportSourcePaths;
|
|
146
|
+
/** Canonical destination directory under the project root (e.g. `.agentsmesh/rules`). */
|
|
147
|
+
readonly canonicalDir: string;
|
|
148
|
+
/** For `singleFile` only: the destination filename inside `canonicalDir`. */
|
|
149
|
+
readonly canonicalRootFilename?: string;
|
|
150
|
+
/** For `directory` mode: file extensions to match (`['.md']`, `['.mdc']`, …). */
|
|
151
|
+
readonly extensions?: readonly string[];
|
|
152
|
+
/** For `directory` mode: pick a built-in mapper. */
|
|
153
|
+
readonly preset?: 'rule' | 'command' | 'agent';
|
|
154
|
+
/** Optional frontmatter post-processing applied by built-in mappers. */
|
|
155
|
+
readonly frontmatterRemap?: FrontmatterRemap;
|
|
156
|
+
/** Custom mapper. Wins over `preset` when both are set. */
|
|
157
|
+
readonly map?: ImportEntryMapper;
|
|
158
|
+
/** For `singleFile` rules: marks the imported entry as a root rule (`root: true`). */
|
|
159
|
+
readonly markAsRoot?: boolean;
|
|
160
|
+
/** For `flatFile` and `mcpJson`: canonical destination filename. */
|
|
161
|
+
readonly canonicalFilename?: string;
|
|
162
|
+
}
|
|
163
|
+
interface TargetImporterDescriptor {
|
|
164
|
+
readonly rules?: ImportFeatureSpec | readonly ImportFeatureSpec[];
|
|
165
|
+
readonly commands?: ImportFeatureSpec;
|
|
166
|
+
readonly agents?: ImportFeatureSpec;
|
|
167
|
+
readonly skills?: ImportFeatureSpec;
|
|
168
|
+
readonly mcp?: ImportFeatureSpec;
|
|
169
|
+
readonly hooks?: ImportFeatureSpec;
|
|
170
|
+
readonly permissions?: ImportFeatureSpec;
|
|
171
|
+
readonly ignore?: ImportFeatureSpec;
|
|
172
|
+
}
|
|
173
|
+
|
|
195
174
|
/**
|
|
196
175
|
* Self-describing target descriptor interface.
|
|
197
176
|
*
|
|
@@ -212,6 +191,11 @@ interface TargetOutputFamily {
|
|
|
212
191
|
/** Explicit paths for additional root mirrors (Cursor, Gemini compat). */
|
|
213
192
|
readonly explicitPaths?: readonly string[];
|
|
214
193
|
}
|
|
194
|
+
interface ExtraRuleOutputContext {
|
|
195
|
+
readonly refs: ReadonlyMap<string, string>;
|
|
196
|
+
readonly scope: TargetLayoutScope;
|
|
197
|
+
}
|
|
198
|
+
type ExtraRuleOutputResolver = (rule: CanonicalFiles['rules'][number], context: ExtraRuleOutputContext) => readonly string[];
|
|
215
199
|
/**
|
|
216
200
|
* Path resolvers for the output reference map.
|
|
217
201
|
* Each method returns a relative output path, or null to skip.
|
|
@@ -235,14 +219,10 @@ interface TargetManagedOutputs {
|
|
|
235
219
|
interface TargetLayout {
|
|
236
220
|
/** Primary root instruction artifact for this scope, if any. */
|
|
237
221
|
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
222
|
/** Output families for rewrite cache keys and root decoration (see `layout-outputs.ts`). */
|
|
245
223
|
readonly outputFamilies?: readonly TargetOutputFamily[];
|
|
224
|
+
/** Additional generated rule paths that share source ownership for reference rewriting. */
|
|
225
|
+
readonly extraRuleOutputPaths?: ExtraRuleOutputResolver;
|
|
246
226
|
/** Optional renderer for scope-specific primary root instruction content. */
|
|
247
227
|
readonly renderPrimaryRootInstruction?: (canonical: CanonicalFiles) => string;
|
|
248
228
|
/** Target-native skills directory for this scope, if any. */
|
|
@@ -277,6 +257,7 @@ type RuleLinter = (canonical: CanonicalFiles, projectRoot: string, projectFiles:
|
|
|
277
257
|
}) => LintDiagnostic[];
|
|
278
258
|
/** Feature-specific lint hook signature. */
|
|
279
259
|
type FeatureLinter = (canonical: CanonicalFiles, options?: unknown) => LintDiagnostic[];
|
|
260
|
+
type GeneratedOutputMerger = (existing: string | null, pending: GenerateResult | undefined, newContent: string, resolvedPath: string) => string | null;
|
|
280
261
|
/** Optional per-feature lint hooks for target-specific validation. */
|
|
281
262
|
interface TargetLintHooks {
|
|
282
263
|
readonly commands?: FeatureLinter;
|
|
@@ -297,10 +278,8 @@ interface TargetDescriptor {
|
|
|
297
278
|
readonly generators: TargetGenerators;
|
|
298
279
|
/** Feature support levels */
|
|
299
280
|
readonly capabilities: TargetCapabilities;
|
|
300
|
-
/** Consolidated global-mode metadata
|
|
281
|
+
/** Consolidated global-mode metadata. */
|
|
301
282
|
readonly globalSupport?: GlobalTargetSupport;
|
|
302
|
-
/** Optional global-scope feature support levels when they differ from project mode */
|
|
303
|
-
readonly globalCapabilities?: TargetCapabilities;
|
|
304
283
|
/** Message shown when import finds nothing for this target */
|
|
305
284
|
readonly emptyImportMessage: string;
|
|
306
285
|
/** Optional linter for canonical files */
|
|
@@ -309,8 +288,6 @@ interface TargetDescriptor {
|
|
|
309
288
|
readonly lint?: TargetLintHooks;
|
|
310
289
|
/** Project-scope target layout metadata */
|
|
311
290
|
readonly project: TargetLayout;
|
|
312
|
-
/** Optional global-scope layout (use `globalSupport.layout` when `globalSupport` is set). */
|
|
313
|
-
readonly global?: TargetLayout;
|
|
314
291
|
/**
|
|
315
292
|
* Declares which embedded-capability features support user-configured conversion.
|
|
316
293
|
* When the corresponding conversion is disabled in config, the feature generator is skipped.
|
|
@@ -320,20 +297,18 @@ interface TargetDescriptor {
|
|
|
320
297
|
readonly agents?: true;
|
|
321
298
|
};
|
|
322
299
|
/**
|
|
323
|
-
* Optional
|
|
324
|
-
*
|
|
300
|
+
* Optional descriptor-driven importer block. When present, the shared
|
|
301
|
+
* `runDescriptorImport` orchestrator handles scan + map for each declared
|
|
302
|
+
* feature (with scope variance expressed as data, eliminating
|
|
303
|
+
* `if (scope === 'global')` branches in importer bodies). Targets with
|
|
304
|
+
* irreducibly custom parsing keep `generators.importFrom` and may delegate
|
|
305
|
+
* declarable parts of their flow to the runner.
|
|
325
306
|
*/
|
|
326
|
-
readonly
|
|
327
|
-
/** @deprecated Use project.skillDir */
|
|
328
|
-
readonly skillDir?: string;
|
|
329
|
-
/** @deprecated Use project.paths */
|
|
330
|
-
readonly paths?: TargetPathResolvers;
|
|
307
|
+
readonly importer?: TargetImporterDescriptor;
|
|
331
308
|
/** Import reference map builder */
|
|
332
309
|
readonly buildImportPaths: ImportPathBuilder;
|
|
333
310
|
/** Filesystem paths used to detect this target during `init` */
|
|
334
311
|
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
312
|
/**
|
|
338
313
|
* Declares which shared artifact paths this target owns or consumes.
|
|
339
314
|
* Used by the reference rewriter to select the correct artifact map for shared outputs.
|
|
@@ -349,6 +324,8 @@ interface TargetDescriptor {
|
|
|
349
324
|
readonly path: string;
|
|
350
325
|
readonly content: string;
|
|
351
326
|
}[];
|
|
327
|
+
/** Optional target-specific merge strategy for generated outputs. */
|
|
328
|
+
readonly mergeGeneratedOutputContent?: GeneratedOutputMerger;
|
|
352
329
|
/**
|
|
353
330
|
* Async post-pass for hook generator outputs (e.g. Copilot hook script assets under `.github/hooks/`).
|
|
354
331
|
*/
|
|
@@ -359,6 +336,12 @@ interface TargetDescriptor {
|
|
|
359
336
|
readonly path: string;
|
|
360
337
|
readonly content: string;
|
|
361
338
|
}[]>;
|
|
339
|
+
/**
|
|
340
|
+
* When true, the target preserves manual-only activation semantics (e.g.
|
|
341
|
+
* Cursor's `alwaysApply: false` without globs/description). Targets without
|
|
342
|
+
* this flag get a lint warning when canonical rules have `trigger: 'manual'`.
|
|
343
|
+
*/
|
|
344
|
+
readonly preservesManualActivation?: boolean;
|
|
362
345
|
}
|
|
363
346
|
|
|
364
|
-
export type { FeatureLinter as F, GenerateResult as G, ImportPathBuilder as I, LintDiagnostic as L, RuleLinter as R, ScopeExtrasFn as S, TargetCapabilities as T,
|
|
347
|
+
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 {
|
|
2
|
-
export { F as FeatureLinter,
|
|
3
|
-
import './
|
|
1
|
+
import { e as TargetDescriptor } from './target-descriptor-Cb9PXaxr.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-Cb9PXaxr.js';
|
|
3
|
+
import './schema-BeGiBqbB.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
/** Register a full target descriptor (for plugins). */
|