agentsmesh 0.10.0 → 0.11.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 +24 -0
- package/README.md +22 -22
- package/dist/canonical.d.ts +2 -2
- package/dist/canonical.js +1635 -709
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +119 -118
- package/dist/engine.d.ts +2 -2
- package/dist/engine.js +1777 -851
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1789 -863
- package/dist/index.js.map +1 -1
- package/dist/{schema-qelg8gw8.d.ts → schema-BTitJKiN.d.ts} +4 -0
- package/dist/{target-descriptor-Dhdg8s2o.d.ts → target-descriptor-D-Y6BzCL.d.ts} +1 -1
- package/dist/targets.d.ts +3 -3
- package/dist/targets.js +1649 -723
- package/dist/targets.js.map +1 -1
- package/package.json +1 -1
- package/schemas/agentsmesh.json +6 -0
- package/schemas/pack.json +2 -0
package/dist/engine.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { stringify, parse } from 'yaml';
|
|
2
3
|
import { readFile, rm, mkdir, readdir, stat, lstat, unlink, writeFile, rename, access, realpath } from 'fs/promises';
|
|
3
4
|
import { join, basename, dirname, relative, win32, posix, resolve, extname } from 'path';
|
|
4
5
|
import { constants, existsSync, realpathSync, statSync } from 'fs';
|
|
5
|
-
import { stringify, parse } from 'yaml';
|
|
6
6
|
import { parse as parse$1 } from 'smol-toml';
|
|
7
7
|
import { Buffer } from 'buffer';
|
|
8
8
|
import { homedir } from 'os';
|
|
@@ -18,42 +18,44 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
18
18
|
var __esm = (fn, res) => function __init() {
|
|
19
19
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
20
20
|
};
|
|
21
|
-
var __export = (
|
|
21
|
+
var __export = (target16, all) => {
|
|
22
22
|
for (var name in all)
|
|
23
|
-
__defProp(
|
|
23
|
+
__defProp(target16, name, { get: all[name], enumerable: true });
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
// src/config/core/conversions.ts
|
|
27
|
-
function usesCommandSkillProjection(
|
|
28
|
-
return Object.prototype.hasOwnProperty.call(DEFAULT_COMMANDS_TO_SKILLS,
|
|
27
|
+
function usesCommandSkillProjection(target16) {
|
|
28
|
+
return Object.prototype.hasOwnProperty.call(DEFAULT_COMMANDS_TO_SKILLS, target16);
|
|
29
29
|
}
|
|
30
|
-
function usesAgentSkillProjection(
|
|
31
|
-
return Object.prototype.hasOwnProperty.call(DEFAULT_AGENTS_TO_SKILLS,
|
|
30
|
+
function usesAgentSkillProjection(target16) {
|
|
31
|
+
return Object.prototype.hasOwnProperty.call(DEFAULT_AGENTS_TO_SKILLS, target16);
|
|
32
32
|
}
|
|
33
33
|
function resolveConversionValue(value, scope) {
|
|
34
34
|
if (value === void 0) return void 0;
|
|
35
35
|
if (typeof value === "boolean") return value;
|
|
36
36
|
return value[scope];
|
|
37
37
|
}
|
|
38
|
-
function shouldConvertCommandsToSkills(config,
|
|
39
|
-
const raw = config.conversions?.commands_to_skills?.[
|
|
38
|
+
function shouldConvertCommandsToSkills(config, target16, defaultEnabled, scope = "project") {
|
|
39
|
+
const raw = config.conversions?.commands_to_skills?.[target16];
|
|
40
40
|
const configVal = resolveConversionValue(raw, scope);
|
|
41
41
|
if (configVal !== void 0) return configVal;
|
|
42
|
-
if (usesCommandSkillProjection(
|
|
42
|
+
if (usesCommandSkillProjection(target16)) return DEFAULT_COMMANDS_TO_SKILLS[target16];
|
|
43
43
|
return defaultEnabled ?? false;
|
|
44
44
|
}
|
|
45
|
-
function shouldConvertAgentsToSkills(config,
|
|
46
|
-
const raw = config.conversions?.agents_to_skills?.[
|
|
45
|
+
function shouldConvertAgentsToSkills(config, target16, defaultEnabled, scope = "project") {
|
|
46
|
+
const raw = config.conversions?.agents_to_skills?.[target16];
|
|
47
47
|
const configVal = resolveConversionValue(raw, scope);
|
|
48
48
|
if (configVal !== void 0) return configVal;
|
|
49
|
-
if (usesAgentSkillProjection(
|
|
49
|
+
if (usesAgentSkillProjection(target16)) return DEFAULT_AGENTS_TO_SKILLS[target16];
|
|
50
50
|
return defaultEnabled ?? false;
|
|
51
51
|
}
|
|
52
52
|
var DEFAULT_COMMANDS_TO_SKILLS, DEFAULT_AGENTS_TO_SKILLS;
|
|
53
53
|
var init_conversions = __esm({
|
|
54
54
|
"src/config/core/conversions.ts"() {
|
|
55
55
|
DEFAULT_COMMANDS_TO_SKILLS = {
|
|
56
|
-
"codex-cli": true
|
|
56
|
+
"codex-cli": true,
|
|
57
|
+
goose: true,
|
|
58
|
+
kiro: true
|
|
57
59
|
};
|
|
58
60
|
DEFAULT_AGENTS_TO_SKILLS = {
|
|
59
61
|
"gemini-cli": false,
|
|
@@ -61,7 +63,10 @@ var init_conversions = __esm({
|
|
|
61
63
|
cline: true,
|
|
62
64
|
"codex-cli": false,
|
|
63
65
|
// native .codex/agents/*.toml per agent-structures
|
|
64
|
-
windsurf: true
|
|
66
|
+
windsurf: true,
|
|
67
|
+
goose: true,
|
|
68
|
+
antigravity: true,
|
|
69
|
+
continue: true
|
|
65
70
|
};
|
|
66
71
|
}
|
|
67
72
|
});
|
|
@@ -99,12 +104,12 @@ function capabilityLevel(capability) {
|
|
|
99
104
|
function canUseScopedSettings(feature) {
|
|
100
105
|
return settingsBackedFeatures.includes(feature);
|
|
101
106
|
}
|
|
102
|
-
function validateCapabilityImplementations(
|
|
107
|
+
function validateCapabilityImplementations(descriptor16, capabilities4, ctx, pathPrefix) {
|
|
103
108
|
for (const requirement of generatorRequirements) {
|
|
104
|
-
const level = capabilityLevel(
|
|
109
|
+
const level = capabilityLevel(capabilities4[requirement.feature]);
|
|
105
110
|
if (level === "none") continue;
|
|
106
|
-
const hasGenerator = typeof
|
|
107
|
-
const hasSettingsEmitter = canUseScopedSettings(requirement.feature) && typeof
|
|
111
|
+
const hasGenerator = typeof descriptor16.generators[requirement.generator] === "function";
|
|
112
|
+
const hasSettingsEmitter = canUseScopedSettings(requirement.feature) && typeof descriptor16.emitScopedSettings === "function";
|
|
108
113
|
if (hasGenerator || hasSettingsEmitter) continue;
|
|
109
114
|
ctx.addIssue({
|
|
110
115
|
code: "custom",
|
|
@@ -219,8 +224,8 @@ function builtinDescriptors() {
|
|
|
219
224
|
}
|
|
220
225
|
return _builtinDescriptors;
|
|
221
226
|
}
|
|
222
|
-
function registerTargetDescriptor(
|
|
223
|
-
const validated = validateDescriptor(
|
|
227
|
+
function registerTargetDescriptor(descriptor16) {
|
|
228
|
+
const validated = validateDescriptor(descriptor16);
|
|
224
229
|
descriptorRegistry.set(validated.id, validated);
|
|
225
230
|
}
|
|
226
231
|
function getDescriptor(name) {
|
|
@@ -240,11 +245,11 @@ var init_registry = __esm({
|
|
|
240
245
|
|
|
241
246
|
// src/targets/catalog/shared-artifact-owner.ts
|
|
242
247
|
function ownerTargetIdForSharedPath(path) {
|
|
243
|
-
for (const
|
|
244
|
-
if (!
|
|
245
|
-
for (const [prefix, role] of Object.entries(
|
|
248
|
+
for (const descriptor16 of BUILTIN_TARGETS) {
|
|
249
|
+
if (!descriptor16.sharedArtifacts) continue;
|
|
250
|
+
for (const [prefix, role] of Object.entries(descriptor16.sharedArtifacts)) {
|
|
246
251
|
if (role === "owner" && path.startsWith(prefix)) {
|
|
247
|
-
return
|
|
252
|
+
return descriptor16.id;
|
|
248
253
|
}
|
|
249
254
|
}
|
|
250
255
|
}
|
|
@@ -252,11 +257,11 @@ function ownerTargetIdForSharedPath(path) {
|
|
|
252
257
|
}
|
|
253
258
|
function findSharedArtifactOwnershipConflicts(descriptors) {
|
|
254
259
|
const owners = [];
|
|
255
|
-
for (const
|
|
256
|
-
if (!
|
|
257
|
-
for (const [prefix, role] of Object.entries(
|
|
260
|
+
for (const descriptor16 of descriptors) {
|
|
261
|
+
if (!descriptor16.sharedArtifacts) continue;
|
|
262
|
+
for (const [prefix, role] of Object.entries(descriptor16.sharedArtifacts)) {
|
|
258
263
|
if (role !== "owner") continue;
|
|
259
|
-
owners.push({ targetId:
|
|
264
|
+
owners.push({ targetId: descriptor16.id, prefix });
|
|
260
265
|
}
|
|
261
266
|
}
|
|
262
267
|
const conflicts = [];
|
|
@@ -306,9 +311,11 @@ var init_builtin_target_ids_generated = __esm({
|
|
|
306
311
|
"copilot",
|
|
307
312
|
"cursor",
|
|
308
313
|
"gemini-cli",
|
|
314
|
+
"goose",
|
|
309
315
|
"junie",
|
|
310
316
|
"kilo-code",
|
|
311
317
|
"kiro",
|
|
318
|
+
"opencode",
|
|
312
319
|
"roo-code",
|
|
313
320
|
"windsurf"
|
|
314
321
|
];
|
|
@@ -324,6 +331,127 @@ var init_target_ids = __esm({
|
|
|
324
331
|
CODEX_CLI_TARGET_ID = "codex-cli";
|
|
325
332
|
}
|
|
326
333
|
});
|
|
334
|
+
function parseFrontmatter(content) {
|
|
335
|
+
const open = content.indexOf("---");
|
|
336
|
+
if (open !== 0) {
|
|
337
|
+
return { frontmatter: {}, body: content.trim() };
|
|
338
|
+
}
|
|
339
|
+
const close = content.indexOf("---", 3);
|
|
340
|
+
if (close === -1) {
|
|
341
|
+
return { frontmatter: {}, body: content.trim() };
|
|
342
|
+
}
|
|
343
|
+
const yamlStr = content.slice(3, close).trim();
|
|
344
|
+
const body = content.slice(close + 3).trim();
|
|
345
|
+
const frontmatter = yamlStr === "" ? {} : parse(yamlStr) ?? {};
|
|
346
|
+
return { frontmatter, body };
|
|
347
|
+
}
|
|
348
|
+
function serializeFrontmatter(frontmatter, body) {
|
|
349
|
+
const keys = Object.keys(frontmatter);
|
|
350
|
+
if (keys.length === 0) return body;
|
|
351
|
+
const yamlStr = stringify(frontmatter, { lineWidth: 0 }).trimEnd();
|
|
352
|
+
return `---
|
|
353
|
+
${yamlStr}
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
${body}`;
|
|
357
|
+
}
|
|
358
|
+
var init_markdown = __esm({
|
|
359
|
+
"src/utils/text/markdown.ts"() {
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
// src/targets/projection/projected-agent-skill.ts
|
|
364
|
+
function toStringArray(value) {
|
|
365
|
+
if (Array.isArray(value)) {
|
|
366
|
+
return value.filter((entry) => typeof entry === "string" && entry.length > 0);
|
|
367
|
+
}
|
|
368
|
+
if (typeof value === "string" && value.length > 0) {
|
|
369
|
+
return value.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
370
|
+
}
|
|
371
|
+
return [];
|
|
372
|
+
}
|
|
373
|
+
function toHooks(value) {
|
|
374
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
375
|
+
const hooks = {};
|
|
376
|
+
for (const [event, entries] of Object.entries(value)) {
|
|
377
|
+
if (!Array.isArray(entries)) continue;
|
|
378
|
+
hooks[event] = entries.filter(
|
|
379
|
+
(entry) => entry !== null && typeof entry === "object" && typeof entry.matcher === "string" && typeof entry.command === "string"
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
return hooks;
|
|
383
|
+
}
|
|
384
|
+
function projectedAgentSkillDirName(name) {
|
|
385
|
+
return `${PROJECTED_AGENT_SKILL_PREFIX}${name}`;
|
|
386
|
+
}
|
|
387
|
+
function serializeProjectedAgentSkill(agent) {
|
|
388
|
+
const frontmatter = {
|
|
389
|
+
name: projectedAgentSkillDirName(agent.name),
|
|
390
|
+
description: agent.description || void 0,
|
|
391
|
+
"x-agentsmesh-kind": "agent",
|
|
392
|
+
"x-agentsmesh-name": agent.name,
|
|
393
|
+
"x-agentsmesh-tools": agent.tools.length > 0 ? agent.tools : void 0,
|
|
394
|
+
"x-agentsmesh-disallowed-tools": agent.disallowedTools.length > 0 ? agent.disallowedTools : void 0,
|
|
395
|
+
"x-agentsmesh-model": agent.model || void 0,
|
|
396
|
+
"x-agentsmesh-permission-mode": agent.permissionMode || void 0,
|
|
397
|
+
"x-agentsmesh-max-turns": agent.maxTurns > 0 ? agent.maxTurns : void 0,
|
|
398
|
+
"x-agentsmesh-mcp-servers": agent.mcpServers.length > 0 ? agent.mcpServers : void 0,
|
|
399
|
+
"x-agentsmesh-hooks": Object.keys(agent.hooks).length > 0 ? agent.hooks : void 0,
|
|
400
|
+
"x-agentsmesh-skills": agent.skills.length > 0 ? agent.skills : void 0,
|
|
401
|
+
"x-agentsmesh-memory": agent.memory || void 0
|
|
402
|
+
};
|
|
403
|
+
Object.keys(frontmatter).forEach((key) => {
|
|
404
|
+
if (frontmatter[key] === void 0) delete frontmatter[key];
|
|
405
|
+
});
|
|
406
|
+
return serializeFrontmatter(frontmatter, agent.body.trim() || "");
|
|
407
|
+
}
|
|
408
|
+
function parseProjectedAgentSkillFrontmatter(frontmatter, dirName) {
|
|
409
|
+
if (frontmatter["x-agentsmesh-kind"] !== "agent") return null;
|
|
410
|
+
const metadataName = typeof frontmatter["x-agentsmesh-name"] === "string" ? frontmatter["x-agentsmesh-name"] : "";
|
|
411
|
+
const derivedName = dirName.startsWith(PROJECTED_AGENT_SKILL_PREFIX) ? dirName.slice(PROJECTED_AGENT_SKILL_PREFIX.length) : dirName.startsWith(LEGACY_PROJECTED_AGENT_SKILL_PREFIX) ? dirName.slice(LEGACY_PROJECTED_AGENT_SKILL_PREFIX.length) : "";
|
|
412
|
+
const name = (metadataName || derivedName).trim();
|
|
413
|
+
if (!name) return null;
|
|
414
|
+
return {
|
|
415
|
+
name,
|
|
416
|
+
description: typeof frontmatter.description === "string" ? frontmatter.description : "",
|
|
417
|
+
tools: toStringArray(frontmatter["x-agentsmesh-tools"]),
|
|
418
|
+
disallowedTools: toStringArray(frontmatter["x-agentsmesh-disallowed-tools"]),
|
|
419
|
+
model: typeof frontmatter["x-agentsmesh-model"] === "string" ? frontmatter["x-agentsmesh-model"] : "",
|
|
420
|
+
permissionMode: typeof frontmatter["x-agentsmesh-permission-mode"] === "string" ? frontmatter["x-agentsmesh-permission-mode"] : "",
|
|
421
|
+
maxTurns: typeof frontmatter["x-agentsmesh-max-turns"] === "number" ? frontmatter["x-agentsmesh-max-turns"] : Number(frontmatter["x-agentsmesh-max-turns"] ?? 0),
|
|
422
|
+
mcpServers: toStringArray(frontmatter["x-agentsmesh-mcp-servers"]),
|
|
423
|
+
hooks: toHooks(frontmatter["x-agentsmesh-hooks"]),
|
|
424
|
+
skills: toStringArray(frontmatter["x-agentsmesh-skills"]),
|
|
425
|
+
memory: typeof frontmatter["x-agentsmesh-memory"] === "string" ? frontmatter["x-agentsmesh-memory"] : ""
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
function serializeImportedAgent(agent, body) {
|
|
429
|
+
const frontmatter = {
|
|
430
|
+
name: agent.name,
|
|
431
|
+
description: agent.description,
|
|
432
|
+
tools: agent.tools,
|
|
433
|
+
disallowedTools: agent.disallowedTools.length > 0 ? agent.disallowedTools : void 0,
|
|
434
|
+
model: agent.model || void 0,
|
|
435
|
+
permissionMode: agent.permissionMode || void 0,
|
|
436
|
+
maxTurns: agent.maxTurns > 0 ? agent.maxTurns : void 0,
|
|
437
|
+
mcpServers: agent.mcpServers.length > 0 ? agent.mcpServers : void 0,
|
|
438
|
+
hooks: Object.keys(agent.hooks).length > 0 ? agent.hooks : void 0,
|
|
439
|
+
skills: agent.skills.length > 0 ? agent.skills : void 0,
|
|
440
|
+
memory: agent.memory || void 0
|
|
441
|
+
};
|
|
442
|
+
Object.keys(frontmatter).forEach((key) => {
|
|
443
|
+
if (frontmatter[key] === void 0) delete frontmatter[key];
|
|
444
|
+
});
|
|
445
|
+
return serializeFrontmatter(frontmatter, body.trim() || "");
|
|
446
|
+
}
|
|
447
|
+
var PROJECTED_AGENT_SKILL_PREFIX, LEGACY_PROJECTED_AGENT_SKILL_PREFIX;
|
|
448
|
+
var init_projected_agent_skill = __esm({
|
|
449
|
+
"src/targets/projection/projected-agent-skill.ts"() {
|
|
450
|
+
init_markdown();
|
|
451
|
+
PROJECTED_AGENT_SKILL_PREFIX = "am-agent-";
|
|
452
|
+
LEGACY_PROJECTED_AGENT_SKILL_PREFIX = "ab-agent-";
|
|
453
|
+
}
|
|
454
|
+
});
|
|
327
455
|
|
|
328
456
|
// src/core/errors.ts
|
|
329
457
|
var AgentsMeshError, ConfigNotFoundError, ConfigValidationError, TargetNotFoundError, ImportError, GenerationError, RemoteFetchError, LockAcquisitionError, FileSystemError;
|
|
@@ -363,19 +491,19 @@ var init_errors = __esm({
|
|
|
363
491
|
};
|
|
364
492
|
TargetNotFoundError = class extends AgentsMeshError {
|
|
365
493
|
target;
|
|
366
|
-
constructor(
|
|
494
|
+
constructor(target16, options) {
|
|
367
495
|
const suffix = options?.supported ? ` Supported: ${options.supported.join(", ")}.` : "";
|
|
368
|
-
super("AM_TARGET_NOT_FOUND", `Unknown target "${
|
|
496
|
+
super("AM_TARGET_NOT_FOUND", `Unknown target "${target16}".${suffix}`, options);
|
|
369
497
|
this.name = "TargetNotFoundError";
|
|
370
|
-
this.target =
|
|
498
|
+
this.target = target16;
|
|
371
499
|
}
|
|
372
500
|
};
|
|
373
501
|
ImportError = class extends AgentsMeshError {
|
|
374
502
|
target;
|
|
375
|
-
constructor(
|
|
376
|
-
super("AM_IMPORT_FAILED", `Import from ${
|
|
503
|
+
constructor(target16, message, options) {
|
|
504
|
+
super("AM_IMPORT_FAILED", `Import from ${target16} failed: ${message}`, options);
|
|
377
505
|
this.name = "ImportError";
|
|
378
|
-
this.target =
|
|
506
|
+
this.target = target16;
|
|
379
507
|
}
|
|
380
508
|
};
|
|
381
509
|
GenerationError = class extends AgentsMeshError {
|
|
@@ -588,34 +716,6 @@ var init_fs = __esm({
|
|
|
588
716
|
]);
|
|
589
717
|
}
|
|
590
718
|
});
|
|
591
|
-
function parseFrontmatter(content) {
|
|
592
|
-
const open = content.indexOf("---");
|
|
593
|
-
if (open !== 0) {
|
|
594
|
-
return { frontmatter: {}, body: content.trim() };
|
|
595
|
-
}
|
|
596
|
-
const close = content.indexOf("---", 3);
|
|
597
|
-
if (close === -1) {
|
|
598
|
-
return { frontmatter: {}, body: content.trim() };
|
|
599
|
-
}
|
|
600
|
-
const yamlStr = content.slice(3, close).trim();
|
|
601
|
-
const body = content.slice(close + 3).trim();
|
|
602
|
-
const frontmatter = yamlStr === "" ? {} : parse(yamlStr) ?? {};
|
|
603
|
-
return { frontmatter, body };
|
|
604
|
-
}
|
|
605
|
-
function serializeFrontmatter(frontmatter, body) {
|
|
606
|
-
const keys = Object.keys(frontmatter);
|
|
607
|
-
if (keys.length === 0) return body;
|
|
608
|
-
const yamlStr = stringify(frontmatter, { lineWidth: 0 }).trimEnd();
|
|
609
|
-
return `---
|
|
610
|
-
${yamlStr}
|
|
611
|
-
---
|
|
612
|
-
|
|
613
|
-
${body}`;
|
|
614
|
-
}
|
|
615
|
-
var init_markdown = __esm({
|
|
616
|
-
"src/utils/text/markdown.ts"() {
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
719
|
function escapeRegExp(value) {
|
|
620
720
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
621
721
|
}
|
|
@@ -673,7 +773,7 @@ function appendEmbeddedRulesBlock(content, rules) {
|
|
|
673
773
|
|
|
674
774
|
${block}` : block;
|
|
675
775
|
}
|
|
676
|
-
function
|
|
776
|
+
function toStringArray2(value) {
|
|
677
777
|
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
678
778
|
}
|
|
679
779
|
function parseMarker(value) {
|
|
@@ -685,8 +785,8 @@ function parseMarker(value) {
|
|
|
685
785
|
return {
|
|
686
786
|
source: record.source,
|
|
687
787
|
description: typeof record.description === "string" ? record.description : "",
|
|
688
|
-
globs:
|
|
689
|
-
targets:
|
|
788
|
+
globs: toStringArray2(record.globs),
|
|
789
|
+
targets: toStringArray2(record.targets)
|
|
690
790
|
};
|
|
691
791
|
} catch {
|
|
692
792
|
return null;
|
|
@@ -829,7 +929,7 @@ ${ROOT_CONTRACT_END}`;
|
|
|
829
929
|
];
|
|
830
930
|
}
|
|
831
931
|
});
|
|
832
|
-
function
|
|
932
|
+
function toStringArray3(value) {
|
|
833
933
|
if (Array.isArray(value)) {
|
|
834
934
|
return value.filter((entry) => typeof entry === "string").map((entry) => entry.trim()).filter(Boolean);
|
|
835
935
|
}
|
|
@@ -874,7 +974,7 @@ async function serializeImportedRuleWithFallback(destinationPath, importedFrontm
|
|
|
874
974
|
description: typeof mergedFrontmatter.description === "string" ? mergedFrontmatter.description : ""
|
|
875
975
|
};
|
|
876
976
|
if (canonicalFrontmatter.root === false) {
|
|
877
|
-
canonicalFrontmatter.globs =
|
|
977
|
+
canonicalFrontmatter.globs = toStringArray3(mergedFrontmatter.globs);
|
|
878
978
|
}
|
|
879
979
|
for (const [key, value] of Object.entries(mergedFrontmatter)) {
|
|
880
980
|
if (key === "root" || key === "description" || key === "globs" || value === void 0) continue;
|
|
@@ -892,8 +992,8 @@ var init_import_metadata_core = __esm({
|
|
|
892
992
|
async function serializeImportedCommandWithFallback(destinationPath, imported, body) {
|
|
893
993
|
const existingFrontmatter = await readExistingFrontmatter(destinationPath);
|
|
894
994
|
const existingAllowedTools = (() => {
|
|
895
|
-
const fromCamel =
|
|
896
|
-
return fromCamel.length > 0 ? fromCamel :
|
|
995
|
+
const fromCamel = toStringArray3(existingFrontmatter.allowedTools);
|
|
996
|
+
return fromCamel.length > 0 ? fromCamel : toStringArray3(existingFrontmatter["allowed-tools"]);
|
|
897
997
|
})();
|
|
898
998
|
const description = imported.hasDescription ? imported.description ?? "" : typeof existingFrontmatter.description === "string" ? existingFrontmatter.description : "";
|
|
899
999
|
const allowedTools = imported.hasAllowedTools ? imported.allowedTools ?? [] : existingAllowedTools;
|
|
@@ -914,16 +1014,16 @@ async function serializeImportedSkillWithFallback(destinationPath, importedFront
|
|
|
914
1014
|
}
|
|
915
1015
|
async function serializeImportedAgentWithFallback(destinationPath, importedFrontmatter, body) {
|
|
916
1016
|
const existingFrontmatter = await readExistingFrontmatter(destinationPath);
|
|
917
|
-
const tools = Object.prototype.hasOwnProperty.call(importedFrontmatter, "tools") ?
|
|
918
|
-
const existingTools =
|
|
1017
|
+
const tools = Object.prototype.hasOwnProperty.call(importedFrontmatter, "tools") ? toStringArray3(importedFrontmatter.tools) : (() => {
|
|
1018
|
+
const existingTools = toStringArray3(existingFrontmatter.tools);
|
|
919
1019
|
return existingTools.length > 0 ? existingTools : [];
|
|
920
1020
|
})();
|
|
921
1021
|
const disallowedTools = Object.prototype.hasOwnProperty.call(
|
|
922
1022
|
importedFrontmatter,
|
|
923
1023
|
"disallowedTools"
|
|
924
|
-
) ?
|
|
925
|
-
const mcpServers = Object.prototype.hasOwnProperty.call(importedFrontmatter, "mcpServers") ?
|
|
926
|
-
const skills = Object.prototype.hasOwnProperty.call(importedFrontmatter, "skills") ?
|
|
1024
|
+
) ? toStringArray3(importedFrontmatter.disallowedTools) : Object.prototype.hasOwnProperty.call(importedFrontmatter, "disallowed-tools") ? toStringArray3(importedFrontmatter["disallowed-tools"]) : toStringArray3(existingFrontmatter.disallowedTools);
|
|
1025
|
+
const mcpServers = Object.prototype.hasOwnProperty.call(importedFrontmatter, "mcpServers") ? toStringArray3(importedFrontmatter.mcpServers) : Object.prototype.hasOwnProperty.call(importedFrontmatter, "mcp-servers") ? toStringArray3(importedFrontmatter["mcp-servers"]) : toStringArray3(existingFrontmatter.mcpServers);
|
|
1026
|
+
const skills = Object.prototype.hasOwnProperty.call(importedFrontmatter, "skills") ? toStringArray3(importedFrontmatter.skills) : toStringArray3(existingFrontmatter.skills);
|
|
927
1027
|
const maxTurnsRaw = importedFrontmatter.maxTurns ?? importedFrontmatter["max-turns"] ?? existingFrontmatter.maxTurns;
|
|
928
1028
|
const maxTurns = typeof maxTurnsRaw === "number" ? maxTurnsRaw : Number(maxTurnsRaw ?? 0);
|
|
929
1029
|
const hooks = readHooks(importedFrontmatter) ?? readHooks(existingFrontmatter);
|
|
@@ -959,6 +1059,77 @@ var init_import_metadata = __esm({
|
|
|
959
1059
|
init_import_metadata_serialize();
|
|
960
1060
|
}
|
|
961
1061
|
});
|
|
1062
|
+
|
|
1063
|
+
// src/targets/codex-cli/command-skill.ts
|
|
1064
|
+
function toStringArray4(value) {
|
|
1065
|
+
if (Array.isArray(value)) {
|
|
1066
|
+
return value.filter((entry) => typeof entry === "string" && entry.length > 0);
|
|
1067
|
+
}
|
|
1068
|
+
if (typeof value === "string" && value.length > 0) {
|
|
1069
|
+
return value.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
1070
|
+
}
|
|
1071
|
+
return [];
|
|
1072
|
+
}
|
|
1073
|
+
function commandSkillDirName(name) {
|
|
1074
|
+
return `${CODEX_COMMAND_SKILL_PREFIX}${name}`;
|
|
1075
|
+
}
|
|
1076
|
+
function serializeCommandSkill(command) {
|
|
1077
|
+
const frontmatter = {
|
|
1078
|
+
name: commandSkillDirName(command.name),
|
|
1079
|
+
description: command.description || void 0,
|
|
1080
|
+
"x-agentsmesh-kind": "command",
|
|
1081
|
+
"x-agentsmesh-name": command.name,
|
|
1082
|
+
"x-agentsmesh-allowed-tools": command.allowedTools.length > 0 ? command.allowedTools : void 0
|
|
1083
|
+
};
|
|
1084
|
+
if (frontmatter.description === void 0) delete frontmatter.description;
|
|
1085
|
+
if (frontmatter["x-agentsmesh-allowed-tools"] === void 0) {
|
|
1086
|
+
delete frontmatter["x-agentsmesh-allowed-tools"];
|
|
1087
|
+
}
|
|
1088
|
+
return serializeFrontmatter(frontmatter, command.body.trim() || "");
|
|
1089
|
+
}
|
|
1090
|
+
function parseCommandSkillFrontmatter(frontmatter, dirName) {
|
|
1091
|
+
if (frontmatter["x-agentsmesh-kind"] !== "command") return null;
|
|
1092
|
+
const metadataName = typeof frontmatter["x-agentsmesh-name"] === "string" ? frontmatter["x-agentsmesh-name"] : "";
|
|
1093
|
+
const derivedName = dirName.startsWith(CODEX_COMMAND_SKILL_PREFIX) ? dirName.slice(CODEX_COMMAND_SKILL_PREFIX.length) : dirName.startsWith(LEGACY_CODEX_COMMAND_SKILL_PREFIX) ? dirName.slice(LEGACY_CODEX_COMMAND_SKILL_PREFIX.length) : "";
|
|
1094
|
+
const name = (metadataName || derivedName).trim();
|
|
1095
|
+
if (!name) return null;
|
|
1096
|
+
return {
|
|
1097
|
+
name,
|
|
1098
|
+
description: typeof frontmatter.description === "string" ? frontmatter.description : "",
|
|
1099
|
+
allowedTools: toStringArray4(frontmatter["x-agentsmesh-allowed-tools"])
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
function serializeImportedCommand(command, body) {
|
|
1103
|
+
return serializeFrontmatter(
|
|
1104
|
+
{
|
|
1105
|
+
description: command.description,
|
|
1106
|
+
"allowed-tools": command.allowedTools
|
|
1107
|
+
},
|
|
1108
|
+
body.trim() || ""
|
|
1109
|
+
);
|
|
1110
|
+
}
|
|
1111
|
+
var CODEX_COMMAND_SKILL_PREFIX, LEGACY_CODEX_COMMAND_SKILL_PREFIX;
|
|
1112
|
+
var init_command_skill = __esm({
|
|
1113
|
+
"src/targets/codex-cli/command-skill.ts"() {
|
|
1114
|
+
init_markdown();
|
|
1115
|
+
CODEX_COMMAND_SKILL_PREFIX = "am-command-";
|
|
1116
|
+
LEGACY_CODEX_COMMAND_SKILL_PREFIX = "ab-command-";
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
function shouldImportScopedAgentsRule(relDir) {
|
|
1120
|
+
const segments = relDir.split("/").filter(Boolean);
|
|
1121
|
+
if (segments.length === 0) return false;
|
|
1122
|
+
if (segments.some((segment) => segment.startsWith("."))) return false;
|
|
1123
|
+
const relPath = segments.join("/");
|
|
1124
|
+
return !relPath.startsWith("tests/e2e/fixtures/");
|
|
1125
|
+
}
|
|
1126
|
+
async function removePathIfExists(path) {
|
|
1127
|
+
await rm(path, { recursive: true, force: true });
|
|
1128
|
+
}
|
|
1129
|
+
var init_scoped_agents_import = __esm({
|
|
1130
|
+
"src/targets/import/scoped-agents-import.ts"() {
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
962
1133
|
function generateEmbeddedSkills(canonical, skillsDir) {
|
|
963
1134
|
const outputs = [];
|
|
964
1135
|
for (const skill of canonical.skills) {
|
|
@@ -998,6 +1169,42 @@ async function importEmbeddedSkills(projectRoot, skillsDir, fromTool, results, n
|
|
|
998
1169
|
const { frontmatter, body } = parseFrontmatter(
|
|
999
1170
|
normalize(sourceSkillContent, sourceSkillFile, destinationSkillFile)
|
|
1000
1171
|
);
|
|
1172
|
+
const projectedCommand = parseCommandSkillFrontmatter(frontmatter, entry.name);
|
|
1173
|
+
if (projectedCommand) {
|
|
1174
|
+
await removePathIfExists(join(projectRoot, AB_SKILLS, entry.name));
|
|
1175
|
+
const destDir = join(projectRoot, AB_COMMANDS);
|
|
1176
|
+
await mkdirp(destDir);
|
|
1177
|
+
const commandPath = join(destDir, `${projectedCommand.name}.md`);
|
|
1178
|
+
await writeFileAtomic(
|
|
1179
|
+
commandPath,
|
|
1180
|
+
serializeImportedCommand(projectedCommand, normalize(body, sourceSkillFile, commandPath))
|
|
1181
|
+
);
|
|
1182
|
+
results.push({
|
|
1183
|
+
fromTool,
|
|
1184
|
+
fromPath: sourceSkillFile,
|
|
1185
|
+
toPath: `${AB_COMMANDS}/${projectedCommand.name}.md`,
|
|
1186
|
+
feature: "commands"
|
|
1187
|
+
});
|
|
1188
|
+
continue;
|
|
1189
|
+
}
|
|
1190
|
+
const projectedAgent = parseProjectedAgentSkillFrontmatter(frontmatter, entry.name);
|
|
1191
|
+
if (projectedAgent) {
|
|
1192
|
+
await removePathIfExists(join(projectRoot, AB_SKILLS, entry.name));
|
|
1193
|
+
const destDir = join(projectRoot, AB_AGENTS);
|
|
1194
|
+
await mkdirp(destDir);
|
|
1195
|
+
const agentPath = join(destDir, `${projectedAgent.name}.md`);
|
|
1196
|
+
await writeFileAtomic(
|
|
1197
|
+
agentPath,
|
|
1198
|
+
serializeImportedAgent(projectedAgent, normalize(body, sourceSkillFile, agentPath))
|
|
1199
|
+
);
|
|
1200
|
+
results.push({
|
|
1201
|
+
fromTool,
|
|
1202
|
+
fromPath: sourceSkillFile,
|
|
1203
|
+
toPath: `${AB_AGENTS}/${projectedAgent.name}.md`,
|
|
1204
|
+
feature: "agents"
|
|
1205
|
+
});
|
|
1206
|
+
continue;
|
|
1207
|
+
}
|
|
1001
1208
|
const output = await serializeImportedSkillWithFallback(
|
|
1002
1209
|
destinationSkillFile,
|
|
1003
1210
|
{ ...frontmatter, name: entry.name },
|
|
@@ -1029,13 +1236,18 @@ async function importEmbeddedSkills(projectRoot, skillsDir, fromTool, results, n
|
|
|
1029
1236
|
}
|
|
1030
1237
|
}
|
|
1031
1238
|
}
|
|
1032
|
-
var AB_SKILLS;
|
|
1239
|
+
var AB_SKILLS, AB_COMMANDS, AB_AGENTS;
|
|
1033
1240
|
var init_embedded_skill = __esm({
|
|
1034
1241
|
"src/targets/import/embedded-skill.ts"() {
|
|
1035
1242
|
init_fs();
|
|
1036
1243
|
init_markdown();
|
|
1037
1244
|
init_import_metadata();
|
|
1245
|
+
init_projected_agent_skill();
|
|
1246
|
+
init_command_skill();
|
|
1247
|
+
init_scoped_agents_import();
|
|
1038
1248
|
AB_SKILLS = ".agentsmesh/skills";
|
|
1249
|
+
AB_COMMANDS = ".agentsmesh/commands";
|
|
1250
|
+
AB_AGENTS = ".agentsmesh/agents";
|
|
1039
1251
|
}
|
|
1040
1252
|
});
|
|
1041
1253
|
|
|
@@ -1103,6 +1315,12 @@ function generateMcp(canonical) {
|
|
|
1103
1315
|
}
|
|
1104
1316
|
];
|
|
1105
1317
|
}
|
|
1318
|
+
function generateAgents(canonical) {
|
|
1319
|
+
return canonical.agents.map((agent) => ({
|
|
1320
|
+
path: `${ANTIGRAVITY_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
|
|
1321
|
+
content: serializeProjectedAgentSkill(agent)
|
|
1322
|
+
}));
|
|
1323
|
+
}
|
|
1106
1324
|
function renderAntigravityGlobalInstructions(canonical) {
|
|
1107
1325
|
const root = canonical.rules.find((rule) => rule.root);
|
|
1108
1326
|
const nonRootRules = canonical.rules.filter((rule) => {
|
|
@@ -1115,6 +1333,7 @@ var init_generator = __esm({
|
|
|
1115
1333
|
"src/targets/antigravity/generator.ts"() {
|
|
1116
1334
|
init_embedded_skill();
|
|
1117
1335
|
init_managed_blocks();
|
|
1336
|
+
init_projected_agent_skill();
|
|
1118
1337
|
init_constants();
|
|
1119
1338
|
}
|
|
1120
1339
|
});
|
|
@@ -1157,9 +1376,9 @@ var init_path_helpers = __esm({
|
|
|
1157
1376
|
});
|
|
1158
1377
|
|
|
1159
1378
|
// src/core/reference/import-map.ts
|
|
1160
|
-
async function buildImportReferenceMap(
|
|
1379
|
+
async function buildImportReferenceMap(target16, projectRoot, scope = "project") {
|
|
1161
1380
|
const refs = /* @__PURE__ */ new Map();
|
|
1162
|
-
const def = getDescriptor(
|
|
1381
|
+
const def = getDescriptor(target16);
|
|
1163
1382
|
if (def) {
|
|
1164
1383
|
await def.buildImportPaths(refs, projectRoot, scope);
|
|
1165
1384
|
}
|
|
@@ -1172,12 +1391,12 @@ var init_import_map = __esm({
|
|
|
1172
1391
|
});
|
|
1173
1392
|
|
|
1174
1393
|
// src/core/reference/link-format-registry.ts
|
|
1175
|
-
function topLevelDotfilePrefixes(
|
|
1176
|
-
const layouts = [
|
|
1394
|
+
function topLevelDotfilePrefixes(descriptor16) {
|
|
1395
|
+
const layouts = [descriptor16.project, descriptor16.globalSupport?.layout].filter(
|
|
1177
1396
|
(l) => l !== void 0
|
|
1178
1397
|
);
|
|
1179
1398
|
const candidates = [
|
|
1180
|
-
...
|
|
1399
|
+
...descriptor16.detectionPaths,
|
|
1181
1400
|
...layouts.flatMap((l) => l.managedOutputs?.dirs ?? []),
|
|
1182
1401
|
...layouts.flatMap((l) => l.managedOutputs?.files ?? [])
|
|
1183
1402
|
];
|
|
@@ -1190,8 +1409,8 @@ function topLevelDotfilePrefixes(descriptor14) {
|
|
|
1190
1409
|
}
|
|
1191
1410
|
function buildDefaultRootRelativePrefixes() {
|
|
1192
1411
|
const set = /* @__PURE__ */ new Set([".agentsmesh/"]);
|
|
1193
|
-
for (const
|
|
1194
|
-
for (const prefix of topLevelDotfilePrefixes(
|
|
1412
|
+
for (const descriptor16 of BUILTIN_TARGETS) {
|
|
1413
|
+
for (const prefix of topLevelDotfilePrefixes(descriptor16)) set.add(prefix);
|
|
1195
1414
|
}
|
|
1196
1415
|
return Array.from(set);
|
|
1197
1416
|
}
|
|
@@ -1424,21 +1643,21 @@ function formatLinkPathForDestinationLegacy(projectRoot, destinationFile, absolu
|
|
|
1424
1643
|
const api = pathApi(projectRoot);
|
|
1425
1644
|
const root = normalizeForProject(projectRoot, projectRoot);
|
|
1426
1645
|
const destFile = normalizeForProject(projectRoot, destinationFile);
|
|
1427
|
-
const
|
|
1428
|
-
if (!isUnderProjectRoot(projectRoot,
|
|
1429
|
-
return toProjectRootReference(projectRoot,
|
|
1646
|
+
const target16 = normalizeForProject(projectRoot, absoluteTargetPath);
|
|
1647
|
+
if (!isUnderProjectRoot(projectRoot, target16)) {
|
|
1648
|
+
return toProjectRootReference(projectRoot, target16, keepSlash)?.text ?? null;
|
|
1430
1649
|
}
|
|
1431
1650
|
const destDir = normalizeForProject(projectRoot, api.dirname(destFile));
|
|
1432
1651
|
if (!isUnderProjectRoot(projectRoot, destDir) && destDir !== root) {
|
|
1433
|
-
return toProjectRootReference(projectRoot,
|
|
1652
|
+
return toProjectRootReference(projectRoot, target16, keepSlash)?.text ?? null;
|
|
1434
1653
|
}
|
|
1435
|
-
let rel2 = api.relative(destDir,
|
|
1654
|
+
let rel2 = api.relative(destDir, target16).replace(/\\/g, "/");
|
|
1436
1655
|
if (api.isAbsolute(rel2) || WINDOWS_ABSOLUTE_PATH.test(rel2)) {
|
|
1437
|
-
return toProjectRootRelative(projectRoot,
|
|
1656
|
+
return toProjectRootRelative(projectRoot, target16, keepSlash);
|
|
1438
1657
|
}
|
|
1439
1658
|
const joined = normalizeForProject(projectRoot, api.join(destDir, rel2));
|
|
1440
1659
|
if (!isUnderProjectRoot(projectRoot, joined)) {
|
|
1441
|
-
return toProjectRootRelative(projectRoot,
|
|
1660
|
+
return toProjectRootRelative(projectRoot, target16, keepSlash);
|
|
1442
1661
|
}
|
|
1443
1662
|
if (rel2 === "" || rel2 === ".") {
|
|
1444
1663
|
rel2 = ".";
|
|
@@ -1457,11 +1676,11 @@ var init_link_rebaser_formatting = __esm({
|
|
|
1457
1676
|
// src/core/reference/link-rebaser-output.ts
|
|
1458
1677
|
function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTargetPath, keepSlash, options = {}) {
|
|
1459
1678
|
const scope = options.scope ?? "project";
|
|
1460
|
-
const
|
|
1461
|
-
if (isReadingContextOptions(options) && isUnderAgentsMesh(projectRoot, destinationFile) && isUnderAgentsMesh(projectRoot,
|
|
1679
|
+
const target16 = normalizeForProject(projectRoot, absoluteTargetPath);
|
|
1680
|
+
if (isReadingContextOptions(options) && isUnderAgentsMesh(projectRoot, destinationFile) && isUnderAgentsMesh(projectRoot, target16)) {
|
|
1462
1681
|
const api = pathApi(projectRoot);
|
|
1463
1682
|
const root = normalizeForProject(projectRoot, projectRoot);
|
|
1464
|
-
const rel2 = api.relative(root,
|
|
1683
|
+
const rel2 = api.relative(root, target16).replace(/\\/g, "/");
|
|
1465
1684
|
if (!rel2.startsWith("..") && rel2.length > 0) {
|
|
1466
1685
|
return keepSlash && !rel2.endsWith("/") ? `${rel2}/` : rel2;
|
|
1467
1686
|
}
|
|
@@ -1476,10 +1695,10 @@ function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTarg
|
|
|
1476
1695
|
);
|
|
1477
1696
|
}
|
|
1478
1697
|
if (scope === "global" && !isUnderAgentsMesh(projectRoot, destinationFile)) {
|
|
1479
|
-
return toProjectRootReference(projectRoot,
|
|
1698
|
+
return toProjectRootReference(projectRoot, target16, keepSlash)?.text ?? null;
|
|
1480
1699
|
}
|
|
1481
1700
|
const meshCanonicalForShape = (() => {
|
|
1482
|
-
if (isUnderAgentsMesh(projectRoot,
|
|
1701
|
+
if (isUnderAgentsMesh(projectRoot, target16)) return target16;
|
|
1483
1702
|
const logical = options.logicalMeshSourceAbsolute;
|
|
1484
1703
|
if (logical && isUnderAgentsMesh(projectRoot, normalizeForProject(projectRoot, logical))) {
|
|
1485
1704
|
return normalizeForProject(projectRoot, logical);
|
|
@@ -1487,9 +1706,9 @@ function formatLinkPathForDestination(projectRoot, destinationFile, absoluteTarg
|
|
|
1487
1706
|
return null;
|
|
1488
1707
|
})();
|
|
1489
1708
|
if (!meshCanonicalForShape) {
|
|
1490
|
-
return toProjectRootReference(projectRoot,
|
|
1709
|
+
return toProjectRootReference(projectRoot, target16, keepSlash)?.text ?? null;
|
|
1491
1710
|
}
|
|
1492
|
-
const treatAsDirectory = keepSlash || (options.pathIsDirectory?.(
|
|
1711
|
+
const treatAsDirectory = keepSlash || (options.pathIsDirectory?.(target16) ?? false);
|
|
1493
1712
|
if (treatAsDirectory) {
|
|
1494
1713
|
const meshRelative = toAgentsMeshRootRelative(projectRoot, meshCanonicalForShape, keepSlash);
|
|
1495
1714
|
if (meshRelative !== null) return meshRelative;
|
|
@@ -1855,10 +2074,10 @@ function pathVariants(api, path) {
|
|
|
1855
2074
|
}
|
|
1856
2075
|
return variants;
|
|
1857
2076
|
}
|
|
1858
|
-
async function createImportReferenceNormalizer(
|
|
2077
|
+
async function createImportReferenceNormalizer(target16, projectRoot, scope = "project") {
|
|
1859
2078
|
const api = pathApi(projectRoot);
|
|
1860
2079
|
const refs = /* @__PURE__ */ new Map();
|
|
1861
|
-
const targets = Array.from(/* @__PURE__ */ new Set([
|
|
2080
|
+
const targets = Array.from(/* @__PURE__ */ new Set([target16, ...TARGET_IDS]));
|
|
1862
2081
|
for (const candidate of targets) {
|
|
1863
2082
|
const candidateRefs = await buildImportReferenceMap(candidate, projectRoot, scope);
|
|
1864
2083
|
for (const [targetPath, canonicalPath] of candidateRefs.entries()) {
|
|
@@ -1957,7 +2176,7 @@ function toToolsArray(v) {
|
|
|
1957
2176
|
}
|
|
1958
2177
|
return [];
|
|
1959
2178
|
}
|
|
1960
|
-
function
|
|
2179
|
+
function toStringArray5(value) {
|
|
1961
2180
|
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
1962
2181
|
}
|
|
1963
2182
|
function toStringRecord(value) {
|
|
@@ -2047,7 +2266,7 @@ function commandMapper(spec) {
|
|
|
2047
2266
|
hasDescription: true,
|
|
2048
2267
|
description: pickString(remapped.description),
|
|
2049
2268
|
hasAllowedTools: true,
|
|
2050
|
-
allowedTools:
|
|
2269
|
+
allowedTools: toStringArray5(remapped["allowed-tools"])
|
|
2051
2270
|
},
|
|
2052
2271
|
body
|
|
2053
2272
|
);
|
|
@@ -2226,7 +2445,7 @@ function parseMcpJson(content) {
|
|
|
2226
2445
|
out[name] = {
|
|
2227
2446
|
type: typeof server.type === "string" ? server.type : "stdio",
|
|
2228
2447
|
command: server.command,
|
|
2229
|
-
args:
|
|
2448
|
+
args: toStringArray5(server.args),
|
|
2230
2449
|
env: toStringRecord(server.env),
|
|
2231
2450
|
description
|
|
2232
2451
|
};
|
|
@@ -2291,14 +2510,14 @@ function specsForFeature(importer, feature) {
|
|
|
2291
2510
|
if (Array.isArray(value)) return value;
|
|
2292
2511
|
return [value];
|
|
2293
2512
|
}
|
|
2294
|
-
async function runDescriptorImport(
|
|
2295
|
-
const importer =
|
|
2513
|
+
async function runDescriptorImport(descriptor16, projectRoot, scope, options) {
|
|
2514
|
+
const importer = descriptor16.importer;
|
|
2296
2515
|
if (!importer) return [];
|
|
2297
|
-
const normalize = options?.normalize ?? await createImportReferenceNormalizer(
|
|
2516
|
+
const normalize = options?.normalize ?? await createImportReferenceNormalizer(descriptor16.id, projectRoot, scope);
|
|
2298
2517
|
const results = [];
|
|
2299
2518
|
for (const feature of IMPORT_FEATURE_ORDER) {
|
|
2300
2519
|
for (const spec of specsForFeature(importer, feature)) {
|
|
2301
|
-
results.push(...await runSpec(spec, scope, projectRoot,
|
|
2520
|
+
results.push(...await runSpec(spec, scope, projectRoot, descriptor16.id, normalize));
|
|
2302
2521
|
}
|
|
2303
2522
|
}
|
|
2304
2523
|
return results;
|
|
@@ -2612,156 +2831,6 @@ var init_linter = __esm({
|
|
|
2612
2831
|
init_constants();
|
|
2613
2832
|
}
|
|
2614
2833
|
});
|
|
2615
|
-
|
|
2616
|
-
// src/targets/codex-cli/command-skill.ts
|
|
2617
|
-
function toStringArray4(value) {
|
|
2618
|
-
if (Array.isArray(value)) {
|
|
2619
|
-
return value.filter((entry) => typeof entry === "string" && entry.length > 0);
|
|
2620
|
-
}
|
|
2621
|
-
if (typeof value === "string" && value.length > 0) {
|
|
2622
|
-
return value.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
2623
|
-
}
|
|
2624
|
-
return [];
|
|
2625
|
-
}
|
|
2626
|
-
function commandSkillDirName(name) {
|
|
2627
|
-
return `${CODEX_COMMAND_SKILL_PREFIX}${name}`;
|
|
2628
|
-
}
|
|
2629
|
-
function serializeCommandSkill(command) {
|
|
2630
|
-
const frontmatter = {
|
|
2631
|
-
name: commandSkillDirName(command.name),
|
|
2632
|
-
description: command.description || void 0,
|
|
2633
|
-
"x-agentsmesh-kind": "command",
|
|
2634
|
-
"x-agentsmesh-name": command.name,
|
|
2635
|
-
"x-agentsmesh-allowed-tools": command.allowedTools.length > 0 ? command.allowedTools : void 0
|
|
2636
|
-
};
|
|
2637
|
-
if (frontmatter.description === void 0) delete frontmatter.description;
|
|
2638
|
-
if (frontmatter["x-agentsmesh-allowed-tools"] === void 0) {
|
|
2639
|
-
delete frontmatter["x-agentsmesh-allowed-tools"];
|
|
2640
|
-
}
|
|
2641
|
-
return serializeFrontmatter(frontmatter, command.body.trim() || "");
|
|
2642
|
-
}
|
|
2643
|
-
function parseCommandSkillFrontmatter(frontmatter, dirName) {
|
|
2644
|
-
if (frontmatter["x-agentsmesh-kind"] !== "command") return null;
|
|
2645
|
-
const metadataName = typeof frontmatter["x-agentsmesh-name"] === "string" ? frontmatter["x-agentsmesh-name"] : "";
|
|
2646
|
-
const derivedName = dirName.startsWith(CODEX_COMMAND_SKILL_PREFIX) ? dirName.slice(CODEX_COMMAND_SKILL_PREFIX.length) : dirName.startsWith(LEGACY_CODEX_COMMAND_SKILL_PREFIX) ? dirName.slice(LEGACY_CODEX_COMMAND_SKILL_PREFIX.length) : "";
|
|
2647
|
-
const name = (metadataName || derivedName).trim();
|
|
2648
|
-
if (!name) return null;
|
|
2649
|
-
return {
|
|
2650
|
-
name,
|
|
2651
|
-
description: typeof frontmatter.description === "string" ? frontmatter.description : "",
|
|
2652
|
-
allowedTools: toStringArray4(frontmatter["x-agentsmesh-allowed-tools"])
|
|
2653
|
-
};
|
|
2654
|
-
}
|
|
2655
|
-
function serializeImportedCommand(command, body) {
|
|
2656
|
-
return serializeFrontmatter(
|
|
2657
|
-
{
|
|
2658
|
-
description: command.description,
|
|
2659
|
-
"allowed-tools": command.allowedTools
|
|
2660
|
-
},
|
|
2661
|
-
body.trim() || ""
|
|
2662
|
-
);
|
|
2663
|
-
}
|
|
2664
|
-
var CODEX_COMMAND_SKILL_PREFIX, LEGACY_CODEX_COMMAND_SKILL_PREFIX;
|
|
2665
|
-
var init_command_skill = __esm({
|
|
2666
|
-
"src/targets/codex-cli/command-skill.ts"() {
|
|
2667
|
-
init_markdown();
|
|
2668
|
-
CODEX_COMMAND_SKILL_PREFIX = "am-command-";
|
|
2669
|
-
LEGACY_CODEX_COMMAND_SKILL_PREFIX = "ab-command-";
|
|
2670
|
-
}
|
|
2671
|
-
});
|
|
2672
|
-
|
|
2673
|
-
// src/targets/projection/projected-agent-skill.ts
|
|
2674
|
-
function toStringArray5(value) {
|
|
2675
|
-
if (Array.isArray(value)) {
|
|
2676
|
-
return value.filter((entry) => typeof entry === "string" && entry.length > 0);
|
|
2677
|
-
}
|
|
2678
|
-
if (typeof value === "string" && value.length > 0) {
|
|
2679
|
-
return value.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
2680
|
-
}
|
|
2681
|
-
return [];
|
|
2682
|
-
}
|
|
2683
|
-
function toHooks(value) {
|
|
2684
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
2685
|
-
const hooks = {};
|
|
2686
|
-
for (const [event, entries] of Object.entries(value)) {
|
|
2687
|
-
if (!Array.isArray(entries)) continue;
|
|
2688
|
-
hooks[event] = entries.filter(
|
|
2689
|
-
(entry) => entry !== null && typeof entry === "object" && typeof entry.matcher === "string" && typeof entry.command === "string"
|
|
2690
|
-
);
|
|
2691
|
-
}
|
|
2692
|
-
return hooks;
|
|
2693
|
-
}
|
|
2694
|
-
function projectedAgentSkillDirName(name) {
|
|
2695
|
-
return `${PROJECTED_AGENT_SKILL_PREFIX}${name}`;
|
|
2696
|
-
}
|
|
2697
|
-
function serializeProjectedAgentSkill(agent) {
|
|
2698
|
-
const frontmatter = {
|
|
2699
|
-
name: projectedAgentSkillDirName(agent.name),
|
|
2700
|
-
description: agent.description || void 0,
|
|
2701
|
-
"x-agentsmesh-kind": "agent",
|
|
2702
|
-
"x-agentsmesh-name": agent.name,
|
|
2703
|
-
"x-agentsmesh-tools": agent.tools.length > 0 ? agent.tools : void 0,
|
|
2704
|
-
"x-agentsmesh-disallowed-tools": agent.disallowedTools.length > 0 ? agent.disallowedTools : void 0,
|
|
2705
|
-
"x-agentsmesh-model": agent.model || void 0,
|
|
2706
|
-
"x-agentsmesh-permission-mode": agent.permissionMode || void 0,
|
|
2707
|
-
"x-agentsmesh-max-turns": agent.maxTurns > 0 ? agent.maxTurns : void 0,
|
|
2708
|
-
"x-agentsmesh-mcp-servers": agent.mcpServers.length > 0 ? agent.mcpServers : void 0,
|
|
2709
|
-
"x-agentsmesh-hooks": Object.keys(agent.hooks).length > 0 ? agent.hooks : void 0,
|
|
2710
|
-
"x-agentsmesh-skills": agent.skills.length > 0 ? agent.skills : void 0,
|
|
2711
|
-
"x-agentsmesh-memory": agent.memory || void 0
|
|
2712
|
-
};
|
|
2713
|
-
Object.keys(frontmatter).forEach((key) => {
|
|
2714
|
-
if (frontmatter[key] === void 0) delete frontmatter[key];
|
|
2715
|
-
});
|
|
2716
|
-
return serializeFrontmatter(frontmatter, agent.body.trim() || "");
|
|
2717
|
-
}
|
|
2718
|
-
function parseProjectedAgentSkillFrontmatter(frontmatter, dirName) {
|
|
2719
|
-
if (frontmatter["x-agentsmesh-kind"] !== "agent") return null;
|
|
2720
|
-
const metadataName = typeof frontmatter["x-agentsmesh-name"] === "string" ? frontmatter["x-agentsmesh-name"] : "";
|
|
2721
|
-
const derivedName = dirName.startsWith(PROJECTED_AGENT_SKILL_PREFIX) ? dirName.slice(PROJECTED_AGENT_SKILL_PREFIX.length) : dirName.startsWith(LEGACY_PROJECTED_AGENT_SKILL_PREFIX) ? dirName.slice(LEGACY_PROJECTED_AGENT_SKILL_PREFIX.length) : "";
|
|
2722
|
-
const name = (metadataName || derivedName).trim();
|
|
2723
|
-
if (!name) return null;
|
|
2724
|
-
return {
|
|
2725
|
-
name,
|
|
2726
|
-
description: typeof frontmatter.description === "string" ? frontmatter.description : "",
|
|
2727
|
-
tools: toStringArray5(frontmatter["x-agentsmesh-tools"]),
|
|
2728
|
-
disallowedTools: toStringArray5(frontmatter["x-agentsmesh-disallowed-tools"]),
|
|
2729
|
-
model: typeof frontmatter["x-agentsmesh-model"] === "string" ? frontmatter["x-agentsmesh-model"] : "",
|
|
2730
|
-
permissionMode: typeof frontmatter["x-agentsmesh-permission-mode"] === "string" ? frontmatter["x-agentsmesh-permission-mode"] : "",
|
|
2731
|
-
maxTurns: typeof frontmatter["x-agentsmesh-max-turns"] === "number" ? frontmatter["x-agentsmesh-max-turns"] : Number(frontmatter["x-agentsmesh-max-turns"] ?? 0),
|
|
2732
|
-
mcpServers: toStringArray5(frontmatter["x-agentsmesh-mcp-servers"]),
|
|
2733
|
-
hooks: toHooks(frontmatter["x-agentsmesh-hooks"]),
|
|
2734
|
-
skills: toStringArray5(frontmatter["x-agentsmesh-skills"]),
|
|
2735
|
-
memory: typeof frontmatter["x-agentsmesh-memory"] === "string" ? frontmatter["x-agentsmesh-memory"] : ""
|
|
2736
|
-
};
|
|
2737
|
-
}
|
|
2738
|
-
function serializeImportedAgent(agent, body) {
|
|
2739
|
-
const frontmatter = {
|
|
2740
|
-
name: agent.name,
|
|
2741
|
-
description: agent.description,
|
|
2742
|
-
tools: agent.tools,
|
|
2743
|
-
disallowedTools: agent.disallowedTools.length > 0 ? agent.disallowedTools : void 0,
|
|
2744
|
-
model: agent.model || void 0,
|
|
2745
|
-
permissionMode: agent.permissionMode || void 0,
|
|
2746
|
-
maxTurns: agent.maxTurns > 0 ? agent.maxTurns : void 0,
|
|
2747
|
-
mcpServers: agent.mcpServers.length > 0 ? agent.mcpServers : void 0,
|
|
2748
|
-
hooks: Object.keys(agent.hooks).length > 0 ? agent.hooks : void 0,
|
|
2749
|
-
skills: agent.skills.length > 0 ? agent.skills : void 0,
|
|
2750
|
-
memory: agent.memory || void 0
|
|
2751
|
-
};
|
|
2752
|
-
Object.keys(frontmatter).forEach((key) => {
|
|
2753
|
-
if (frontmatter[key] === void 0) delete frontmatter[key];
|
|
2754
|
-
});
|
|
2755
|
-
return serializeFrontmatter(frontmatter, body.trim() || "");
|
|
2756
|
-
}
|
|
2757
|
-
var PROJECTED_AGENT_SKILL_PREFIX, LEGACY_PROJECTED_AGENT_SKILL_PREFIX;
|
|
2758
|
-
var init_projected_agent_skill = __esm({
|
|
2759
|
-
"src/targets/projection/projected-agent-skill.ts"() {
|
|
2760
|
-
init_markdown();
|
|
2761
|
-
PROJECTED_AGENT_SKILL_PREFIX = "am-agent-";
|
|
2762
|
-
LEGACY_PROJECTED_AGENT_SKILL_PREFIX = "ab-agent-";
|
|
2763
|
-
}
|
|
2764
|
-
});
|
|
2765
2834
|
function rel(projectRoot, absPath) {
|
|
2766
2835
|
return pathApi(projectRoot).relative(projectRoot, absPath).replace(/\\/g, "/");
|
|
2767
2836
|
}
|
|
@@ -2799,12 +2868,12 @@ function addSkillLikeMapping(refs, relPath, skillsDir) {
|
|
|
2799
2868
|
if (!dirName || !filePath) return;
|
|
2800
2869
|
const commandPrefix = dirName.startsWith(CODEX_COMMAND_SKILL_PREFIX) ? CODEX_COMMAND_SKILL_PREFIX : dirName.startsWith(LEGACY_CODEX_COMMAND_SKILL_PREFIX) ? LEGACY_CODEX_COMMAND_SKILL_PREFIX : null;
|
|
2801
2870
|
if (commandPrefix && filePath === "SKILL.md") {
|
|
2802
|
-
refs.set(relPath, `${
|
|
2871
|
+
refs.set(relPath, `${AB_COMMANDS2}/${dirName.slice(commandPrefix.length)}.md`);
|
|
2803
2872
|
return;
|
|
2804
2873
|
}
|
|
2805
2874
|
const agentPrefix = dirName.startsWith(PROJECTED_AGENT_SKILL_PREFIX) ? PROJECTED_AGENT_SKILL_PREFIX : dirName.startsWith(LEGACY_PROJECTED_AGENT_SKILL_PREFIX) ? LEGACY_PROJECTED_AGENT_SKILL_PREFIX : null;
|
|
2806
2875
|
if (agentPrefix && filePath === "SKILL.md") {
|
|
2807
|
-
refs.set(relPath, `${
|
|
2876
|
+
refs.set(relPath, `${AB_AGENTS2}/${dirName.slice(agentPrefix.length)}.md`);
|
|
2808
2877
|
return;
|
|
2809
2878
|
}
|
|
2810
2879
|
const canonicalBase = `${AB_SKILLS2}/${dirName}`;
|
|
@@ -2822,18 +2891,18 @@ async function targetRootSegments() {
|
|
|
2822
2891
|
if (targetRootSegmentsCache !== void 0) return targetRootSegmentsCache;
|
|
2823
2892
|
const { BUILTIN_TARGETS: BUILTIN_TARGETS2 } = await Promise.resolve().then(() => (init_builtin_targets(), builtin_targets_exports));
|
|
2824
2893
|
const roots = /* @__PURE__ */ new Set();
|
|
2825
|
-
for (const
|
|
2894
|
+
for (const descriptor16 of BUILTIN_TARGETS2) {
|
|
2826
2895
|
for (const path of [
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
...
|
|
2830
|
-
...
|
|
2831
|
-
...
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
...
|
|
2835
|
-
...
|
|
2836
|
-
...
|
|
2896
|
+
descriptor16.project.rootInstructionPath,
|
|
2897
|
+
descriptor16.project.skillDir,
|
|
2898
|
+
...descriptor16.project.managedOutputs?.dirs ?? [],
|
|
2899
|
+
...descriptor16.project.managedOutputs?.files ?? [],
|
|
2900
|
+
...descriptor16.detectionPaths,
|
|
2901
|
+
descriptor16.globalSupport?.layout.rootInstructionPath,
|
|
2902
|
+
descriptor16.globalSupport?.layout.skillDir,
|
|
2903
|
+
...descriptor16.globalSupport?.layout.managedOutputs?.dirs ?? [],
|
|
2904
|
+
...descriptor16.globalSupport?.layout.managedOutputs?.files ?? [],
|
|
2905
|
+
...descriptor16.globalSupport?.detectionPaths ?? []
|
|
2837
2906
|
]) {
|
|
2838
2907
|
if (path !== void 0) {
|
|
2839
2908
|
const segment = firstPathSegment(path);
|
|
@@ -2890,7 +2959,7 @@ async function addScopedAgentsMappings(refs, projectRoot) {
|
|
|
2890
2959
|
refs.set(relPath, `${AB_RULES}/${ruleName}.md`);
|
|
2891
2960
|
}
|
|
2892
2961
|
}
|
|
2893
|
-
var AB_RULES,
|
|
2962
|
+
var AB_RULES, AB_COMMANDS2, AB_AGENTS2, AB_SKILLS2, targetRootSegmentsCache;
|
|
2894
2963
|
var init_import_map_shared = __esm({
|
|
2895
2964
|
"src/core/reference/import-map-shared.ts"() {
|
|
2896
2965
|
init_path_helpers();
|
|
@@ -2898,19 +2967,19 @@ var init_import_map_shared = __esm({
|
|
|
2898
2967
|
init_command_skill();
|
|
2899
2968
|
init_projected_agent_skill();
|
|
2900
2969
|
AB_RULES = ".agentsmesh/rules";
|
|
2901
|
-
|
|
2902
|
-
|
|
2970
|
+
AB_COMMANDS2 = ".agentsmesh/commands";
|
|
2971
|
+
AB_AGENTS2 = ".agentsmesh/agents";
|
|
2903
2972
|
AB_SKILLS2 = ".agentsmesh/skills";
|
|
2904
2973
|
}
|
|
2905
2974
|
});
|
|
2906
2975
|
|
|
2907
2976
|
// src/core/reference/import-maps/constants.ts
|
|
2908
|
-
var AB_RULES2,
|
|
2977
|
+
var AB_RULES2, AB_COMMANDS3, AB_AGENTS3;
|
|
2909
2978
|
var init_constants2 = __esm({
|
|
2910
2979
|
"src/core/reference/import-maps/constants.ts"() {
|
|
2911
2980
|
AB_RULES2 = ".agentsmesh/rules";
|
|
2912
|
-
|
|
2913
|
-
|
|
2981
|
+
AB_COMMANDS3 = ".agentsmesh/commands";
|
|
2982
|
+
AB_AGENTS3 = ".agentsmesh/agents";
|
|
2914
2983
|
}
|
|
2915
2984
|
});
|
|
2916
2985
|
|
|
@@ -2932,7 +3001,7 @@ async function buildAntigravityImportPaths(refs, projectRoot, scope = "project")
|
|
|
2932
3001
|
addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
|
|
2933
3002
|
}
|
|
2934
3003
|
for (const absPath of await listFiles(projectRoot, ANTIGRAVITY_WORKFLOWS_DIR)) {
|
|
2935
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3004
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
2936
3005
|
}
|
|
2937
3006
|
for (const absPath of await listFiles(projectRoot, ANTIGRAVITY_SKILLS_DIR)) {
|
|
2938
3007
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ANTIGRAVITY_SKILLS_DIR);
|
|
@@ -2990,10 +3059,10 @@ async function buildClaudeCodeImportPaths(refs, projectRoot, scope = "project")
|
|
|
2990
3059
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
2991
3060
|
}
|
|
2992
3061
|
for (const absPath of await listFiles(projectRoot, ".claude/commands")) {
|
|
2993
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3062
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
2994
3063
|
}
|
|
2995
3064
|
for (const absPath of await listFiles(projectRoot, ".claude/agents")) {
|
|
2996
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3065
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
2997
3066
|
}
|
|
2998
3067
|
for (const absPath of await listFiles(projectRoot, ".claude/skills")) {
|
|
2999
3068
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".claude/skills");
|
|
@@ -3038,7 +3107,7 @@ async function buildClineImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3038
3107
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3039
3108
|
}
|
|
3040
3109
|
for (const absPath of await listFiles(projectRoot, CLINE_GLOBAL_WORKFLOWS_DIR)) {
|
|
3041
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3110
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3042
3111
|
}
|
|
3043
3112
|
for (const absPath of await listFiles(projectRoot, CLINE_SKILLS_DIR)) {
|
|
3044
3113
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), CLINE_SKILLS_DIR);
|
|
@@ -3055,7 +3124,7 @@ async function buildClineImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3055
3124
|
addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
|
|
3056
3125
|
}
|
|
3057
3126
|
for (const absPath of await listFiles(projectRoot, ".clinerules/workflows")) {
|
|
3058
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3127
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3059
3128
|
}
|
|
3060
3129
|
for (const absPath of await listFiles(projectRoot, ".cline/skills")) {
|
|
3061
3130
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".cline/skills");
|
|
@@ -3093,7 +3162,7 @@ async function buildCodexCliImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3093
3162
|
}
|
|
3094
3163
|
}
|
|
3095
3164
|
for (const absPath of await listFiles(projectRoot, ".codex/agents")) {
|
|
3096
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3165
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".toml");
|
|
3097
3166
|
}
|
|
3098
3167
|
for (const absPath of await listFiles(projectRoot, ".agents/skills")) {
|
|
3099
3168
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".agents/skills");
|
|
@@ -3134,7 +3203,7 @@ async function buildContinueImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3134
3203
|
addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
|
|
3135
3204
|
}
|
|
3136
3205
|
for (const absPath of await listFiles(projectRoot, ".continue/prompts")) {
|
|
3137
|
-
refs.set(rel(projectRoot, absPath), `${
|
|
3206
|
+
refs.set(rel(projectRoot, absPath), `${AB_COMMANDS3}/${basename(absPath, ".md")}.md`);
|
|
3138
3207
|
}
|
|
3139
3208
|
for (const absPath of await listFiles(projectRoot, ".continue/skills")) {
|
|
3140
3209
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".continue/skills");
|
|
@@ -3168,10 +3237,10 @@ async function buildCopilotImportPaths(refs, projectRoot) {
|
|
|
3168
3237
|
addCopilotInstructionMapping(refs, rel(projectRoot, absPath));
|
|
3169
3238
|
}
|
|
3170
3239
|
for (const absPath of await listFiles(projectRoot, ".github/prompts")) {
|
|
3171
|
-
refs.set(rel(projectRoot, absPath), `${
|
|
3240
|
+
refs.set(rel(projectRoot, absPath), `${AB_COMMANDS3}/${basename(absPath, ".prompt.md")}.md`);
|
|
3172
3241
|
}
|
|
3173
3242
|
for (const absPath of await listFiles(projectRoot, ".github/agents")) {
|
|
3174
|
-
refs.set(rel(projectRoot, absPath), `${
|
|
3243
|
+
refs.set(rel(projectRoot, absPath), `${AB_AGENTS3}/${basename(absPath, ".agent.md")}.md`);
|
|
3175
3244
|
}
|
|
3176
3245
|
for (const absPath of await listFiles(projectRoot, ".github/skills")) {
|
|
3177
3246
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".github/skills");
|
|
@@ -3227,10 +3296,10 @@ async function buildCursorImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3227
3296
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".mdc");
|
|
3228
3297
|
}
|
|
3229
3298
|
for (const absPath of await listFiles(projectRoot, ".cursor/commands")) {
|
|
3230
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3299
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3231
3300
|
}
|
|
3232
3301
|
for (const absPath of await listFiles(projectRoot, ".cursor/agents")) {
|
|
3233
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3302
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3234
3303
|
}
|
|
3235
3304
|
for (const absPath of await listFiles(projectRoot, ".cursor/skills")) {
|
|
3236
3305
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".cursor/skills");
|
|
@@ -3242,10 +3311,10 @@ async function buildCursorImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3242
3311
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".mdc");
|
|
3243
3312
|
}
|
|
3244
3313
|
for (const absPath of await listFiles(projectRoot, ".cursor/commands")) {
|
|
3245
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3314
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3246
3315
|
}
|
|
3247
3316
|
for (const absPath of await listFiles(projectRoot, ".cursor/agents")) {
|
|
3248
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3317
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3249
3318
|
}
|
|
3250
3319
|
for (const absPath of await listFiles(projectRoot, ".cursor/skills")) {
|
|
3251
3320
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".cursor/skills");
|
|
@@ -3272,10 +3341,10 @@ async function buildGeminiCliImportPaths(refs, projectRoot) {
|
|
|
3272
3341
|
const relativeNoExt = noExt.startsWith(commandsPrefix) ? noExt.slice(commandsPrefix.length) : noExt;
|
|
3273
3342
|
const segments = relativeNoExt.split("/").filter(Boolean);
|
|
3274
3343
|
const canonicalName = segments.join(":");
|
|
3275
|
-
refs.set(relPath, `${
|
|
3344
|
+
refs.set(relPath, `${AB_COMMANDS3}/${canonicalName}.md`);
|
|
3276
3345
|
}
|
|
3277
3346
|
for (const absPath of await listFiles(projectRoot, ".gemini/agents")) {
|
|
3278
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3347
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3279
3348
|
}
|
|
3280
3349
|
for (const absPath of await listFiles(projectRoot, ".gemini/skills")) {
|
|
3281
3350
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".gemini/skills");
|
|
@@ -3288,9 +3357,50 @@ var init_gemini_cli = __esm({
|
|
|
3288
3357
|
}
|
|
3289
3358
|
});
|
|
3290
3359
|
|
|
3360
|
+
// src/targets/goose/constants.ts
|
|
3361
|
+
var GOOSE_TARGET, GOOSE_ROOT_FILE, GOOSE_SKILLS_DIR, GOOSE_IGNORE, GOOSE_GLOBAL_DIR, GOOSE_GLOBAL_ROOT_FILE, GOOSE_GLOBAL_IGNORE, GOOSE_GLOBAL_SKILLS_DIR, GOOSE_CANONICAL_RULES_DIR, GOOSE_CANONICAL_IGNORE;
|
|
3362
|
+
var init_constants7 = __esm({
|
|
3363
|
+
"src/targets/goose/constants.ts"() {
|
|
3364
|
+
GOOSE_TARGET = "goose";
|
|
3365
|
+
GOOSE_ROOT_FILE = ".goosehints";
|
|
3366
|
+
GOOSE_SKILLS_DIR = ".agents/skills";
|
|
3367
|
+
GOOSE_IGNORE = ".gooseignore";
|
|
3368
|
+
GOOSE_GLOBAL_DIR = ".config/goose";
|
|
3369
|
+
GOOSE_GLOBAL_ROOT_FILE = `${GOOSE_GLOBAL_DIR}/.goosehints`;
|
|
3370
|
+
GOOSE_GLOBAL_IGNORE = `${GOOSE_GLOBAL_DIR}/.gooseignore`;
|
|
3371
|
+
GOOSE_GLOBAL_SKILLS_DIR = ".agents/skills";
|
|
3372
|
+
GOOSE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
3373
|
+
GOOSE_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
3374
|
+
}
|
|
3375
|
+
});
|
|
3376
|
+
|
|
3377
|
+
// src/core/reference/import-maps/goose.ts
|
|
3378
|
+
async function buildGooseImportPaths(refs, projectRoot, scope = "project") {
|
|
3379
|
+
if (scope === "global") {
|
|
3380
|
+
refs.set(GOOSE_GLOBAL_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
3381
|
+
for (const absPath of await listFiles(projectRoot, GOOSE_GLOBAL_SKILLS_DIR)) {
|
|
3382
|
+
addSkillLikeMapping(refs, rel(projectRoot, absPath), GOOSE_GLOBAL_SKILLS_DIR);
|
|
3383
|
+
}
|
|
3384
|
+
refs.set(GOOSE_GLOBAL_IGNORE, ".agentsmesh/ignore");
|
|
3385
|
+
return;
|
|
3386
|
+
}
|
|
3387
|
+
refs.set(GOOSE_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
3388
|
+
for (const absPath of await listFiles(projectRoot, GOOSE_SKILLS_DIR)) {
|
|
3389
|
+
addSkillLikeMapping(refs, rel(projectRoot, absPath), GOOSE_SKILLS_DIR);
|
|
3390
|
+
}
|
|
3391
|
+
refs.set(GOOSE_IGNORE, ".agentsmesh/ignore");
|
|
3392
|
+
}
|
|
3393
|
+
var init_goose = __esm({
|
|
3394
|
+
"src/core/reference/import-maps/goose.ts"() {
|
|
3395
|
+
init_import_map_shared();
|
|
3396
|
+
init_constants7();
|
|
3397
|
+
init_constants2();
|
|
3398
|
+
}
|
|
3399
|
+
});
|
|
3400
|
+
|
|
3291
3401
|
// src/targets/junie/constants.ts
|
|
3292
3402
|
var JUNIE_TARGET, JUNIE_DIR, JUNIE_GUIDELINES, JUNIE_CI_GUIDELINES, JUNIE_DOT_AGENTS, JUNIE_AGENTS_FALLBACK, JUNIE_MCP_DIR, JUNIE_MCP_FILE, JUNIE_SKILLS_DIR, JUNIE_RULES_DIR, JUNIE_COMMANDS_DIR, JUNIE_AGENTS_DIR, JUNIE_IGNORE, JUNIE_GLOBAL_DIR, JUNIE_GLOBAL_SKILLS_DIR, JUNIE_GLOBAL_AGENTS_DIR, JUNIE_GLOBAL_COMMANDS_DIR, JUNIE_GLOBAL_MCP_DIR, JUNIE_GLOBAL_MCP_FILE, JUNIE_GLOBAL_AGENTS_MD, JUNIE_GLOBAL_AGENTS_SKILLS_DIR, JUNIE_CANONICAL_ROOT_RULE, JUNIE_CANONICAL_RULES_DIR, JUNIE_CANONICAL_COMMANDS_DIR, JUNIE_CANONICAL_AGENTS_DIR, JUNIE_CANONICAL_MCP, JUNIE_CANONICAL_IGNORE;
|
|
3293
|
-
var
|
|
3403
|
+
var init_constants8 = __esm({
|
|
3294
3404
|
"src/targets/junie/constants.ts"() {
|
|
3295
3405
|
JUNIE_TARGET = "junie";
|
|
3296
3406
|
JUNIE_DIR = ".junie";
|
|
@@ -3331,10 +3441,10 @@ async function buildJunieImportPaths(refs, projectRoot) {
|
|
|
3331
3441
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3332
3442
|
}
|
|
3333
3443
|
for (const absPath of await listFiles(projectRoot, ".junie/commands")) {
|
|
3334
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3444
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3335
3445
|
}
|
|
3336
3446
|
for (const absPath of await listFiles(projectRoot, ".junie/agents")) {
|
|
3337
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3447
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3338
3448
|
}
|
|
3339
3449
|
for (const absPath of await listFiles(projectRoot, ".junie/skills")) {
|
|
3340
3450
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".junie/skills");
|
|
@@ -3343,14 +3453,14 @@ async function buildJunieImportPaths(refs, projectRoot) {
|
|
|
3343
3453
|
var init_junie = __esm({
|
|
3344
3454
|
"src/core/reference/import-maps/junie.ts"() {
|
|
3345
3455
|
init_import_map_shared();
|
|
3346
|
-
|
|
3456
|
+
init_constants8();
|
|
3347
3457
|
init_constants2();
|
|
3348
3458
|
}
|
|
3349
3459
|
});
|
|
3350
3460
|
|
|
3351
3461
|
// src/targets/kilo-code/constants.ts
|
|
3352
3462
|
var KILO_CODE_TARGET, KILO_CODE_DIR, KILO_CODE_ROOT_RULE, KILO_CODE_RULES_DIR, KILO_CODE_COMMANDS_DIR, KILO_CODE_AGENTS_DIR, KILO_CODE_SKILLS_DIR, KILO_CODE_MCP_FILE, KILO_CODE_IGNORE, KILO_CODE_LEGACY_DIR, KILO_CODE_LEGACY_RULES_DIR, KILO_CODE_LEGACY_WORKFLOWS_DIR, KILO_CODE_LEGACY_SKILLS_DIR, KILO_CODE_LEGACY_MCP_FILE, KILO_CODE_LEGACY_MODES_FILE, KILO_CODE_GLOBAL_DIR, KILO_CODE_GLOBAL_AGENTS_MD, KILO_CODE_GLOBAL_RULES_DIR, KILO_CODE_GLOBAL_COMMANDS_DIR, KILO_CODE_GLOBAL_AGENTS_DIR, KILO_CODE_GLOBAL_SKILLS_DIR, KILO_CODE_GLOBAL_MCP_FILE, KILO_CODE_GLOBAL_IGNORE, KILO_CODE_GLOBAL_AGENTS_SKILLS_DIR, KILO_CODE_CANONICAL_RULES_DIR, KILO_CODE_CANONICAL_COMMANDS_DIR, KILO_CODE_CANONICAL_AGENTS_DIR, KILO_CODE_CANONICAL_MCP, KILO_CODE_CANONICAL_IGNORE;
|
|
3353
|
-
var
|
|
3463
|
+
var init_constants9 = __esm({
|
|
3354
3464
|
"src/targets/kilo-code/constants.ts"() {
|
|
3355
3465
|
KILO_CODE_TARGET = "kilo-code";
|
|
3356
3466
|
KILO_CODE_DIR = ".kilo";
|
|
@@ -3390,10 +3500,10 @@ async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3390
3500
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3391
3501
|
}
|
|
3392
3502
|
for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_COMMANDS_DIR)) {
|
|
3393
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3503
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3394
3504
|
}
|
|
3395
3505
|
for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_AGENTS_DIR)) {
|
|
3396
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3506
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3397
3507
|
}
|
|
3398
3508
|
for (const absPath of await listFiles(projectRoot, KILO_CODE_GLOBAL_SKILLS_DIR)) {
|
|
3399
3509
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_GLOBAL_SKILLS_DIR);
|
|
@@ -3406,10 +3516,10 @@ async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3406
3516
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3407
3517
|
}
|
|
3408
3518
|
for (const absPath of await listFiles(projectRoot, KILO_CODE_COMMANDS_DIR)) {
|
|
3409
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3519
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3410
3520
|
}
|
|
3411
3521
|
for (const absPath of await listFiles(projectRoot, KILO_CODE_AGENTS_DIR)) {
|
|
3412
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3522
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3413
3523
|
}
|
|
3414
3524
|
for (const absPath of await listFiles(projectRoot, KILO_CODE_SKILLS_DIR)) {
|
|
3415
3525
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_SKILLS_DIR);
|
|
@@ -3424,7 +3534,7 @@ async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3424
3534
|
addSimpleFileMapping(refs, relPath, AB_RULES2, ".md");
|
|
3425
3535
|
}
|
|
3426
3536
|
for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_WORKFLOWS_DIR)) {
|
|
3427
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3537
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3428
3538
|
}
|
|
3429
3539
|
for (const absPath of await listFiles(projectRoot, KILO_CODE_LEGACY_SKILLS_DIR)) {
|
|
3430
3540
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), KILO_CODE_LEGACY_SKILLS_DIR);
|
|
@@ -3434,14 +3544,14 @@ async function buildKiloCodeImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3434
3544
|
var init_kilo_code = __esm({
|
|
3435
3545
|
"src/core/reference/import-maps/kilo-code.ts"() {
|
|
3436
3546
|
init_import_map_shared();
|
|
3437
|
-
|
|
3547
|
+
init_constants9();
|
|
3438
3548
|
init_constants2();
|
|
3439
3549
|
}
|
|
3440
3550
|
});
|
|
3441
3551
|
|
|
3442
3552
|
// src/targets/kiro/constants.ts
|
|
3443
3553
|
var KIRO_TARGET, KIRO_AGENTS_MD, KIRO_DIR, KIRO_STEERING_DIR, KIRO_SKILLS_DIR, KIRO_AGENTS_DIR, KIRO_HOOKS_DIR, KIRO_SETTINGS_DIR, KIRO_MCP_FILE, KIRO_IGNORE, KIRO_GLOBAL_STEERING_DIR, KIRO_GLOBAL_STEERING_AGENTS_MD, KIRO_GLOBAL_SKILLS_DIR, KIRO_GLOBAL_AGENTS_DIR, KIRO_GLOBAL_MCP_FILE, KIRO_GLOBAL_IGNORE, KIRO_GLOBAL_AGENTS_SKILLS_DIR, KIRO_CANONICAL_ROOT_RULE, KIRO_CANONICAL_RULES_DIR, KIRO_CANONICAL_AGENTS_DIR, KIRO_CANONICAL_MCP, KIRO_CANONICAL_HOOKS, KIRO_CANONICAL_IGNORE;
|
|
3444
|
-
var
|
|
3554
|
+
var init_constants10 = __esm({
|
|
3445
3555
|
"src/targets/kiro/constants.ts"() {
|
|
3446
3556
|
KIRO_TARGET = "kiro";
|
|
3447
3557
|
KIRO_AGENTS_MD = "AGENTS.md";
|
|
@@ -3482,7 +3592,7 @@ async function buildKiroImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3482
3592
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), KIRO_GLOBAL_SKILLS_DIR);
|
|
3483
3593
|
}
|
|
3484
3594
|
for (const absPath of await listFiles(projectRoot, KIRO_GLOBAL_AGENTS_DIR)) {
|
|
3485
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3595
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3486
3596
|
}
|
|
3487
3597
|
return;
|
|
3488
3598
|
}
|
|
@@ -3494,20 +3604,89 @@ async function buildKiroImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3494
3604
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), KIRO_SKILLS_DIR);
|
|
3495
3605
|
}
|
|
3496
3606
|
for (const absPath of await listFiles(projectRoot, KIRO_AGENTS_DIR)) {
|
|
3497
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3607
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3498
3608
|
}
|
|
3499
3609
|
}
|
|
3500
3610
|
var init_kiro = __esm({
|
|
3501
3611
|
"src/core/reference/import-maps/kiro.ts"() {
|
|
3502
3612
|
init_import_map_shared();
|
|
3503
|
-
|
|
3613
|
+
init_constants10();
|
|
3614
|
+
init_constants2();
|
|
3615
|
+
}
|
|
3616
|
+
});
|
|
3617
|
+
|
|
3618
|
+
// src/targets/opencode/constants.ts
|
|
3619
|
+
var OPENCODE_TARGET, OPENCODE_DIR, OPENCODE_ROOT_RULE, OPENCODE_RULES_DIR, OPENCODE_COMMANDS_DIR, OPENCODE_AGENTS_DIR, OPENCODE_SKILLS_DIR, OPENCODE_CONFIG_FILE, OPENCODE_GLOBAL_DIR, OPENCODE_GLOBAL_AGENTS_MD, OPENCODE_GLOBAL_RULES_DIR, OPENCODE_GLOBAL_COMMANDS_DIR, OPENCODE_GLOBAL_AGENTS_DIR, OPENCODE_GLOBAL_SKILLS_DIR, OPENCODE_GLOBAL_CONFIG_FILE, OPENCODE_GLOBAL_AGENTS_SKILLS_DIR, OPENCODE_CANONICAL_RULES_DIR, OPENCODE_CANONICAL_COMMANDS_DIR, OPENCODE_CANONICAL_AGENTS_DIR, OPENCODE_CANONICAL_MCP;
|
|
3620
|
+
var init_constants11 = __esm({
|
|
3621
|
+
"src/targets/opencode/constants.ts"() {
|
|
3622
|
+
OPENCODE_TARGET = "opencode";
|
|
3623
|
+
OPENCODE_DIR = ".opencode";
|
|
3624
|
+
OPENCODE_ROOT_RULE = "AGENTS.md";
|
|
3625
|
+
OPENCODE_RULES_DIR = `${OPENCODE_DIR}/rules`;
|
|
3626
|
+
OPENCODE_COMMANDS_DIR = `${OPENCODE_DIR}/commands`;
|
|
3627
|
+
OPENCODE_AGENTS_DIR = `${OPENCODE_DIR}/agents`;
|
|
3628
|
+
OPENCODE_SKILLS_DIR = `${OPENCODE_DIR}/skills`;
|
|
3629
|
+
OPENCODE_CONFIG_FILE = "opencode.json";
|
|
3630
|
+
OPENCODE_GLOBAL_DIR = ".config/opencode";
|
|
3631
|
+
OPENCODE_GLOBAL_AGENTS_MD = `${OPENCODE_GLOBAL_DIR}/AGENTS.md`;
|
|
3632
|
+
OPENCODE_GLOBAL_RULES_DIR = `${OPENCODE_GLOBAL_DIR}/rules`;
|
|
3633
|
+
OPENCODE_GLOBAL_COMMANDS_DIR = `${OPENCODE_GLOBAL_DIR}/commands`;
|
|
3634
|
+
OPENCODE_GLOBAL_AGENTS_DIR = `${OPENCODE_GLOBAL_DIR}/agents`;
|
|
3635
|
+
OPENCODE_GLOBAL_SKILLS_DIR = `${OPENCODE_GLOBAL_DIR}/skills`;
|
|
3636
|
+
OPENCODE_GLOBAL_CONFIG_FILE = `${OPENCODE_GLOBAL_DIR}/opencode.json`;
|
|
3637
|
+
OPENCODE_GLOBAL_AGENTS_SKILLS_DIR = ".agents/skills";
|
|
3638
|
+
OPENCODE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
3639
|
+
OPENCODE_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
3640
|
+
OPENCODE_CANONICAL_AGENTS_DIR = ".agentsmesh/agents";
|
|
3641
|
+
OPENCODE_CANONICAL_MCP = ".agentsmesh/mcp.json";
|
|
3642
|
+
}
|
|
3643
|
+
});
|
|
3644
|
+
|
|
3645
|
+
// src/core/reference/import-maps/opencode.ts
|
|
3646
|
+
async function buildOpencodeImportPaths(refs, projectRoot, scope = "project") {
|
|
3647
|
+
if (scope === "global") {
|
|
3648
|
+
refs.set(OPENCODE_GLOBAL_AGENTS_MD, `${AB_RULES2}/_root.md`);
|
|
3649
|
+
for (const absPath of await listFiles(projectRoot, OPENCODE_GLOBAL_RULES_DIR)) {
|
|
3650
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3651
|
+
}
|
|
3652
|
+
for (const absPath of await listFiles(projectRoot, OPENCODE_GLOBAL_COMMANDS_DIR)) {
|
|
3653
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3654
|
+
}
|
|
3655
|
+
for (const absPath of await listFiles(projectRoot, OPENCODE_GLOBAL_AGENTS_DIR)) {
|
|
3656
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3657
|
+
}
|
|
3658
|
+
for (const absPath of await listFiles(projectRoot, OPENCODE_GLOBAL_SKILLS_DIR)) {
|
|
3659
|
+
addSkillLikeMapping(refs, rel(projectRoot, absPath), OPENCODE_GLOBAL_SKILLS_DIR);
|
|
3660
|
+
}
|
|
3661
|
+
refs.set(OPENCODE_GLOBAL_CONFIG_FILE, ".agentsmesh/mcp.json");
|
|
3662
|
+
return;
|
|
3663
|
+
}
|
|
3664
|
+
refs.set(OPENCODE_ROOT_RULE, `${AB_RULES2}/_root.md`);
|
|
3665
|
+
for (const absPath of await listFiles(projectRoot, OPENCODE_RULES_DIR)) {
|
|
3666
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3667
|
+
}
|
|
3668
|
+
for (const absPath of await listFiles(projectRoot, OPENCODE_COMMANDS_DIR)) {
|
|
3669
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3670
|
+
}
|
|
3671
|
+
for (const absPath of await listFiles(projectRoot, OPENCODE_AGENTS_DIR)) {
|
|
3672
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3673
|
+
}
|
|
3674
|
+
for (const absPath of await listFiles(projectRoot, OPENCODE_SKILLS_DIR)) {
|
|
3675
|
+
addSkillLikeMapping(refs, rel(projectRoot, absPath), OPENCODE_SKILLS_DIR);
|
|
3676
|
+
}
|
|
3677
|
+
refs.set(OPENCODE_CONFIG_FILE, ".agentsmesh/mcp.json");
|
|
3678
|
+
}
|
|
3679
|
+
var init_opencode = __esm({
|
|
3680
|
+
"src/core/reference/import-maps/opencode.ts"() {
|
|
3681
|
+
init_import_map_shared();
|
|
3682
|
+
init_constants11();
|
|
3504
3683
|
init_constants2();
|
|
3505
3684
|
}
|
|
3506
3685
|
});
|
|
3507
3686
|
|
|
3508
3687
|
// src/targets/roo-code/constants.ts
|
|
3509
3688
|
var ROO_CODE_TARGET, ROO_CODE_DIR, ROO_CODE_ROOT_RULE, ROO_CODE_ROOT_RULE_FALLBACK, ROO_CODE_RULES_DIR, ROO_CODE_COMMANDS_DIR, ROO_CODE_SKILLS_DIR, ROO_CODE_MCP_FILE, ROO_CODE_IGNORE, ROO_CODE_MODES_FILE, ROO_CODE_GLOBAL_MODES_FILE, ROO_CODE_GLOBAL_DIR, ROO_CODE_GLOBAL_RULES_DIR, ROO_CODE_GLOBAL_COMMANDS_DIR, ROO_CODE_GLOBAL_SKILLS_DIR, ROO_CODE_GLOBAL_MCP_FILE, ROO_CODE_GLOBAL_IGNORE, ROO_CODE_GLOBAL_AGENTS_MD, ROO_CODE_GLOBAL_AGENTS_SKILLS_DIR, ROO_CODE_CANONICAL_RULES_DIR, ROO_CODE_CANONICAL_COMMANDS_DIR, ROO_CODE_CANONICAL_MCP, ROO_CODE_CANONICAL_IGNORE;
|
|
3510
|
-
var
|
|
3689
|
+
var init_constants12 = __esm({
|
|
3511
3690
|
"src/targets/roo-code/constants.ts"() {
|
|
3512
3691
|
ROO_CODE_TARGET = "roo-code";
|
|
3513
3692
|
ROO_CODE_DIR = ".roo";
|
|
@@ -3543,7 +3722,7 @@ async function buildRooCodeImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3543
3722
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3544
3723
|
}
|
|
3545
3724
|
for (const absPath of await listFiles(projectRoot, ROO_CODE_GLOBAL_COMMANDS_DIR)) {
|
|
3546
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3725
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3547
3726
|
}
|
|
3548
3727
|
for (const absPath of await listFiles(projectRoot, ROO_CODE_GLOBAL_SKILLS_DIR)) {
|
|
3549
3728
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ROO_CODE_GLOBAL_SKILLS_DIR);
|
|
@@ -3565,7 +3744,7 @@ async function buildRooCodeImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3565
3744
|
}
|
|
3566
3745
|
}
|
|
3567
3746
|
for (const absPath of await listFiles(projectRoot, ROO_CODE_COMMANDS_DIR)) {
|
|
3568
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3747
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3569
3748
|
}
|
|
3570
3749
|
for (const absPath of await listFiles(projectRoot, ROO_CODE_SKILLS_DIR)) {
|
|
3571
3750
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ROO_CODE_SKILLS_DIR);
|
|
@@ -3574,7 +3753,7 @@ async function buildRooCodeImportPaths(refs, projectRoot, scope = "project") {
|
|
|
3574
3753
|
var init_roo_code = __esm({
|
|
3575
3754
|
"src/core/reference/import-maps/roo-code.ts"() {
|
|
3576
3755
|
init_import_map_shared();
|
|
3577
|
-
|
|
3756
|
+
init_constants12();
|
|
3578
3757
|
init_constants2();
|
|
3579
3758
|
}
|
|
3580
3759
|
});
|
|
@@ -3588,7 +3767,7 @@ async function buildWindsurfImportPaths(refs, projectRoot) {
|
|
|
3588
3767
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_RULES2, ".md");
|
|
3589
3768
|
}
|
|
3590
3769
|
for (const absPath of await listFiles(projectRoot, ".windsurf/workflows")) {
|
|
3591
|
-
addSimpleFileMapping(refs, rel(projectRoot, absPath),
|
|
3770
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3592
3771
|
}
|
|
3593
3772
|
for (const absPath of await listFiles(projectRoot, ".windsurf/skills")) {
|
|
3594
3773
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), ".windsurf/skills");
|
|
@@ -3612,9 +3791,11 @@ var init_import_maps = __esm({
|
|
|
3612
3791
|
init_copilot();
|
|
3613
3792
|
init_cursor();
|
|
3614
3793
|
init_gemini_cli();
|
|
3794
|
+
init_goose();
|
|
3615
3795
|
init_junie();
|
|
3616
3796
|
init_kilo_code();
|
|
3617
3797
|
init_kiro();
|
|
3798
|
+
init_opencode();
|
|
3618
3799
|
init_roo_code();
|
|
3619
3800
|
init_windsurf();
|
|
3620
3801
|
}
|
|
@@ -3632,6 +3813,7 @@ var target, project, global, globalCapabilities, descriptor;
|
|
|
3632
3813
|
var init_antigravity2 = __esm({
|
|
3633
3814
|
"src/targets/antigravity/index.ts"() {
|
|
3634
3815
|
init_capabilities();
|
|
3816
|
+
init_projected_agent_skill();
|
|
3635
3817
|
init_generator();
|
|
3636
3818
|
init_constants();
|
|
3637
3819
|
init_importer();
|
|
@@ -3643,6 +3825,7 @@ var init_antigravity2 = __esm({
|
|
|
3643
3825
|
primaryRootInstructionPath: ANTIGRAVITY_RULES_ROOT,
|
|
3644
3826
|
generateRules,
|
|
3645
3827
|
generateCommands,
|
|
3828
|
+
generateAgents,
|
|
3646
3829
|
generateSkills,
|
|
3647
3830
|
generateMcp,
|
|
3648
3831
|
importFrom: importFromAntigravity
|
|
@@ -3661,8 +3844,8 @@ var init_antigravity2 = __esm({
|
|
|
3661
3844
|
commandPath(name, _config) {
|
|
3662
3845
|
return `${ANTIGRAVITY_WORKFLOWS_DIR}/${name}.md`;
|
|
3663
3846
|
},
|
|
3664
|
-
agentPath(
|
|
3665
|
-
return
|
|
3847
|
+
agentPath(name) {
|
|
3848
|
+
return `${ANTIGRAVITY_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
3666
3849
|
}
|
|
3667
3850
|
}
|
|
3668
3851
|
};
|
|
@@ -3693,8 +3876,8 @@ var init_antigravity2 = __esm({
|
|
|
3693
3876
|
commandPath(name, _config) {
|
|
3694
3877
|
return `${ANTIGRAVITY_GLOBAL_WORKFLOWS_DIR}/${name}.md`;
|
|
3695
3878
|
},
|
|
3696
|
-
agentPath(
|
|
3697
|
-
return
|
|
3879
|
+
agentPath(name) {
|
|
3880
|
+
return `${ANTIGRAVITY_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
3698
3881
|
}
|
|
3699
3882
|
}
|
|
3700
3883
|
};
|
|
@@ -3724,6 +3907,7 @@ var init_antigravity2 = __esm({
|
|
|
3724
3907
|
permissions: "none"
|
|
3725
3908
|
},
|
|
3726
3909
|
emptyImportMessage: "No Antigravity config found (.agents/rules/, .agents/skills/, or .agents/workflows/).",
|
|
3910
|
+
supportsConversion: { agents: true },
|
|
3727
3911
|
lintRules,
|
|
3728
3912
|
project,
|
|
3729
3913
|
globalSupport: {
|
|
@@ -3867,7 +4051,7 @@ function generateCommands2(canonical) {
|
|
|
3867
4051
|
return { path: `${CLAUDE_COMMANDS_DIR}/${cmd.name}.md`, content };
|
|
3868
4052
|
});
|
|
3869
4053
|
}
|
|
3870
|
-
function
|
|
4054
|
+
function generateAgents2(canonical) {
|
|
3871
4055
|
return canonical.agents.map((agent) => {
|
|
3872
4056
|
const frontmatter = {
|
|
3873
4057
|
name: agent.name,
|
|
@@ -4319,7 +4503,7 @@ var init_claude_code2 = __esm({
|
|
|
4319
4503
|
primaryRootInstructionPath: CLAUDE_ROOT,
|
|
4320
4504
|
generateRules: generateRules2,
|
|
4321
4505
|
generateCommands: generateCommands2,
|
|
4322
|
-
generateAgents,
|
|
4506
|
+
generateAgents: generateAgents2,
|
|
4323
4507
|
generateSkills: generateSkills2,
|
|
4324
4508
|
generateMcp: generateMcp2,
|
|
4325
4509
|
generatePermissions,
|
|
@@ -4525,7 +4709,7 @@ function generateMcp3(canonical) {
|
|
|
4525
4709
|
const content = JSON.stringify({ mcpServers: canonical.mcp.mcpServers }, null, 2);
|
|
4526
4710
|
return [{ path: CLINE_MCP_SETTINGS, content }];
|
|
4527
4711
|
}
|
|
4528
|
-
function
|
|
4712
|
+
function generateAgents3(canonical) {
|
|
4529
4713
|
return canonical.agents.map((agent) => ({
|
|
4530
4714
|
path: `${CLINE_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
|
|
4531
4715
|
content: serializeProjectedAgentSkill(agent)
|
|
@@ -5114,11 +5298,11 @@ var init_linter3 = __esm({
|
|
|
5114
5298
|
});
|
|
5115
5299
|
|
|
5116
5300
|
// src/core/lint/shared/helpers.ts
|
|
5117
|
-
function createWarning(file,
|
|
5301
|
+
function createWarning(file, target16, message) {
|
|
5118
5302
|
return {
|
|
5119
5303
|
level: "warning",
|
|
5120
5304
|
file,
|
|
5121
|
-
target:
|
|
5305
|
+
target: target16,
|
|
5122
5306
|
message
|
|
5123
5307
|
};
|
|
5124
5308
|
}
|
|
@@ -5128,12 +5312,12 @@ function formatOxfordComma(items) {
|
|
|
5128
5312
|
if (items.length === 2) return `${items[0]} and ${items[1]}`;
|
|
5129
5313
|
return `${items.slice(0, -1).join(", ")}, and ${items[items.length - 1]}`;
|
|
5130
5314
|
}
|
|
5131
|
-
function createUnsupportedHookWarning(event,
|
|
5132
|
-
const by = options?.unsupportedBy ??
|
|
5315
|
+
function createUnsupportedHookWarning(event, target16, supportedEvents, options) {
|
|
5316
|
+
const by = options?.unsupportedBy ?? target16;
|
|
5133
5317
|
const supported = formatOxfordComma(supportedEvents);
|
|
5134
5318
|
return createWarning(
|
|
5135
5319
|
".agentsmesh/hooks.yaml",
|
|
5136
|
-
|
|
5320
|
+
target16,
|
|
5137
5321
|
`${event} is not supported by ${by}; only ${supported} are projected.`
|
|
5138
5322
|
);
|
|
5139
5323
|
}
|
|
@@ -5190,7 +5374,7 @@ var init_cline2 = __esm({
|
|
|
5190
5374
|
primaryRootInstructionPath: CLINE_AGENTS_MD,
|
|
5191
5375
|
generateRules: generateRules3,
|
|
5192
5376
|
generateCommands: generateCommands3,
|
|
5193
|
-
generateAgents:
|
|
5377
|
+
generateAgents: generateAgents3,
|
|
5194
5378
|
generateSkills: generateSkills3,
|
|
5195
5379
|
generateMcp: generateMcp3,
|
|
5196
5380
|
generateHooks: generateHooks2,
|
|
@@ -5317,7 +5501,7 @@ var init_cline2 = __esm({
|
|
|
5317
5501
|
|
|
5318
5502
|
// src/targets/codex-cli/constants.ts
|
|
5319
5503
|
var CODEX_TARGET, CODEX_MD, AGENTS_MD, CODEX_GLOBAL_AGENTS_MD, CODEX_GLOBAL_AGENTS_OVERRIDE_MD, CODEX_SKILLS_DIR, CODEX_SKILLS_FALLBACK_DIR, CODEX_CONFIG_TOML, CODEX_INSTRUCTIONS_DIR, CODEX_RULES_DIR, CODEX_AGENTS_DIR, CODEX_CANONICAL_RULES_DIR, CODEX_CANONICAL_COMMANDS_DIR, CODEX_CANONICAL_AGENTS_DIR, CODEX_CANONICAL_SKILLS_DIR, CODEX_CANONICAL_MCP, CODEX_RULE_EMBED_MARKER, CODEX_RULE_EMBED_JSON_PREFIX, CODEX_RULE_EMBED_B64_BEGIN, CODEX_RULE_EMBED_B64_END, CODEX_RULE_EMBED_B64_LINE, CODEX_RULE_INDEX_START, CODEX_RULE_INDEX_END;
|
|
5320
|
-
var
|
|
5504
|
+
var init_constants13 = __esm({
|
|
5321
5505
|
"src/targets/codex-cli/constants.ts"() {
|
|
5322
5506
|
CODEX_TARGET = "codex-cli";
|
|
5323
5507
|
CODEX_MD = "codex.md";
|
|
@@ -5380,7 +5564,7 @@ function summarizeRule(rule) {
|
|
|
5380
5564
|
scopes.push(`Enforced in \`${CODEX_RULES_DIR}/${ruleSlug2(rule.source)}.rules\`.`);
|
|
5381
5565
|
}
|
|
5382
5566
|
if (rule.targets.length > 0) {
|
|
5383
|
-
scopes.push(`Targeted to ${rule.targets.map((
|
|
5567
|
+
scopes.push(`Targeted to ${rule.targets.map((target16) => `\`${target16}\``).join(", ")}.`);
|
|
5384
5568
|
}
|
|
5385
5569
|
return scopes.join(" ");
|
|
5386
5570
|
}
|
|
@@ -5410,7 +5594,7 @@ function stripCodexRuleIndex(content) {
|
|
|
5410
5594
|
var init_instruction_mirror = __esm({
|
|
5411
5595
|
"src/targets/codex-cli/instruction-mirror.ts"() {
|
|
5412
5596
|
init_markdown();
|
|
5413
|
-
|
|
5597
|
+
init_constants13();
|
|
5414
5598
|
}
|
|
5415
5599
|
});
|
|
5416
5600
|
function looksLikeCodexRulesDsl(body) {
|
|
@@ -5476,7 +5660,7 @@ function renderCodexGlobalInstructions(canonical) {
|
|
|
5476
5660
|
var init_rules = __esm({
|
|
5477
5661
|
"src/targets/codex-cli/generator/rules.ts"() {
|
|
5478
5662
|
init_managed_blocks();
|
|
5479
|
-
|
|
5663
|
+
init_constants13();
|
|
5480
5664
|
init_instruction_mirror();
|
|
5481
5665
|
}
|
|
5482
5666
|
});
|
|
@@ -5517,13 +5701,13 @@ function generateCommands4(canonical) {
|
|
|
5517
5701
|
var init_skills = __esm({
|
|
5518
5702
|
"src/targets/codex-cli/generator/skills.ts"() {
|
|
5519
5703
|
init_markdown();
|
|
5520
|
-
|
|
5704
|
+
init_constants13();
|
|
5521
5705
|
init_command_skill();
|
|
5522
5706
|
}
|
|
5523
5707
|
});
|
|
5524
5708
|
|
|
5525
5709
|
// src/targets/codex-cli/generator/agents.ts
|
|
5526
|
-
function
|
|
5710
|
+
function generateAgents4(canonical) {
|
|
5527
5711
|
return canonical.agents.map((agent) => ({
|
|
5528
5712
|
path: `${CODEX_AGENTS_DIR}/${agent.name}.toml`,
|
|
5529
5713
|
content: serializeAgentToCodexToml(agent)
|
|
@@ -5558,7 +5742,7 @@ ${body}
|
|
|
5558
5742
|
}
|
|
5559
5743
|
var init_agents = __esm({
|
|
5560
5744
|
"src/targets/codex-cli/generator/agents.ts"() {
|
|
5561
|
-
|
|
5745
|
+
init_constants13();
|
|
5562
5746
|
}
|
|
5563
5747
|
});
|
|
5564
5748
|
|
|
@@ -5610,7 +5794,7 @@ function needsTomlQuoting(key) {
|
|
|
5610
5794
|
var init_mcp = __esm({
|
|
5611
5795
|
"src/targets/codex-cli/generator/mcp.ts"() {
|
|
5612
5796
|
init_mcp_servers();
|
|
5613
|
-
|
|
5797
|
+
init_constants13();
|
|
5614
5798
|
}
|
|
5615
5799
|
});
|
|
5616
5800
|
|
|
@@ -5681,21 +5865,7 @@ var init_mcp_helpers = __esm({
|
|
|
5681
5865
|
"src/targets/codex-cli/mcp-helpers.ts"() {
|
|
5682
5866
|
init_fs();
|
|
5683
5867
|
init_mcp_merge();
|
|
5684
|
-
|
|
5685
|
-
}
|
|
5686
|
-
});
|
|
5687
|
-
function shouldImportScopedAgentsRule(relDir) {
|
|
5688
|
-
const segments = relDir.split("/").filter(Boolean);
|
|
5689
|
-
if (segments.length === 0) return false;
|
|
5690
|
-
if (segments.some((segment) => segment.startsWith("."))) return false;
|
|
5691
|
-
const relPath = segments.join("/");
|
|
5692
|
-
return !relPath.startsWith("tests/e2e/fixtures/");
|
|
5693
|
-
}
|
|
5694
|
-
async function removePathIfExists(path) {
|
|
5695
|
-
await rm(path, { recursive: true, force: true });
|
|
5696
|
-
}
|
|
5697
|
-
var init_scoped_agents_import = __esm({
|
|
5698
|
-
"src/targets/import/scoped-agents-import.ts"() {
|
|
5868
|
+
init_constants13();
|
|
5699
5869
|
}
|
|
5700
5870
|
});
|
|
5701
5871
|
async function importSkills(projectRoot, results, normalize) {
|
|
@@ -5775,7 +5945,7 @@ var init_skills_adapter2 = __esm({
|
|
|
5775
5945
|
init_projected_agent_skill();
|
|
5776
5946
|
init_scoped_agents_import();
|
|
5777
5947
|
init_skill_import_pipeline();
|
|
5778
|
-
|
|
5948
|
+
init_constants13();
|
|
5779
5949
|
}
|
|
5780
5950
|
});
|
|
5781
5951
|
async function importCodexAgentsFromToml(projectRoot, results, normalize) {
|
|
@@ -5828,7 +5998,7 @@ var init_importer_agents = __esm({
|
|
|
5828
5998
|
"src/targets/codex-cli/importer-agents.ts"() {
|
|
5829
5999
|
init_fs();
|
|
5830
6000
|
init_projected_agent_skill();
|
|
5831
|
-
|
|
6001
|
+
init_constants13();
|
|
5832
6002
|
}
|
|
5833
6003
|
});
|
|
5834
6004
|
function tryParseEmbeddedCanonicalFromCodexRules(content) {
|
|
@@ -5871,7 +6041,7 @@ function tryParseEmbeddedCanonicalFromCodexRules(content) {
|
|
|
5871
6041
|
}
|
|
5872
6042
|
var init_codex_rules_embed = __esm({
|
|
5873
6043
|
"src/targets/codex-cli/codex-rules-embed.ts"() {
|
|
5874
|
-
|
|
6044
|
+
init_constants13();
|
|
5875
6045
|
}
|
|
5876
6046
|
});
|
|
5877
6047
|
async function importCodexNonRootRuleFiles(projectRoot, destDir, normalize) {
|
|
@@ -5945,7 +6115,7 @@ var init_import_codex_non_root_rules = __esm({
|
|
|
5945
6115
|
init_fs();
|
|
5946
6116
|
init_markdown();
|
|
5947
6117
|
init_import_metadata();
|
|
5948
|
-
|
|
6118
|
+
init_constants13();
|
|
5949
6119
|
init_codex_rules_embed();
|
|
5950
6120
|
}
|
|
5951
6121
|
});
|
|
@@ -6067,7 +6237,7 @@ var init_importer_rules2 = __esm({
|
|
|
6067
6237
|
init_embedded_rules();
|
|
6068
6238
|
init_import_orchestrator();
|
|
6069
6239
|
init_scoped_agents_import();
|
|
6070
|
-
|
|
6240
|
+
init_constants13();
|
|
6071
6241
|
init_import_codex_non_root_rules();
|
|
6072
6242
|
init_instruction_mirror();
|
|
6073
6243
|
}
|
|
@@ -6092,7 +6262,7 @@ async function importFromCodex(projectRoot, options) {
|
|
|
6092
6262
|
var init_importer4 = __esm({
|
|
6093
6263
|
"src/targets/codex-cli/importer.ts"() {
|
|
6094
6264
|
init_import_rewriter();
|
|
6095
|
-
|
|
6265
|
+
init_constants13();
|
|
6096
6266
|
init_mcp_helpers();
|
|
6097
6267
|
init_skills_adapter2();
|
|
6098
6268
|
init_importer_agents();
|
|
@@ -6117,7 +6287,7 @@ function lintRules4(canonical, projectRoot, _projectFiles) {
|
|
|
6117
6287
|
}
|
|
6118
6288
|
var init_linter4 = __esm({
|
|
6119
6289
|
"src/targets/codex-cli/linter.ts"() {
|
|
6120
|
-
|
|
6290
|
+
init_constants13();
|
|
6121
6291
|
}
|
|
6122
6292
|
});
|
|
6123
6293
|
|
|
@@ -6167,7 +6337,7 @@ var target4, project4, global3, globalCapabilities4, descriptor4;
|
|
|
6167
6337
|
var init_codex_cli2 = __esm({
|
|
6168
6338
|
"src/targets/codex-cli/index.ts"() {
|
|
6169
6339
|
init_generator5();
|
|
6170
|
-
|
|
6340
|
+
init_constants13();
|
|
6171
6341
|
init_importer4();
|
|
6172
6342
|
init_linter4();
|
|
6173
6343
|
init_lint2();
|
|
@@ -6180,7 +6350,7 @@ var init_codex_cli2 = __esm({
|
|
|
6180
6350
|
primaryRootInstructionPath: AGENTS_MD,
|
|
6181
6351
|
generateRules: generateRules4,
|
|
6182
6352
|
generateCommands: generateCommands4,
|
|
6183
|
-
generateAgents:
|
|
6353
|
+
generateAgents: generateAgents4,
|
|
6184
6354
|
generateSkills: generateSkills4,
|
|
6185
6355
|
generateMcp: generateMcp4,
|
|
6186
6356
|
importFrom: importFromCodex
|
|
@@ -6388,12 +6558,19 @@ function generateMcp5(canonical) {
|
|
|
6388
6558
|
}
|
|
6389
6559
|
];
|
|
6390
6560
|
}
|
|
6561
|
+
function generateAgents5(canonical) {
|
|
6562
|
+
return canonical.agents.map((agent) => ({
|
|
6563
|
+
path: `${CONTINUE_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
|
|
6564
|
+
content: serializeProjectedAgentSkill(agent)
|
|
6565
|
+
}));
|
|
6566
|
+
}
|
|
6391
6567
|
function generateSkills5(canonical) {
|
|
6392
6568
|
return generateEmbeddedSkills(canonical, CONTINUE_SKILLS_DIR);
|
|
6393
6569
|
}
|
|
6394
6570
|
var init_generator6 = __esm({
|
|
6395
6571
|
"src/targets/continue/generator.ts"() {
|
|
6396
6572
|
init_embedded_skill();
|
|
6573
|
+
init_projected_agent_skill();
|
|
6397
6574
|
init_markdown();
|
|
6398
6575
|
init_command_rule();
|
|
6399
6576
|
init_constants5();
|
|
@@ -6411,7 +6588,7 @@ function readMcpServers(content, extension) {
|
|
|
6411
6588
|
servers[name] = {
|
|
6412
6589
|
type: typeof server.type === "string" ? server.type : "stdio",
|
|
6413
6590
|
command: server.command,
|
|
6414
|
-
args:
|
|
6591
|
+
args: toStringArray5(server.args),
|
|
6415
6592
|
env: toStringRecord(server.env),
|
|
6416
6593
|
description: typeof server.description === "string" ? server.description : void 0
|
|
6417
6594
|
};
|
|
@@ -6653,6 +6830,7 @@ var init_scope_extras = __esm({
|
|
|
6653
6830
|
var target5, project5, globalLayout2, globalCapabilities5, descriptor5;
|
|
6654
6831
|
var init_continue2 = __esm({
|
|
6655
6832
|
"src/targets/continue/index.ts"() {
|
|
6833
|
+
init_projected_agent_skill();
|
|
6656
6834
|
init_generator6();
|
|
6657
6835
|
init_constants5();
|
|
6658
6836
|
init_importer5();
|
|
@@ -6667,6 +6845,7 @@ var init_continue2 = __esm({
|
|
|
6667
6845
|
primaryRootInstructionPath: CONTINUE_ROOT_RULE,
|
|
6668
6846
|
generateRules: generateRules5,
|
|
6669
6847
|
generateCommands: generateCommands5,
|
|
6848
|
+
generateAgents: generateAgents5,
|
|
6670
6849
|
generateSkills: generateSkills5,
|
|
6671
6850
|
generateMcp: generateMcp5,
|
|
6672
6851
|
importFrom: importFromContinue
|
|
@@ -6685,8 +6864,8 @@ var init_continue2 = __esm({
|
|
|
6685
6864
|
commandPath(name, _config) {
|
|
6686
6865
|
return continueCommandRulePath(name);
|
|
6687
6866
|
},
|
|
6688
|
-
agentPath(
|
|
6689
|
-
return
|
|
6867
|
+
agentPath(name) {
|
|
6868
|
+
return `${CONTINUE_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
6690
6869
|
}
|
|
6691
6870
|
}
|
|
6692
6871
|
};
|
|
@@ -6713,8 +6892,8 @@ var init_continue2 = __esm({
|
|
|
6713
6892
|
commandPath(name, _config) {
|
|
6714
6893
|
return `${CONTINUE_PROMPTS_DIR}/${name}.md`;
|
|
6715
6894
|
},
|
|
6716
|
-
agentPath(
|
|
6717
|
-
return
|
|
6895
|
+
agentPath(name) {
|
|
6896
|
+
return `${CONTINUE_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
6718
6897
|
}
|
|
6719
6898
|
}
|
|
6720
6899
|
};
|
|
@@ -6744,6 +6923,7 @@ var init_continue2 = __esm({
|
|
|
6744
6923
|
permissions: "none"
|
|
6745
6924
|
},
|
|
6746
6925
|
emptyImportMessage: "No Continue config found (.continue/rules/*.md, .continue/skills, or .continue/mcpServers/*).",
|
|
6926
|
+
supportsConversion: { agents: true },
|
|
6747
6927
|
lintRules: lintRules5,
|
|
6748
6928
|
lint: {
|
|
6749
6929
|
commands: lintCommands2
|
|
@@ -6786,7 +6966,7 @@ var init_continue2 = __esm({
|
|
|
6786
6966
|
|
|
6787
6967
|
// src/targets/copilot/constants.ts
|
|
6788
6968
|
var COPILOT_TARGET, COPILOT_INSTRUCTIONS, COPILOT_CONTEXT_DIR, COPILOT_INSTRUCTIONS_DIR, COPILOT_PROMPTS_DIR, COPILOT_HOOKS_DIR, COPILOT_SKILLS_DIR, COPILOT_AGENTS_DIR, COPILOT_CANONICAL_RULES_DIR, COPILOT_CANONICAL_COMMANDS_DIR, COPILOT_CANONICAL_AGENTS_DIR, COPILOT_CANONICAL_SKILLS_DIR, COPILOT_CANONICAL_HOOKS, COPILOT_LEGACY_HOOKS_DIR, COPILOT_GLOBAL_INSTRUCTIONS, COPILOT_GLOBAL_AGENTS_DIR, COPILOT_GLOBAL_SKILLS_DIR, COPILOT_GLOBAL_PROMPTS_DIR, COPILOT_GLOBAL_AGENTS_MD, COPILOT_GLOBAL_CLAUDE_SKILLS_DIR, COPILOT_GLOBAL_AGENTS_SKILLS_DIR;
|
|
6789
|
-
var
|
|
6969
|
+
var init_constants14 = __esm({
|
|
6790
6970
|
"src/targets/copilot/constants.ts"() {
|
|
6791
6971
|
COPILOT_TARGET = "copilot";
|
|
6792
6972
|
COPILOT_INSTRUCTIONS = ".github/copilot-instructions.md";
|
|
@@ -6851,7 +7031,7 @@ function parseCommandPromptFrontmatter(frontmatter, promptPath) {
|
|
|
6851
7031
|
var init_command_prompt = __esm({
|
|
6852
7032
|
"src/targets/copilot/command-prompt.ts"() {
|
|
6853
7033
|
init_markdown();
|
|
6854
|
-
|
|
7034
|
+
init_constants14();
|
|
6855
7035
|
}
|
|
6856
7036
|
});
|
|
6857
7037
|
|
|
@@ -6954,7 +7134,7 @@ function generateSkills6(canonical) {
|
|
|
6954
7134
|
}
|
|
6955
7135
|
return outputs;
|
|
6956
7136
|
}
|
|
6957
|
-
function
|
|
7137
|
+
function generateAgents6(canonical) {
|
|
6958
7138
|
return canonical.agents.map((agent) => {
|
|
6959
7139
|
const frontmatter = {
|
|
6960
7140
|
name: agent.name,
|
|
@@ -7003,7 +7183,7 @@ function generateHooks3(canonical) {
|
|
|
7003
7183
|
var init_generator7 = __esm({
|
|
7004
7184
|
"src/targets/copilot/generator.ts"() {
|
|
7005
7185
|
init_markdown();
|
|
7006
|
-
|
|
7186
|
+
init_constants14();
|
|
7007
7187
|
init_command_prompt();
|
|
7008
7188
|
init_hook_entry();
|
|
7009
7189
|
}
|
|
@@ -7097,7 +7277,7 @@ async function importHooks(projectRoot, results) {
|
|
|
7097
7277
|
var init_hook_parser = __esm({
|
|
7098
7278
|
"src/targets/copilot/hook-parser.ts"() {
|
|
7099
7279
|
init_fs();
|
|
7100
|
-
|
|
7280
|
+
init_constants14();
|
|
7101
7281
|
}
|
|
7102
7282
|
});
|
|
7103
7283
|
async function importSkills2(projectRoot, results, normalize, skillsDirRel = COPILOT_SKILLS_DIR) {
|
|
@@ -7118,7 +7298,7 @@ async function importSkills2(projectRoot, results, normalize, skillsDirRel = COP
|
|
|
7118
7298
|
var init_skills_adapter3 = __esm({
|
|
7119
7299
|
"src/targets/copilot/skills-adapter.ts"() {
|
|
7120
7300
|
init_skill_import_pipeline();
|
|
7121
|
-
|
|
7301
|
+
init_constants14();
|
|
7122
7302
|
}
|
|
7123
7303
|
});
|
|
7124
7304
|
|
|
@@ -7141,7 +7321,7 @@ var init_importer6 = __esm({
|
|
|
7141
7321
|
"src/targets/copilot/importer.ts"() {
|
|
7142
7322
|
init_import_rewriter();
|
|
7143
7323
|
init_descriptor_import_runner();
|
|
7144
|
-
|
|
7324
|
+
init_constants14();
|
|
7145
7325
|
init_hook_parser();
|
|
7146
7326
|
init_skills_adapter3();
|
|
7147
7327
|
init_copilot2();
|
|
@@ -7160,7 +7340,7 @@ var init_import_mappers4 = __esm({
|
|
|
7160
7340
|
init_import_metadata();
|
|
7161
7341
|
init_shared_import_helpers();
|
|
7162
7342
|
init_command_prompt();
|
|
7163
|
-
|
|
7343
|
+
init_constants14();
|
|
7164
7344
|
copilotLegacyRuleMapper = async ({
|
|
7165
7345
|
relativePath,
|
|
7166
7346
|
normalizeTo,
|
|
@@ -7277,7 +7457,7 @@ function lintRules6(canonical, projectRoot, projectFiles, options) {
|
|
|
7277
7457
|
var init_linter6 = __esm({
|
|
7278
7458
|
"src/targets/copilot/linter.ts"() {
|
|
7279
7459
|
init_validate_rules();
|
|
7280
|
-
|
|
7460
|
+
init_constants14();
|
|
7281
7461
|
}
|
|
7282
7462
|
});
|
|
7283
7463
|
|
|
@@ -7394,7 +7574,7 @@ var SCRIPT_PREFIX_RE;
|
|
|
7394
7574
|
var init_hook_assets = __esm({
|
|
7395
7575
|
"src/targets/copilot/hook-assets.ts"() {
|
|
7396
7576
|
init_fs();
|
|
7397
|
-
|
|
7577
|
+
init_constants14();
|
|
7398
7578
|
init_hook_entry();
|
|
7399
7579
|
SCRIPT_PREFIX_RE = /^(?<prefix>\s*(?:(?:bash|sh|zsh)\s+)?)["']?(?<path>(?:\.\.\/|\.\/|[^/\s"'`]+\/)[^\s"'`]+)["']?(?<suffix>(?:\s.*)?)$/;
|
|
7400
7580
|
}
|
|
@@ -7408,7 +7588,7 @@ var generateCopilotGlobalExtras;
|
|
|
7408
7588
|
var init_scope_extras2 = __esm({
|
|
7409
7589
|
"src/targets/copilot/scope-extras.ts"() {
|
|
7410
7590
|
init_fs();
|
|
7411
|
-
|
|
7591
|
+
init_constants14();
|
|
7412
7592
|
generateCopilotGlobalExtras = async (canonical, projectRoot, scope, enabledFeatures) => {
|
|
7413
7593
|
if (scope !== "global" || !enabledFeatures.has("rules")) return [];
|
|
7414
7594
|
const root = canonical.rules.find((r) => r.root);
|
|
@@ -7431,7 +7611,7 @@ var target6, project6, global4, globalCapabilities6, descriptor6;
|
|
|
7431
7611
|
var init_copilot2 = __esm({
|
|
7432
7612
|
"src/targets/copilot/index.ts"() {
|
|
7433
7613
|
init_generator7();
|
|
7434
|
-
|
|
7614
|
+
init_constants14();
|
|
7435
7615
|
init_importer6();
|
|
7436
7616
|
init_import_mappers4();
|
|
7437
7617
|
init_linter6();
|
|
@@ -7445,7 +7625,7 @@ var init_copilot2 = __esm({
|
|
|
7445
7625
|
primaryRootInstructionPath: COPILOT_INSTRUCTIONS,
|
|
7446
7626
|
generateRules: generateRules6,
|
|
7447
7627
|
generateCommands: generateCommands6,
|
|
7448
|
-
generateAgents:
|
|
7628
|
+
generateAgents: generateAgents6,
|
|
7449
7629
|
generateSkills: generateSkills6,
|
|
7450
7630
|
generateHooks: generateHooks3,
|
|
7451
7631
|
importFrom: importFromCopilot
|
|
@@ -7749,7 +7929,7 @@ var init_skills2 = __esm({
|
|
|
7749
7929
|
});
|
|
7750
7930
|
|
|
7751
7931
|
// src/targets/cursor/generator/agents.ts
|
|
7752
|
-
function
|
|
7932
|
+
function generateAgents7(canonical) {
|
|
7753
7933
|
return canonical.agents.map((agent) => {
|
|
7754
7934
|
const frontmatter = {
|
|
7755
7935
|
name: agent.name,
|
|
@@ -8522,7 +8702,7 @@ var init_cursor2 = __esm({
|
|
|
8522
8702
|
primaryRootInstructionPath: CURSOR_GENERAL_RULE,
|
|
8523
8703
|
generateRules: generateRules7,
|
|
8524
8704
|
generateCommands: generateCommands7,
|
|
8525
|
-
generateAgents:
|
|
8705
|
+
generateAgents: generateAgents7,
|
|
8526
8706
|
generateSkills: generateSkills7,
|
|
8527
8707
|
generateMcp: generateMcp6,
|
|
8528
8708
|
generatePermissions: generatePermissions2,
|
|
@@ -8689,7 +8869,7 @@ var init_cursor2 = __esm({
|
|
|
8689
8869
|
|
|
8690
8870
|
// src/targets/gemini-cli/constants.ts
|
|
8691
8871
|
var GEMINI_TARGET, GEMINI_ROOT, GEMINI_COMPAT_AGENTS, GEMINI_RULES_DIR, GEMINI_COMPAT_INNER_ROOT, GEMINI_COMMANDS_DIR, GEMINI_POLICIES_DIR, GEMINI_SETTINGS, GEMINI_IGNORE, GEMINI_SKILLS_DIR, GEMINI_AGENTS_DIR, GEMINI_SYSTEM, GEMINI_DEFAULT_POLICIES_FILE, GEMINI_CANONICAL_RULES_DIR, GEMINI_CANONICAL_COMMANDS_DIR, GEMINI_CANONICAL_AGENTS_DIR, GEMINI_CANONICAL_SKILLS_DIR, GEMINI_CANONICAL_MCP, GEMINI_CANONICAL_HOOKS, GEMINI_CANONICAL_IGNORE, GEMINI_CANONICAL_PERMISSIONS, GEMINI_GLOBAL_ROOT, GEMINI_GLOBAL_COMPAT_AGENTS, GEMINI_GLOBAL_SETTINGS, GEMINI_GLOBAL_COMMANDS_DIR, GEMINI_GLOBAL_SKILLS_DIR, GEMINI_GLOBAL_AGENTS_DIR;
|
|
8692
|
-
var
|
|
8872
|
+
var init_constants15 = __esm({
|
|
8693
8873
|
"src/targets/gemini-cli/constants.ts"() {
|
|
8694
8874
|
GEMINI_TARGET = "gemini-cli";
|
|
8695
8875
|
GEMINI_ROOT = "GEMINI.md";
|
|
@@ -8741,7 +8921,7 @@ function generateRules8(canonical) {
|
|
|
8741
8921
|
var init_rules3 = __esm({
|
|
8742
8922
|
"src/targets/gemini-cli/generator/rules.ts"() {
|
|
8743
8923
|
init_managed_blocks();
|
|
8744
|
-
|
|
8924
|
+
init_constants15();
|
|
8745
8925
|
}
|
|
8746
8926
|
});
|
|
8747
8927
|
function canonicalCommandNameToGeminiTomlPath(cmdName, commandsDir) {
|
|
@@ -8781,13 +8961,13 @@ function generateCommands8(canonical) {
|
|
|
8781
8961
|
}
|
|
8782
8962
|
var init_commands2 = __esm({
|
|
8783
8963
|
"src/targets/gemini-cli/generator/commands.ts"() {
|
|
8784
|
-
|
|
8964
|
+
init_constants15();
|
|
8785
8965
|
init_command_namespace();
|
|
8786
8966
|
}
|
|
8787
8967
|
});
|
|
8788
8968
|
|
|
8789
8969
|
// src/targets/gemini-cli/generator/agents.ts
|
|
8790
|
-
function
|
|
8970
|
+
function generateAgents8(canonical) {
|
|
8791
8971
|
return canonical.agents.map((agent) => {
|
|
8792
8972
|
const frontmatter = {
|
|
8793
8973
|
name: agent.name,
|
|
@@ -8809,7 +8989,7 @@ function generateAgents6(canonical) {
|
|
|
8809
8989
|
var init_agents3 = __esm({
|
|
8810
8990
|
"src/targets/gemini-cli/generator/agents.ts"() {
|
|
8811
8991
|
init_markdown();
|
|
8812
|
-
|
|
8992
|
+
init_constants15();
|
|
8813
8993
|
}
|
|
8814
8994
|
});
|
|
8815
8995
|
|
|
@@ -8840,7 +9020,7 @@ function generateSkills8(canonical) {
|
|
|
8840
9020
|
var init_skills3 = __esm({
|
|
8841
9021
|
"src/targets/gemini-cli/generator/skills.ts"() {
|
|
8842
9022
|
init_markdown();
|
|
8843
|
-
|
|
9023
|
+
init_constants15();
|
|
8844
9024
|
}
|
|
8845
9025
|
});
|
|
8846
9026
|
|
|
@@ -8901,7 +9081,7 @@ function generateGeminiSettingsFiles(canonical) {
|
|
|
8901
9081
|
var init_settings = __esm({
|
|
8902
9082
|
"src/targets/gemini-cli/generator/settings.ts"() {
|
|
8903
9083
|
init_hook_command();
|
|
8904
|
-
|
|
9084
|
+
init_constants15();
|
|
8905
9085
|
}
|
|
8906
9086
|
});
|
|
8907
9087
|
|
|
@@ -8912,7 +9092,7 @@ function generateIgnore4(canonical) {
|
|
|
8912
9092
|
}
|
|
8913
9093
|
var init_ignore2 = __esm({
|
|
8914
9094
|
"src/targets/gemini-cli/generator/ignore.ts"() {
|
|
8915
|
-
|
|
9095
|
+
init_constants15();
|
|
8916
9096
|
}
|
|
8917
9097
|
});
|
|
8918
9098
|
|
|
@@ -9013,7 +9193,7 @@ function generateGeminiPermissionsPolicies(canonical) {
|
|
|
9013
9193
|
}
|
|
9014
9194
|
var init_policies_generator = __esm({
|
|
9015
9195
|
"src/targets/gemini-cli/policies-generator.ts"() {
|
|
9016
|
-
|
|
9196
|
+
init_constants15();
|
|
9017
9197
|
}
|
|
9018
9198
|
});
|
|
9019
9199
|
function mapGeminiHookEvent(event) {
|
|
@@ -9141,7 +9321,7 @@ var init_format_helpers_settings = __esm({
|
|
|
9141
9321
|
"src/targets/gemini-cli/format-helpers-settings.ts"() {
|
|
9142
9322
|
init_hook_command();
|
|
9143
9323
|
init_fs();
|
|
9144
|
-
|
|
9324
|
+
init_constants15();
|
|
9145
9325
|
init_format_helpers_shared();
|
|
9146
9326
|
}
|
|
9147
9327
|
});
|
|
@@ -9166,7 +9346,7 @@ async function importGeminiIgnore(projectRoot, results) {
|
|
|
9166
9346
|
var init_format_helpers = __esm({
|
|
9167
9347
|
"src/targets/gemini-cli/format-helpers.ts"() {
|
|
9168
9348
|
init_fs();
|
|
9169
|
-
|
|
9349
|
+
init_constants15();
|
|
9170
9350
|
init_format_helpers_shared();
|
|
9171
9351
|
init_format_helpers_settings();
|
|
9172
9352
|
}
|
|
@@ -9274,7 +9454,7 @@ async function importGeminiPolicies(projectRoot) {
|
|
|
9274
9454
|
var init_policies_importer = __esm({
|
|
9275
9455
|
"src/targets/gemini-cli/policies-importer.ts"() {
|
|
9276
9456
|
init_fs();
|
|
9277
|
-
|
|
9457
|
+
init_constants15();
|
|
9278
9458
|
}
|
|
9279
9459
|
});
|
|
9280
9460
|
function stripProjectRootCanonicalPrefix(content, projectRoot) {
|
|
@@ -9400,7 +9580,7 @@ var init_importer_skills_agents = __esm({
|
|
|
9400
9580
|
init_markdown();
|
|
9401
9581
|
init_import_metadata();
|
|
9402
9582
|
init_projected_agent_skill();
|
|
9403
|
-
|
|
9583
|
+
init_constants15();
|
|
9404
9584
|
}
|
|
9405
9585
|
});
|
|
9406
9586
|
async function importRootRule2(projectRoot, results, normalize) {
|
|
@@ -9476,7 +9656,7 @@ var init_importer8 = __esm({
|
|
|
9476
9656
|
init_import_metadata();
|
|
9477
9657
|
init_embedded_rules();
|
|
9478
9658
|
init_descriptor_import_runner();
|
|
9479
|
-
|
|
9659
|
+
init_constants15();
|
|
9480
9660
|
init_gemini_cli2();
|
|
9481
9661
|
init_format_helpers();
|
|
9482
9662
|
init_policies_importer();
|
|
@@ -9544,7 +9724,7 @@ var init_importer_mappers3 = __esm({
|
|
|
9544
9724
|
init_import_metadata();
|
|
9545
9725
|
init_shared_import_helpers();
|
|
9546
9726
|
init_format_helpers();
|
|
9547
|
-
|
|
9727
|
+
init_constants15();
|
|
9548
9728
|
}
|
|
9549
9729
|
});
|
|
9550
9730
|
|
|
@@ -9568,7 +9748,7 @@ function lintRules8(canonical, projectRoot, projectFiles, options) {
|
|
|
9568
9748
|
var init_linter8 = __esm({
|
|
9569
9749
|
"src/targets/gemini-cli/linter.ts"() {
|
|
9570
9750
|
init_validate_rules();
|
|
9571
|
-
|
|
9751
|
+
init_constants15();
|
|
9572
9752
|
}
|
|
9573
9753
|
});
|
|
9574
9754
|
|
|
@@ -9662,7 +9842,7 @@ var init_gemini_cli2 = __esm({
|
|
|
9662
9842
|
init_generator11();
|
|
9663
9843
|
init_capabilities();
|
|
9664
9844
|
init_policies_generator();
|
|
9665
|
-
|
|
9845
|
+
init_constants15();
|
|
9666
9846
|
init_importer8();
|
|
9667
9847
|
init_import_mappers6();
|
|
9668
9848
|
init_linter8();
|
|
@@ -9678,7 +9858,7 @@ var init_gemini_cli2 = __esm({
|
|
|
9678
9858
|
primaryRootInstructionPath: GEMINI_ROOT,
|
|
9679
9859
|
generateRules: generateRules8,
|
|
9680
9860
|
generateCommands: generateCommands8,
|
|
9681
|
-
generateAgents:
|
|
9861
|
+
generateAgents: generateAgents8,
|
|
9682
9862
|
generateSkills: generateSkills8,
|
|
9683
9863
|
generateIgnore: generateIgnore4,
|
|
9684
9864
|
generatePermissions: generateGeminiPermissionsPolicies,
|
|
@@ -9856,7 +10036,261 @@ var init_gemini_cli2 = __esm({
|
|
|
9856
10036
|
};
|
|
9857
10037
|
}
|
|
9858
10038
|
});
|
|
10039
|
+
|
|
10040
|
+
// src/targets/goose/generator.ts
|
|
9859
10041
|
function generateRules9(canonical) {
|
|
10042
|
+
const root = canonical.rules.find((rule) => rule.root);
|
|
10043
|
+
const nonRootRules = canonical.rules.filter((rule) => {
|
|
10044
|
+
if (rule.root) return false;
|
|
10045
|
+
return rule.targets.length === 0 || rule.targets.includes(GOOSE_TARGET);
|
|
10046
|
+
});
|
|
10047
|
+
const rootBody = root?.body.trim() ?? "";
|
|
10048
|
+
const content = appendEmbeddedRulesBlock(rootBody, nonRootRules);
|
|
10049
|
+
if (!content) return [];
|
|
10050
|
+
return [{ path: GOOSE_ROOT_FILE, content }];
|
|
10051
|
+
}
|
|
10052
|
+
function generateSkills9(canonical) {
|
|
10053
|
+
return generateEmbeddedSkills(canonical, GOOSE_SKILLS_DIR);
|
|
10054
|
+
}
|
|
10055
|
+
function generateCommands9(canonical) {
|
|
10056
|
+
return canonical.commands.map((command) => ({
|
|
10057
|
+
path: `${GOOSE_SKILLS_DIR}/${commandSkillDirName(command.name)}/SKILL.md`,
|
|
10058
|
+
content: serializeCommandSkill(command)
|
|
10059
|
+
}));
|
|
10060
|
+
}
|
|
10061
|
+
function generateAgents9(canonical) {
|
|
10062
|
+
return canonical.agents.map((agent) => ({
|
|
10063
|
+
path: `${GOOSE_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
|
|
10064
|
+
content: serializeProjectedAgentSkill(agent)
|
|
10065
|
+
}));
|
|
10066
|
+
}
|
|
10067
|
+
function generateIgnore5(canonical) {
|
|
10068
|
+
if (canonical.ignore.length === 0) return [];
|
|
10069
|
+
return [{ path: GOOSE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
10070
|
+
}
|
|
10071
|
+
var init_generator12 = __esm({
|
|
10072
|
+
"src/targets/goose/generator.ts"() {
|
|
10073
|
+
init_embedded_skill();
|
|
10074
|
+
init_managed_blocks();
|
|
10075
|
+
init_projected_agent_skill();
|
|
10076
|
+
init_command_skill();
|
|
10077
|
+
init_constants7();
|
|
10078
|
+
}
|
|
10079
|
+
});
|
|
10080
|
+
|
|
10081
|
+
// src/targets/goose/importer.ts
|
|
10082
|
+
async function importFromGoose(projectRoot, options = {}) {
|
|
10083
|
+
const scope = options.scope ?? "project";
|
|
10084
|
+
const results = [];
|
|
10085
|
+
const normalize = await createImportReferenceNormalizer(GOOSE_TARGET, projectRoot, scope);
|
|
10086
|
+
results.push(...await runDescriptorImport(descriptor9, projectRoot, scope, { normalize }));
|
|
10087
|
+
const skillsDir = scope === "global" ? GOOSE_GLOBAL_SKILLS_DIR : GOOSE_SKILLS_DIR;
|
|
10088
|
+
await importEmbeddedSkills(projectRoot, skillsDir, GOOSE_TARGET, results, normalize);
|
|
10089
|
+
return results;
|
|
10090
|
+
}
|
|
10091
|
+
var init_importer9 = __esm({
|
|
10092
|
+
"src/targets/goose/importer.ts"() {
|
|
10093
|
+
init_import_rewriter();
|
|
10094
|
+
init_embedded_skill();
|
|
10095
|
+
init_descriptor_import_runner();
|
|
10096
|
+
init_constants7();
|
|
10097
|
+
init_goose2();
|
|
10098
|
+
}
|
|
10099
|
+
});
|
|
10100
|
+
|
|
10101
|
+
// src/targets/goose/linter.ts
|
|
10102
|
+
function lintRules9(canonical, projectRoot, projectFiles, options) {
|
|
10103
|
+
return validateRules(canonical, projectRoot, projectFiles, {
|
|
10104
|
+
checkGlobMatches: options?.scope !== "global"
|
|
10105
|
+
}).map((diagnostic) => ({
|
|
10106
|
+
...diagnostic,
|
|
10107
|
+
target: GOOSE_TARGET
|
|
10108
|
+
}));
|
|
10109
|
+
}
|
|
10110
|
+
var init_linter9 = __esm({
|
|
10111
|
+
"src/targets/goose/linter.ts"() {
|
|
10112
|
+
init_validate_rules();
|
|
10113
|
+
init_constants7();
|
|
10114
|
+
}
|
|
10115
|
+
});
|
|
10116
|
+
|
|
10117
|
+
// src/targets/goose/lint.ts
|
|
10118
|
+
function lintHooks4(canonical) {
|
|
10119
|
+
if (!canonical.hooks) return [];
|
|
10120
|
+
const hasEntries = Object.values(canonical.hooks).some(
|
|
10121
|
+
(entries) => Array.isArray(entries) && entries.length > 0
|
|
10122
|
+
);
|
|
10123
|
+
if (!hasEntries) return [];
|
|
10124
|
+
return [
|
|
10125
|
+
createWarning(
|
|
10126
|
+
".agentsmesh/hooks.yaml",
|
|
10127
|
+
"goose",
|
|
10128
|
+
"Goose has no lifecycle hook system; canonical hooks are not projected."
|
|
10129
|
+
)
|
|
10130
|
+
];
|
|
10131
|
+
}
|
|
10132
|
+
function lintPermissions2(canonical) {
|
|
10133
|
+
if (!canonical.permissions) return [];
|
|
10134
|
+
const { allow, deny } = canonical.permissions;
|
|
10135
|
+
const ask = canonical.permissions.ask ?? [];
|
|
10136
|
+
if (allow.length === 0 && deny.length === 0 && ask.length === 0) return [];
|
|
10137
|
+
return [
|
|
10138
|
+
createWarning(
|
|
10139
|
+
".agentsmesh/permissions.yaml",
|
|
10140
|
+
"goose",
|
|
10141
|
+
"Goose permissions are managed at runtime via permission.yaml in ~/.config/goose/; canonical permissions are not projected."
|
|
10142
|
+
)
|
|
10143
|
+
];
|
|
10144
|
+
}
|
|
10145
|
+
function lintMcp3(canonical) {
|
|
10146
|
+
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
10147
|
+
return [
|
|
10148
|
+
createWarning(
|
|
10149
|
+
".agentsmesh/mcp.json",
|
|
10150
|
+
"goose",
|
|
10151
|
+
"Goose MCP extensions are configured globally in ~/.config/goose/config.yaml; project-level MCP is not projected."
|
|
10152
|
+
)
|
|
10153
|
+
];
|
|
10154
|
+
}
|
|
10155
|
+
var init_lint7 = __esm({
|
|
10156
|
+
"src/targets/goose/lint.ts"() {
|
|
10157
|
+
init_helpers();
|
|
10158
|
+
}
|
|
10159
|
+
});
|
|
10160
|
+
|
|
10161
|
+
// src/targets/goose/index.ts
|
|
10162
|
+
var target9, project9, globalLayout3, capabilities, descriptor9;
|
|
10163
|
+
var init_goose2 = __esm({
|
|
10164
|
+
"src/targets/goose/index.ts"() {
|
|
10165
|
+
init_command_skill();
|
|
10166
|
+
init_projected_agent_skill();
|
|
10167
|
+
init_generator12();
|
|
10168
|
+
init_skill_mirror();
|
|
10169
|
+
init_importer9();
|
|
10170
|
+
init_linter9();
|
|
10171
|
+
init_lint7();
|
|
10172
|
+
init_import_map_builders();
|
|
10173
|
+
init_constants7();
|
|
10174
|
+
target9 = {
|
|
10175
|
+
name: GOOSE_TARGET,
|
|
10176
|
+
primaryRootInstructionPath: GOOSE_ROOT_FILE,
|
|
10177
|
+
generateRules: generateRules9,
|
|
10178
|
+
generateCommands: generateCommands9,
|
|
10179
|
+
generateAgents: generateAgents9,
|
|
10180
|
+
generateSkills: generateSkills9,
|
|
10181
|
+
generateIgnore: generateIgnore5,
|
|
10182
|
+
importFrom: importFromGoose
|
|
10183
|
+
};
|
|
10184
|
+
project9 = {
|
|
10185
|
+
rootInstructionPath: GOOSE_ROOT_FILE,
|
|
10186
|
+
skillDir: GOOSE_SKILLS_DIR,
|
|
10187
|
+
managedOutputs: {
|
|
10188
|
+
dirs: [GOOSE_SKILLS_DIR],
|
|
10189
|
+
files: [GOOSE_ROOT_FILE, GOOSE_IGNORE]
|
|
10190
|
+
},
|
|
10191
|
+
paths: {
|
|
10192
|
+
rulePath(_slug) {
|
|
10193
|
+
return GOOSE_ROOT_FILE;
|
|
10194
|
+
},
|
|
10195
|
+
commandPath(name) {
|
|
10196
|
+
return `${GOOSE_SKILLS_DIR}/${commandSkillDirName(name)}/SKILL.md`;
|
|
10197
|
+
},
|
|
10198
|
+
agentPath(name) {
|
|
10199
|
+
return `${GOOSE_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
10200
|
+
}
|
|
10201
|
+
}
|
|
10202
|
+
};
|
|
10203
|
+
globalLayout3 = {
|
|
10204
|
+
rootInstructionPath: GOOSE_GLOBAL_ROOT_FILE,
|
|
10205
|
+
skillDir: GOOSE_GLOBAL_SKILLS_DIR,
|
|
10206
|
+
managedOutputs: {
|
|
10207
|
+
dirs: [GOOSE_GLOBAL_SKILLS_DIR],
|
|
10208
|
+
files: [GOOSE_GLOBAL_ROOT_FILE, GOOSE_GLOBAL_IGNORE]
|
|
10209
|
+
},
|
|
10210
|
+
rewriteGeneratedPath(path) {
|
|
10211
|
+
if (path === GOOSE_ROOT_FILE) return GOOSE_GLOBAL_ROOT_FILE;
|
|
10212
|
+
if (path === GOOSE_IGNORE) return GOOSE_GLOBAL_IGNORE;
|
|
10213
|
+
if (path.startsWith(`${GOOSE_SKILLS_DIR}/`)) {
|
|
10214
|
+
return path;
|
|
10215
|
+
}
|
|
10216
|
+
return path;
|
|
10217
|
+
},
|
|
10218
|
+
mirrorGlobalPath(path, activeTargets) {
|
|
10219
|
+
return mirrorSkillsToAgents(path, GOOSE_GLOBAL_SKILLS_DIR, activeTargets);
|
|
10220
|
+
},
|
|
10221
|
+
paths: {
|
|
10222
|
+
rulePath(_slug) {
|
|
10223
|
+
return GOOSE_GLOBAL_ROOT_FILE;
|
|
10224
|
+
},
|
|
10225
|
+
commandPath(name) {
|
|
10226
|
+
return `${GOOSE_GLOBAL_SKILLS_DIR}/${commandSkillDirName(name)}/SKILL.md`;
|
|
10227
|
+
},
|
|
10228
|
+
agentPath(name) {
|
|
10229
|
+
return `${GOOSE_GLOBAL_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
10230
|
+
}
|
|
10231
|
+
}
|
|
10232
|
+
};
|
|
10233
|
+
capabilities = {
|
|
10234
|
+
rules: "native",
|
|
10235
|
+
additionalRules: "embedded",
|
|
10236
|
+
commands: "none",
|
|
10237
|
+
agents: "none",
|
|
10238
|
+
skills: "native",
|
|
10239
|
+
mcp: "none",
|
|
10240
|
+
hooks: "none",
|
|
10241
|
+
ignore: "native",
|
|
10242
|
+
permissions: "none"
|
|
10243
|
+
};
|
|
10244
|
+
descriptor9 = {
|
|
10245
|
+
id: GOOSE_TARGET,
|
|
10246
|
+
generators: target9,
|
|
10247
|
+
capabilities,
|
|
10248
|
+
emptyImportMessage: "No Goose config found (.goosehints, .agents/skills, or .gooseignore).",
|
|
10249
|
+
lintRules: lintRules9,
|
|
10250
|
+
lint: {
|
|
10251
|
+
hooks: lintHooks4,
|
|
10252
|
+
permissions: lintPermissions2,
|
|
10253
|
+
mcp: lintMcp3
|
|
10254
|
+
},
|
|
10255
|
+
supportsConversion: { commands: true, agents: true },
|
|
10256
|
+
project: project9,
|
|
10257
|
+
globalSupport: {
|
|
10258
|
+
capabilities,
|
|
10259
|
+
detectionPaths: [GOOSE_GLOBAL_ROOT_FILE, GOOSE_GLOBAL_IGNORE, GOOSE_GLOBAL_SKILLS_DIR],
|
|
10260
|
+
layout: globalLayout3
|
|
10261
|
+
},
|
|
10262
|
+
importer: {
|
|
10263
|
+
rules: {
|
|
10264
|
+
feature: "rules",
|
|
10265
|
+
mode: "singleFile",
|
|
10266
|
+
source: {
|
|
10267
|
+
project: [GOOSE_ROOT_FILE],
|
|
10268
|
+
global: [GOOSE_GLOBAL_ROOT_FILE]
|
|
10269
|
+
},
|
|
10270
|
+
canonicalDir: GOOSE_CANONICAL_RULES_DIR,
|
|
10271
|
+
canonicalRootFilename: "_root.md",
|
|
10272
|
+
markAsRoot: true
|
|
10273
|
+
},
|
|
10274
|
+
ignore: {
|
|
10275
|
+
feature: "ignore",
|
|
10276
|
+
mode: "flatFile",
|
|
10277
|
+
source: {
|
|
10278
|
+
project: [GOOSE_IGNORE],
|
|
10279
|
+
global: [GOOSE_GLOBAL_IGNORE]
|
|
10280
|
+
},
|
|
10281
|
+
canonicalDir: ".agentsmesh",
|
|
10282
|
+
canonicalFilename: GOOSE_CANONICAL_IGNORE
|
|
10283
|
+
}
|
|
10284
|
+
},
|
|
10285
|
+
sharedArtifacts: {
|
|
10286
|
+
".agents/skills/": "consumer"
|
|
10287
|
+
},
|
|
10288
|
+
buildImportPaths: buildGooseImportPaths,
|
|
10289
|
+
detectionPaths: [GOOSE_ROOT_FILE, GOOSE_IGNORE]
|
|
10290
|
+
};
|
|
10291
|
+
}
|
|
10292
|
+
});
|
|
10293
|
+
function generateRules10(canonical) {
|
|
9860
10294
|
const outputs = [];
|
|
9861
10295
|
const root = canonical.rules.find((rule) => rule.root);
|
|
9862
10296
|
if (root) {
|
|
@@ -9897,7 +10331,7 @@ function generateMcp7(canonical) {
|
|
|
9897
10331
|
);
|
|
9898
10332
|
return [{ path: JUNIE_MCP_FILE, content: JSON.stringify({ mcpServers: servers }, null, 2) }];
|
|
9899
10333
|
}
|
|
9900
|
-
function
|
|
10334
|
+
function generateCommands10(canonical) {
|
|
9901
10335
|
return canonical.commands.map((command) => {
|
|
9902
10336
|
const frontmatter = {
|
|
9903
10337
|
description: command.description || void 0
|
|
@@ -9909,7 +10343,7 @@ function generateCommands9(canonical) {
|
|
|
9909
10343
|
};
|
|
9910
10344
|
});
|
|
9911
10345
|
}
|
|
9912
|
-
function
|
|
10346
|
+
function generateAgents10(canonical) {
|
|
9913
10347
|
return canonical.agents.map((agent) => {
|
|
9914
10348
|
const frontmatter = {
|
|
9915
10349
|
name: agent.name,
|
|
@@ -9928,11 +10362,11 @@ function generateAgents7(canonical) {
|
|
|
9928
10362
|
};
|
|
9929
10363
|
});
|
|
9930
10364
|
}
|
|
9931
|
-
function
|
|
10365
|
+
function generateIgnore6(canonical) {
|
|
9932
10366
|
if (canonical.ignore.length === 0) return [];
|
|
9933
10367
|
return [{ path: JUNIE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
9934
10368
|
}
|
|
9935
|
-
function
|
|
10369
|
+
function generateSkills10(canonical) {
|
|
9936
10370
|
return generateEmbeddedSkills(canonical, JUNIE_SKILLS_DIR);
|
|
9937
10371
|
}
|
|
9938
10372
|
function renderJunieGlobalInstructions(canonical) {
|
|
@@ -9943,13 +10377,13 @@ function renderJunieGlobalInstructions(canonical) {
|
|
|
9943
10377
|
});
|
|
9944
10378
|
return appendEmbeddedRulesBlock(root?.body.trim() ?? "", nonRootRules);
|
|
9945
10379
|
}
|
|
9946
|
-
var
|
|
10380
|
+
var init_generator13 = __esm({
|
|
9947
10381
|
"src/targets/junie/generator.ts"() {
|
|
9948
10382
|
init_mcp_servers();
|
|
9949
10383
|
init_embedded_skill();
|
|
9950
10384
|
init_managed_blocks();
|
|
9951
10385
|
init_markdown();
|
|
9952
|
-
|
|
10386
|
+
init_constants8();
|
|
9953
10387
|
}
|
|
9954
10388
|
});
|
|
9955
10389
|
async function importRootRule3(projectRoot, results, normalize) {
|
|
@@ -9992,11 +10426,11 @@ async function importFromJunie(projectRoot) {
|
|
|
9992
10426
|
const results = [];
|
|
9993
10427
|
const normalize = await createImportReferenceNormalizer(JUNIE_TARGET, projectRoot);
|
|
9994
10428
|
await importRootRule3(projectRoot, results, normalize);
|
|
9995
|
-
results.push(...await runDescriptorImport(
|
|
10429
|
+
results.push(...await runDescriptorImport(descriptor10, projectRoot, "project", { normalize }));
|
|
9996
10430
|
await importEmbeddedSkills(projectRoot, JUNIE_SKILLS_DIR, JUNIE_TARGET, results, normalize);
|
|
9997
10431
|
return results;
|
|
9998
10432
|
}
|
|
9999
|
-
var
|
|
10433
|
+
var init_importer10 = __esm({
|
|
10000
10434
|
"src/targets/junie/importer.ts"() {
|
|
10001
10435
|
init_import_rewriter();
|
|
10002
10436
|
init_fs();
|
|
@@ -10005,13 +10439,13 @@ var init_importer9 = __esm({
|
|
|
10005
10439
|
init_embedded_rules();
|
|
10006
10440
|
init_import_metadata();
|
|
10007
10441
|
init_descriptor_import_runner();
|
|
10008
|
-
|
|
10442
|
+
init_constants8();
|
|
10009
10443
|
init_junie2();
|
|
10010
10444
|
}
|
|
10011
10445
|
});
|
|
10012
10446
|
|
|
10013
10447
|
// src/targets/junie/linter.ts
|
|
10014
|
-
function
|
|
10448
|
+
function lintRules10(canonical, projectRoot, projectFiles, options) {
|
|
10015
10449
|
return validateRules(canonical, projectRoot, projectFiles, {
|
|
10016
10450
|
checkGlobMatches: options?.scope !== "global"
|
|
10017
10451
|
}).map((diagnostic) => ({
|
|
@@ -10019,15 +10453,15 @@ function lintRules9(canonical, projectRoot, projectFiles, options) {
|
|
|
10019
10453
|
target: JUNIE_TARGET
|
|
10020
10454
|
}));
|
|
10021
10455
|
}
|
|
10022
|
-
var
|
|
10456
|
+
var init_linter10 = __esm({
|
|
10023
10457
|
"src/targets/junie/linter.ts"() {
|
|
10024
10458
|
init_validate_rules();
|
|
10025
|
-
|
|
10459
|
+
init_constants8();
|
|
10026
10460
|
}
|
|
10027
10461
|
});
|
|
10028
10462
|
|
|
10029
10463
|
// src/targets/junie/lint.ts
|
|
10030
|
-
function
|
|
10464
|
+
function lintMcp4(canonical) {
|
|
10031
10465
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
10032
10466
|
const diagnostics = [];
|
|
10033
10467
|
for (const [name, server] of Object.entries(canonical.mcp.mcpServers)) {
|
|
@@ -10043,7 +10477,7 @@ function lintMcp3(canonical) {
|
|
|
10043
10477
|
}
|
|
10044
10478
|
return diagnostics;
|
|
10045
10479
|
}
|
|
10046
|
-
var
|
|
10480
|
+
var init_lint8 = __esm({
|
|
10047
10481
|
"src/targets/junie/lint.ts"() {
|
|
10048
10482
|
init_mcp_servers();
|
|
10049
10483
|
init_helpers();
|
|
@@ -10051,28 +10485,28 @@ var init_lint7 = __esm({
|
|
|
10051
10485
|
});
|
|
10052
10486
|
|
|
10053
10487
|
// src/targets/junie/index.ts
|
|
10054
|
-
var
|
|
10488
|
+
var target10, project10, global7, globalCapabilities9, descriptor10;
|
|
10055
10489
|
var init_junie2 = __esm({
|
|
10056
10490
|
"src/targets/junie/index.ts"() {
|
|
10057
|
-
|
|
10058
|
-
|
|
10491
|
+
init_generator13();
|
|
10492
|
+
init_constants8();
|
|
10059
10493
|
init_skill_mirror();
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10494
|
+
init_importer10();
|
|
10495
|
+
init_linter10();
|
|
10496
|
+
init_lint8();
|
|
10063
10497
|
init_import_map_builders();
|
|
10064
|
-
|
|
10498
|
+
target10 = {
|
|
10065
10499
|
name: "junie",
|
|
10066
10500
|
primaryRootInstructionPath: JUNIE_DOT_AGENTS,
|
|
10067
|
-
generateRules:
|
|
10068
|
-
generateCommands:
|
|
10069
|
-
generateAgents:
|
|
10070
|
-
generateSkills:
|
|
10501
|
+
generateRules: generateRules10,
|
|
10502
|
+
generateCommands: generateCommands10,
|
|
10503
|
+
generateAgents: generateAgents10,
|
|
10504
|
+
generateSkills: generateSkills10,
|
|
10071
10505
|
generateMcp: generateMcp7,
|
|
10072
|
-
generateIgnore:
|
|
10506
|
+
generateIgnore: generateIgnore6,
|
|
10073
10507
|
importFrom: importFromJunie
|
|
10074
10508
|
};
|
|
10075
|
-
|
|
10509
|
+
project10 = {
|
|
10076
10510
|
rootInstructionPath: JUNIE_DOT_AGENTS,
|
|
10077
10511
|
skillDir: ".junie/skills",
|
|
10078
10512
|
managedOutputs: {
|
|
@@ -10154,9 +10588,9 @@ var init_junie2 = __esm({
|
|
|
10154
10588
|
ignore: "none",
|
|
10155
10589
|
permissions: "none"
|
|
10156
10590
|
};
|
|
10157
|
-
|
|
10591
|
+
descriptor10 = {
|
|
10158
10592
|
id: "junie",
|
|
10159
|
-
generators:
|
|
10593
|
+
generators: target10,
|
|
10160
10594
|
capabilities: {
|
|
10161
10595
|
rules: "native",
|
|
10162
10596
|
additionalRules: "native",
|
|
@@ -10169,11 +10603,11 @@ var init_junie2 = __esm({
|
|
|
10169
10603
|
permissions: "none"
|
|
10170
10604
|
},
|
|
10171
10605
|
emptyImportMessage: "No Junie config found (.junie/guidelines.md, .junie/AGENTS.md, .junie/skills, .junie/mcp/mcp.json, or .aiignore).",
|
|
10172
|
-
lintRules:
|
|
10606
|
+
lintRules: lintRules10,
|
|
10173
10607
|
lint: {
|
|
10174
|
-
mcp:
|
|
10608
|
+
mcp: lintMcp4
|
|
10175
10609
|
},
|
|
10176
|
-
project:
|
|
10610
|
+
project: project10,
|
|
10177
10611
|
globalSupport: {
|
|
10178
10612
|
capabilities: globalCapabilities9,
|
|
10179
10613
|
detectionPaths: [
|
|
@@ -10236,7 +10670,7 @@ var init_junie2 = __esm({
|
|
|
10236
10670
|
};
|
|
10237
10671
|
}
|
|
10238
10672
|
});
|
|
10239
|
-
function
|
|
10673
|
+
function generateRules11(canonical) {
|
|
10240
10674
|
const outputs = [];
|
|
10241
10675
|
const root = canonical.rules.find((rule) => rule.root);
|
|
10242
10676
|
if (root) {
|
|
@@ -10260,7 +10694,7 @@ function generateRules10(canonical) {
|
|
|
10260
10694
|
}
|
|
10261
10695
|
return outputs;
|
|
10262
10696
|
}
|
|
10263
|
-
function
|
|
10697
|
+
function generateCommands11(canonical) {
|
|
10264
10698
|
return canonical.commands.map((command) => {
|
|
10265
10699
|
const frontmatter = {};
|
|
10266
10700
|
if (command.description) frontmatter.description = command.description;
|
|
@@ -10270,7 +10704,7 @@ function generateCommands10(canonical) {
|
|
|
10270
10704
|
};
|
|
10271
10705
|
});
|
|
10272
10706
|
}
|
|
10273
|
-
function
|
|
10707
|
+
function generateAgents11(canonical) {
|
|
10274
10708
|
return canonical.agents.map((agent) => {
|
|
10275
10709
|
const slug = basename(agent.source, ".md");
|
|
10276
10710
|
const frontmatter = { mode: "subagent" };
|
|
@@ -10293,18 +10727,18 @@ function generateMcp8(canonical) {
|
|
|
10293
10727
|
}
|
|
10294
10728
|
];
|
|
10295
10729
|
}
|
|
10296
|
-
function
|
|
10730
|
+
function generateIgnore7(canonical) {
|
|
10297
10731
|
if (canonical.ignore.length === 0) return [];
|
|
10298
10732
|
return [{ path: KILO_CODE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
10299
10733
|
}
|
|
10300
|
-
function
|
|
10734
|
+
function generateSkills11(canonical) {
|
|
10301
10735
|
return generateEmbeddedSkills(canonical, KILO_CODE_SKILLS_DIR);
|
|
10302
10736
|
}
|
|
10303
|
-
var
|
|
10737
|
+
var init_generator14 = __esm({
|
|
10304
10738
|
"src/targets/kilo-code/generator.ts"() {
|
|
10305
10739
|
init_embedded_skill();
|
|
10306
10740
|
init_markdown();
|
|
10307
|
-
|
|
10741
|
+
init_constants9();
|
|
10308
10742
|
}
|
|
10309
10743
|
});
|
|
10310
10744
|
var kiloNonRootRuleMapper, kiloCommandMapper, kiloAgentMapper;
|
|
@@ -10312,7 +10746,7 @@ var init_import_mappers7 = __esm({
|
|
|
10312
10746
|
"src/targets/kilo-code/import-mappers.ts"() {
|
|
10313
10747
|
init_markdown();
|
|
10314
10748
|
init_import_metadata();
|
|
10315
|
-
|
|
10749
|
+
init_constants9();
|
|
10316
10750
|
kiloNonRootRuleMapper = async ({
|
|
10317
10751
|
relativePath,
|
|
10318
10752
|
normalizeTo,
|
|
@@ -10489,7 +10923,7 @@ async function importFromKiloCode(projectRoot, options = {}) {
|
|
|
10489
10923
|
const scope = options.scope ?? "project";
|
|
10490
10924
|
const results = [];
|
|
10491
10925
|
const normalize = await createImportReferenceNormalizer(KILO_CODE_TARGET, projectRoot, scope);
|
|
10492
|
-
results.push(...await runDescriptorImport(
|
|
10926
|
+
results.push(...await runDescriptorImport(descriptor11, projectRoot, scope, { normalize }));
|
|
10493
10927
|
await importEmbeddedSkills(
|
|
10494
10928
|
projectRoot,
|
|
10495
10929
|
KILO_CODE_SKILLS_DIR,
|
|
@@ -10512,7 +10946,7 @@ async function importFromKiloCode(projectRoot, options = {}) {
|
|
|
10512
10946
|
return results;
|
|
10513
10947
|
}
|
|
10514
10948
|
var CANONICAL_ROOT_RULE_PATH, LEGACY_ROOT_RULE_FILE;
|
|
10515
|
-
var
|
|
10949
|
+
var init_importer11 = __esm({
|
|
10516
10950
|
"src/targets/kilo-code/importer.ts"() {
|
|
10517
10951
|
init_import_rewriter();
|
|
10518
10952
|
init_embedded_skill();
|
|
@@ -10522,7 +10956,7 @@ var init_importer10 = __esm({
|
|
|
10522
10956
|
init_import_metadata();
|
|
10523
10957
|
init_markdown();
|
|
10524
10958
|
init_import_mappers7();
|
|
10525
|
-
|
|
10959
|
+
init_constants9();
|
|
10526
10960
|
init_kilo_code2();
|
|
10527
10961
|
CANONICAL_ROOT_RULE_PATH = `${KILO_CODE_CANONICAL_RULES_DIR}/_root.md`;
|
|
10528
10962
|
LEGACY_ROOT_RULE_FILE = "00-root.md";
|
|
@@ -10530,7 +10964,7 @@ var init_importer10 = __esm({
|
|
|
10530
10964
|
});
|
|
10531
10965
|
|
|
10532
10966
|
// src/targets/kilo-code/linter.ts
|
|
10533
|
-
function
|
|
10967
|
+
function lintRules11(canonical, projectRoot, projectFiles, options) {
|
|
10534
10968
|
return validateRules(canonical, projectRoot, projectFiles, {
|
|
10535
10969
|
checkGlobMatches: options?.scope !== "global"
|
|
10536
10970
|
}).map((diagnostic) => ({
|
|
@@ -10538,15 +10972,15 @@ function lintRules10(canonical, projectRoot, projectFiles, options) {
|
|
|
10538
10972
|
target: KILO_CODE_TARGET
|
|
10539
10973
|
}));
|
|
10540
10974
|
}
|
|
10541
|
-
var
|
|
10975
|
+
var init_linter11 = __esm({
|
|
10542
10976
|
"src/targets/kilo-code/linter.ts"() {
|
|
10543
10977
|
init_validate_rules();
|
|
10544
|
-
|
|
10978
|
+
init_constants9();
|
|
10545
10979
|
}
|
|
10546
10980
|
});
|
|
10547
10981
|
|
|
10548
10982
|
// src/targets/kilo-code/lint.ts
|
|
10549
|
-
function
|
|
10983
|
+
function lintHooks5(canonical) {
|
|
10550
10984
|
if (!canonical.hooks) return [];
|
|
10551
10985
|
const hasEntries = Object.values(canonical.hooks).some(
|
|
10552
10986
|
(entries) => Array.isArray(entries) && entries.length > 0
|
|
@@ -10560,7 +10994,7 @@ function lintHooks4(canonical) {
|
|
|
10560
10994
|
)
|
|
10561
10995
|
];
|
|
10562
10996
|
}
|
|
10563
|
-
function
|
|
10997
|
+
function lintPermissions3(canonical) {
|
|
10564
10998
|
if (!canonical.permissions) return [];
|
|
10565
10999
|
const { allow, deny } = canonical.permissions;
|
|
10566
11000
|
const ask = canonical.permissions.ask ?? [];
|
|
@@ -10573,36 +11007,36 @@ function lintPermissions2(canonical) {
|
|
|
10573
11007
|
)
|
|
10574
11008
|
];
|
|
10575
11009
|
}
|
|
10576
|
-
var
|
|
11010
|
+
var init_lint9 = __esm({
|
|
10577
11011
|
"src/targets/kilo-code/lint.ts"() {
|
|
10578
11012
|
init_helpers();
|
|
10579
11013
|
}
|
|
10580
11014
|
});
|
|
10581
11015
|
|
|
10582
11016
|
// src/targets/kilo-code/index.ts
|
|
10583
|
-
var
|
|
11017
|
+
var target11, project11, globalLayout4, capabilities2, descriptor11;
|
|
10584
11018
|
var init_kilo_code2 = __esm({
|
|
10585
11019
|
"src/targets/kilo-code/index.ts"() {
|
|
10586
|
-
|
|
10587
|
-
|
|
11020
|
+
init_generator14();
|
|
11021
|
+
init_constants9();
|
|
10588
11022
|
init_skill_mirror();
|
|
10589
|
-
|
|
11023
|
+
init_importer11();
|
|
10590
11024
|
init_import_mappers7();
|
|
10591
|
-
|
|
10592
|
-
|
|
11025
|
+
init_linter11();
|
|
11026
|
+
init_lint9();
|
|
10593
11027
|
init_import_map_builders();
|
|
10594
|
-
|
|
11028
|
+
target11 = {
|
|
10595
11029
|
name: KILO_CODE_TARGET,
|
|
10596
11030
|
primaryRootInstructionPath: KILO_CODE_ROOT_RULE,
|
|
10597
|
-
generateRules:
|
|
10598
|
-
generateCommands:
|
|
10599
|
-
generateAgents:
|
|
10600
|
-
generateSkills:
|
|
11031
|
+
generateRules: generateRules11,
|
|
11032
|
+
generateCommands: generateCommands11,
|
|
11033
|
+
generateAgents: generateAgents11,
|
|
11034
|
+
generateSkills: generateSkills11,
|
|
10601
11035
|
generateMcp: generateMcp8,
|
|
10602
|
-
generateIgnore:
|
|
11036
|
+
generateIgnore: generateIgnore7,
|
|
10603
11037
|
importFrom: importFromKiloCode
|
|
10604
11038
|
};
|
|
10605
|
-
|
|
11039
|
+
project11 = {
|
|
10606
11040
|
rootInstructionPath: KILO_CODE_ROOT_RULE,
|
|
10607
11041
|
skillDir: KILO_CODE_SKILLS_DIR,
|
|
10608
11042
|
managedOutputs: {
|
|
@@ -10621,7 +11055,7 @@ var init_kilo_code2 = __esm({
|
|
|
10621
11055
|
}
|
|
10622
11056
|
}
|
|
10623
11057
|
};
|
|
10624
|
-
|
|
11058
|
+
globalLayout4 = {
|
|
10625
11059
|
rootInstructionPath: KILO_CODE_GLOBAL_AGENTS_MD,
|
|
10626
11060
|
skillDir: KILO_CODE_GLOBAL_SKILLS_DIR,
|
|
10627
11061
|
managedOutputs: {
|
|
@@ -10653,7 +11087,7 @@ var init_kilo_code2 = __esm({
|
|
|
10653
11087
|
}
|
|
10654
11088
|
}
|
|
10655
11089
|
};
|
|
10656
|
-
|
|
11090
|
+
capabilities2 = {
|
|
10657
11091
|
rules: "native",
|
|
10658
11092
|
additionalRules: "native",
|
|
10659
11093
|
commands: "native",
|
|
@@ -10664,19 +11098,19 @@ var init_kilo_code2 = __esm({
|
|
|
10664
11098
|
ignore: "native",
|
|
10665
11099
|
permissions: "none"
|
|
10666
11100
|
};
|
|
10667
|
-
|
|
11101
|
+
descriptor11 = {
|
|
10668
11102
|
id: KILO_CODE_TARGET,
|
|
10669
|
-
generators:
|
|
10670
|
-
capabilities,
|
|
11103
|
+
generators: target11,
|
|
11104
|
+
capabilities: capabilities2,
|
|
10671
11105
|
emptyImportMessage: "No Kilo Code config found (AGENTS.md, .kilo/rules, .kilo/commands, .kilo/agents, .kilo/skills, .kilo/mcp.json, .kilocodeignore, .kilocode/, or .kilocodemodes).",
|
|
10672
|
-
lintRules:
|
|
11106
|
+
lintRules: lintRules11,
|
|
10673
11107
|
lint: {
|
|
10674
|
-
hooks:
|
|
10675
|
-
permissions:
|
|
11108
|
+
hooks: lintHooks5,
|
|
11109
|
+
permissions: lintPermissions3
|
|
10676
11110
|
},
|
|
10677
|
-
project:
|
|
11111
|
+
project: project11,
|
|
10678
11112
|
globalSupport: {
|
|
10679
|
-
capabilities,
|
|
11113
|
+
capabilities: capabilities2,
|
|
10680
11114
|
detectionPaths: [
|
|
10681
11115
|
KILO_CODE_GLOBAL_AGENTS_MD,
|
|
10682
11116
|
KILO_CODE_GLOBAL_RULES_DIR,
|
|
@@ -10686,7 +11120,7 @@ var init_kilo_code2 = __esm({
|
|
|
10686
11120
|
KILO_CODE_GLOBAL_MCP_FILE,
|
|
10687
11121
|
KILO_CODE_GLOBAL_IGNORE
|
|
10688
11122
|
],
|
|
10689
|
-
layout:
|
|
11123
|
+
layout: globalLayout4
|
|
10690
11124
|
},
|
|
10691
11125
|
importer: {
|
|
10692
11126
|
rules: [
|
|
@@ -10887,7 +11321,7 @@ function steeringFrontmatter(rule) {
|
|
|
10887
11321
|
if (rule.description) frontmatter.description = rule.description;
|
|
10888
11322
|
return frontmatter;
|
|
10889
11323
|
}
|
|
10890
|
-
function
|
|
11324
|
+
function generateRules12(canonical) {
|
|
10891
11325
|
const outputs = [];
|
|
10892
11326
|
const root = canonical.rules.find((rule) => rule.root);
|
|
10893
11327
|
if (root) {
|
|
@@ -10904,7 +11338,13 @@ function generateRules11(canonical) {
|
|
|
10904
11338
|
}
|
|
10905
11339
|
return outputs;
|
|
10906
11340
|
}
|
|
10907
|
-
function
|
|
11341
|
+
function generateCommands12(canonical) {
|
|
11342
|
+
return canonical.commands.map((command) => ({
|
|
11343
|
+
path: `${KIRO_SKILLS_DIR}/${commandSkillDirName(command.name)}/SKILL.md`,
|
|
11344
|
+
content: serializeCommandSkill(command)
|
|
11345
|
+
}));
|
|
11346
|
+
}
|
|
11347
|
+
function generateSkills12(canonical) {
|
|
10908
11348
|
return generateEmbeddedSkills(canonical, KIRO_SKILLS_DIR);
|
|
10909
11349
|
}
|
|
10910
11350
|
function generateMcp9(canonical) {
|
|
@@ -10923,7 +11363,7 @@ function generateHooks5(canonical) {
|
|
|
10923
11363
|
content: hook.content
|
|
10924
11364
|
}));
|
|
10925
11365
|
}
|
|
10926
|
-
function
|
|
11366
|
+
function generateAgents12(canonical) {
|
|
10927
11367
|
return canonical.agents.map((agent) => {
|
|
10928
11368
|
const frontmatter = {
|
|
10929
11369
|
name: agent.name,
|
|
@@ -10938,16 +11378,17 @@ function generateAgents9(canonical) {
|
|
|
10938
11378
|
return { path: `${KIRO_AGENTS_DIR}/${agent.name}.md`, content };
|
|
10939
11379
|
});
|
|
10940
11380
|
}
|
|
10941
|
-
function
|
|
11381
|
+
function generateIgnore8(canonical) {
|
|
10942
11382
|
if (canonical.ignore.length === 0) return [];
|
|
10943
11383
|
return [{ path: KIRO_IGNORE, content: canonical.ignore.join("\n") }];
|
|
10944
11384
|
}
|
|
10945
|
-
var
|
|
11385
|
+
var init_generator15 = __esm({
|
|
10946
11386
|
"src/targets/kiro/generator.ts"() {
|
|
10947
11387
|
init_embedded_skill();
|
|
11388
|
+
init_command_skill();
|
|
10948
11389
|
init_markdown();
|
|
10949
11390
|
init_hook_format();
|
|
10950
|
-
|
|
11391
|
+
init_constants10();
|
|
10951
11392
|
}
|
|
10952
11393
|
});
|
|
10953
11394
|
function canonicalRuleMeta(frontmatter) {
|
|
@@ -11036,12 +11477,12 @@ async function importFromKiro(projectRoot, options = {}) {
|
|
|
11036
11477
|
const normalize = await createImportReferenceNormalizer(KIRO_TARGET, projectRoot, scope);
|
|
11037
11478
|
await importRoot(projectRoot, results, normalize, scope);
|
|
11038
11479
|
await importNonRootRules(projectRoot, results, normalize);
|
|
11039
|
-
results.push(...await runDescriptorImport(
|
|
11480
|
+
results.push(...await runDescriptorImport(descriptor12, projectRoot, scope, { normalize }));
|
|
11040
11481
|
await importEmbeddedSkills(projectRoot, KIRO_SKILLS_DIR, KIRO_TARGET, results, normalize);
|
|
11041
11482
|
if (scope === "project") await importHooks2(projectRoot, results);
|
|
11042
11483
|
return results;
|
|
11043
11484
|
}
|
|
11044
|
-
var
|
|
11485
|
+
var init_importer12 = __esm({
|
|
11045
11486
|
"src/targets/kiro/importer.ts"() {
|
|
11046
11487
|
init_import_rewriter();
|
|
11047
11488
|
init_embedded_skill();
|
|
@@ -11052,13 +11493,13 @@ var init_importer11 = __esm({
|
|
|
11052
11493
|
init_fs();
|
|
11053
11494
|
init_markdown();
|
|
11054
11495
|
init_hook_format();
|
|
11055
|
-
|
|
11496
|
+
init_constants10();
|
|
11056
11497
|
init_kiro2();
|
|
11057
11498
|
}
|
|
11058
11499
|
});
|
|
11059
11500
|
|
|
11060
11501
|
// src/targets/kiro/linter.ts
|
|
11061
|
-
function
|
|
11502
|
+
function lintRules12(canonical, projectRoot, projectFiles, options) {
|
|
11062
11503
|
return validateRules(canonical, projectRoot, projectFiles, {
|
|
11063
11504
|
checkGlobMatches: options?.scope !== "global"
|
|
11064
11505
|
}).map((diagnostic) => ({
|
|
@@ -11066,15 +11507,15 @@ function lintRules11(canonical, projectRoot, projectFiles, options) {
|
|
|
11066
11507
|
target: KIRO_TARGET
|
|
11067
11508
|
}));
|
|
11068
11509
|
}
|
|
11069
|
-
var
|
|
11510
|
+
var init_linter12 = __esm({
|
|
11070
11511
|
"src/targets/kiro/linter.ts"() {
|
|
11071
11512
|
init_validate_rules();
|
|
11072
|
-
|
|
11513
|
+
init_constants10();
|
|
11073
11514
|
}
|
|
11074
11515
|
});
|
|
11075
11516
|
|
|
11076
11517
|
// src/targets/kiro/lint.ts
|
|
11077
|
-
function
|
|
11518
|
+
function lintHooks6(canonical) {
|
|
11078
11519
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
11079
11520
|
const supported = ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SubagentStop"];
|
|
11080
11521
|
const supportedSet = new Set(supported);
|
|
@@ -11082,184 +11523,652 @@ function lintHooks5(canonical) {
|
|
|
11082
11523
|
(event) => createUnsupportedHookWarning(event, "kiro", supported, { unsupportedBy: "Kiro hooks" })
|
|
11083
11524
|
);
|
|
11084
11525
|
}
|
|
11085
|
-
var
|
|
11086
|
-
"src/targets/kiro/lint.ts"() {
|
|
11526
|
+
var init_lint10 = __esm({
|
|
11527
|
+
"src/targets/kiro/lint.ts"() {
|
|
11528
|
+
init_helpers();
|
|
11529
|
+
}
|
|
11530
|
+
});
|
|
11531
|
+
|
|
11532
|
+
// src/targets/kiro/index.ts
|
|
11533
|
+
var target12, project12, global8, globalCapabilities10, descriptor12;
|
|
11534
|
+
var init_kiro2 = __esm({
|
|
11535
|
+
"src/targets/kiro/index.ts"() {
|
|
11536
|
+
init_command_skill();
|
|
11537
|
+
init_generator15();
|
|
11538
|
+
init_skill_mirror();
|
|
11539
|
+
init_importer12();
|
|
11540
|
+
init_linter12();
|
|
11541
|
+
init_lint10();
|
|
11542
|
+
init_import_map_builders();
|
|
11543
|
+
init_constants10();
|
|
11544
|
+
target12 = {
|
|
11545
|
+
name: KIRO_TARGET,
|
|
11546
|
+
primaryRootInstructionPath: KIRO_AGENTS_MD,
|
|
11547
|
+
generateRules: generateRules12,
|
|
11548
|
+
generateCommands: generateCommands12,
|
|
11549
|
+
generateAgents: generateAgents12,
|
|
11550
|
+
generateSkills: generateSkills12,
|
|
11551
|
+
generateMcp: generateMcp9,
|
|
11552
|
+
generateHooks: generateHooks5,
|
|
11553
|
+
generateIgnore: generateIgnore8,
|
|
11554
|
+
importFrom: importFromKiro
|
|
11555
|
+
};
|
|
11556
|
+
project12 = {
|
|
11557
|
+
rootInstructionPath: KIRO_AGENTS_MD,
|
|
11558
|
+
skillDir: KIRO_SKILLS_DIR,
|
|
11559
|
+
managedOutputs: {
|
|
11560
|
+
dirs: [".kiro/hooks", ".kiro/skills", ".kiro/steering", ".kiro/agents"],
|
|
11561
|
+
files: ["AGENTS.md", ".kiro/settings/mcp.json", ".kiroignore"]
|
|
11562
|
+
},
|
|
11563
|
+
paths: {
|
|
11564
|
+
rulePath(slug, _rule) {
|
|
11565
|
+
return `${KIRO_STEERING_DIR}/${slug}.md`;
|
|
11566
|
+
},
|
|
11567
|
+
commandPath(name) {
|
|
11568
|
+
return `${KIRO_SKILLS_DIR}/${commandSkillDirName(name)}/SKILL.md`;
|
|
11569
|
+
},
|
|
11570
|
+
agentPath(name, _config) {
|
|
11571
|
+
return `${KIRO_AGENTS_DIR}/${name}.md`;
|
|
11572
|
+
}
|
|
11573
|
+
}
|
|
11574
|
+
};
|
|
11575
|
+
global8 = {
|
|
11576
|
+
rootInstructionPath: KIRO_GLOBAL_STEERING_AGENTS_MD,
|
|
11577
|
+
skillDir: KIRO_GLOBAL_SKILLS_DIR,
|
|
11578
|
+
managedOutputs: {
|
|
11579
|
+
dirs: [
|
|
11580
|
+
KIRO_GLOBAL_STEERING_DIR,
|
|
11581
|
+
KIRO_GLOBAL_SKILLS_DIR,
|
|
11582
|
+
KIRO_GLOBAL_AGENTS_DIR,
|
|
11583
|
+
KIRO_GLOBAL_AGENTS_SKILLS_DIR
|
|
11584
|
+
],
|
|
11585
|
+
files: [KIRO_GLOBAL_STEERING_AGENTS_MD, KIRO_GLOBAL_MCP_FILE, KIRO_GLOBAL_IGNORE]
|
|
11586
|
+
},
|
|
11587
|
+
rewriteGeneratedPath(path) {
|
|
11588
|
+
if (path === KIRO_AGENTS_MD) {
|
|
11589
|
+
return KIRO_GLOBAL_STEERING_AGENTS_MD;
|
|
11590
|
+
}
|
|
11591
|
+
if (path.startsWith(`${KIRO_STEERING_DIR}/`)) {
|
|
11592
|
+
return path.replace(`${KIRO_STEERING_DIR}/`, `${KIRO_GLOBAL_STEERING_DIR}/`);
|
|
11593
|
+
}
|
|
11594
|
+
if (path.startsWith(`${KIRO_SKILLS_DIR}/`)) {
|
|
11595
|
+
return path.replace(`${KIRO_SKILLS_DIR}/`, `${KIRO_GLOBAL_SKILLS_DIR}/`);
|
|
11596
|
+
}
|
|
11597
|
+
if (path.startsWith(`${KIRO_AGENTS_DIR}/`)) {
|
|
11598
|
+
return path.replace(`${KIRO_AGENTS_DIR}/`, `${KIRO_GLOBAL_AGENTS_DIR}/`);
|
|
11599
|
+
}
|
|
11600
|
+
if (path === KIRO_MCP_FILE) {
|
|
11601
|
+
return KIRO_GLOBAL_MCP_FILE;
|
|
11602
|
+
}
|
|
11603
|
+
if (path === KIRO_IGNORE) {
|
|
11604
|
+
return KIRO_GLOBAL_IGNORE;
|
|
11605
|
+
}
|
|
11606
|
+
if (path.startsWith(`${KIRO_HOOKS_DIR}/`)) {
|
|
11607
|
+
return null;
|
|
11608
|
+
}
|
|
11609
|
+
return path;
|
|
11610
|
+
},
|
|
11611
|
+
mirrorGlobalPath(path, activeTargets) {
|
|
11612
|
+
return mirrorSkillsToAgents(path, ".kiro/skills", activeTargets);
|
|
11613
|
+
},
|
|
11614
|
+
paths: {
|
|
11615
|
+
rulePath(slug, _rule) {
|
|
11616
|
+
return `${KIRO_GLOBAL_STEERING_DIR}/${slug}.md`;
|
|
11617
|
+
},
|
|
11618
|
+
commandPath(name) {
|
|
11619
|
+
return `${KIRO_SKILLS_DIR}/${commandSkillDirName(name)}/SKILL.md`;
|
|
11620
|
+
},
|
|
11621
|
+
agentPath(name, _config) {
|
|
11622
|
+
return `${KIRO_GLOBAL_AGENTS_DIR}/${name}.md`;
|
|
11623
|
+
}
|
|
11624
|
+
}
|
|
11625
|
+
};
|
|
11626
|
+
globalCapabilities10 = {
|
|
11627
|
+
rules: "native",
|
|
11628
|
+
additionalRules: "native",
|
|
11629
|
+
commands: "none",
|
|
11630
|
+
agents: "native",
|
|
11631
|
+
skills: "native",
|
|
11632
|
+
mcp: "native",
|
|
11633
|
+
hooks: "none",
|
|
11634
|
+
ignore: "native",
|
|
11635
|
+
permissions: "none"
|
|
11636
|
+
};
|
|
11637
|
+
descriptor12 = {
|
|
11638
|
+
id: KIRO_TARGET,
|
|
11639
|
+
generators: target12,
|
|
11640
|
+
capabilities: {
|
|
11641
|
+
rules: "native",
|
|
11642
|
+
additionalRules: "native",
|
|
11643
|
+
commands: "none",
|
|
11644
|
+
agents: "native",
|
|
11645
|
+
skills: "native",
|
|
11646
|
+
mcp: "native",
|
|
11647
|
+
hooks: "native",
|
|
11648
|
+
ignore: "native",
|
|
11649
|
+
permissions: "none"
|
|
11650
|
+
},
|
|
11651
|
+
emptyImportMessage: "No Kiro config found (AGENTS.md, .kiro/steering, .kiro/skills, .kiro/agents, .kiro/hooks, .kiro/settings/mcp.json, or .kiroignore).",
|
|
11652
|
+
supportsConversion: { commands: true },
|
|
11653
|
+
lintRules: lintRules12,
|
|
11654
|
+
lint: {
|
|
11655
|
+
hooks: lintHooks6
|
|
11656
|
+
},
|
|
11657
|
+
project: project12,
|
|
11658
|
+
globalSupport: {
|
|
11659
|
+
capabilities: globalCapabilities10,
|
|
11660
|
+
detectionPaths: [
|
|
11661
|
+
KIRO_GLOBAL_STEERING_DIR,
|
|
11662
|
+
KIRO_GLOBAL_STEERING_AGENTS_MD,
|
|
11663
|
+
KIRO_GLOBAL_SKILLS_DIR,
|
|
11664
|
+
KIRO_GLOBAL_AGENTS_DIR,
|
|
11665
|
+
KIRO_GLOBAL_MCP_FILE,
|
|
11666
|
+
KIRO_GLOBAL_IGNORE
|
|
11667
|
+
],
|
|
11668
|
+
layout: global8
|
|
11669
|
+
},
|
|
11670
|
+
importer: {
|
|
11671
|
+
agents: {
|
|
11672
|
+
feature: "agents",
|
|
11673
|
+
mode: "directory",
|
|
11674
|
+
source: { project: [KIRO_AGENTS_DIR], global: [KIRO_AGENTS_DIR] },
|
|
11675
|
+
canonicalDir: KIRO_CANONICAL_AGENTS_DIR,
|
|
11676
|
+
extensions: [".md"],
|
|
11677
|
+
preset: "agent"
|
|
11678
|
+
},
|
|
11679
|
+
mcp: {
|
|
11680
|
+
feature: "mcp",
|
|
11681
|
+
mode: "mcpJson",
|
|
11682
|
+
source: { project: [KIRO_MCP_FILE], global: [KIRO_GLOBAL_MCP_FILE] },
|
|
11683
|
+
canonicalDir: ".agentsmesh",
|
|
11684
|
+
canonicalFilename: KIRO_CANONICAL_MCP
|
|
11685
|
+
},
|
|
11686
|
+
ignore: {
|
|
11687
|
+
feature: "ignore",
|
|
11688
|
+
mode: "flatFile",
|
|
11689
|
+
source: { project: [KIRO_IGNORE], global: [KIRO_GLOBAL_IGNORE] },
|
|
11690
|
+
canonicalDir: ".agentsmesh",
|
|
11691
|
+
canonicalFilename: KIRO_CANONICAL_IGNORE
|
|
11692
|
+
}
|
|
11693
|
+
},
|
|
11694
|
+
buildImportPaths: buildKiroImportPaths,
|
|
11695
|
+
detectionPaths: [
|
|
11696
|
+
KIRO_STEERING_DIR,
|
|
11697
|
+
KIRO_SKILLS_DIR,
|
|
11698
|
+
KIRO_AGENTS_DIR,
|
|
11699
|
+
KIRO_HOOKS_DIR,
|
|
11700
|
+
KIRO_MCP_FILE,
|
|
11701
|
+
KIRO_IGNORE
|
|
11702
|
+
]
|
|
11703
|
+
};
|
|
11704
|
+
}
|
|
11705
|
+
});
|
|
11706
|
+
function generateRules13(canonical) {
|
|
11707
|
+
const outputs = [];
|
|
11708
|
+
const root = canonical.rules.find((rule) => rule.root);
|
|
11709
|
+
if (root) {
|
|
11710
|
+
outputs.push({
|
|
11711
|
+
path: OPENCODE_ROOT_RULE,
|
|
11712
|
+
content: root.body.trim() ? root.body : ""
|
|
11713
|
+
});
|
|
11714
|
+
}
|
|
11715
|
+
for (const rule of canonical.rules) {
|
|
11716
|
+
if (rule.root) continue;
|
|
11717
|
+
if (rule.targets.length > 0 && !rule.targets.includes(OPENCODE_TARGET)) continue;
|
|
11718
|
+
const slug = basename(rule.source, ".md");
|
|
11719
|
+
const frontmatter = {};
|
|
11720
|
+
if (rule.description) frontmatter.description = rule.description;
|
|
11721
|
+
if (rule.globs.length > 0) frontmatter.globs = rule.globs;
|
|
11722
|
+
const content = Object.keys(frontmatter).length > 0 ? serializeFrontmatter(frontmatter, rule.body.trim() || "") : rule.body.trim() || "";
|
|
11723
|
+
outputs.push({
|
|
11724
|
+
path: `${OPENCODE_RULES_DIR}/${slug}.md`,
|
|
11725
|
+
content
|
|
11726
|
+
});
|
|
11727
|
+
}
|
|
11728
|
+
return outputs;
|
|
11729
|
+
}
|
|
11730
|
+
function generateCommands13(canonical) {
|
|
11731
|
+
return canonical.commands.map((command) => {
|
|
11732
|
+
const frontmatter = {};
|
|
11733
|
+
if (command.description) frontmatter.description = command.description;
|
|
11734
|
+
return {
|
|
11735
|
+
path: `${OPENCODE_COMMANDS_DIR}/${command.name}.md`,
|
|
11736
|
+
content: serializeFrontmatter(frontmatter, command.body.trim() || "")
|
|
11737
|
+
};
|
|
11738
|
+
});
|
|
11739
|
+
}
|
|
11740
|
+
function generateAgents13(canonical) {
|
|
11741
|
+
return canonical.agents.map((agent) => {
|
|
11742
|
+
const slug = basename(agent.source, ".md");
|
|
11743
|
+
const frontmatter = { mode: "subagent" };
|
|
11744
|
+
if (agent.description) frontmatter.description = agent.description;
|
|
11745
|
+
if (agent.model) frontmatter.model = agent.model;
|
|
11746
|
+
if (agent.tools.length > 0) frontmatter.tools = agent.tools;
|
|
11747
|
+
if (agent.disallowedTools.length > 0) frontmatter.disallowedTools = agent.disallowedTools;
|
|
11748
|
+
return {
|
|
11749
|
+
path: `${OPENCODE_AGENTS_DIR}/${slug}.md`,
|
|
11750
|
+
content: serializeFrontmatter(frontmatter, agent.body.trim() || "")
|
|
11751
|
+
};
|
|
11752
|
+
});
|
|
11753
|
+
}
|
|
11754
|
+
function toOpenCodeMcpServer(server) {
|
|
11755
|
+
if ("url" in server) {
|
|
11756
|
+
const entry2 = { type: "remote", url: server.url };
|
|
11757
|
+
if (Object.keys(server.headers).length > 0) entry2.headers = server.headers;
|
|
11758
|
+
if (server.description) entry2.description = server.description;
|
|
11759
|
+
return entry2;
|
|
11760
|
+
}
|
|
11761
|
+
const entry = {
|
|
11762
|
+
type: "local",
|
|
11763
|
+
command: [server.command, ...server.args]
|
|
11764
|
+
};
|
|
11765
|
+
if (Object.keys(server.env).length > 0) entry.environment = server.env;
|
|
11766
|
+
if (server.description) entry.description = server.description;
|
|
11767
|
+
return entry;
|
|
11768
|
+
}
|
|
11769
|
+
function generateMcp10(canonical) {
|
|
11770
|
+
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
11771
|
+
const mcpEntries = {};
|
|
11772
|
+
for (const [name, server] of Object.entries(canonical.mcp.mcpServers)) {
|
|
11773
|
+
mcpEntries[name] = toOpenCodeMcpServer(server);
|
|
11774
|
+
}
|
|
11775
|
+
return [
|
|
11776
|
+
{
|
|
11777
|
+
path: OPENCODE_CONFIG_FILE,
|
|
11778
|
+
content: JSON.stringify({ mcp: mcpEntries }, null, 2)
|
|
11779
|
+
}
|
|
11780
|
+
];
|
|
11781
|
+
}
|
|
11782
|
+
function generateSkills13(canonical) {
|
|
11783
|
+
return generateEmbeddedSkills(canonical, OPENCODE_SKILLS_DIR);
|
|
11784
|
+
}
|
|
11785
|
+
var init_generator16 = __esm({
|
|
11786
|
+
"src/targets/opencode/generator.ts"() {
|
|
11787
|
+
init_embedded_skill();
|
|
11788
|
+
init_markdown();
|
|
11789
|
+
init_constants11();
|
|
11790
|
+
}
|
|
11791
|
+
});
|
|
11792
|
+
function toStringRecord2(value) {
|
|
11793
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
11794
|
+
const out = {};
|
|
11795
|
+
for (const [k, v] of Object.entries(value)) {
|
|
11796
|
+
if (typeof v === "string") out[k] = v;
|
|
11797
|
+
}
|
|
11798
|
+
return out;
|
|
11799
|
+
}
|
|
11800
|
+
function parseOpenCodeMcp(content) {
|
|
11801
|
+
let parsed;
|
|
11802
|
+
try {
|
|
11803
|
+
parsed = JSON.parse(content);
|
|
11804
|
+
} catch {
|
|
11805
|
+
return {};
|
|
11806
|
+
}
|
|
11807
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
11808
|
+
const raw = parsed.mcp;
|
|
11809
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {};
|
|
11810
|
+
const out = {};
|
|
11811
|
+
for (const [name, value] of Object.entries(raw)) {
|
|
11812
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) continue;
|
|
11813
|
+
const entry = value;
|
|
11814
|
+
if (typeof entry.url === "string") {
|
|
11815
|
+
out[name] = {
|
|
11816
|
+
type: "url",
|
|
11817
|
+
url: entry.url,
|
|
11818
|
+
headers: toStringRecord2(entry.headers),
|
|
11819
|
+
env: toStringRecord2(entry.environment),
|
|
11820
|
+
...typeof entry.description === "string" ? { description: entry.description } : {}
|
|
11821
|
+
};
|
|
11822
|
+
continue;
|
|
11823
|
+
}
|
|
11824
|
+
if (Array.isArray(entry.command) && entry.command.length > 0) {
|
|
11825
|
+
const cmdArr = entry.command;
|
|
11826
|
+
const command = cmdArr[0];
|
|
11827
|
+
if (command === void 0) continue;
|
|
11828
|
+
const args = cmdArr.slice(1);
|
|
11829
|
+
out[name] = {
|
|
11830
|
+
type: "stdio",
|
|
11831
|
+
command,
|
|
11832
|
+
args,
|
|
11833
|
+
env: toStringRecord2(entry.environment),
|
|
11834
|
+
...typeof entry.description === "string" ? { description: entry.description } : {}
|
|
11835
|
+
};
|
|
11836
|
+
}
|
|
11837
|
+
}
|
|
11838
|
+
return out;
|
|
11839
|
+
}
|
|
11840
|
+
async function importMcp4(projectRoot, scope, results) {
|
|
11841
|
+
const configFile = scope === "global" ? OPENCODE_GLOBAL_CONFIG_FILE : OPENCODE_CONFIG_FILE;
|
|
11842
|
+
const srcPath = join(projectRoot, configFile);
|
|
11843
|
+
const content = await readFileSafe(srcPath);
|
|
11844
|
+
if (content === null) return;
|
|
11845
|
+
const imported = parseOpenCodeMcp(content);
|
|
11846
|
+
if (Object.keys(imported).length === 0) return;
|
|
11847
|
+
await writeMcpWithMerge(projectRoot, OPENCODE_CANONICAL_MCP, imported);
|
|
11848
|
+
results.push({
|
|
11849
|
+
feature: "mcp",
|
|
11850
|
+
fromTool: OPENCODE_TARGET,
|
|
11851
|
+
fromPath: srcPath,
|
|
11852
|
+
toPath: OPENCODE_CANONICAL_MCP
|
|
11853
|
+
});
|
|
11854
|
+
}
|
|
11855
|
+
async function importFromOpenCode(projectRoot, options = {}) {
|
|
11856
|
+
const scope = options.scope ?? "project";
|
|
11857
|
+
const results = [];
|
|
11858
|
+
const normalize = await createImportReferenceNormalizer(OPENCODE_TARGET, projectRoot, scope);
|
|
11859
|
+
results.push(...await runDescriptorImport(descriptor13, projectRoot, scope, { normalize }));
|
|
11860
|
+
await importEmbeddedSkills(projectRoot, OPENCODE_SKILLS_DIR, OPENCODE_TARGET, results, normalize);
|
|
11861
|
+
await importMcp4(projectRoot, scope, results);
|
|
11862
|
+
return results;
|
|
11863
|
+
}
|
|
11864
|
+
var init_importer13 = __esm({
|
|
11865
|
+
"src/targets/opencode/importer.ts"() {
|
|
11866
|
+
init_import_rewriter();
|
|
11867
|
+
init_embedded_skill();
|
|
11868
|
+
init_descriptor_import_runner();
|
|
11869
|
+
init_mcp_merge();
|
|
11870
|
+
init_fs();
|
|
11871
|
+
init_constants11();
|
|
11872
|
+
init_opencode2();
|
|
11873
|
+
}
|
|
11874
|
+
});
|
|
11875
|
+
var opencodeNonRootRuleMapper, opencodeCommandMapper, opencodeAgentMapper;
|
|
11876
|
+
var init_import_mappers8 = __esm({
|
|
11877
|
+
"src/targets/opencode/import-mappers.ts"() {
|
|
11878
|
+
init_markdown();
|
|
11879
|
+
init_import_metadata();
|
|
11880
|
+
init_constants11();
|
|
11881
|
+
opencodeNonRootRuleMapper = async ({
|
|
11882
|
+
relativePath,
|
|
11883
|
+
normalizeTo,
|
|
11884
|
+
destDir
|
|
11885
|
+
}) => {
|
|
11886
|
+
const destPath = join(destDir, relativePath);
|
|
11887
|
+
const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
|
|
11888
|
+
return {
|
|
11889
|
+
destPath,
|
|
11890
|
+
toPath: `${OPENCODE_CANONICAL_RULES_DIR}/${relativePath}`,
|
|
11891
|
+
content: await serializeImportedRuleWithFallback(
|
|
11892
|
+
destPath,
|
|
11893
|
+
{
|
|
11894
|
+
root: false,
|
|
11895
|
+
description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
|
|
11896
|
+
globs: Array.isArray(frontmatter.globs) ? frontmatter.globs : void 0
|
|
11897
|
+
},
|
|
11898
|
+
body
|
|
11899
|
+
)
|
|
11900
|
+
};
|
|
11901
|
+
};
|
|
11902
|
+
opencodeCommandMapper = async ({
|
|
11903
|
+
relativePath,
|
|
11904
|
+
normalizeTo,
|
|
11905
|
+
destDir
|
|
11906
|
+
}) => {
|
|
11907
|
+
const destPath = join(destDir, relativePath);
|
|
11908
|
+
const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
|
|
11909
|
+
return {
|
|
11910
|
+
destPath,
|
|
11911
|
+
toPath: `${OPENCODE_CANONICAL_COMMANDS_DIR}/${relativePath}`,
|
|
11912
|
+
content: await serializeImportedCommandWithFallback(
|
|
11913
|
+
destPath,
|
|
11914
|
+
{
|
|
11915
|
+
hasDescription: Object.prototype.hasOwnProperty.call(frontmatter, "description"),
|
|
11916
|
+
description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
|
|
11917
|
+
hasAllowedTools: false,
|
|
11918
|
+
allowedTools: []
|
|
11919
|
+
},
|
|
11920
|
+
body
|
|
11921
|
+
)
|
|
11922
|
+
};
|
|
11923
|
+
};
|
|
11924
|
+
opencodeAgentMapper = async ({
|
|
11925
|
+
relativePath,
|
|
11926
|
+
normalizeTo,
|
|
11927
|
+
destDir
|
|
11928
|
+
}) => {
|
|
11929
|
+
const destPath = join(destDir, relativePath);
|
|
11930
|
+
const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
|
|
11931
|
+
return {
|
|
11932
|
+
destPath,
|
|
11933
|
+
toPath: `${OPENCODE_CANONICAL_AGENTS_DIR}/${relativePath}`,
|
|
11934
|
+
content: await serializeImportedAgentWithFallback(destPath, frontmatter, body)
|
|
11935
|
+
};
|
|
11936
|
+
};
|
|
11937
|
+
}
|
|
11938
|
+
});
|
|
11939
|
+
|
|
11940
|
+
// src/targets/opencode/linter.ts
|
|
11941
|
+
function lintRules13(canonical, projectRoot, projectFiles, options) {
|
|
11942
|
+
return validateRules(canonical, projectRoot, projectFiles, {
|
|
11943
|
+
checkGlobMatches: options?.scope !== "global"
|
|
11944
|
+
}).map((diagnostic) => ({
|
|
11945
|
+
...diagnostic,
|
|
11946
|
+
target: OPENCODE_TARGET
|
|
11947
|
+
}));
|
|
11948
|
+
}
|
|
11949
|
+
var init_linter13 = __esm({
|
|
11950
|
+
"src/targets/opencode/linter.ts"() {
|
|
11951
|
+
init_validate_rules();
|
|
11952
|
+
init_constants11();
|
|
11953
|
+
}
|
|
11954
|
+
});
|
|
11955
|
+
|
|
11956
|
+
// src/targets/opencode/lint.ts
|
|
11957
|
+
function lintHooks7(canonical) {
|
|
11958
|
+
if (!canonical.hooks) return [];
|
|
11959
|
+
const hasEntries = Object.values(canonical.hooks).some(
|
|
11960
|
+
(entries) => Array.isArray(entries) && entries.length > 0
|
|
11961
|
+
);
|
|
11962
|
+
if (!hasEntries) return [];
|
|
11963
|
+
return [
|
|
11964
|
+
createWarning(
|
|
11965
|
+
".agentsmesh/hooks.yaml",
|
|
11966
|
+
"opencode",
|
|
11967
|
+
"opencode hooks are plugin-based (TypeScript/JavaScript); canonical config hooks are not projected."
|
|
11968
|
+
)
|
|
11969
|
+
];
|
|
11970
|
+
}
|
|
11971
|
+
function lintPermissions4(canonical) {
|
|
11972
|
+
if (!canonical.permissions) return [];
|
|
11973
|
+
const { allow, deny } = canonical.permissions;
|
|
11974
|
+
const ask = canonical.permissions.ask ?? [];
|
|
11975
|
+
if (allow.length === 0 && deny.length === 0 && ask.length === 0) return [];
|
|
11976
|
+
return [
|
|
11977
|
+
createWarning(
|
|
11978
|
+
".agentsmesh/permissions.yaml",
|
|
11979
|
+
"opencode",
|
|
11980
|
+
"opencode permissions live in opencode.json, which agentsmesh does not generate in v1; canonical permissions are not projected."
|
|
11981
|
+
)
|
|
11982
|
+
];
|
|
11983
|
+
}
|
|
11984
|
+
function lintIgnore(canonical) {
|
|
11985
|
+
if (canonical.ignore.length === 0) return [];
|
|
11986
|
+
return [
|
|
11987
|
+
createWarning(
|
|
11988
|
+
".agentsmesh/ignore",
|
|
11989
|
+
"opencode",
|
|
11990
|
+
"opencode has no dedicated ignore file; canonical ignore patterns are not projected. Configure watcher.ignore in opencode.json manually."
|
|
11991
|
+
)
|
|
11992
|
+
];
|
|
11993
|
+
}
|
|
11994
|
+
var init_lint11 = __esm({
|
|
11995
|
+
"src/targets/opencode/lint.ts"() {
|
|
11087
11996
|
init_helpers();
|
|
11088
11997
|
}
|
|
11089
11998
|
});
|
|
11090
11999
|
|
|
11091
|
-
// src/targets/
|
|
11092
|
-
var
|
|
11093
|
-
var
|
|
11094
|
-
"src/targets/
|
|
11095
|
-
|
|
12000
|
+
// src/targets/opencode/index.ts
|
|
12001
|
+
var target13, project13, globalLayout5, capabilities3, descriptor13;
|
|
12002
|
+
var init_opencode2 = __esm({
|
|
12003
|
+
"src/targets/opencode/index.ts"() {
|
|
12004
|
+
init_generator16();
|
|
12005
|
+
init_constants11();
|
|
11096
12006
|
init_skill_mirror();
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
12007
|
+
init_importer13();
|
|
12008
|
+
init_import_mappers8();
|
|
12009
|
+
init_linter13();
|
|
12010
|
+
init_lint11();
|
|
11100
12011
|
init_import_map_builders();
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
generateAgents:
|
|
11107
|
-
generateSkills:
|
|
11108
|
-
generateMcp:
|
|
11109
|
-
|
|
11110
|
-
generateIgnore: generateIgnore7,
|
|
11111
|
-
importFrom: importFromKiro
|
|
12012
|
+
target13 = {
|
|
12013
|
+
name: OPENCODE_TARGET,
|
|
12014
|
+
primaryRootInstructionPath: OPENCODE_ROOT_RULE,
|
|
12015
|
+
generateRules: generateRules13,
|
|
12016
|
+
generateCommands: generateCommands13,
|
|
12017
|
+
generateAgents: generateAgents13,
|
|
12018
|
+
generateSkills: generateSkills13,
|
|
12019
|
+
generateMcp: generateMcp10,
|
|
12020
|
+
importFrom: importFromOpenCode
|
|
11112
12021
|
};
|
|
11113
|
-
|
|
11114
|
-
rootInstructionPath:
|
|
11115
|
-
skillDir:
|
|
12022
|
+
project13 = {
|
|
12023
|
+
rootInstructionPath: OPENCODE_ROOT_RULE,
|
|
12024
|
+
skillDir: OPENCODE_SKILLS_DIR,
|
|
11116
12025
|
managedOutputs: {
|
|
11117
|
-
dirs: [
|
|
11118
|
-
files: [
|
|
12026
|
+
dirs: [OPENCODE_RULES_DIR, OPENCODE_COMMANDS_DIR, OPENCODE_AGENTS_DIR, OPENCODE_SKILLS_DIR],
|
|
12027
|
+
files: [OPENCODE_ROOT_RULE, OPENCODE_CONFIG_FILE]
|
|
11119
12028
|
},
|
|
11120
12029
|
paths: {
|
|
11121
|
-
rulePath(slug
|
|
11122
|
-
return `${
|
|
12030
|
+
rulePath(slug) {
|
|
12031
|
+
return `${OPENCODE_RULES_DIR}/${slug}.md`;
|
|
11123
12032
|
},
|
|
11124
|
-
commandPath(
|
|
11125
|
-
return
|
|
12033
|
+
commandPath(name) {
|
|
12034
|
+
return `${OPENCODE_COMMANDS_DIR}/${name}.md`;
|
|
11126
12035
|
},
|
|
11127
|
-
agentPath(name
|
|
11128
|
-
return `${
|
|
12036
|
+
agentPath(name) {
|
|
12037
|
+
return `${OPENCODE_AGENTS_DIR}/${name}.md`;
|
|
11129
12038
|
}
|
|
11130
12039
|
}
|
|
11131
12040
|
};
|
|
11132
|
-
|
|
11133
|
-
rootInstructionPath:
|
|
11134
|
-
skillDir:
|
|
12041
|
+
globalLayout5 = {
|
|
12042
|
+
rootInstructionPath: OPENCODE_GLOBAL_AGENTS_MD,
|
|
12043
|
+
skillDir: OPENCODE_GLOBAL_SKILLS_DIR,
|
|
11135
12044
|
managedOutputs: {
|
|
11136
12045
|
dirs: [
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
12046
|
+
OPENCODE_GLOBAL_RULES_DIR,
|
|
12047
|
+
OPENCODE_GLOBAL_COMMANDS_DIR,
|
|
12048
|
+
OPENCODE_GLOBAL_AGENTS_DIR,
|
|
12049
|
+
OPENCODE_GLOBAL_SKILLS_DIR,
|
|
12050
|
+
OPENCODE_GLOBAL_AGENTS_SKILLS_DIR
|
|
11141
12051
|
],
|
|
11142
|
-
files: [
|
|
12052
|
+
files: [OPENCODE_GLOBAL_AGENTS_MD, OPENCODE_GLOBAL_CONFIG_FILE]
|
|
11143
12053
|
},
|
|
11144
12054
|
rewriteGeneratedPath(path) {
|
|
11145
|
-
if (path ===
|
|
11146
|
-
|
|
11147
|
-
}
|
|
11148
|
-
if (path.startsWith(`${KIRO_STEERING_DIR}/`)) {
|
|
11149
|
-
return path.replace(`${KIRO_STEERING_DIR}/`, `${KIRO_GLOBAL_STEERING_DIR}/`);
|
|
11150
|
-
}
|
|
11151
|
-
if (path.startsWith(`${KIRO_SKILLS_DIR}/`)) {
|
|
11152
|
-
return path.replace(`${KIRO_SKILLS_DIR}/`, `${KIRO_GLOBAL_SKILLS_DIR}/`);
|
|
11153
|
-
}
|
|
11154
|
-
if (path.startsWith(`${KIRO_AGENTS_DIR}/`)) {
|
|
11155
|
-
return path.replace(`${KIRO_AGENTS_DIR}/`, `${KIRO_GLOBAL_AGENTS_DIR}/`);
|
|
11156
|
-
}
|
|
11157
|
-
if (path === KIRO_MCP_FILE) {
|
|
11158
|
-
return KIRO_GLOBAL_MCP_FILE;
|
|
11159
|
-
}
|
|
11160
|
-
if (path === KIRO_IGNORE) {
|
|
11161
|
-
return KIRO_GLOBAL_IGNORE;
|
|
11162
|
-
}
|
|
11163
|
-
if (path.startsWith(`${KIRO_HOOKS_DIR}/`)) {
|
|
11164
|
-
return null;
|
|
11165
|
-
}
|
|
12055
|
+
if (path === OPENCODE_ROOT_RULE) return OPENCODE_GLOBAL_AGENTS_MD;
|
|
12056
|
+
if (path === OPENCODE_CONFIG_FILE) return OPENCODE_GLOBAL_CONFIG_FILE;
|
|
11166
12057
|
return path;
|
|
11167
12058
|
},
|
|
11168
12059
|
mirrorGlobalPath(path, activeTargets) {
|
|
11169
|
-
return mirrorSkillsToAgents(path,
|
|
12060
|
+
return mirrorSkillsToAgents(path, OPENCODE_GLOBAL_SKILLS_DIR, activeTargets);
|
|
11170
12061
|
},
|
|
11171
12062
|
paths: {
|
|
11172
|
-
rulePath(slug
|
|
11173
|
-
return `${
|
|
12063
|
+
rulePath(slug) {
|
|
12064
|
+
return `${OPENCODE_GLOBAL_RULES_DIR}/${slug}.md`;
|
|
11174
12065
|
},
|
|
11175
|
-
commandPath(
|
|
11176
|
-
return
|
|
12066
|
+
commandPath(name) {
|
|
12067
|
+
return `${OPENCODE_GLOBAL_COMMANDS_DIR}/${name}.md`;
|
|
11177
12068
|
},
|
|
11178
|
-
agentPath(name
|
|
11179
|
-
return `${
|
|
12069
|
+
agentPath(name) {
|
|
12070
|
+
return `${OPENCODE_GLOBAL_AGENTS_DIR}/${name}.md`;
|
|
11180
12071
|
}
|
|
11181
12072
|
}
|
|
11182
12073
|
};
|
|
11183
|
-
|
|
12074
|
+
capabilities3 = {
|
|
11184
12075
|
rules: "native",
|
|
11185
12076
|
additionalRules: "native",
|
|
11186
|
-
commands: "
|
|
12077
|
+
commands: "native",
|
|
11187
12078
|
agents: "native",
|
|
11188
12079
|
skills: "native",
|
|
11189
12080
|
mcp: "native",
|
|
11190
12081
|
hooks: "none",
|
|
11191
|
-
ignore: "
|
|
12082
|
+
ignore: "none",
|
|
11192
12083
|
permissions: "none"
|
|
11193
12084
|
};
|
|
11194
|
-
|
|
11195
|
-
id:
|
|
11196
|
-
generators:
|
|
11197
|
-
capabilities:
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
commands: "none",
|
|
11201
|
-
agents: "native",
|
|
11202
|
-
skills: "native",
|
|
11203
|
-
mcp: "native",
|
|
11204
|
-
hooks: "native",
|
|
11205
|
-
ignore: "native",
|
|
11206
|
-
permissions: "none"
|
|
11207
|
-
},
|
|
11208
|
-
emptyImportMessage: "No Kiro config found (AGENTS.md, .kiro/steering, .kiro/skills, .kiro/agents, .kiro/hooks, .kiro/settings/mcp.json, or .kiroignore).",
|
|
11209
|
-
lintRules: lintRules11,
|
|
12085
|
+
descriptor13 = {
|
|
12086
|
+
id: OPENCODE_TARGET,
|
|
12087
|
+
generators: target13,
|
|
12088
|
+
capabilities: capabilities3,
|
|
12089
|
+
emptyImportMessage: "No OpenCode config found (AGENTS.md, .opencode/rules, .opencode/commands, .opencode/agents, .opencode/skills, or opencode.json).",
|
|
12090
|
+
lintRules: lintRules13,
|
|
11210
12091
|
lint: {
|
|
11211
|
-
hooks:
|
|
12092
|
+
hooks: lintHooks7,
|
|
12093
|
+
permissions: lintPermissions4,
|
|
12094
|
+
ignore: lintIgnore
|
|
11212
12095
|
},
|
|
11213
|
-
project:
|
|
12096
|
+
project: project13,
|
|
11214
12097
|
globalSupport: {
|
|
11215
|
-
capabilities:
|
|
12098
|
+
capabilities: capabilities3,
|
|
11216
12099
|
detectionPaths: [
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
12100
|
+
OPENCODE_GLOBAL_AGENTS_MD,
|
|
12101
|
+
OPENCODE_GLOBAL_RULES_DIR,
|
|
12102
|
+
OPENCODE_GLOBAL_COMMANDS_DIR,
|
|
12103
|
+
OPENCODE_GLOBAL_AGENTS_DIR,
|
|
12104
|
+
OPENCODE_GLOBAL_SKILLS_DIR,
|
|
12105
|
+
OPENCODE_GLOBAL_CONFIG_FILE
|
|
11223
12106
|
],
|
|
11224
|
-
layout:
|
|
12107
|
+
layout: globalLayout5
|
|
11225
12108
|
},
|
|
11226
12109
|
importer: {
|
|
12110
|
+
rules: [
|
|
12111
|
+
{
|
|
12112
|
+
feature: "rules",
|
|
12113
|
+
mode: "singleFile",
|
|
12114
|
+
source: {
|
|
12115
|
+
project: [OPENCODE_ROOT_RULE],
|
|
12116
|
+
global: [OPENCODE_GLOBAL_AGENTS_MD]
|
|
12117
|
+
},
|
|
12118
|
+
canonicalDir: OPENCODE_CANONICAL_RULES_DIR,
|
|
12119
|
+
canonicalRootFilename: "_root.md",
|
|
12120
|
+
markAsRoot: true
|
|
12121
|
+
},
|
|
12122
|
+
{
|
|
12123
|
+
feature: "rules",
|
|
12124
|
+
mode: "directory",
|
|
12125
|
+
source: {
|
|
12126
|
+
project: [OPENCODE_RULES_DIR],
|
|
12127
|
+
global: [OPENCODE_GLOBAL_RULES_DIR]
|
|
12128
|
+
},
|
|
12129
|
+
canonicalDir: OPENCODE_CANONICAL_RULES_DIR,
|
|
12130
|
+
extensions: [".md"],
|
|
12131
|
+
map: opencodeNonRootRuleMapper
|
|
12132
|
+
}
|
|
12133
|
+
],
|
|
12134
|
+
commands: {
|
|
12135
|
+
feature: "commands",
|
|
12136
|
+
mode: "directory",
|
|
12137
|
+
source: {
|
|
12138
|
+
project: [OPENCODE_COMMANDS_DIR],
|
|
12139
|
+
global: [OPENCODE_GLOBAL_COMMANDS_DIR]
|
|
12140
|
+
},
|
|
12141
|
+
canonicalDir: OPENCODE_CANONICAL_COMMANDS_DIR,
|
|
12142
|
+
extensions: [".md"],
|
|
12143
|
+
map: opencodeCommandMapper
|
|
12144
|
+
},
|
|
11227
12145
|
agents: {
|
|
11228
12146
|
feature: "agents",
|
|
11229
12147
|
mode: "directory",
|
|
11230
|
-
source: {
|
|
11231
|
-
|
|
12148
|
+
source: {
|
|
12149
|
+
project: [OPENCODE_AGENTS_DIR],
|
|
12150
|
+
global: [OPENCODE_GLOBAL_AGENTS_DIR]
|
|
12151
|
+
},
|
|
12152
|
+
canonicalDir: OPENCODE_CANONICAL_AGENTS_DIR,
|
|
11232
12153
|
extensions: [".md"],
|
|
11233
|
-
|
|
11234
|
-
},
|
|
11235
|
-
mcp: {
|
|
11236
|
-
feature: "mcp",
|
|
11237
|
-
mode: "mcpJson",
|
|
11238
|
-
source: { project: [KIRO_MCP_FILE], global: [KIRO_GLOBAL_MCP_FILE] },
|
|
11239
|
-
canonicalDir: ".agentsmesh",
|
|
11240
|
-
canonicalFilename: KIRO_CANONICAL_MCP
|
|
11241
|
-
},
|
|
11242
|
-
ignore: {
|
|
11243
|
-
feature: "ignore",
|
|
11244
|
-
mode: "flatFile",
|
|
11245
|
-
source: { project: [KIRO_IGNORE], global: [KIRO_GLOBAL_IGNORE] },
|
|
11246
|
-
canonicalDir: ".agentsmesh",
|
|
11247
|
-
canonicalFilename: KIRO_CANONICAL_IGNORE
|
|
12154
|
+
map: opencodeAgentMapper
|
|
11248
12155
|
}
|
|
12156
|
+
// MCP is imported manually in importer.ts because OpenCode uses `mcp`
|
|
12157
|
+
// key (not `mcpServers`) with a different server format.
|
|
11249
12158
|
},
|
|
11250
|
-
buildImportPaths:
|
|
12159
|
+
buildImportPaths: buildOpencodeImportPaths,
|
|
11251
12160
|
detectionPaths: [
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
12161
|
+
OPENCODE_RULES_DIR,
|
|
12162
|
+
OPENCODE_COMMANDS_DIR,
|
|
12163
|
+
OPENCODE_AGENTS_DIR,
|
|
12164
|
+
OPENCODE_SKILLS_DIR,
|
|
12165
|
+
OPENCODE_CONFIG_FILE,
|
|
12166
|
+
"opencode.jsonc"
|
|
11258
12167
|
]
|
|
11259
12168
|
};
|
|
11260
12169
|
}
|
|
11261
12170
|
});
|
|
11262
|
-
function
|
|
12171
|
+
function generateRules14(canonical) {
|
|
11263
12172
|
const outputs = [];
|
|
11264
12173
|
const root = canonical.rules.find((rule) => rule.root);
|
|
11265
12174
|
if (root) {
|
|
@@ -11279,7 +12188,7 @@ function generateRules12(canonical) {
|
|
|
11279
12188
|
}
|
|
11280
12189
|
return outputs;
|
|
11281
12190
|
}
|
|
11282
|
-
function
|
|
12191
|
+
function generateCommands14(canonical) {
|
|
11283
12192
|
return canonical.commands.map((command) => {
|
|
11284
12193
|
const frontmatter = {};
|
|
11285
12194
|
if (command.description) frontmatter.description = command.description;
|
|
@@ -11289,7 +12198,7 @@ function generateCommands11(canonical) {
|
|
|
11289
12198
|
};
|
|
11290
12199
|
});
|
|
11291
12200
|
}
|
|
11292
|
-
function
|
|
12201
|
+
function generateMcp11(canonical) {
|
|
11293
12202
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
11294
12203
|
return [
|
|
11295
12204
|
{
|
|
@@ -11298,14 +12207,14 @@ function generateMcp10(canonical) {
|
|
|
11298
12207
|
}
|
|
11299
12208
|
];
|
|
11300
12209
|
}
|
|
11301
|
-
function
|
|
12210
|
+
function generateIgnore9(canonical) {
|
|
11302
12211
|
if (canonical.ignore.length === 0) return [];
|
|
11303
12212
|
return [{ path: ROO_CODE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
11304
12213
|
}
|
|
11305
|
-
function
|
|
12214
|
+
function generateSkills14(canonical) {
|
|
11306
12215
|
return generateEmbeddedSkills(canonical, ROO_CODE_SKILLS_DIR);
|
|
11307
12216
|
}
|
|
11308
|
-
function
|
|
12217
|
+
function generateAgents14(canonical) {
|
|
11309
12218
|
if (canonical.agents.length === 0) return [];
|
|
11310
12219
|
const customModes = canonical.agents.map((agent) => {
|
|
11311
12220
|
const slug = basename(agent.source, ".md");
|
|
@@ -11316,19 +12225,19 @@ function generateAgents10(canonical) {
|
|
|
11316
12225
|
});
|
|
11317
12226
|
return [{ path: ROO_CODE_MODES_FILE, content: stringify({ customModes }) }];
|
|
11318
12227
|
}
|
|
11319
|
-
var
|
|
12228
|
+
var init_generator17 = __esm({
|
|
11320
12229
|
"src/targets/roo-code/generator.ts"() {
|
|
11321
12230
|
init_embedded_skill();
|
|
11322
12231
|
init_markdown();
|
|
11323
|
-
|
|
12232
|
+
init_constants12();
|
|
11324
12233
|
}
|
|
11325
12234
|
});
|
|
11326
12235
|
var rooNonRootRuleMapper, rooCommandMapper;
|
|
11327
|
-
var
|
|
12236
|
+
var init_import_mappers9 = __esm({
|
|
11328
12237
|
"src/targets/roo-code/import-mappers.ts"() {
|
|
11329
12238
|
init_markdown();
|
|
11330
12239
|
init_import_metadata();
|
|
11331
|
-
|
|
12240
|
+
init_constants12();
|
|
11332
12241
|
rooNonRootRuleMapper = async ({
|
|
11333
12242
|
relativePath,
|
|
11334
12243
|
normalizeTo,
|
|
@@ -11412,25 +12321,25 @@ async function importFromRooCode(projectRoot, options = {}) {
|
|
|
11412
12321
|
const scope = options.scope ?? "project";
|
|
11413
12322
|
const results = [];
|
|
11414
12323
|
const normalize = await createImportReferenceNormalizer(ROO_CODE_TARGET, projectRoot, scope);
|
|
11415
|
-
results.push(...await runDescriptorImport(
|
|
12324
|
+
results.push(...await runDescriptorImport(descriptor14, projectRoot, scope, { normalize }));
|
|
11416
12325
|
await importPerModeRules(projectRoot, results, normalize);
|
|
11417
12326
|
await importEmbeddedSkills(projectRoot, ROO_CODE_SKILLS_DIR, ROO_CODE_TARGET, results, normalize);
|
|
11418
12327
|
return results;
|
|
11419
12328
|
}
|
|
11420
|
-
var
|
|
12329
|
+
var init_importer14 = __esm({
|
|
11421
12330
|
"src/targets/roo-code/importer.ts"() {
|
|
11422
12331
|
init_import_rewriter();
|
|
11423
12332
|
init_embedded_skill();
|
|
11424
12333
|
init_import_orchestrator();
|
|
11425
12334
|
init_descriptor_import_runner();
|
|
11426
|
-
|
|
11427
|
-
|
|
12335
|
+
init_import_mappers9();
|
|
12336
|
+
init_constants12();
|
|
11428
12337
|
init_roo_code2();
|
|
11429
12338
|
}
|
|
11430
12339
|
});
|
|
11431
12340
|
|
|
11432
12341
|
// src/targets/roo-code/linter.ts
|
|
11433
|
-
function
|
|
12342
|
+
function lintRules14(canonical, projectRoot, projectFiles, options) {
|
|
11434
12343
|
return validateRules(canonical, projectRoot, projectFiles, {
|
|
11435
12344
|
checkGlobMatches: options?.scope !== "global"
|
|
11436
12345
|
}).map((diagnostic) => ({
|
|
@@ -11438,10 +12347,10 @@ function lintRules12(canonical, projectRoot, projectFiles, options) {
|
|
|
11438
12347
|
target: ROO_CODE_TARGET
|
|
11439
12348
|
}));
|
|
11440
12349
|
}
|
|
11441
|
-
var
|
|
12350
|
+
var init_linter14 = __esm({
|
|
11442
12351
|
"src/targets/roo-code/linter.ts"() {
|
|
11443
12352
|
init_validate_rules();
|
|
11444
|
-
|
|
12353
|
+
init_constants12();
|
|
11445
12354
|
}
|
|
11446
12355
|
});
|
|
11447
12356
|
function computeStatus5(existing, content) {
|
|
@@ -11449,29 +12358,29 @@ function computeStatus5(existing, content) {
|
|
|
11449
12358
|
if (existing !== content) return "updated";
|
|
11450
12359
|
return "unchanged";
|
|
11451
12360
|
}
|
|
11452
|
-
var
|
|
12361
|
+
var target14, project14, generateRooGlobalExtras, global9, globalCapabilities11, descriptor14;
|
|
11453
12362
|
var init_roo_code2 = __esm({
|
|
11454
12363
|
"src/targets/roo-code/index.ts"() {
|
|
11455
12364
|
init_fs();
|
|
11456
|
-
|
|
11457
|
-
|
|
12365
|
+
init_generator17();
|
|
12366
|
+
init_constants12();
|
|
11458
12367
|
init_skill_mirror();
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
12368
|
+
init_importer14();
|
|
12369
|
+
init_import_mappers9();
|
|
12370
|
+
init_linter14();
|
|
11462
12371
|
init_import_map_builders();
|
|
11463
|
-
|
|
12372
|
+
target14 = {
|
|
11464
12373
|
name: "roo-code",
|
|
11465
12374
|
primaryRootInstructionPath: ROO_CODE_ROOT_RULE,
|
|
11466
|
-
generateRules:
|
|
11467
|
-
generateCommands:
|
|
11468
|
-
generateSkills:
|
|
11469
|
-
generateMcp:
|
|
11470
|
-
generateIgnore:
|
|
11471
|
-
generateAgents:
|
|
12375
|
+
generateRules: generateRules14,
|
|
12376
|
+
generateCommands: generateCommands14,
|
|
12377
|
+
generateSkills: generateSkills14,
|
|
12378
|
+
generateMcp: generateMcp11,
|
|
12379
|
+
generateIgnore: generateIgnore9,
|
|
12380
|
+
generateAgents: generateAgents14,
|
|
11472
12381
|
importFrom: importFromRooCode
|
|
11473
12382
|
};
|
|
11474
|
-
|
|
12383
|
+
project14 = {
|
|
11475
12384
|
rootInstructionPath: ROO_CODE_ROOT_RULE,
|
|
11476
12385
|
skillDir: ".roo/skills",
|
|
11477
12386
|
managedOutputs: {
|
|
@@ -11579,9 +12488,9 @@ var init_roo_code2 = __esm({
|
|
|
11579
12488
|
ignore: "native",
|
|
11580
12489
|
permissions: "none"
|
|
11581
12490
|
};
|
|
11582
|
-
|
|
12491
|
+
descriptor14 = {
|
|
11583
12492
|
id: "roo-code",
|
|
11584
|
-
generators:
|
|
12493
|
+
generators: target14,
|
|
11585
12494
|
capabilities: {
|
|
11586
12495
|
rules: "native",
|
|
11587
12496
|
additionalRules: "native",
|
|
@@ -11594,8 +12503,8 @@ var init_roo_code2 = __esm({
|
|
|
11594
12503
|
permissions: "none"
|
|
11595
12504
|
},
|
|
11596
12505
|
emptyImportMessage: "No Roo Code config found (.roo/rules, .roo/commands, .roo/skills, .roo/mcp.json, .rooignore, or .roorules).",
|
|
11597
|
-
lintRules:
|
|
11598
|
-
project:
|
|
12506
|
+
lintRules: lintRules14,
|
|
12507
|
+
project: project14,
|
|
11599
12508
|
globalSupport: {
|
|
11600
12509
|
capabilities: globalCapabilities11,
|
|
11601
12510
|
detectionPaths: [
|
|
@@ -11678,7 +12587,7 @@ var init_roo_code2 = __esm({
|
|
|
11678
12587
|
|
|
11679
12588
|
// src/targets/windsurf/constants.ts
|
|
11680
12589
|
var WINDSURF_TARGET, WINDSURF_RULES_ROOT, WINDSURF_RULES_DIR, WINDSURF_IGNORE, CODEIUM_IGNORE, WINDSURF_AGENTS_MD, WINDSURF_HOOKS_FILE, WINDSURF_MCP_EXAMPLE_FILE, WINDSURF_MCP_CONFIG_FILE, WINDSURF_WORKFLOWS_DIR, WINDSURF_SKILLS_DIR, WINDSURF_CANONICAL_RULES_DIR, WINDSURF_CANONICAL_COMMANDS_DIR, WINDSURF_CANONICAL_AGENTS_DIR, WINDSURF_CANONICAL_SKILLS_DIR, WINDSURF_CANONICAL_IGNORE, WINDSURF_CANONICAL_HOOKS, WINDSURF_CANONICAL_MCP, WINDSURF_GLOBAL_RULES, WINDSURF_GLOBAL_SKILLS_DIR, WINDSURF_GLOBAL_WORKFLOWS_DIR, WINDSURF_GLOBAL_HOOKS_FILE, WINDSURF_GLOBAL_MCP_FILE, WINDSURF_GLOBAL_IGNORE, WINDSURF_GLOBAL_AGENTS_SKILLS_DIR;
|
|
11681
|
-
var
|
|
12590
|
+
var init_constants16 = __esm({
|
|
11682
12591
|
"src/targets/windsurf/constants.ts"() {
|
|
11683
12592
|
WINDSURF_TARGET = "windsurf";
|
|
11684
12593
|
WINDSURF_RULES_ROOT = ".windsurfrules";
|
|
@@ -11717,7 +12626,7 @@ function directoryScopedRuleDir(globs) {
|
|
|
11717
12626
|
if (dirs.length !== globs.length) return null;
|
|
11718
12627
|
return dirs.every((dir) => dir === dirs[0]) ? dirs[0] : null;
|
|
11719
12628
|
}
|
|
11720
|
-
function
|
|
12629
|
+
function generateRules15(canonical) {
|
|
11721
12630
|
const outputs = [];
|
|
11722
12631
|
const root = canonical.rules.find((r) => r.root);
|
|
11723
12632
|
if (!root) return [];
|
|
@@ -11754,23 +12663,23 @@ function generateRules13(canonical) {
|
|
|
11754
12663
|
var init_rules4 = __esm({
|
|
11755
12664
|
"src/targets/windsurf/generator/rules.ts"() {
|
|
11756
12665
|
init_markdown();
|
|
11757
|
-
|
|
12666
|
+
init_constants16();
|
|
11758
12667
|
}
|
|
11759
12668
|
});
|
|
11760
12669
|
|
|
11761
12670
|
// src/targets/windsurf/generator/ignore.ts
|
|
11762
|
-
function
|
|
12671
|
+
function generateIgnore10(canonical) {
|
|
11763
12672
|
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
11764
12673
|
return [{ path: CODEIUM_IGNORE, content: canonical.ignore.join("\n") }];
|
|
11765
12674
|
}
|
|
11766
12675
|
var init_ignore3 = __esm({
|
|
11767
12676
|
"src/targets/windsurf/generator/ignore.ts"() {
|
|
11768
|
-
|
|
12677
|
+
init_constants16();
|
|
11769
12678
|
}
|
|
11770
12679
|
});
|
|
11771
12680
|
|
|
11772
12681
|
// src/targets/windsurf/generator/workflows.ts
|
|
11773
|
-
function
|
|
12682
|
+
function generateCommands15(canonical) {
|
|
11774
12683
|
return canonical.commands.map((cmd) => {
|
|
11775
12684
|
const frontmatter = {
|
|
11776
12685
|
description: cmd.description.trim() || void 0,
|
|
@@ -11789,12 +12698,12 @@ function generateCommands12(canonical) {
|
|
|
11789
12698
|
var init_workflows = __esm({
|
|
11790
12699
|
"src/targets/windsurf/generator/workflows.ts"() {
|
|
11791
12700
|
init_markdown();
|
|
11792
|
-
|
|
12701
|
+
init_constants16();
|
|
11793
12702
|
}
|
|
11794
12703
|
});
|
|
11795
12704
|
|
|
11796
12705
|
// src/targets/windsurf/generator/agents.ts
|
|
11797
|
-
function
|
|
12706
|
+
function generateAgents15(canonical) {
|
|
11798
12707
|
return canonical.agents.map((agent) => ({
|
|
11799
12708
|
path: `${WINDSURF_SKILLS_DIR}/${projectedAgentSkillDirName(agent.name)}/SKILL.md`,
|
|
11800
12709
|
content: serializeProjectedAgentSkill(agent)
|
|
@@ -11803,12 +12712,12 @@ function generateAgents11(canonical) {
|
|
|
11803
12712
|
var init_agents4 = __esm({
|
|
11804
12713
|
"src/targets/windsurf/generator/agents.ts"() {
|
|
11805
12714
|
init_projected_agent_skill();
|
|
11806
|
-
|
|
12715
|
+
init_constants16();
|
|
11807
12716
|
}
|
|
11808
12717
|
});
|
|
11809
12718
|
|
|
11810
12719
|
// src/targets/windsurf/generator/mcp.ts
|
|
11811
|
-
function
|
|
12720
|
+
function generateMcp12(canonical) {
|
|
11812
12721
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
11813
12722
|
return [
|
|
11814
12723
|
{
|
|
@@ -11819,7 +12728,7 @@ function generateMcp11(canonical) {
|
|
|
11819
12728
|
}
|
|
11820
12729
|
var init_mcp3 = __esm({
|
|
11821
12730
|
"src/targets/windsurf/generator/mcp.ts"() {
|
|
11822
|
-
|
|
12731
|
+
init_constants16();
|
|
11823
12732
|
}
|
|
11824
12733
|
});
|
|
11825
12734
|
|
|
@@ -11862,12 +12771,12 @@ function generateHooks6(canonical) {
|
|
|
11862
12771
|
var init_hooks2 = __esm({
|
|
11863
12772
|
"src/targets/windsurf/generator/hooks.ts"() {
|
|
11864
12773
|
init_hook_command();
|
|
11865
|
-
|
|
12774
|
+
init_constants16();
|
|
11866
12775
|
}
|
|
11867
12776
|
});
|
|
11868
12777
|
|
|
11869
12778
|
// src/targets/windsurf/generator/skills.ts
|
|
11870
|
-
function
|
|
12779
|
+
function generateSkills15(canonical) {
|
|
11871
12780
|
const outputs = [];
|
|
11872
12781
|
for (const skill of canonical.skills) {
|
|
11873
12782
|
const frontmatter = {
|
|
@@ -11889,12 +12798,12 @@ function generateSkills13(canonical) {
|
|
|
11889
12798
|
var init_skills4 = __esm({
|
|
11890
12799
|
"src/targets/windsurf/generator/skills.ts"() {
|
|
11891
12800
|
init_markdown();
|
|
11892
|
-
|
|
12801
|
+
init_constants16();
|
|
11893
12802
|
}
|
|
11894
12803
|
});
|
|
11895
12804
|
|
|
11896
12805
|
// src/targets/windsurf/generator/index.ts
|
|
11897
|
-
var
|
|
12806
|
+
var init_generator18 = __esm({
|
|
11898
12807
|
"src/targets/windsurf/generator/index.ts"() {
|
|
11899
12808
|
init_rules4();
|
|
11900
12809
|
init_ignore3();
|
|
@@ -11907,9 +12816,9 @@ var init_generator16 = __esm({
|
|
|
11907
12816
|
});
|
|
11908
12817
|
|
|
11909
12818
|
// src/targets/windsurf/generator.ts
|
|
11910
|
-
var
|
|
12819
|
+
var init_generator19 = __esm({
|
|
11911
12820
|
"src/targets/windsurf/generator.ts"() {
|
|
11912
|
-
|
|
12821
|
+
init_generator18();
|
|
11913
12822
|
}
|
|
11914
12823
|
});
|
|
11915
12824
|
function toStringArray8(value) {
|
|
@@ -11961,7 +12870,7 @@ var init_importer_workflows = __esm({
|
|
|
11961
12870
|
init_fs();
|
|
11962
12871
|
init_markdown();
|
|
11963
12872
|
init_import_metadata();
|
|
11964
|
-
|
|
12873
|
+
init_constants16();
|
|
11965
12874
|
}
|
|
11966
12875
|
});
|
|
11967
12876
|
async function importSkills4(projectRoot, results, normalize, skillsRelDir = WINDSURF_SKILLS_DIR) {
|
|
@@ -12008,7 +12917,7 @@ var init_skills_adapter5 = __esm({
|
|
|
12008
12917
|
init_projected_agent_skill();
|
|
12009
12918
|
init_scoped_agents_import();
|
|
12010
12919
|
init_skill_import_pipeline();
|
|
12011
|
-
|
|
12920
|
+
init_constants16();
|
|
12012
12921
|
}
|
|
12013
12922
|
});
|
|
12014
12923
|
async function importWindsurfHooks(projectRoot, results) {
|
|
@@ -12106,7 +13015,7 @@ async function importWindsurfMcp(projectRoot, results) {
|
|
|
12106
13015
|
var init_importer_hooks_mcp = __esm({
|
|
12107
13016
|
"src/targets/windsurf/importer-hooks-mcp.ts"() {
|
|
12108
13017
|
init_fs();
|
|
12109
|
-
|
|
13018
|
+
init_constants16();
|
|
12110
13019
|
}
|
|
12111
13020
|
});
|
|
12112
13021
|
async function importFromWindsurf(projectRoot, options) {
|
|
@@ -12243,7 +13152,7 @@ async function importFromWindsurf(projectRoot, options) {
|
|
|
12243
13152
|
await importWindsurfMcp(projectRoot, results);
|
|
12244
13153
|
return results;
|
|
12245
13154
|
}
|
|
12246
|
-
var
|
|
13155
|
+
var init_importer15 = __esm({
|
|
12247
13156
|
"src/targets/windsurf/importer.ts"() {
|
|
12248
13157
|
init_import_rewriter();
|
|
12249
13158
|
init_fs();
|
|
@@ -12251,13 +13160,13 @@ var init_importer13 = __esm({
|
|
|
12251
13160
|
init_import_metadata();
|
|
12252
13161
|
init_import_orchestrator();
|
|
12253
13162
|
init_scoped_agents_import();
|
|
12254
|
-
|
|
13163
|
+
init_constants16();
|
|
12255
13164
|
init_importer_workflows();
|
|
12256
13165
|
init_skills_adapter5();
|
|
12257
13166
|
init_importer_hooks_mcp();
|
|
12258
13167
|
}
|
|
12259
13168
|
});
|
|
12260
|
-
function
|
|
13169
|
+
function lintRules15(canonical, projectRoot, _projectFiles) {
|
|
12261
13170
|
const diags = [];
|
|
12262
13171
|
const { rules } = canonical;
|
|
12263
13172
|
if (rules.length > 0) {
|
|
@@ -12284,9 +13193,9 @@ function lintRules13(canonical, projectRoot, _projectFiles) {
|
|
|
12284
13193
|
}
|
|
12285
13194
|
return diags;
|
|
12286
13195
|
}
|
|
12287
|
-
var
|
|
13196
|
+
var init_linter15 = __esm({
|
|
12288
13197
|
"src/targets/windsurf/linter.ts"() {
|
|
12289
|
-
|
|
13198
|
+
init_constants16();
|
|
12290
13199
|
}
|
|
12291
13200
|
});
|
|
12292
13201
|
|
|
@@ -12300,7 +13209,7 @@ function lintCommands6(canonical) {
|
|
|
12300
13209
|
)
|
|
12301
13210
|
);
|
|
12302
13211
|
}
|
|
12303
|
-
function
|
|
13212
|
+
function lintMcp5(canonical) {
|
|
12304
13213
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
12305
13214
|
return [
|
|
12306
13215
|
createWarning(
|
|
@@ -12310,7 +13219,7 @@ function lintMcp4(canonical) {
|
|
|
12310
13219
|
)
|
|
12311
13220
|
];
|
|
12312
13221
|
}
|
|
12313
|
-
var
|
|
13222
|
+
var init_lint12 = __esm({
|
|
12314
13223
|
"src/targets/windsurf/lint.ts"() {
|
|
12315
13224
|
init_helpers();
|
|
12316
13225
|
}
|
|
@@ -12323,32 +13232,32 @@ function directoryScopedRuleDir2(globs) {
|
|
|
12323
13232
|
if (dirs.length !== globs.length) return null;
|
|
12324
13233
|
return dirs.every((dir) => dir === dirs[0]) ? dirs[0] : null;
|
|
12325
13234
|
}
|
|
12326
|
-
var
|
|
13235
|
+
var target15, project15, global10, globalCapabilities12, descriptor15;
|
|
12327
13236
|
var init_windsurf2 = __esm({
|
|
12328
13237
|
"src/targets/windsurf/index.ts"() {
|
|
12329
|
-
|
|
13238
|
+
init_generator19();
|
|
12330
13239
|
init_capabilities();
|
|
12331
|
-
|
|
13240
|
+
init_constants16();
|
|
12332
13241
|
init_skill_mirror();
|
|
12333
|
-
|
|
12334
|
-
|
|
12335
|
-
|
|
13242
|
+
init_importer15();
|
|
13243
|
+
init_linter15();
|
|
13244
|
+
init_lint12();
|
|
12336
13245
|
init_import_map_builders();
|
|
12337
13246
|
init_conversions();
|
|
12338
13247
|
init_projected_agent_skill();
|
|
12339
|
-
|
|
13248
|
+
target15 = {
|
|
12340
13249
|
name: "windsurf",
|
|
12341
13250
|
primaryRootInstructionPath: WINDSURF_AGENTS_MD,
|
|
12342
|
-
generateRules:
|
|
12343
|
-
generateCommands:
|
|
12344
|
-
generateAgents:
|
|
12345
|
-
generateSkills:
|
|
12346
|
-
generateMcp:
|
|
13251
|
+
generateRules: generateRules15,
|
|
13252
|
+
generateCommands: generateCommands15,
|
|
13253
|
+
generateAgents: generateAgents15,
|
|
13254
|
+
generateSkills: generateSkills15,
|
|
13255
|
+
generateMcp: generateMcp12,
|
|
12347
13256
|
generateHooks: generateHooks6,
|
|
12348
|
-
generateIgnore:
|
|
13257
|
+
generateIgnore: generateIgnore10,
|
|
12349
13258
|
importFrom: importFromWindsurf
|
|
12350
13259
|
};
|
|
12351
|
-
|
|
13260
|
+
project15 = {
|
|
12352
13261
|
rootInstructionPath: WINDSURF_AGENTS_MD,
|
|
12353
13262
|
extraRuleOutputPaths(rule) {
|
|
12354
13263
|
if (rule.root) return [WINDSURF_AGENTS_MD];
|
|
@@ -12443,9 +13352,9 @@ var init_windsurf2 = __esm({
|
|
|
12443
13352
|
ignore: "native",
|
|
12444
13353
|
permissions: "none"
|
|
12445
13354
|
};
|
|
12446
|
-
|
|
13355
|
+
descriptor15 = {
|
|
12447
13356
|
id: "windsurf",
|
|
12448
|
-
generators:
|
|
13357
|
+
generators: target15,
|
|
12449
13358
|
capabilities: {
|
|
12450
13359
|
rules: "native",
|
|
12451
13360
|
additionalRules: "native",
|
|
@@ -12459,12 +13368,12 @@ var init_windsurf2 = __esm({
|
|
|
12459
13368
|
},
|
|
12460
13369
|
emptyImportMessage: "No Windsurf config found (.windsurfrules, .windsurf/rules, .windsurfignore, or .codeiumignore).",
|
|
12461
13370
|
supportsConversion: { agents: true },
|
|
12462
|
-
lintRules:
|
|
13371
|
+
lintRules: lintRules15,
|
|
12463
13372
|
lint: {
|
|
12464
13373
|
commands: lintCommands6,
|
|
12465
|
-
mcp:
|
|
13374
|
+
mcp: lintMcp5
|
|
12466
13375
|
},
|
|
12467
|
-
project:
|
|
13376
|
+
project: project15,
|
|
12468
13377
|
globalSupport: {
|
|
12469
13378
|
capabilities: globalCapabilities12,
|
|
12470
13379
|
detectionPaths: [
|
|
@@ -12507,67 +13416,80 @@ function builtinTargetsMap() {
|
|
|
12507
13416
|
}
|
|
12508
13417
|
return _builtinTargetsMap;
|
|
12509
13418
|
}
|
|
12510
|
-
function getBuiltinTargetDefinition(
|
|
12511
|
-
return builtinTargetsMap().get(
|
|
13419
|
+
function getBuiltinTargetDefinition(target16) {
|
|
13420
|
+
return builtinTargetsMap().get(target16);
|
|
12512
13421
|
}
|
|
12513
|
-
function getTargetCapabilities(
|
|
12514
|
-
const
|
|
12515
|
-
if (!
|
|
12516
|
-
const raw = scope === "global" ?
|
|
13422
|
+
function getTargetCapabilities(target16, scope = "project") {
|
|
13423
|
+
const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
|
|
13424
|
+
if (!descriptor16) return void 0;
|
|
13425
|
+
const raw = scope === "global" ? descriptor16.globalSupport?.capabilities ?? descriptor16.capabilities : descriptor16.capabilities;
|
|
12517
13426
|
return normalizeTargetCapabilities(raw);
|
|
12518
13427
|
}
|
|
12519
|
-
function getTargetDetectionPaths(
|
|
12520
|
-
const
|
|
12521
|
-
if (!
|
|
13428
|
+
function getTargetDetectionPaths(target16, scope = "project") {
|
|
13429
|
+
const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
|
|
13430
|
+
if (!descriptor16) return [];
|
|
12522
13431
|
if (scope === "global") {
|
|
12523
|
-
return
|
|
13432
|
+
return descriptor16.globalSupport?.detectionPaths ?? [];
|
|
12524
13433
|
}
|
|
12525
|
-
return
|
|
13434
|
+
return descriptor16.detectionPaths;
|
|
12526
13435
|
}
|
|
12527
|
-
function getTargetLayout(
|
|
12528
|
-
const
|
|
12529
|
-
if (!
|
|
13436
|
+
function getTargetLayout(target16, scope = "project") {
|
|
13437
|
+
const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
|
|
13438
|
+
if (!descriptor16) return void 0;
|
|
12530
13439
|
if (scope === "global") {
|
|
12531
|
-
return
|
|
13440
|
+
return descriptor16.globalSupport?.layout;
|
|
12532
13441
|
}
|
|
12533
|
-
return
|
|
13442
|
+
return descriptor16.project;
|
|
12534
13443
|
}
|
|
12535
|
-
function getTargetPrimaryRootInstructionPath(
|
|
12536
|
-
return getTargetLayout(
|
|
13444
|
+
function getTargetPrimaryRootInstructionPath(target16, scope = "project") {
|
|
13445
|
+
return getTargetLayout(target16, scope)?.rootInstructionPath;
|
|
12537
13446
|
}
|
|
12538
|
-
function getTargetSkillDir(
|
|
12539
|
-
return getTargetLayout(
|
|
13447
|
+
function getTargetSkillDir(target16, scope = "project") {
|
|
13448
|
+
return getTargetLayout(target16, scope)?.skillDir;
|
|
12540
13449
|
}
|
|
12541
|
-
function getTargetManagedOutputs(
|
|
12542
|
-
return getTargetLayout(
|
|
13450
|
+
function getTargetManagedOutputs(target16, scope = "project") {
|
|
13451
|
+
return getTargetLayout(target16, scope)?.managedOutputs;
|
|
12543
13452
|
}
|
|
12544
|
-
function rewriteGeneratedOutputPath(
|
|
12545
|
-
const layout = getTargetLayout(
|
|
13453
|
+
function rewriteGeneratedOutputPath(target16, path, scope = "project") {
|
|
13454
|
+
const layout = getTargetLayout(target16, scope);
|
|
12546
13455
|
if (!layout) return null;
|
|
12547
13456
|
return layout.rewriteGeneratedPath ? layout.rewriteGeneratedPath(path) : path;
|
|
12548
13457
|
}
|
|
12549
|
-
function isFeatureSuppressedByConversion(
|
|
12550
|
-
if (!
|
|
12551
|
-
if (feature === "commands" &&
|
|
12552
|
-
return !shouldConvertCommandsToSkills(config,
|
|
13458
|
+
function isFeatureSuppressedByConversion(descriptor16, feature, config, scope) {
|
|
13459
|
+
if (!descriptor16 || !config) return false;
|
|
13460
|
+
if (feature === "commands" && descriptor16.supportsConversion?.commands) {
|
|
13461
|
+
return !shouldConvertCommandsToSkills(config, descriptor16.id, true, scope);
|
|
13462
|
+
}
|
|
13463
|
+
if (feature === "agents" && descriptor16.supportsConversion?.agents) {
|
|
13464
|
+
return !shouldConvertAgentsToSkills(config, descriptor16.id, true, scope);
|
|
13465
|
+
}
|
|
13466
|
+
return false;
|
|
13467
|
+
}
|
|
13468
|
+
function isConversionUpgrading(descriptor16, feature, config, scope) {
|
|
13469
|
+
if (!descriptor16 || !config) return false;
|
|
13470
|
+
if (feature === "commands" && descriptor16.supportsConversion?.commands) {
|
|
13471
|
+
return shouldConvertCommandsToSkills(config, descriptor16.id, true, scope);
|
|
12553
13472
|
}
|
|
12554
|
-
if (feature === "agents" &&
|
|
12555
|
-
return
|
|
13473
|
+
if (feature === "agents" && descriptor16.supportsConversion?.agents) {
|
|
13474
|
+
return shouldConvertAgentsToSkills(config, descriptor16.id, true, scope);
|
|
12556
13475
|
}
|
|
12557
13476
|
return false;
|
|
12558
13477
|
}
|
|
12559
|
-
function getEffectiveTargetSupportLevel(
|
|
12560
|
-
const baseLevel = getTargetCapabilities(
|
|
13478
|
+
function getEffectiveTargetSupportLevel(target16, feature, config, scope = "project") {
|
|
13479
|
+
const baseLevel = getTargetCapabilities(target16, scope)?.[feature]?.level ?? "none";
|
|
13480
|
+
const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
|
|
13481
|
+
if (baseLevel === "none" && isConversionUpgrading(descriptor16, feature, config, scope)) {
|
|
13482
|
+
return "embedded";
|
|
13483
|
+
}
|
|
12561
13484
|
if (baseLevel !== "embedded") return baseLevel;
|
|
12562
|
-
|
|
12563
|
-
return isFeatureSuppressedByConversion(descriptor14, feature, config, scope) ? "none" : baseLevel;
|
|
13485
|
+
return isFeatureSuppressedByConversion(descriptor16, feature, config, scope) ? "none" : baseLevel;
|
|
12564
13486
|
}
|
|
12565
|
-
function resolveTargetFeatureGenerator(
|
|
12566
|
-
const
|
|
12567
|
-
if (!
|
|
12568
|
-
if (isFeatureSuppressedByConversion(
|
|
13487
|
+
function resolveTargetFeatureGenerator(target16, feature, config, scope = "project") {
|
|
13488
|
+
const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
|
|
13489
|
+
if (!descriptor16?.generators) return void 0;
|
|
13490
|
+
if (isFeatureSuppressedByConversion(descriptor16, feature, config, scope)) return void 0;
|
|
12569
13491
|
const pick = PICK_FEATURE_GENERATOR[feature];
|
|
12570
|
-
return pick === null ? void 0 : pick(
|
|
13492
|
+
return pick === null ? void 0 : pick(descriptor16.generators);
|
|
12571
13493
|
}
|
|
12572
13494
|
var BUILTIN_TARGETS, _builtinTargetsMap, PICK_FEATURE_GENERATOR;
|
|
12573
13495
|
var init_builtin_targets = __esm({
|
|
@@ -12585,9 +13507,11 @@ var init_builtin_targets = __esm({
|
|
|
12585
13507
|
init_copilot2();
|
|
12586
13508
|
init_cursor2();
|
|
12587
13509
|
init_gemini_cli2();
|
|
13510
|
+
init_goose2();
|
|
12588
13511
|
init_junie2();
|
|
12589
13512
|
init_kilo_code2();
|
|
12590
13513
|
init_kiro2();
|
|
13514
|
+
init_opencode2();
|
|
12591
13515
|
init_roo_code2();
|
|
12592
13516
|
init_windsurf2();
|
|
12593
13517
|
BUILTIN_TARGETS = [
|
|
@@ -12603,7 +13527,9 @@ var init_builtin_targets = __esm({
|
|
|
12603
13527
|
descriptor10,
|
|
12604
13528
|
descriptor11,
|
|
12605
13529
|
descriptor12,
|
|
12606
|
-
descriptor13
|
|
13530
|
+
descriptor13,
|
|
13531
|
+
descriptor14,
|
|
13532
|
+
descriptor15
|
|
12607
13533
|
];
|
|
12608
13534
|
PICK_FEATURE_GENERATOR = {
|
|
12609
13535
|
rules: (g) => g.generateRules,
|
|
@@ -12638,51 +13564,51 @@ function addSkillDirectoryMappings(refs, canonicalPath, targetPath) {
|
|
|
12638
13564
|
|
|
12639
13565
|
// src/core/reference/map-targets.ts
|
|
12640
13566
|
init_builtin_targets();
|
|
12641
|
-
function ruleTargetPath(
|
|
12642
|
-
const layout = getTargetLayout(
|
|
13567
|
+
function ruleTargetPath(target16, rule, scope = "project") {
|
|
13568
|
+
const layout = getTargetLayout(target16, scope);
|
|
12643
13569
|
if (!layout) return null;
|
|
12644
13570
|
if (rule.root) {
|
|
12645
13571
|
return layout.rootInstructionPath ?? null;
|
|
12646
13572
|
}
|
|
12647
|
-
if (rule.targets.length > 0 && !rule.targets.includes(
|
|
13573
|
+
if (rule.targets.length > 0 && !rule.targets.includes(target16)) return null;
|
|
12648
13574
|
const slug = posix.basename(rule.source.replace(/\\/g, "/"), ".md");
|
|
12649
13575
|
return layout.paths.rulePath(slug, rule);
|
|
12650
13576
|
}
|
|
12651
|
-
function commandTargetPath(
|
|
12652
|
-
const layout = getTargetLayout(
|
|
13577
|
+
function commandTargetPath(target16, name, config, scope = "project") {
|
|
13578
|
+
const layout = getTargetLayout(target16, scope);
|
|
12653
13579
|
if (!layout) return null;
|
|
12654
13580
|
return layout.paths.commandPath(name, config);
|
|
12655
13581
|
}
|
|
12656
|
-
function agentTargetPath(
|
|
12657
|
-
const layout = getTargetLayout(
|
|
13582
|
+
function agentTargetPath(target16, name, config, scope = "project") {
|
|
13583
|
+
const layout = getTargetLayout(target16, scope);
|
|
12658
13584
|
if (!layout) return null;
|
|
12659
13585
|
return layout.paths.agentPath(name, config);
|
|
12660
13586
|
}
|
|
12661
13587
|
|
|
12662
13588
|
// src/core/reference/map.ts
|
|
12663
|
-
init_constants11();
|
|
12664
13589
|
init_constants13();
|
|
12665
|
-
|
|
13590
|
+
init_constants15();
|
|
13591
|
+
init_constants16();
|
|
12666
13592
|
init_builtin_targets();
|
|
12667
13593
|
function addDirectoryMapping3(refs, from, to) {
|
|
12668
13594
|
refs.set(from, to);
|
|
12669
13595
|
refs.set(`${from}/`, `${to}/`);
|
|
12670
13596
|
}
|
|
12671
|
-
function buildReferenceMap(
|
|
13597
|
+
function buildReferenceMap(target16, canonical, config, scope = "project") {
|
|
12672
13598
|
const refs = /* @__PURE__ */ new Map();
|
|
12673
13599
|
for (const rule of canonical.rules) {
|
|
12674
|
-
const path = ruleTargetPath(
|
|
13600
|
+
const path = ruleTargetPath(target16, rule, scope);
|
|
12675
13601
|
if (path) refs.set(`.agentsmesh/rules/${basename(rule.source)}`, path);
|
|
12676
13602
|
}
|
|
12677
13603
|
for (const command of canonical.commands) {
|
|
12678
|
-
const path = commandTargetPath(
|
|
13604
|
+
const path = commandTargetPath(target16, command.name, config, scope);
|
|
12679
13605
|
if (path) refs.set(`.agentsmesh/commands/${command.name}.md`, path);
|
|
12680
13606
|
}
|
|
12681
13607
|
for (const agent of canonical.agents) {
|
|
12682
|
-
const path = agentTargetPath(
|
|
13608
|
+
const path = agentTargetPath(target16, agent.name, config, scope);
|
|
12683
13609
|
if (path) refs.set(`.agentsmesh/agents/${agent.name}.md`, path);
|
|
12684
13610
|
}
|
|
12685
|
-
const skillDir = getTargetSkillDir(
|
|
13611
|
+
const skillDir = getTargetSkillDir(target16, scope);
|
|
12686
13612
|
if (!skillDir) return refs;
|
|
12687
13613
|
for (const skill of canonical.skills) {
|
|
12688
13614
|
addDirectoryMapping3(refs, `.agentsmesh/skills/${skill.name}`, `${skillDir}/${skill.name}`);
|
|
@@ -12725,14 +13651,14 @@ function isKiloCodeAgents(result) {
|
|
|
12725
13651
|
function isCompatibilityAgents(result) {
|
|
12726
13652
|
return isCursorAgents(result) || isGeminiAgents(result);
|
|
12727
13653
|
}
|
|
12728
|
-
function reverseReferenceMap(
|
|
12729
|
-
const cached2 = cache.get(
|
|
13654
|
+
function reverseReferenceMap(target16, canonical, config, cache) {
|
|
13655
|
+
const cached2 = cache.get(target16);
|
|
12730
13656
|
if (cached2) return cached2;
|
|
12731
13657
|
const reversed = /* @__PURE__ */ new Map();
|
|
12732
|
-
for (const [canonicalPath, targetPath] of buildReferenceMap(
|
|
13658
|
+
for (const [canonicalPath, targetPath] of buildReferenceMap(target16, canonical, config)) {
|
|
12733
13659
|
if (!reversed.has(targetPath)) reversed.set(targetPath, canonicalPath);
|
|
12734
13660
|
}
|
|
12735
|
-
cache.set(
|
|
13661
|
+
cache.set(target16, reversed);
|
|
12736
13662
|
return reversed;
|
|
12737
13663
|
}
|
|
12738
13664
|
function normalizeContent(content, refs) {
|
|
@@ -12771,11 +13697,11 @@ function preferEquivalentCodexAgents(results, canonical, config) {
|
|
|
12771
13697
|
return results.filter((result) => {
|
|
12772
13698
|
if (isCursorAgents(result)) {
|
|
12773
13699
|
const targets = overlapTargetsByPath.get(result.path);
|
|
12774
|
-
if (targets && [...targets].some((
|
|
13700
|
+
if (targets && [...targets].some((target16) => target16 !== "cursor")) return false;
|
|
12775
13701
|
}
|
|
12776
13702
|
if (isGeminiAgents(result)) {
|
|
12777
13703
|
const targets = overlapTargetsByPath.get(result.path);
|
|
12778
|
-
if (targets && [...targets].some((
|
|
13704
|
+
if (targets && [...targets].some((target16) => target16 !== "cursor" && target16 !== "gemini-cli")) {
|
|
12779
13705
|
return false;
|
|
12780
13706
|
}
|
|
12781
13707
|
}
|
|
@@ -12821,8 +13747,8 @@ function skillSupportingDirPrefixes(supportingFiles) {
|
|
|
12821
13747
|
}
|
|
12822
13748
|
return [...dirs];
|
|
12823
13749
|
}
|
|
12824
|
-
function addPackSkillArtifactMappings(refs,
|
|
12825
|
-
const skillDir = getTargetSkillDir(
|
|
13750
|
+
function addPackSkillArtifactMappings(refs, target16, canonical, projectRoot, scope) {
|
|
13751
|
+
const skillDir = getTargetSkillDir(target16, scope);
|
|
12826
13752
|
if (!skillDir) return;
|
|
12827
13753
|
const api = pathApi(projectRoot);
|
|
12828
13754
|
const packsPrefix = api.join(projectRoot, ".agentsmesh", "packs");
|
|
@@ -12856,8 +13782,8 @@ function copilotInstructionsPath(rule) {
|
|
|
12856
13782
|
const slug = basename(rule.source, ".md");
|
|
12857
13783
|
return `.github/instructions/${slug}.instructions.md`;
|
|
12858
13784
|
}
|
|
12859
|
-
function applyCopilotInstructionArtifactRefs(
|
|
12860
|
-
if (
|
|
13785
|
+
function applyCopilotInstructionArtifactRefs(target16, refs, projectRoot, destinationPath, canonical) {
|
|
13786
|
+
if (target16 !== "copilot" || !destinationPath?.startsWith(".github/instructions/")) return;
|
|
12861
13787
|
const api = pathApi(projectRoot);
|
|
12862
13788
|
for (const rule of canonical.rules) {
|
|
12863
13789
|
if (rule.root || rule.globs.length === 0) continue;
|
|
@@ -12892,11 +13818,11 @@ function resolveRewriteFamilyId(layout, outputPath) {
|
|
|
12892
13818
|
function pushUnique(paths, path) {
|
|
12893
13819
|
if (path !== void 0 && path.length > 0 && !paths.includes(path)) paths.push(path);
|
|
12894
13820
|
}
|
|
12895
|
-
function extraRuleOutputPaths(
|
|
13821
|
+
function extraRuleOutputPaths(target16, rule, refs, scope) {
|
|
12896
13822
|
const paths = [];
|
|
12897
13823
|
const targetPath = refs.get(`.agentsmesh/rules/${basename(rule.source)}`);
|
|
12898
13824
|
pushUnique(paths, targetPath);
|
|
12899
|
-
const layout = getTargetLayout(
|
|
13825
|
+
const layout = getTargetLayout(target16, scope);
|
|
12900
13826
|
if (rule.root) {
|
|
12901
13827
|
for (const mirrorPath of getAdditionalRootDecorationPaths(layout)) {
|
|
12902
13828
|
pushUnique(paths, mirrorPath);
|
|
@@ -12910,8 +13836,8 @@ function extraRuleOutputPaths(target14, rule, refs, scope) {
|
|
|
12910
13836
|
|
|
12911
13837
|
// src/core/reference/output-source-map.ts
|
|
12912
13838
|
init_builtin_targets();
|
|
12913
|
-
function addSkillMirrorSourceEntry(
|
|
12914
|
-
const layout = getTargetLayout(
|
|
13839
|
+
function addSkillMirrorSourceEntry(target16, scope, primaryOutputPath, source, sourceMap, activeTargets) {
|
|
13840
|
+
const layout = getTargetLayout(target16, scope);
|
|
12915
13841
|
if (!layout?.mirrorGlobalPath) return;
|
|
12916
13842
|
const raw = layout.mirrorGlobalPath(primaryOutputPath, activeTargets ?? []);
|
|
12917
13843
|
const mirrorPaths = raw === null ? [] : Array.isArray(raw) ? raw : [raw];
|
|
@@ -12930,24 +13856,24 @@ function canonicalAgentPath(agent) {
|
|
|
12930
13856
|
function canonicalSkillPath(skill) {
|
|
12931
13857
|
return `.agentsmesh/skills/${skill.name}/SKILL.md`;
|
|
12932
13858
|
}
|
|
12933
|
-
function buildArtifactPathMap(
|
|
13859
|
+
function buildArtifactPathMap(target16, canonical, config, projectRoot, destinationPath, options) {
|
|
12934
13860
|
const scope = options?.scope ?? "project";
|
|
12935
13861
|
const api = pathApi(projectRoot);
|
|
12936
13862
|
const refs = new Map(
|
|
12937
|
-
[...buildReferenceMap(
|
|
13863
|
+
[...buildReferenceMap(target16, canonical, config, scope)].map(([canonicalPath, targetPath]) => [
|
|
12938
13864
|
api.normalize(api.join(projectRoot, canonicalPath)),
|
|
12939
13865
|
api.normalize(api.join(projectRoot, targetPath))
|
|
12940
13866
|
])
|
|
12941
13867
|
);
|
|
12942
|
-
applyCopilotInstructionArtifactRefs(
|
|
12943
|
-
addPackSkillArtifactMappings(refs,
|
|
13868
|
+
applyCopilotInstructionArtifactRefs(target16, refs, projectRoot, destinationPath, canonical);
|
|
13869
|
+
addPackSkillArtifactMappings(refs, target16, canonical, projectRoot, scope);
|
|
12944
13870
|
return refs;
|
|
12945
13871
|
}
|
|
12946
|
-
function buildOutputSourceMap(
|
|
12947
|
-
const refs = buildReferenceMap(
|
|
13872
|
+
function buildOutputSourceMap(target16, canonical, config, scope = "project", activeTargets) {
|
|
13873
|
+
const refs = buildReferenceMap(target16, canonical, config, scope);
|
|
12948
13874
|
const sourceMap = /* @__PURE__ */ new Map();
|
|
12949
13875
|
for (const rule of canonical.rules) {
|
|
12950
|
-
for (const targetPath of extraRuleOutputPaths(
|
|
13876
|
+
for (const targetPath of extraRuleOutputPaths(target16, rule, refs, scope)) {
|
|
12951
13877
|
sourceMap.set(targetPath, rule.source);
|
|
12952
13878
|
}
|
|
12953
13879
|
}
|
|
@@ -12964,7 +13890,7 @@ function buildOutputSourceMap(target14, canonical, config, scope = "project", ac
|
|
|
12964
13890
|
if (skillTargetPath) {
|
|
12965
13891
|
sourceMap.set(skillTargetPath, skill.source);
|
|
12966
13892
|
addSkillMirrorSourceEntry(
|
|
12967
|
-
|
|
13893
|
+
target16,
|
|
12968
13894
|
scope,
|
|
12969
13895
|
skillTargetPath,
|
|
12970
13896
|
skill.source,
|
|
@@ -12978,7 +13904,7 @@ function buildOutputSourceMap(target14, canonical, config, scope = "project", ac
|
|
|
12978
13904
|
if (targetPath) {
|
|
12979
13905
|
sourceMap.set(targetPath, file.absolutePath);
|
|
12980
13906
|
addSkillMirrorSourceEntry(
|
|
12981
|
-
|
|
13907
|
+
target16,
|
|
12982
13908
|
scope,
|
|
12983
13909
|
targetPath,
|
|
12984
13910
|
file.absolutePath,
|
|
@@ -12998,9 +13924,9 @@ init_shared_artifact_owner();
|
|
|
12998
13924
|
function findSharedArtifactOwner(path, activeTargets) {
|
|
12999
13925
|
if (!activeTargets) return null;
|
|
13000
13926
|
for (const targetId of activeTargets) {
|
|
13001
|
-
const
|
|
13002
|
-
if (!
|
|
13003
|
-
for (const [pathPrefix, role] of Object.entries(
|
|
13927
|
+
const descriptor16 = getDescriptor(targetId);
|
|
13928
|
+
if (!descriptor16?.sharedArtifacts) continue;
|
|
13929
|
+
for (const [pathPrefix, role] of Object.entries(descriptor16.sharedArtifacts)) {
|
|
13004
13930
|
if (role === "owner" && path.startsWith(pathPrefix)) {
|
|
13005
13931
|
return targetId;
|
|
13006
13932
|
}
|
|
@@ -13017,8 +13943,8 @@ function artifactMapTargetForResult(result, scope, activeTargets) {
|
|
|
13017
13943
|
}
|
|
13018
13944
|
return result.target;
|
|
13019
13945
|
}
|
|
13020
|
-
function sourceMapCacheKey(
|
|
13021
|
-
return `${
|
|
13946
|
+
function sourceMapCacheKey(target16, activeTargets) {
|
|
13947
|
+
return `${target16}\0${(activeTargets ?? []).join(",")}`;
|
|
13022
13948
|
}
|
|
13023
13949
|
function collectPlannedPaths(projectRoot, results) {
|
|
13024
13950
|
const api = pathApi(projectRoot);
|
|
@@ -13298,28 +14224,28 @@ function computeStatus6(existing, content) {
|
|
|
13298
14224
|
if (existing !== content) return "updated";
|
|
13299
14225
|
return "unchanged";
|
|
13300
14226
|
}
|
|
13301
|
-
function resolveGeneratedOutputPath(
|
|
13302
|
-
let resolvedPath = rewriteGeneratedOutputPath(
|
|
14227
|
+
function resolveGeneratedOutputPath(target16, path, scope) {
|
|
14228
|
+
let resolvedPath = rewriteGeneratedOutputPath(target16, path, scope);
|
|
13303
14229
|
if (resolvedPath !== null) return resolvedPath;
|
|
13304
|
-
const desc = getDescriptor(
|
|
14230
|
+
const desc = getDescriptor(target16);
|
|
13305
14231
|
if (!desc) return null;
|
|
13306
14232
|
const layout = scope === "global" ? desc.globalSupport?.layout : desc.project;
|
|
13307
14233
|
if (!layout) return null;
|
|
13308
14234
|
resolvedPath = layout.rewriteGeneratedPath ? layout.rewriteGeneratedPath(path) : path;
|
|
13309
14235
|
return resolvedPath;
|
|
13310
14236
|
}
|
|
13311
|
-
async function emitGeneratedOutput(results,
|
|
13312
|
-
const resolvedPath = resolveGeneratedOutputPath(
|
|
14237
|
+
async function emitGeneratedOutput(results, target16, out, projectRoot, scope, options) {
|
|
14238
|
+
const resolvedPath = resolveGeneratedOutputPath(target16, out.path, scope);
|
|
13313
14239
|
if (resolvedPath === null) return null;
|
|
13314
14240
|
const existing = await readFileSafe(join(projectRoot, resolvedPath));
|
|
13315
|
-
const pendingIdx = results.findIndex((r) => r.path === resolvedPath && r.target ===
|
|
14241
|
+
const pendingIdx = results.findIndex((r) => r.path === resolvedPath && r.target === target16);
|
|
13316
14242
|
const pendingResult = pendingIdx >= 0 ? results[pendingIdx] : void 0;
|
|
13317
14243
|
const content = options?.mergeContent?.(existing, pendingResult, out.content, resolvedPath) ?? out.content;
|
|
13318
14244
|
if (pendingIdx >= 0) {
|
|
13319
14245
|
results.splice(pendingIdx, 1);
|
|
13320
14246
|
}
|
|
13321
14247
|
results.push({
|
|
13322
|
-
target:
|
|
14248
|
+
target: target16,
|
|
13323
14249
|
path: resolvedPath,
|
|
13324
14250
|
content,
|
|
13325
14251
|
currentContent: existing ?? void 0,
|
|
@@ -13327,8 +14253,8 @@ async function emitGeneratedOutput(results, target14, out, projectRoot, scope, o
|
|
|
13327
14253
|
});
|
|
13328
14254
|
return resolvedPath;
|
|
13329
14255
|
}
|
|
13330
|
-
function featureContext(
|
|
13331
|
-
const caps = getTargetCapabilities(
|
|
14256
|
+
function featureContext(target16, feature, scope) {
|
|
14257
|
+
const caps = getTargetCapabilities(target16, scope);
|
|
13332
14258
|
return {
|
|
13333
14259
|
capability: caps?.[feature] ?? { level: "none" },
|
|
13334
14260
|
scope
|
|
@@ -13336,21 +14262,21 @@ function featureContext(target14, feature, scope) {
|
|
|
13336
14262
|
}
|
|
13337
14263
|
async function generateFeature(results, targets, canonical, projectRoot, enabled, scope, feature, getGen) {
|
|
13338
14264
|
if (!enabled) return;
|
|
13339
|
-
for (const
|
|
13340
|
-
const gen = getGen(
|
|
14265
|
+
for (const target16 of targets) {
|
|
14266
|
+
const gen = getGen(target16);
|
|
13341
14267
|
if (!gen) continue;
|
|
13342
|
-
const ctx = featureContext(
|
|
14268
|
+
const ctx = featureContext(target16, feature, scope);
|
|
13343
14269
|
for (const out of gen(canonical, ctx)) {
|
|
13344
|
-
const resolvedPath = await emitGeneratedOutput(results,
|
|
14270
|
+
const resolvedPath = await emitGeneratedOutput(results, target16, out, projectRoot, scope);
|
|
13345
14271
|
if (resolvedPath === null) continue;
|
|
13346
|
-
const layout = getTargetLayout(
|
|
14272
|
+
const layout = getTargetLayout(target16, scope);
|
|
13347
14273
|
if (layout?.mirrorGlobalPath) {
|
|
13348
14274
|
const raw = layout.mirrorGlobalPath(resolvedPath, targets);
|
|
13349
14275
|
const mirrorPaths = raw === null ? [] : Array.isArray(raw) ? raw : [raw];
|
|
13350
14276
|
for (const mirrorPath of mirrorPaths) {
|
|
13351
14277
|
const existingMirror = await readFileSafe(join(projectRoot, mirrorPath));
|
|
13352
14278
|
results.push({
|
|
13353
|
-
target:
|
|
14279
|
+
target: target16,
|
|
13354
14280
|
path: mirrorPath,
|
|
13355
14281
|
content: out.content,
|
|
13356
14282
|
currentContent: existingMirror ?? void 0,
|
|
@@ -13389,9 +14315,9 @@ function decoratePrimaryRootInstructions(results, canonical, scope = "project")
|
|
|
13389
14315
|
init_builtin_targets();
|
|
13390
14316
|
init_registry();
|
|
13391
14317
|
init_settings2();
|
|
13392
|
-
function mergeOutputContent(
|
|
13393
|
-
const
|
|
13394
|
-
const merged =
|
|
14318
|
+
function mergeOutputContent(target16, existing, pending, newContent, resolvedPath) {
|
|
14319
|
+
const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
|
|
14320
|
+
const merged = descriptor16?.mergeGeneratedOutputContent?.(
|
|
13395
14321
|
existing,
|
|
13396
14322
|
pending,
|
|
13397
14323
|
newContent,
|
|
@@ -13402,44 +14328,44 @@ function mergeOutputContent(target14, existing, pending, newContent, resolvedPat
|
|
|
13402
14328
|
return base !== null && SETTINGS_JSON_PATHS.includes(resolvedPath) ? mergeSettingsJson(base, newContent) : newContent;
|
|
13403
14329
|
}
|
|
13404
14330
|
async function generatePermissionsFeature(results, targets, canonical, projectRoot, scope) {
|
|
13405
|
-
for (const
|
|
13406
|
-
const gen = resolveTargetFeatureGenerator(
|
|
14331
|
+
for (const target16 of targets) {
|
|
14332
|
+
const gen = resolveTargetFeatureGenerator(target16, "permissions", void 0, scope) ?? getDescriptor(target16)?.generators.generatePermissions;
|
|
13407
14333
|
if (!gen) continue;
|
|
13408
14334
|
for (const out of gen(canonical)) {
|
|
13409
|
-
await emitGeneratedOutput(results,
|
|
13410
|
-
mergeContent: (existing, pending, newContent, resolvedPath) => mergeOutputContent(
|
|
14335
|
+
await emitGeneratedOutput(results, target16, out, projectRoot, scope, {
|
|
14336
|
+
mergeContent: (existing, pending, newContent, resolvedPath) => mergeOutputContent(target16, existing, pending, newContent, resolvedPath)
|
|
13411
14337
|
});
|
|
13412
14338
|
}
|
|
13413
14339
|
}
|
|
13414
14340
|
}
|
|
13415
14341
|
async function generateHooksFeature(results, targets, canonical, projectRoot, scope, config) {
|
|
13416
|
-
for (const
|
|
13417
|
-
const gen = resolveTargetFeatureGenerator(
|
|
14342
|
+
for (const target16 of targets) {
|
|
14343
|
+
const gen = resolveTargetFeatureGenerator(target16, "hooks", config, scope) ?? getDescriptor(target16)?.generators.generateHooks;
|
|
13418
14344
|
if (!gen) continue;
|
|
13419
|
-
const ctx = featureContext(
|
|
14345
|
+
const ctx = featureContext(target16, "hooks", scope);
|
|
13420
14346
|
let outputs = [...gen(canonical, ctx)];
|
|
13421
|
-
const
|
|
13422
|
-
const post =
|
|
14347
|
+
const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
|
|
14348
|
+
const post = descriptor16?.postProcessHookOutputs;
|
|
13423
14349
|
if (post) {
|
|
13424
14350
|
outputs = [...await post(projectRoot, canonical, outputs)];
|
|
13425
14351
|
}
|
|
13426
14352
|
for (const out of outputs) {
|
|
13427
|
-
await emitGeneratedOutput(results,
|
|
13428
|
-
mergeContent: (existing, pending, newContent, resolvedPath) => mergeOutputContent(
|
|
14353
|
+
await emitGeneratedOutput(results, target16, out, projectRoot, scope, {
|
|
14354
|
+
mergeContent: (existing, pending, newContent, resolvedPath) => mergeOutputContent(target16, existing, pending, newContent, resolvedPath)
|
|
13429
14355
|
});
|
|
13430
14356
|
}
|
|
13431
14357
|
}
|
|
13432
14358
|
}
|
|
13433
14359
|
async function generateScopedSettingsFeature(results, targets, canonical, projectRoot, scope) {
|
|
13434
|
-
for (const
|
|
13435
|
-
const
|
|
13436
|
-
const emit =
|
|
14360
|
+
for (const target16 of targets) {
|
|
14361
|
+
const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
|
|
14362
|
+
const emit = descriptor16?.emitScopedSettings;
|
|
13437
14363
|
if (!emit) continue;
|
|
13438
14364
|
const outputs = emit(canonical, scope);
|
|
13439
14365
|
if (outputs.length === 0) continue;
|
|
13440
14366
|
for (const out of outputs) {
|
|
13441
|
-
await emitGeneratedOutput(results,
|
|
13442
|
-
mergeContent: (existing, pending, newContent, resolvedPath) => mergeOutputContent(
|
|
14367
|
+
await emitGeneratedOutput(results, target16, out, projectRoot, scope, {
|
|
14368
|
+
mergeContent: (existing, pending, newContent, resolvedPath) => mergeOutputContent(target16, existing, pending, newContent, resolvedPath)
|
|
13443
14369
|
});
|
|
13444
14370
|
}
|
|
13445
14371
|
}
|
|
@@ -13450,8 +14376,8 @@ async function generate(ctx) {
|
|
|
13450
14376
|
const { config, canonical, projectRoot, scope = "project", targetFilter } = ctx;
|
|
13451
14377
|
const allTargets = [...config.targets, ...config.pluginTargets ?? []];
|
|
13452
14378
|
const targets = targetFilter ? allTargets.filter((t) => targetFilter.includes(t)) : allTargets;
|
|
13453
|
-
function resolveGen(
|
|
13454
|
-
return resolveTargetFeatureGenerator(
|
|
14379
|
+
function resolveGen(target16, feature) {
|
|
14380
|
+
return resolveTargetFeatureGenerator(target16, feature, config, scope);
|
|
13455
14381
|
}
|
|
13456
14382
|
const hasRules = config.features.includes("rules");
|
|
13457
14383
|
const hasCommands = config.features.includes("commands");
|
|
@@ -13470,7 +14396,7 @@ async function generate(ctx) {
|
|
|
13470
14396
|
hasRules,
|
|
13471
14397
|
scope,
|
|
13472
14398
|
"rules",
|
|
13473
|
-
(
|
|
14399
|
+
(target16) => resolveGen(target16, "rules")
|
|
13474
14400
|
);
|
|
13475
14401
|
await generateFeature(
|
|
13476
14402
|
results,
|
|
@@ -13480,7 +14406,7 @@ async function generate(ctx) {
|
|
|
13480
14406
|
hasCommands,
|
|
13481
14407
|
scope,
|
|
13482
14408
|
"commands",
|
|
13483
|
-
(
|
|
14409
|
+
(target16) => resolveGen(target16, "commands")
|
|
13484
14410
|
);
|
|
13485
14411
|
await generateFeature(
|
|
13486
14412
|
results,
|
|
@@ -13490,7 +14416,7 @@ async function generate(ctx) {
|
|
|
13490
14416
|
hasAgents,
|
|
13491
14417
|
scope,
|
|
13492
14418
|
"agents",
|
|
13493
|
-
(
|
|
14419
|
+
(target16) => resolveGen(target16, "agents")
|
|
13494
14420
|
);
|
|
13495
14421
|
await generateFeature(
|
|
13496
14422
|
results,
|
|
@@ -13500,7 +14426,7 @@ async function generate(ctx) {
|
|
|
13500
14426
|
hasSkills,
|
|
13501
14427
|
scope,
|
|
13502
14428
|
"skills",
|
|
13503
|
-
(
|
|
14429
|
+
(target16) => resolveGen(target16, "skills")
|
|
13504
14430
|
);
|
|
13505
14431
|
await generateFeature(
|
|
13506
14432
|
results,
|
|
@@ -13510,7 +14436,7 @@ async function generate(ctx) {
|
|
|
13510
14436
|
hasMcp,
|
|
13511
14437
|
scope,
|
|
13512
14438
|
"mcp",
|
|
13513
|
-
(
|
|
14439
|
+
(target16) => resolveGen(target16, "mcp")
|
|
13514
14440
|
);
|
|
13515
14441
|
if (hasPermissions) {
|
|
13516
14442
|
await generatePermissionsFeature(results, targets, canonical, projectRoot, scope);
|
|
@@ -13524,12 +14450,12 @@ async function generate(ctx) {
|
|
|
13524
14450
|
hasIgnore,
|
|
13525
14451
|
scope,
|
|
13526
14452
|
"ignore",
|
|
13527
|
-
(
|
|
14453
|
+
(target16) => resolveGen(target16, "ignore")
|
|
13528
14454
|
);
|
|
13529
14455
|
const enabledFeatures = new Set(config.features);
|
|
13530
|
-
for (const
|
|
13531
|
-
const
|
|
13532
|
-
const scopeExtras =
|
|
14456
|
+
for (const target16 of targets) {
|
|
14457
|
+
const descriptor16 = getBuiltinTargetDefinition(target16) ?? getDescriptor(target16);
|
|
14458
|
+
const scopeExtras = descriptor16?.globalSupport?.scopeExtras;
|
|
13533
14459
|
if (scopeExtras) {
|
|
13534
14460
|
const extras = await scopeExtras(canonical, projectRoot, scope, enabledFeatures);
|
|
13535
14461
|
results.push(...extras);
|
|
@@ -13734,8 +14660,8 @@ function deepMergeObjects(base, overrides2) {
|
|
|
13734
14660
|
}
|
|
13735
14661
|
return result;
|
|
13736
14662
|
}
|
|
13737
|
-
function mergeLocalConfig(
|
|
13738
|
-
const merged = { ...
|
|
14663
|
+
function mergeLocalConfig(project16, local) {
|
|
14664
|
+
const merged = { ...project16 };
|
|
13739
14665
|
if (Array.isArray(local.targets) && local.targets.length > 0) {
|
|
13740
14666
|
merged.targets = local.targets;
|
|
13741
14667
|
}
|
|
@@ -13755,7 +14681,7 @@ function mergeLocalConfig(project14, local) {
|
|
|
13755
14681
|
);
|
|
13756
14682
|
}
|
|
13757
14683
|
if (Array.isArray(local.extends) && local.extends.length > 0) {
|
|
13758
|
-
merged.extends = [...
|
|
14684
|
+
merged.extends = [...project16.extends ?? [], ...local.extends];
|
|
13759
14685
|
}
|
|
13760
14686
|
return merged;
|
|
13761
14687
|
}
|
|
@@ -14065,13 +14991,13 @@ function parseGitlabSource(source) {
|
|
|
14065
14991
|
const slash = slug.lastIndexOf("/");
|
|
14066
14992
|
if (slash < 0) return null;
|
|
14067
14993
|
const namespace = slug.slice(0, slash).trim();
|
|
14068
|
-
const
|
|
14069
|
-
if (!namespace || !
|
|
14994
|
+
const project16 = slug.slice(slash + 1).trim();
|
|
14995
|
+
if (!namespace || !project16) return null;
|
|
14070
14996
|
return {
|
|
14071
14997
|
namespace,
|
|
14072
|
-
project:
|
|
14998
|
+
project: project16,
|
|
14073
14999
|
ref,
|
|
14074
|
-
cloneUrl: `https://gitlab.com/${namespace}/${
|
|
15000
|
+
cloneUrl: `https://gitlab.com/${namespace}/${project16}.git`
|
|
14075
15001
|
};
|
|
14076
15002
|
}
|
|
14077
15003
|
function parseGitSource(source) {
|
|
@@ -14821,12 +15747,12 @@ init_importer7();
|
|
|
14821
15747
|
init_importer6();
|
|
14822
15748
|
init_importer8();
|
|
14823
15749
|
init_importer4();
|
|
14824
|
-
|
|
15750
|
+
init_importer15();
|
|
14825
15751
|
init_importer3();
|
|
14826
15752
|
init_importer5();
|
|
14827
|
-
init_importer9();
|
|
14828
|
-
init_importer11();
|
|
14829
15753
|
init_importer10();
|
|
15754
|
+
init_importer12();
|
|
15755
|
+
init_importer11();
|
|
14830
15756
|
var NATIVE_IMPORTERS = {
|
|
14831
15757
|
"claude-code": importFromClaudeCode,
|
|
14832
15758
|
cursor: importFromCursor,
|
|
@@ -15287,9 +16213,9 @@ async function loadPlugin(entry, projectRoot) {
|
|
|
15287
16213
|
const descriptors = [];
|
|
15288
16214
|
for (const raw of rawDescriptors) {
|
|
15289
16215
|
try {
|
|
15290
|
-
const
|
|
15291
|
-
registerTargetDescriptor(
|
|
15292
|
-
descriptors.push(
|
|
16216
|
+
const descriptor16 = validateDescriptor(raw);
|
|
16217
|
+
registerTargetDescriptor(descriptor16);
|
|
16218
|
+
descriptors.push(descriptor16);
|
|
15293
16219
|
} catch (err) {
|
|
15294
16220
|
throw new Error(
|
|
15295
16221
|
`Plugin '${entry.source}' exported an invalid descriptor: ${err instanceof Error ? err.message : String(err)}`,
|
|
@@ -15328,14 +16254,14 @@ init_fs();
|
|
|
15328
16254
|
// src/targets/catalog/target-catalog.ts
|
|
15329
16255
|
init_builtin_targets();
|
|
15330
16256
|
var TARGET_CATALOG = Object.fromEntries(
|
|
15331
|
-
BUILTIN_TARGETS.map((
|
|
15332
|
-
|
|
16257
|
+
BUILTIN_TARGETS.map((target16) => [
|
|
16258
|
+
target16.id,
|
|
15333
16259
|
{
|
|
15334
|
-
importFrom:
|
|
15335
|
-
emptyImportMessage:
|
|
15336
|
-
lintRules:
|
|
15337
|
-
lint:
|
|
15338
|
-
capabilities:
|
|
16260
|
+
importFrom: target16.generators.importFrom,
|
|
16261
|
+
emptyImportMessage: target16.emptyImportMessage,
|
|
16262
|
+
lintRules: target16.lintRules,
|
|
16263
|
+
lint: target16.lint,
|
|
16264
|
+
capabilities: target16.capabilities
|
|
15339
16265
|
}
|
|
15340
16266
|
])
|
|
15341
16267
|
);
|
|
@@ -15515,14 +16441,14 @@ async function runLint(config, canonical, projectRoot, targetFilter, options = {
|
|
|
15515
16441
|
const hasHooks = config.features.includes("hooks");
|
|
15516
16442
|
const diagnostics = [];
|
|
15517
16443
|
const projectFiles = scope === "global" ? [] : await getProjectFiles(projectRoot);
|
|
15518
|
-
for (const
|
|
15519
|
-
const fullDesc = getDescriptor(
|
|
15520
|
-
const
|
|
15521
|
-
if (
|
|
16444
|
+
for (const target16 of targets) {
|
|
16445
|
+
const fullDesc = getDescriptor(target16);
|
|
16446
|
+
const descriptor16 = isBuiltinTargetId(target16) ? getTargetCatalogEntry(target16) : fullDesc;
|
|
16447
|
+
if (descriptor16?.capabilities) {
|
|
15522
16448
|
diagnostics.push(
|
|
15523
16449
|
...lintSilentFeatureDrops({
|
|
15524
|
-
target:
|
|
15525
|
-
capabilities:
|
|
16450
|
+
target: target16,
|
|
16451
|
+
capabilities: descriptor16.capabilities,
|
|
15526
16452
|
canonical,
|
|
15527
16453
|
enabledFeatures: config.features
|
|
15528
16454
|
})
|
|
@@ -15531,7 +16457,7 @@ async function runLint(config, canonical, projectRoot, targetFilter, options = {
|
|
|
15531
16457
|
if (hasHooks) {
|
|
15532
16458
|
diagnostics.push(
|
|
15533
16459
|
...lintHookScriptReferences({
|
|
15534
|
-
target:
|
|
16460
|
+
target: target16,
|
|
15535
16461
|
canonical,
|
|
15536
16462
|
hasScriptProjection: fullDesc?.postProcessHookOutputs !== void 0
|
|
15537
16463
|
})
|
|
@@ -15540,30 +16466,30 @@ async function runLint(config, canonical, projectRoot, targetFilter, options = {
|
|
|
15540
16466
|
if (hasRules) {
|
|
15541
16467
|
diagnostics.push(
|
|
15542
16468
|
...lintRuleScopeInversion({
|
|
15543
|
-
target:
|
|
16469
|
+
target: target16,
|
|
15544
16470
|
canonical,
|
|
15545
16471
|
preservesManualActivation: fullDesc?.preservesManualActivation === true
|
|
15546
16472
|
})
|
|
15547
16473
|
);
|
|
15548
16474
|
}
|
|
15549
|
-
if (hasRules &&
|
|
15550
|
-
diagnostics.push(...
|
|
16475
|
+
if (hasRules && descriptor16?.lintRules) {
|
|
16476
|
+
diagnostics.push(...descriptor16.lintRules(canonical, projectRoot, projectFiles, { scope }));
|
|
15551
16477
|
}
|
|
15552
16478
|
if (fullDesc?.generators.lint) {
|
|
15553
16479
|
diagnostics.push(...fullDesc.generators.lint(canonical));
|
|
15554
16480
|
}
|
|
15555
16481
|
const lintOpts = { scope };
|
|
15556
|
-
if (hasCommands &&
|
|
15557
|
-
diagnostics.push(...
|
|
16482
|
+
if (hasCommands && descriptor16?.lint?.commands) {
|
|
16483
|
+
diagnostics.push(...descriptor16.lint.commands(canonical, lintOpts));
|
|
15558
16484
|
}
|
|
15559
|
-
if (hasMcp &&
|
|
15560
|
-
diagnostics.push(...
|
|
16485
|
+
if (hasMcp && descriptor16?.lint?.mcp) {
|
|
16486
|
+
diagnostics.push(...descriptor16.lint.mcp(canonical, lintOpts));
|
|
15561
16487
|
}
|
|
15562
|
-
if (hasPermissions &&
|
|
15563
|
-
diagnostics.push(...
|
|
16488
|
+
if (hasPermissions && descriptor16?.lint?.permissions) {
|
|
16489
|
+
diagnostics.push(...descriptor16.lint.permissions(canonical, lintOpts));
|
|
15564
16490
|
}
|
|
15565
|
-
if (hasHooks &&
|
|
15566
|
-
diagnostics.push(...
|
|
16491
|
+
if (hasHooks && descriptor16?.lint?.hooks) {
|
|
16492
|
+
diagnostics.push(...descriptor16.lint.hooks(canonical, lintOpts));
|
|
15567
16493
|
}
|
|
15568
16494
|
}
|
|
15569
16495
|
const hasErrors = diagnostics.some((d) => d.level === "error");
|
|
@@ -15781,14 +16707,14 @@ async function checkLockSync(opts) {
|
|
|
15781
16707
|
// src/public/engine.ts
|
|
15782
16708
|
init_registry();
|
|
15783
16709
|
init_target_ids();
|
|
15784
|
-
async function importFrom(
|
|
15785
|
-
const
|
|
15786
|
-
if (!
|
|
15787
|
-
throw new TargetNotFoundError(
|
|
16710
|
+
async function importFrom(target16, opts) {
|
|
16711
|
+
const descriptor16 = getDescriptor(target16);
|
|
16712
|
+
if (!descriptor16) {
|
|
16713
|
+
throw new TargetNotFoundError(target16, {
|
|
15788
16714
|
supported: [...TARGET_IDS, ...getAllDescriptors().map((d) => d.id)]
|
|
15789
16715
|
});
|
|
15790
16716
|
}
|
|
15791
|
-
return
|
|
16717
|
+
return descriptor16.generators.importFrom(opts.root, { scope: opts.scope ?? "project" });
|
|
15792
16718
|
}
|
|
15793
16719
|
async function loadConfig2(projectRoot) {
|
|
15794
16720
|
return loadConfigFromDir(projectRoot);
|