agentsmesh 0.26.0 → 0.28.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 +38 -0
- package/README.md +10 -10
- package/dist/canonical.js +692 -241
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +196 -192
- package/dist/engine.js +695 -244
- package/dist/engine.js.map +1 -1
- package/dist/index.js +713 -254
- package/dist/index.js.map +1 -1
- package/dist/lessons.js +18 -10
- package/dist/lessons.js.map +1 -1
- package/dist/targets.js +692 -241
- package/dist/targets.js.map +1 -1
- package/package.json +1 -1
package/dist/targets.js
CHANGED
|
@@ -23,16 +23,21 @@ function canUseScopedSettings(feature) {
|
|
|
23
23
|
return settingsBackedFeatures.includes(feature);
|
|
24
24
|
}
|
|
25
25
|
function validateCapabilityImplementations(descriptor31, capabilities17, ctx, pathPrefix) {
|
|
26
|
+
const isGlobalScope = pathPrefix[0] === "globalSupport";
|
|
27
|
+
const hasScopeExtras = isGlobalScope && typeof descriptor31.globalSupport?.scopeExtras === "function";
|
|
26
28
|
for (const requirement of generatorRequirements) {
|
|
27
29
|
const level = capabilityLevel(capabilities17[requirement.feature]);
|
|
28
30
|
if (level === "none") continue;
|
|
31
|
+
const settingsBacked = canUseScopedSettings(requirement.feature);
|
|
29
32
|
const hasGenerator = typeof descriptor31.generators[requirement.generator] === "function";
|
|
30
|
-
const hasSettingsEmitter =
|
|
31
|
-
|
|
33
|
+
const hasSettingsEmitter = settingsBacked && typeof descriptor31.emitScopedSettings === "function";
|
|
34
|
+
const hasScopeExtrasEmitter = settingsBacked && hasScopeExtras;
|
|
35
|
+
if (hasGenerator || hasSettingsEmitter || hasScopeExtrasEmitter) continue;
|
|
36
|
+
const settingsHint = settingsBacked ? isGlobalScope ? " or emitScopedSettings or globalSupport.scopeExtras" : " or emitScopedSettings" : "";
|
|
32
37
|
ctx.addIssue({
|
|
33
38
|
code: "custom",
|
|
34
39
|
path: [...pathPrefix, requirement.feature],
|
|
35
|
-
message: `Capability "${requirement.feature}" is "${level}" but generators.${requirement.generator}
|
|
40
|
+
message: `Capability "${requirement.feature}" is "${level}" but generators.${requirement.generator}${settingsHint} is missing.`
|
|
36
41
|
});
|
|
37
42
|
}
|
|
38
43
|
}
|
|
@@ -1271,13 +1276,14 @@ var init_embedded_skill = __esm({
|
|
|
1271
1276
|
});
|
|
1272
1277
|
|
|
1273
1278
|
// src/targets/aider/constants.ts
|
|
1274
|
-
var AIDER_TARGET, AIDER_CONVENTIONS, AIDER_SKILLS_DIR, AIDER_IGNORE, AIDER_GLOBAL_CONVENTIONS, AIDER_GLOBAL_SKILLS_DIR, AIDER_GLOBAL_IGNORE, AIDER_CANONICAL_RULES_DIR, AIDER_CANONICAL_IGNORE;
|
|
1279
|
+
var AIDER_TARGET, AIDER_CONVENTIONS, AIDER_SKILLS_DIR, AIDER_IGNORE, AIDER_CONF_FILE, AIDER_GLOBAL_CONVENTIONS, AIDER_GLOBAL_SKILLS_DIR, AIDER_GLOBAL_IGNORE, AIDER_CANONICAL_RULES_DIR, AIDER_CANONICAL_IGNORE;
|
|
1275
1280
|
var init_constants = __esm({
|
|
1276
1281
|
"src/targets/aider/constants.ts"() {
|
|
1277
1282
|
AIDER_TARGET = "aider";
|
|
1278
1283
|
AIDER_CONVENTIONS = "CONVENTIONS.md";
|
|
1279
1284
|
AIDER_SKILLS_DIR = ".aider/skills";
|
|
1280
1285
|
AIDER_IGNORE = ".aiderignore";
|
|
1286
|
+
AIDER_CONF_FILE = ".aider.conf.yml";
|
|
1281
1287
|
AIDER_GLOBAL_CONVENTIONS = "CONVENTIONS.md";
|
|
1282
1288
|
AIDER_GLOBAL_SKILLS_DIR = ".aider/skills";
|
|
1283
1289
|
AIDER_GLOBAL_IGNORE = ".aiderignore";
|
|
@@ -1285,8 +1291,6 @@ var init_constants = __esm({
|
|
|
1285
1291
|
AIDER_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
1286
1292
|
}
|
|
1287
1293
|
});
|
|
1288
|
-
|
|
1289
|
-
// src/targets/aider/generator.ts
|
|
1290
1294
|
function generateRules(canonical) {
|
|
1291
1295
|
const root = canonical.rules.find((rule) => rule.root);
|
|
1292
1296
|
const nonRootRules = canonical.rules.filter((rule) => {
|
|
@@ -1296,7 +1300,10 @@ function generateRules(canonical) {
|
|
|
1296
1300
|
const rootBody = root?.body.trim() ?? "";
|
|
1297
1301
|
const content = appendEmbeddedRulesBlock(rootBody, nonRootRules);
|
|
1298
1302
|
if (!content) return [];
|
|
1299
|
-
return [
|
|
1303
|
+
return [
|
|
1304
|
+
{ path: AIDER_CONVENTIONS, content },
|
|
1305
|
+
{ path: AIDER_CONF_FILE, content: stringify({ read: [AIDER_CONVENTIONS] }) }
|
|
1306
|
+
];
|
|
1300
1307
|
}
|
|
1301
1308
|
function generateSkills(canonical) {
|
|
1302
1309
|
return generateEmbeddedSkills(canonical, AIDER_SKILLS_DIR);
|
|
@@ -3140,7 +3147,7 @@ var init_antigravity = __esm({
|
|
|
3140
3147
|
});
|
|
3141
3148
|
|
|
3142
3149
|
// src/targets/augment-code/constants.ts
|
|
3143
|
-
var AUGMENT_CODE_TARGET, AUGMENT_CODE_DIR, AUGMENT_CODE_RULES_DIR, AUGMENT_CODE_COMMANDS_DIR, AUGMENT_CODE_AGENTS_DIR, AUGMENT_CODE_SKILLS_DIR, AUGMENT_CODE_SETTINGS_FILE, AUGMENT_CODE_IGNORE_FILE, AUGMENT_CODE_GLOBAL_DIR, AUGMENT_CODE_GLOBAL_RULES_DIR, AUGMENT_CODE_GLOBAL_COMMANDS_DIR, AUGMENT_CODE_GLOBAL_AGENTS_DIR, AUGMENT_CODE_GLOBAL_SKILLS_DIR, AUGMENT_CODE_GLOBAL_SETTINGS_FILE, AUGMENT_CODE_CANONICAL_RULES_DIR, AUGMENT_CODE_CANONICAL_AGENTS_DIR, AUGMENT_CODE_CANONICAL_MCP, AUGMENT_CODE_CANONICAL_HOOKS, AUGMENT_CODE_CANONICAL_IGNORE;
|
|
3150
|
+
var AUGMENT_CODE_TARGET, AUGMENT_CODE_DIR, AUGMENT_CODE_RULES_DIR, AUGMENT_CODE_COMMANDS_DIR, AUGMENT_CODE_AGENTS_DIR, AUGMENT_CODE_SKILLS_DIR, AUGMENT_CODE_SETTINGS_FILE, AUGMENT_CODE_IGNORE_FILE, AUGMENT_CODE_GLOBAL_DIR, AUGMENT_CODE_GLOBAL_RULES_DIR, AUGMENT_CODE_GLOBAL_COMMANDS_DIR, AUGMENT_CODE_GLOBAL_AGENTS_DIR, AUGMENT_CODE_GLOBAL_SKILLS_DIR, AUGMENT_CODE_GLOBAL_SETTINGS_FILE, AUGMENT_CODE_CANONICAL_RULES_DIR, AUGMENT_CODE_CANONICAL_AGENTS_DIR, AUGMENT_CODE_CANONICAL_MCP, AUGMENT_CODE_CANONICAL_HOOKS, AUGMENT_CODE_CANONICAL_IGNORE, AUGMENT_CODE_CANONICAL_PERMISSIONS;
|
|
3144
3151
|
var init_constants6 = __esm({
|
|
3145
3152
|
"src/targets/augment-code/constants.ts"() {
|
|
3146
3153
|
AUGMENT_CODE_TARGET = "augment-code";
|
|
@@ -3162,6 +3169,7 @@ var init_constants6 = __esm({
|
|
|
3162
3169
|
AUGMENT_CODE_CANONICAL_MCP = ".agentsmesh/mcp.json";
|
|
3163
3170
|
AUGMENT_CODE_CANONICAL_HOOKS = ".agentsmesh/hooks.yaml";
|
|
3164
3171
|
AUGMENT_CODE_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
3172
|
+
AUGMENT_CODE_CANONICAL_PERMISSIONS = ".agentsmesh/permissions.yaml";
|
|
3165
3173
|
}
|
|
3166
3174
|
});
|
|
3167
3175
|
|
|
@@ -3374,7 +3382,7 @@ var init_codex_cli = __esm({
|
|
|
3374
3382
|
});
|
|
3375
3383
|
|
|
3376
3384
|
// src/targets/continue/constants.ts
|
|
3377
|
-
var CONTINUE_TARGET, CONTINUE_RULES_DIR, CONTINUE_PROMPTS_DIR, CONTINUE_MCP_DIR, CONTINUE_MCP_FILE, CONTINUE_ROOT_RULE, CONTINUE_ROOT_RULE_LEGACY, CONTINUE_SKILLS_DIR, CONTINUE_GLOBAL_AGENTS_MD, CONTINUE_GLOBAL_CONFIG, CONTINUE_CANONICAL_RULES_DIR, CONTINUE_CANONICAL_COMMANDS_DIR, CONTINUE_CANONICAL_MCP;
|
|
3385
|
+
var CONTINUE_TARGET, CONTINUE_RULES_DIR, CONTINUE_PROMPTS_DIR, CONTINUE_MCP_DIR, CONTINUE_MCP_FILE, CONTINUE_ROOT_RULE, CONTINUE_ROOT_RULE_LEGACY, CONTINUE_SKILLS_DIR, CONTINUE_GLOBAL_AGENTS_MD, CONTINUE_GLOBAL_CONFIG, CONTINUE_GLOBAL_PERMISSIONS, CONTINUE_CANONICAL_RULES_DIR, CONTINUE_CANONICAL_COMMANDS_DIR, CONTINUE_CANONICAL_MCP, CONTINUE_CANONICAL_PERMISSIONS;
|
|
3378
3386
|
var init_constants9 = __esm({
|
|
3379
3387
|
"src/targets/continue/constants.ts"() {
|
|
3380
3388
|
CONTINUE_TARGET = "continue";
|
|
@@ -3387,9 +3395,11 @@ var init_constants9 = __esm({
|
|
|
3387
3395
|
CONTINUE_SKILLS_DIR = ".continue/skills";
|
|
3388
3396
|
CONTINUE_GLOBAL_AGENTS_MD = ".continue/AGENTS.md";
|
|
3389
3397
|
CONTINUE_GLOBAL_CONFIG = ".continue/config.yaml";
|
|
3398
|
+
CONTINUE_GLOBAL_PERMISSIONS = ".continue/permissions.yaml";
|
|
3390
3399
|
CONTINUE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
3391
3400
|
CONTINUE_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
3392
3401
|
CONTINUE_CANONICAL_MCP = ".agentsmesh/mcp.json";
|
|
3402
|
+
CONTINUE_CANONICAL_PERMISSIONS = ".agentsmesh/permissions.yaml";
|
|
3393
3403
|
}
|
|
3394
3404
|
});
|
|
3395
3405
|
async function buildContinueImportPaths(refs, projectRoot, scope = "project") {
|
|
@@ -3606,21 +3616,26 @@ var init_deepagents_cli = __esm({
|
|
|
3606
3616
|
});
|
|
3607
3617
|
|
|
3608
3618
|
// src/targets/factory-droid/constants.ts
|
|
3609
|
-
var FACTORY_DROID_TARGET, FACTORY_DROID_ROOT_FILE, FACTORY_DROID_SKILLS_DIR, FACTORY_DROID_DROIDS_DIR, FACTORY_DROID_MCP_FILE, FACTORY_DROID_GLOBAL_ROOT_FILE, FACTORY_DROID_GLOBAL_SKILLS_DIR, FACTORY_DROID_GLOBAL_DROIDS_DIR, FACTORY_DROID_GLOBAL_MCP_FILE, FACTORY_DROID_HOOKS_FILE, FACTORY_DROID_GLOBAL_HOOKS_FILE, FACTORY_DROID_CANONICAL_RULES_DIR;
|
|
3619
|
+
var FACTORY_DROID_TARGET, FACTORY_DROID_ROOT_FILE, FACTORY_DROID_SKILLS_DIR, FACTORY_DROID_COMMANDS_DIR, FACTORY_DROID_DROIDS_DIR, FACTORY_DROID_MCP_FILE, FACTORY_DROID_GLOBAL_ROOT_FILE, FACTORY_DROID_GLOBAL_SKILLS_DIR, FACTORY_DROID_GLOBAL_COMMANDS_DIR, FACTORY_DROID_GLOBAL_DROIDS_DIR, FACTORY_DROID_GLOBAL_MCP_FILE, FACTORY_DROID_HOOKS_FILE, FACTORY_DROID_GLOBAL_HOOKS_FILE, FACTORY_DROID_CANONICAL_RULES_DIR, FACTORY_DROID_CANONICAL_AGENTS_DIR, FACTORY_DROID_CANONICAL_COMMANDS_DIR, FACTORY_DROID_CANONICAL_HOOKS;
|
|
3610
3620
|
var init_constants13 = __esm({
|
|
3611
3621
|
"src/targets/factory-droid/constants.ts"() {
|
|
3612
3622
|
FACTORY_DROID_TARGET = "factory-droid";
|
|
3613
3623
|
FACTORY_DROID_ROOT_FILE = "AGENTS.md";
|
|
3614
3624
|
FACTORY_DROID_SKILLS_DIR = ".factory/skills";
|
|
3625
|
+
FACTORY_DROID_COMMANDS_DIR = ".factory/commands";
|
|
3615
3626
|
FACTORY_DROID_DROIDS_DIR = ".factory/droids";
|
|
3616
3627
|
FACTORY_DROID_MCP_FILE = ".factory/mcp.json";
|
|
3617
3628
|
FACTORY_DROID_GLOBAL_ROOT_FILE = ".factory/AGENTS.md";
|
|
3618
3629
|
FACTORY_DROID_GLOBAL_SKILLS_DIR = ".factory/skills";
|
|
3630
|
+
FACTORY_DROID_GLOBAL_COMMANDS_DIR = ".factory/commands";
|
|
3619
3631
|
FACTORY_DROID_GLOBAL_DROIDS_DIR = ".factory/droids";
|
|
3620
3632
|
FACTORY_DROID_GLOBAL_MCP_FILE = ".factory/mcp.json";
|
|
3621
3633
|
FACTORY_DROID_HOOKS_FILE = ".factory/hooks.json";
|
|
3622
3634
|
FACTORY_DROID_GLOBAL_HOOKS_FILE = ".factory/hooks.json";
|
|
3623
3635
|
FACTORY_DROID_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
3636
|
+
FACTORY_DROID_CANONICAL_AGENTS_DIR = ".agentsmesh/agents";
|
|
3637
|
+
FACTORY_DROID_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
3638
|
+
FACTORY_DROID_CANONICAL_HOOKS = ".agentsmesh/hooks.yaml";
|
|
3624
3639
|
}
|
|
3625
3640
|
});
|
|
3626
3641
|
|
|
@@ -3628,6 +3643,9 @@ var init_constants13 = __esm({
|
|
|
3628
3643
|
async function buildFactoryDroidImportPaths(refs, projectRoot, scope = "project") {
|
|
3629
3644
|
if (scope === "global") {
|
|
3630
3645
|
refs.set(FACTORY_DROID_GLOBAL_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
3646
|
+
for (const absPath of await listFiles(projectRoot, FACTORY_DROID_GLOBAL_COMMANDS_DIR)) {
|
|
3647
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3648
|
+
}
|
|
3631
3649
|
for (const absPath of await listFiles(projectRoot, FACTORY_DROID_GLOBAL_DROIDS_DIR)) {
|
|
3632
3650
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3633
3651
|
}
|
|
@@ -3638,6 +3656,9 @@ async function buildFactoryDroidImportPaths(refs, projectRoot, scope = "project"
|
|
|
3638
3656
|
return;
|
|
3639
3657
|
}
|
|
3640
3658
|
refs.set(FACTORY_DROID_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
3659
|
+
for (const absPath of await listFiles(projectRoot, FACTORY_DROID_COMMANDS_DIR)) {
|
|
3660
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3661
|
+
}
|
|
3641
3662
|
for (const absPath of await listFiles(projectRoot, FACTORY_DROID_DROIDS_DIR)) {
|
|
3642
3663
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3643
3664
|
}
|
|
@@ -3684,7 +3705,7 @@ var init_gemini_cli = __esm({
|
|
|
3684
3705
|
});
|
|
3685
3706
|
|
|
3686
3707
|
// src/targets/goose/constants.ts
|
|
3687
|
-
var GOOSE_TARGET, GOOSE_ROOT_FILE, GOOSE_SKILLS_DIR, GOOSE_IGNORE, GOOSE_GLOBAL_DIR, GOOSE_GLOBAL_ROOT_FILE, GOOSE_GLOBAL_IGNORE, GOOSE_GLOBAL_CONFIG, GOOSE_GLOBAL_SKILLS_DIR, GOOSE_CANONICAL_RULES_DIR, GOOSE_CANONICAL_IGNORE;
|
|
3708
|
+
var GOOSE_TARGET, GOOSE_ROOT_FILE, GOOSE_SKILLS_DIR, GOOSE_IGNORE, GOOSE_GLOBAL_DIR, GOOSE_GLOBAL_ROOT_FILE, GOOSE_GLOBAL_IGNORE, GOOSE_GLOBAL_CONFIG, GOOSE_GLOBAL_SKILLS_DIR, GOOSE_GLOBAL_PERMISSIONS, GOOSE_HOOKS_FILE, GOOSE_CANONICAL_RULES_DIR, GOOSE_CANONICAL_IGNORE, GOOSE_CANONICAL_HOOKS, GOOSE_CANONICAL_PERMISSIONS;
|
|
3688
3709
|
var init_constants14 = __esm({
|
|
3689
3710
|
"src/targets/goose/constants.ts"() {
|
|
3690
3711
|
GOOSE_TARGET = "goose";
|
|
@@ -3696,8 +3717,12 @@ var init_constants14 = __esm({
|
|
|
3696
3717
|
GOOSE_GLOBAL_IGNORE = `${GOOSE_GLOBAL_DIR}/.gooseignore`;
|
|
3697
3718
|
GOOSE_GLOBAL_CONFIG = `${GOOSE_GLOBAL_DIR}/config.yaml`;
|
|
3698
3719
|
GOOSE_GLOBAL_SKILLS_DIR = ".agents/skills";
|
|
3720
|
+
GOOSE_GLOBAL_PERMISSIONS = `${GOOSE_GLOBAL_DIR}/permission.yaml`;
|
|
3721
|
+
GOOSE_HOOKS_FILE = ".agents/plugins/agentsmesh/hooks/hooks.json";
|
|
3699
3722
|
GOOSE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
3700
3723
|
GOOSE_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
3724
|
+
GOOSE_CANONICAL_HOOKS = ".agentsmesh/hooks.yaml";
|
|
3725
|
+
GOOSE_CANONICAL_PERMISSIONS = ".agentsmesh/permissions.yaml";
|
|
3701
3726
|
}
|
|
3702
3727
|
});
|
|
3703
3728
|
|
|
@@ -4038,16 +4063,19 @@ var init_opencode = __esm({
|
|
|
4038
4063
|
});
|
|
4039
4064
|
|
|
4040
4065
|
// src/targets/pi-agent/constants.ts
|
|
4041
|
-
var PI_AGENT_TARGET, PI_AGENT_ROOT_FILE, PI_AGENT_SKILLS_DIR, PI_AGENT_GLOBAL_DIR, PI_AGENT_GLOBAL_ROOT_FILE, PI_AGENT_GLOBAL_SKILLS_DIR, PI_AGENT_CANONICAL_RULES_DIR;
|
|
4066
|
+
var PI_AGENT_TARGET, PI_AGENT_ROOT_FILE, PI_AGENT_SKILLS_DIR, PI_AGENT_COMMANDS_DIR, PI_AGENT_GLOBAL_DIR, PI_AGENT_GLOBAL_ROOT_FILE, PI_AGENT_GLOBAL_SKILLS_DIR, PI_AGENT_GLOBAL_COMMANDS_DIR, PI_AGENT_CANONICAL_RULES_DIR, PI_AGENT_CANONICAL_COMMANDS_DIR;
|
|
4042
4067
|
var init_constants20 = __esm({
|
|
4043
4068
|
"src/targets/pi-agent/constants.ts"() {
|
|
4044
4069
|
PI_AGENT_TARGET = "pi-agent";
|
|
4045
4070
|
PI_AGENT_ROOT_FILE = "AGENTS.md";
|
|
4046
4071
|
PI_AGENT_SKILLS_DIR = ".pi/skills";
|
|
4072
|
+
PI_AGENT_COMMANDS_DIR = ".pi/prompts";
|
|
4047
4073
|
PI_AGENT_GLOBAL_DIR = ".pi/agent";
|
|
4048
4074
|
PI_AGENT_GLOBAL_ROOT_FILE = `${PI_AGENT_GLOBAL_DIR}/AGENTS.md`;
|
|
4049
4075
|
PI_AGENT_GLOBAL_SKILLS_DIR = `${PI_AGENT_GLOBAL_DIR}/skills`;
|
|
4076
|
+
PI_AGENT_GLOBAL_COMMANDS_DIR = `${PI_AGENT_GLOBAL_DIR}/prompts`;
|
|
4050
4077
|
PI_AGENT_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
4078
|
+
PI_AGENT_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
4051
4079
|
}
|
|
4052
4080
|
});
|
|
4053
4081
|
|
|
@@ -4055,12 +4083,18 @@ var init_constants20 = __esm({
|
|
|
4055
4083
|
async function buildPiAgentImportPaths(refs, projectRoot, scope = "project") {
|
|
4056
4084
|
if (scope === "global") {
|
|
4057
4085
|
refs.set(PI_AGENT_GLOBAL_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
4086
|
+
for (const absPath of await listFiles(projectRoot, PI_AGENT_GLOBAL_COMMANDS_DIR)) {
|
|
4087
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
4088
|
+
}
|
|
4058
4089
|
for (const absPath of await listFiles(projectRoot, PI_AGENT_GLOBAL_SKILLS_DIR)) {
|
|
4059
4090
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), PI_AGENT_GLOBAL_SKILLS_DIR);
|
|
4060
4091
|
}
|
|
4061
4092
|
return;
|
|
4062
4093
|
}
|
|
4063
4094
|
refs.set(PI_AGENT_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
4095
|
+
for (const absPath of await listFiles(projectRoot, PI_AGENT_COMMANDS_DIR)) {
|
|
4096
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
4097
|
+
}
|
|
4064
4098
|
for (const absPath of await listFiles(projectRoot, PI_AGENT_SKILLS_DIR)) {
|
|
4065
4099
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), PI_AGENT_SKILLS_DIR);
|
|
4066
4100
|
}
|
|
@@ -4166,7 +4200,7 @@ var init_replit_agent = __esm({
|
|
|
4166
4200
|
});
|
|
4167
4201
|
|
|
4168
4202
|
// src/targets/roo-code/constants.ts
|
|
4169
|
-
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;
|
|
4203
|
+
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_AGENTS_DIR, ROO_CODE_CANONICAL_COMMANDS_DIR, ROO_CODE_CANONICAL_MCP, ROO_CODE_CANONICAL_IGNORE;
|
|
4170
4204
|
var init_constants23 = __esm({
|
|
4171
4205
|
"src/targets/roo-code/constants.ts"() {
|
|
4172
4206
|
ROO_CODE_TARGET = "roo-code";
|
|
@@ -4189,6 +4223,7 @@ var init_constants23 = __esm({
|
|
|
4189
4223
|
ROO_CODE_GLOBAL_AGENTS_MD = `${ROO_CODE_GLOBAL_DIR}/AGENTS.md`;
|
|
4190
4224
|
ROO_CODE_GLOBAL_AGENTS_SKILLS_DIR = ".agents/skills";
|
|
4191
4225
|
ROO_CODE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
4226
|
+
ROO_CODE_CANONICAL_AGENTS_DIR = ".agentsmesh/agents";
|
|
4192
4227
|
ROO_CODE_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
4193
4228
|
ROO_CODE_CANONICAL_MCP = ".agentsmesh/mcp.json";
|
|
4194
4229
|
ROO_CODE_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
@@ -4478,8 +4513,26 @@ var init_import_map_builders = __esm({
|
|
|
4478
4513
|
init_import_maps();
|
|
4479
4514
|
}
|
|
4480
4515
|
});
|
|
4481
|
-
|
|
4482
|
-
|
|
4516
|
+
function mergeAiderConf(existing, newContent) {
|
|
4517
|
+
if (existing === null) return newContent;
|
|
4518
|
+
let parsed;
|
|
4519
|
+
try {
|
|
4520
|
+
parsed = parse(existing);
|
|
4521
|
+
} catch {
|
|
4522
|
+
return newContent;
|
|
4523
|
+
}
|
|
4524
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return newContent;
|
|
4525
|
+
const base = parsed;
|
|
4526
|
+
const reads = /* @__PURE__ */ new Set();
|
|
4527
|
+
const existingRead = base.read;
|
|
4528
|
+
if (typeof existingRead === "string") reads.add(existingRead);
|
|
4529
|
+
else if (Array.isArray(existingRead)) {
|
|
4530
|
+
for (const entry of existingRead) if (typeof entry === "string") reads.add(entry);
|
|
4531
|
+
}
|
|
4532
|
+
reads.add(AIDER_CONVENTIONS);
|
|
4533
|
+
base.read = [...reads];
|
|
4534
|
+
return stringify(base);
|
|
4535
|
+
}
|
|
4483
4536
|
var target, project, globalLayout, capabilities, descriptor;
|
|
4484
4537
|
var init_aider2 = __esm({
|
|
4485
4538
|
"src/targets/aider/index.ts"() {
|
|
@@ -4506,7 +4559,7 @@ var init_aider2 = __esm({
|
|
|
4506
4559
|
skillDir: AIDER_SKILLS_DIR,
|
|
4507
4560
|
managedOutputs: {
|
|
4508
4561
|
dirs: [AIDER_SKILLS_DIR],
|
|
4509
|
-
files: [AIDER_CONVENTIONS, AIDER_IGNORE]
|
|
4562
|
+
files: [AIDER_CONVENTIONS, AIDER_CONF_FILE, AIDER_IGNORE]
|
|
4510
4563
|
},
|
|
4511
4564
|
paths: {
|
|
4512
4565
|
rulePath(_slug) {
|
|
@@ -4530,6 +4583,7 @@ var init_aider2 = __esm({
|
|
|
4530
4583
|
rewriteGeneratedPath(path) {
|
|
4531
4584
|
if (path === AIDER_CONVENTIONS) return AIDER_GLOBAL_CONVENTIONS;
|
|
4532
4585
|
if (path === AIDER_IGNORE) return AIDER_GLOBAL_IGNORE;
|
|
4586
|
+
if (path === AIDER_CONF_FILE) return null;
|
|
4533
4587
|
if (path.startsWith(`${AIDER_SKILLS_DIR}/`)) {
|
|
4534
4588
|
return path.replace(`${AIDER_SKILLS_DIR}/`, `${AIDER_GLOBAL_SKILLS_DIR}/`);
|
|
4535
4589
|
}
|
|
@@ -4605,6 +4659,10 @@ var init_aider2 = __esm({
|
|
|
4605
4659
|
canonicalFilename: AIDER_CANONICAL_IGNORE
|
|
4606
4660
|
}
|
|
4607
4661
|
},
|
|
4662
|
+
mergeGeneratedOutputContent(existing, _pending, newContent, resolvedPath) {
|
|
4663
|
+
if (resolvedPath === AIDER_CONF_FILE) return mergeAiderConf(existing, newContent);
|
|
4664
|
+
return null;
|
|
4665
|
+
},
|
|
4608
4666
|
buildImportPaths: buildAiderImportPaths,
|
|
4609
4667
|
detectionPaths: [AIDER_CONVENTIONS, AIDER_IGNORE]
|
|
4610
4668
|
};
|
|
@@ -4629,7 +4687,7 @@ function generateAgents2(canonical) {
|
|
|
4629
4687
|
{
|
|
4630
4688
|
name: agent.name,
|
|
4631
4689
|
...agent.description ? { description: agent.description } : {},
|
|
4632
|
-
|
|
4690
|
+
prompt: agent.body.trim(),
|
|
4633
4691
|
...agent.tools.length > 0 ? { allowedTools: agent.tools } : {}
|
|
4634
4692
|
},
|
|
4635
4693
|
null,
|
|
@@ -4728,7 +4786,7 @@ async function amazonQAgentMapper(ctx) {
|
|
|
4728
4786
|
const name = typeof raw.name === "string" ? raw.name : agentName;
|
|
4729
4787
|
const description = typeof raw.description === "string" ? raw.description : "";
|
|
4730
4788
|
const tools = Array.isArray(raw.allowedTools) ? raw.allowedTools.filter((t) => typeof t === "string") : [];
|
|
4731
|
-
const body = typeof raw.systemPrompt === "string" ? raw.systemPrompt : "";
|
|
4789
|
+
const body = typeof raw.prompt === "string" ? raw.prompt : typeof raw.systemPrompt === "string" ? raw.systemPrompt : "";
|
|
4732
4790
|
const content = await serializeImportedAgentWithFallback(
|
|
4733
4791
|
destPath,
|
|
4734
4792
|
{ name, description, tools },
|
|
@@ -4788,7 +4846,7 @@ var init_capabilities2 = __esm({
|
|
|
4788
4846
|
"src/targets/amazon-q/capabilities.ts"() {
|
|
4789
4847
|
projectCapabilities = {
|
|
4790
4848
|
rules: "native",
|
|
4791
|
-
additionalRules: "
|
|
4849
|
+
additionalRules: "native",
|
|
4792
4850
|
commands: "none",
|
|
4793
4851
|
agents: "native",
|
|
4794
4852
|
skills: "none",
|
|
@@ -5751,16 +5809,13 @@ var init_antigravity2 = __esm({
|
|
|
5751
5809
|
});
|
|
5752
5810
|
function ruleFrontmatter(rule) {
|
|
5753
5811
|
const fm = {};
|
|
5754
|
-
if (rule.description) {
|
|
5755
|
-
fm.description = rule.description;
|
|
5756
|
-
}
|
|
5757
5812
|
if (rule.globs.length > 0 || rule.trigger === "manual" || rule.trigger === "model_decision") {
|
|
5758
|
-
fm.
|
|
5759
|
-
if (rule.
|
|
5760
|
-
|
|
5761
|
-
}
|
|
5813
|
+
fm.type = "agent_requested";
|
|
5814
|
+
if (rule.description) fm.description = rule.description;
|
|
5815
|
+
if (rule.globs.length > 0) fm.globs = rule.globs;
|
|
5762
5816
|
} else {
|
|
5763
|
-
fm.
|
|
5817
|
+
fm.type = "always_apply";
|
|
5818
|
+
if (rule.description) fm.description = rule.description;
|
|
5764
5819
|
}
|
|
5765
5820
|
return fm;
|
|
5766
5821
|
}
|
|
@@ -5776,7 +5831,7 @@ function generateRules5(canonical) {
|
|
|
5776
5831
|
for (const rule of canonical.rules) {
|
|
5777
5832
|
if (rule.targets.length > 0 && !rule.targets.includes(AUGMENT_CODE_TARGET)) continue;
|
|
5778
5833
|
if (rule.root) {
|
|
5779
|
-
const fm = {
|
|
5834
|
+
const fm = { type: "always_apply" };
|
|
5780
5835
|
if (rule.description) fm.description = rule.description;
|
|
5781
5836
|
outputs.push({
|
|
5782
5837
|
path: `${AUGMENT_CODE_RULES_DIR}/_root.md`,
|
|
@@ -5828,6 +5883,27 @@ var init_generator5 = __esm({
|
|
|
5828
5883
|
init_constants6();
|
|
5829
5884
|
}
|
|
5830
5885
|
});
|
|
5886
|
+
function parseToolPermissions(raw) {
|
|
5887
|
+
if (!Array.isArray(raw)) return null;
|
|
5888
|
+
const allow = [];
|
|
5889
|
+
const deny = [];
|
|
5890
|
+
const ask = [];
|
|
5891
|
+
for (const entry of raw) {
|
|
5892
|
+
if (!entry || typeof entry !== "object") continue;
|
|
5893
|
+
const e = entry;
|
|
5894
|
+
const toolName = typeof e.toolName === "string" ? e.toolName : void 0;
|
|
5895
|
+
const permission = e.permission;
|
|
5896
|
+
if (!toolName || !permission || typeof permission !== "object") continue;
|
|
5897
|
+
if (e.shellInputRegex !== void 0) continue;
|
|
5898
|
+
if (permission.type === "allow") allow.push(toolName);
|
|
5899
|
+
else if (permission.type === "deny") deny.push(toolName);
|
|
5900
|
+
else if (permission.type === "ask-user") ask.push(toolName);
|
|
5901
|
+
}
|
|
5902
|
+
if (allow.length === 0 && deny.length === 0 && ask.length === 0) return null;
|
|
5903
|
+
const permissions = { allow, deny };
|
|
5904
|
+
if (ask.length > 0) permissions.ask = ask;
|
|
5905
|
+
return permissions;
|
|
5906
|
+
}
|
|
5831
5907
|
function augmentHooksToCanonical(hooks) {
|
|
5832
5908
|
const result = {};
|
|
5833
5909
|
for (const [event, entries] of Object.entries(hooks)) {
|
|
@@ -5850,7 +5926,7 @@ function augmentHooksToCanonical(hooks) {
|
|
|
5850
5926
|
}
|
|
5851
5927
|
return result;
|
|
5852
5928
|
}
|
|
5853
|
-
async function importAugmentSettings(projectRoot, settingsPath, results) {
|
|
5929
|
+
async function importAugmentSettings(projectRoot, settingsPath, results, options = {}) {
|
|
5854
5930
|
const content = await readFileSafe(join(projectRoot, settingsPath));
|
|
5855
5931
|
if (content === null) return;
|
|
5856
5932
|
let settings;
|
|
@@ -5884,6 +5960,20 @@ async function importAugmentSettings(projectRoot, settingsPath, results) {
|
|
|
5884
5960
|
});
|
|
5885
5961
|
}
|
|
5886
5962
|
}
|
|
5963
|
+
if (options.includePermissions) {
|
|
5964
|
+
const permissions = parseToolPermissions(settings.toolPermissions);
|
|
5965
|
+
if (permissions) {
|
|
5966
|
+
const destPath = join(projectRoot, AUGMENT_CODE_CANONICAL_PERMISSIONS);
|
|
5967
|
+
await mkdirp(dirname(destPath));
|
|
5968
|
+
await writeFileAtomic(destPath, stringify(permissions));
|
|
5969
|
+
results.push({
|
|
5970
|
+
fromTool: AUGMENT_CODE_TARGET,
|
|
5971
|
+
fromPath: join(projectRoot, settingsPath),
|
|
5972
|
+
toPath: AUGMENT_CODE_CANONICAL_PERMISSIONS,
|
|
5973
|
+
feature: "permissions"
|
|
5974
|
+
});
|
|
5975
|
+
}
|
|
5976
|
+
}
|
|
5887
5977
|
}
|
|
5888
5978
|
async function importAugmentIgnore(projectRoot, ignorePath, results) {
|
|
5889
5979
|
const content = await readFileSafe(join(projectRoot, ignorePath));
|
|
@@ -5913,7 +6003,7 @@ function canonicalRuleMeta(frontmatter, isRoot) {
|
|
|
5913
6003
|
description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
|
|
5914
6004
|
globs: Array.isArray(frontmatter.globs) ? frontmatter.globs : []
|
|
5915
6005
|
};
|
|
5916
|
-
if (frontmatter.agent_requested === true) {
|
|
6006
|
+
if (frontmatter.type === "agent_requested" || frontmatter.agent_requested === true) {
|
|
5917
6007
|
meta.trigger = "model_decision";
|
|
5918
6008
|
}
|
|
5919
6009
|
return meta;
|
|
@@ -6008,7 +6098,9 @@ async function importFromAugmentCode(projectRoot, options = {}) {
|
|
|
6008
6098
|
const skillsDir = scope === "global" ? AUGMENT_CODE_GLOBAL_SKILLS_DIR : AUGMENT_CODE_SKILLS_DIR;
|
|
6009
6099
|
await importEmbeddedSkills(projectRoot, skillsDir, AUGMENT_CODE_TARGET, results, normalize);
|
|
6010
6100
|
const settingsFile = scope === "global" ? AUGMENT_CODE_GLOBAL_SETTINGS_FILE : AUGMENT_CODE_SETTINGS_FILE;
|
|
6011
|
-
await importAugmentSettings(projectRoot, settingsFile, results
|
|
6101
|
+
await importAugmentSettings(projectRoot, settingsFile, results, {
|
|
6102
|
+
includePermissions: scope === "global"
|
|
6103
|
+
});
|
|
6012
6104
|
if (scope === "project") {
|
|
6013
6105
|
await importAugmentIgnore(projectRoot, AUGMENT_CODE_IGNORE_FILE, results);
|
|
6014
6106
|
}
|
|
@@ -6066,12 +6158,12 @@ var init_lint5 = __esm({
|
|
|
6066
6158
|
}
|
|
6067
6159
|
});
|
|
6068
6160
|
|
|
6069
|
-
// src/targets/augment-code/
|
|
6161
|
+
// src/targets/augment-code/settings-build.ts
|
|
6070
6162
|
function serializeHooksForSettings(hooks) {
|
|
6071
6163
|
const result = {};
|
|
6072
6164
|
for (const [event, entries] of Object.entries(hooks)) {
|
|
6073
6165
|
if (!entries || entries.length === 0) continue;
|
|
6074
|
-
|
|
6166
|
+
result[event] = entries.map((entry) => ({
|
|
6075
6167
|
matcher: entry.matcher,
|
|
6076
6168
|
hooks: [
|
|
6077
6169
|
{
|
|
@@ -6081,10 +6173,38 @@ function serializeHooksForSettings(hooks) {
|
|
|
6081
6173
|
}
|
|
6082
6174
|
]
|
|
6083
6175
|
}));
|
|
6084
|
-
result[event] = serialized;
|
|
6085
6176
|
}
|
|
6086
6177
|
return result;
|
|
6087
6178
|
}
|
|
6179
|
+
function serializeToolPermissions(permissions) {
|
|
6180
|
+
if (!permissions) return void 0;
|
|
6181
|
+
const entries = [];
|
|
6182
|
+
for (const toolName of permissions.allow ?? []) {
|
|
6183
|
+
entries.push({ toolName, permission: { type: "allow" } });
|
|
6184
|
+
}
|
|
6185
|
+
for (const toolName of permissions.deny ?? []) {
|
|
6186
|
+
entries.push({ toolName, permission: { type: "deny" } });
|
|
6187
|
+
}
|
|
6188
|
+
for (const toolName of permissions.ask ?? []) {
|
|
6189
|
+
entries.push({ toolName, permission: { type: "ask-user" } });
|
|
6190
|
+
}
|
|
6191
|
+
return entries.length > 0 ? entries : void 0;
|
|
6192
|
+
}
|
|
6193
|
+
function buildSettingsContent(canonical, enabledFeatures, scope) {
|
|
6194
|
+
const settings = {};
|
|
6195
|
+
if (enabledFeatures.has("mcp") && canonical.mcp && Object.keys(canonical.mcp.mcpServers).length > 0) {
|
|
6196
|
+
settings.mcpServers = canonical.mcp.mcpServers;
|
|
6197
|
+
}
|
|
6198
|
+
if (enabledFeatures.has("hooks") && canonical.hooks && Object.keys(canonical.hooks).length > 0) {
|
|
6199
|
+
settings.hooks = serializeHooksForSettings(canonical.hooks);
|
|
6200
|
+
}
|
|
6201
|
+
if (scope === "global" && enabledFeatures.has("permissions")) {
|
|
6202
|
+
const toolPermissions = serializeToolPermissions(canonical.permissions);
|
|
6203
|
+
if (toolPermissions) settings.toolPermissions = toolPermissions;
|
|
6204
|
+
}
|
|
6205
|
+
if (Object.keys(settings).length === 0) return null;
|
|
6206
|
+
return JSON.stringify(settings, null, 2);
|
|
6207
|
+
}
|
|
6088
6208
|
function mergeAugmentSettings(existing, newContent) {
|
|
6089
6209
|
if (existing === null) return newContent;
|
|
6090
6210
|
let base;
|
|
@@ -6099,19 +6219,15 @@ function mergeAugmentSettings(existing, newContent) {
|
|
|
6099
6219
|
const overlay = incoming;
|
|
6100
6220
|
if (overlay.mcpServers !== void 0) base.mcpServers = overlay.mcpServers;
|
|
6101
6221
|
if (overlay.hooks !== void 0) base.hooks = overlay.hooks;
|
|
6222
|
+
if (overlay.toolPermissions !== void 0) base.toolPermissions = overlay.toolPermissions;
|
|
6102
6223
|
return JSON.stringify(base, null, 2);
|
|
6103
6224
|
}
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
if (enabledFeatures.has("mcp") && canonical.mcp && Object.keys(canonical.mcp.mcpServers).length > 0) {
|
|
6107
|
-
settings.mcpServers = canonical.mcp.mcpServers;
|
|
6225
|
+
var init_settings_build = __esm({
|
|
6226
|
+
"src/targets/augment-code/settings-build.ts"() {
|
|
6108
6227
|
}
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
if (Object.keys(settings).length === 0) return null;
|
|
6113
|
-
return JSON.stringify(settings, null, 2);
|
|
6114
|
-
}
|
|
6228
|
+
});
|
|
6229
|
+
|
|
6230
|
+
// src/targets/augment-code/index.ts
|
|
6115
6231
|
var target5, project5, globalLayout5, capabilities3, globalCapabilities3, descriptor5;
|
|
6116
6232
|
var init_augment_code2 = __esm({
|
|
6117
6233
|
"src/targets/augment-code/index.ts"() {
|
|
@@ -6120,6 +6236,7 @@ var init_augment_code2 = __esm({
|
|
|
6120
6236
|
init_linter5();
|
|
6121
6237
|
init_lint5();
|
|
6122
6238
|
init_import_map_builders();
|
|
6239
|
+
init_settings_build();
|
|
6123
6240
|
init_constants6();
|
|
6124
6241
|
target5 = {
|
|
6125
6242
|
name: AUGMENT_CODE_TARGET,
|
|
@@ -6133,7 +6250,12 @@ var init_augment_code2 = __esm({
|
|
|
6133
6250
|
project5 = {
|
|
6134
6251
|
skillDir: AUGMENT_CODE_SKILLS_DIR,
|
|
6135
6252
|
managedOutputs: {
|
|
6136
|
-
dirs: [
|
|
6253
|
+
dirs: [
|
|
6254
|
+
AUGMENT_CODE_RULES_DIR,
|
|
6255
|
+
AUGMENT_CODE_COMMANDS_DIR,
|
|
6256
|
+
AUGMENT_CODE_AGENTS_DIR,
|
|
6257
|
+
AUGMENT_CODE_SKILLS_DIR
|
|
6258
|
+
],
|
|
6137
6259
|
files: [AUGMENT_CODE_SETTINGS_FILE, AUGMENT_CODE_IGNORE_FILE]
|
|
6138
6260
|
},
|
|
6139
6261
|
paths: {
|
|
@@ -6209,7 +6331,7 @@ var init_augment_code2 = __esm({
|
|
|
6209
6331
|
mcp: "native",
|
|
6210
6332
|
hooks: "none",
|
|
6211
6333
|
ignore: "none",
|
|
6212
|
-
permissions: "
|
|
6334
|
+
permissions: "native"
|
|
6213
6335
|
};
|
|
6214
6336
|
descriptor5 = {
|
|
6215
6337
|
id: AUGMENT_CODE_TARGET,
|
|
@@ -6237,8 +6359,8 @@ var init_augment_code2 = __esm({
|
|
|
6237
6359
|
],
|
|
6238
6360
|
layout: globalLayout5
|
|
6239
6361
|
},
|
|
6240
|
-
emitScopedSettings(canonical,
|
|
6241
|
-
const content = buildSettingsContent(canonical, enabledFeatures);
|
|
6362
|
+
emitScopedSettings(canonical, scope, enabledFeatures) {
|
|
6363
|
+
const content = buildSettingsContent(canonical, enabledFeatures, scope);
|
|
6242
6364
|
if (content === null) return [];
|
|
6243
6365
|
return [{ path: AUGMENT_CODE_SETTINGS_FILE, content }];
|
|
6244
6366
|
},
|
|
@@ -8197,30 +8319,79 @@ var init_mcp = __esm({
|
|
|
8197
8319
|
init_constants28();
|
|
8198
8320
|
}
|
|
8199
8321
|
});
|
|
8200
|
-
|
|
8201
|
-
// src/targets/codex-cli/generator/hooks.ts
|
|
8202
|
-
function generateHooks4(canonical) {
|
|
8322
|
+
function buildWrappedCommandHooks(canonical, hooksFilePath) {
|
|
8203
8323
|
if (!canonical.hooks) return [];
|
|
8204
8324
|
const hooks = {};
|
|
8205
8325
|
for (const [event, entries] of Object.entries(canonical.hooks)) {
|
|
8206
8326
|
if (!Array.isArray(entries)) continue;
|
|
8207
8327
|
const mapped = entries.flatMap((entry) => {
|
|
8208
8328
|
if (!hasHookCommand(entry) || entry.type === "prompt") return [];
|
|
8209
|
-
const hook = {
|
|
8210
|
-
type: "command",
|
|
8211
|
-
command: getHookCommand(entry)
|
|
8212
|
-
};
|
|
8329
|
+
const hook = { type: "command", command: getHookCommand(entry) };
|
|
8213
8330
|
if (entry.timeout !== void 0) hook.timeout = entry.timeout;
|
|
8214
8331
|
return [{ matcher: entry.matcher, hooks: [hook] }];
|
|
8215
8332
|
});
|
|
8216
8333
|
if (mapped.length > 0) hooks[event] = mapped;
|
|
8217
8334
|
}
|
|
8218
8335
|
if (Object.keys(hooks).length === 0) return [];
|
|
8219
|
-
return [{ path:
|
|
8336
|
+
return [{ path: hooksFilePath, content: JSON.stringify({ hooks }, null, 2) }];
|
|
8337
|
+
}
|
|
8338
|
+
async function importWrappedCommandHooks(options) {
|
|
8339
|
+
const { projectRoot, hooksFile, canonicalHooksPath, targetName, results } = options;
|
|
8340
|
+
const srcPath = join(projectRoot, hooksFile);
|
|
8341
|
+
const content = await readFileSafe(srcPath);
|
|
8342
|
+
if (content === null) return;
|
|
8343
|
+
let parsed;
|
|
8344
|
+
try {
|
|
8345
|
+
parsed = JSON.parse(content);
|
|
8346
|
+
} catch {
|
|
8347
|
+
return;
|
|
8348
|
+
}
|
|
8349
|
+
if (!parsed || typeof parsed !== "object") return;
|
|
8350
|
+
const rawHooks = parsed.hooks;
|
|
8351
|
+
if (!rawHooks || typeof rawHooks !== "object" || Array.isArray(rawHooks)) return;
|
|
8352
|
+
const hooks = {};
|
|
8353
|
+
for (const [event, groups] of Object.entries(rawHooks)) {
|
|
8354
|
+
if (!Array.isArray(groups)) continue;
|
|
8355
|
+
for (const group of groups) {
|
|
8356
|
+
if (!group || typeof group !== "object") continue;
|
|
8357
|
+
const record = group;
|
|
8358
|
+
const matcher = typeof record.matcher === "string" ? record.matcher : "*";
|
|
8359
|
+
if (!Array.isArray(record.hooks)) continue;
|
|
8360
|
+
for (const raw of record.hooks) {
|
|
8361
|
+
if (!raw || typeof raw !== "object") continue;
|
|
8362
|
+
const hook = raw;
|
|
8363
|
+
if (hook.type !== "command" || typeof hook.command !== "string") continue;
|
|
8364
|
+
const imported = { matcher, command: hook.command, type: "command" };
|
|
8365
|
+
if (typeof hook.timeout === "number") imported.timeout = hook.timeout;
|
|
8366
|
+
(hooks[event] ??= []).push(imported);
|
|
8367
|
+
}
|
|
8368
|
+
}
|
|
8369
|
+
}
|
|
8370
|
+
if (Object.keys(hooks).length === 0) return;
|
|
8371
|
+
const destPath = join(projectRoot, canonicalHooksPath);
|
|
8372
|
+
await mkdirp(dirname(destPath));
|
|
8373
|
+
await writeFileAtomic(destPath, stringify(hooks));
|
|
8374
|
+
results.push({
|
|
8375
|
+
fromTool: targetName,
|
|
8376
|
+
fromPath: srcPath,
|
|
8377
|
+
toPath: canonicalHooksPath,
|
|
8378
|
+
feature: "hooks"
|
|
8379
|
+
});
|
|
8380
|
+
}
|
|
8381
|
+
var init_wrapped_command_hooks = __esm({
|
|
8382
|
+
"src/targets/import/wrapped-command-hooks.ts"() {
|
|
8383
|
+
init_hook_command();
|
|
8384
|
+
init_fs();
|
|
8385
|
+
}
|
|
8386
|
+
});
|
|
8387
|
+
|
|
8388
|
+
// src/targets/codex-cli/generator/hooks.ts
|
|
8389
|
+
function generateHooks4(canonical) {
|
|
8390
|
+
return buildWrappedCommandHooks(canonical, CODEX_HOOKS_FILE);
|
|
8220
8391
|
}
|
|
8221
8392
|
var init_hooks = __esm({
|
|
8222
8393
|
"src/targets/codex-cli/generator/hooks.ts"() {
|
|
8223
|
-
|
|
8394
|
+
init_wrapped_command_hooks();
|
|
8224
8395
|
init_constants28();
|
|
8225
8396
|
}
|
|
8226
8397
|
});
|
|
@@ -8611,51 +8782,20 @@ var init_importer_rules2 = __esm({
|
|
|
8611
8782
|
init_instruction_mirror();
|
|
8612
8783
|
}
|
|
8613
8784
|
});
|
|
8785
|
+
|
|
8786
|
+
// src/targets/codex-cli/importer-hooks.ts
|
|
8614
8787
|
async function importCodexHooks(projectRoot, results) {
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
} catch {
|
|
8622
|
-
return;
|
|
8623
|
-
}
|
|
8624
|
-
if (!parsed || typeof parsed !== "object") return;
|
|
8625
|
-
const rawHooks = parsed.hooks;
|
|
8626
|
-
if (!rawHooks || typeof rawHooks !== "object" || Array.isArray(rawHooks)) return;
|
|
8627
|
-
const hooks = {};
|
|
8628
|
-
for (const [event, groups] of Object.entries(rawHooks)) {
|
|
8629
|
-
if (!Array.isArray(groups)) continue;
|
|
8630
|
-
for (const group of groups) {
|
|
8631
|
-
if (!group || typeof group !== "object") continue;
|
|
8632
|
-
const record = group;
|
|
8633
|
-
const matcher = typeof record.matcher === "string" ? record.matcher : "*";
|
|
8634
|
-
if (!Array.isArray(record.hooks)) continue;
|
|
8635
|
-
for (const raw of record.hooks) {
|
|
8636
|
-
if (!raw || typeof raw !== "object") continue;
|
|
8637
|
-
const hook = raw;
|
|
8638
|
-
if (hook.type !== "command" || typeof hook.command !== "string") continue;
|
|
8639
|
-
const imported = { matcher, command: hook.command, type: "command" };
|
|
8640
|
-
if (typeof hook.timeout === "number") imported.timeout = hook.timeout;
|
|
8641
|
-
(hooks[event] ??= []).push(imported);
|
|
8642
|
-
}
|
|
8643
|
-
}
|
|
8644
|
-
}
|
|
8645
|
-
if (Object.keys(hooks).length === 0) return;
|
|
8646
|
-
const destPath = join(projectRoot, CODEX_CANONICAL_HOOKS);
|
|
8647
|
-
await mkdirp(dirname(destPath));
|
|
8648
|
-
await writeFileAtomic(destPath, stringify(hooks));
|
|
8649
|
-
results.push({
|
|
8650
|
-
fromTool: CODEX_TARGET,
|
|
8651
|
-
fromPath: srcPath,
|
|
8652
|
-
toPath: CODEX_CANONICAL_HOOKS,
|
|
8653
|
-
feature: "hooks"
|
|
8788
|
+
await importWrappedCommandHooks({
|
|
8789
|
+
projectRoot,
|
|
8790
|
+
hooksFile: CODEX_HOOKS_FILE,
|
|
8791
|
+
canonicalHooksPath: CODEX_CANONICAL_HOOKS,
|
|
8792
|
+
targetName: CODEX_TARGET,
|
|
8793
|
+
results
|
|
8654
8794
|
});
|
|
8655
8795
|
}
|
|
8656
8796
|
var init_importer_hooks = __esm({
|
|
8657
8797
|
"src/targets/codex-cli/importer-hooks.ts"() {
|
|
8658
|
-
|
|
8798
|
+
init_wrapped_command_hooks();
|
|
8659
8799
|
init_constants28();
|
|
8660
8800
|
}
|
|
8661
8801
|
});
|
|
@@ -8836,7 +8976,7 @@ var init_codex_cli2 = __esm({
|
|
|
8836
8976
|
agents: "native",
|
|
8837
8977
|
skills: "native",
|
|
8838
8978
|
mcp: "native",
|
|
8839
|
-
hooks: "
|
|
8979
|
+
hooks: "native",
|
|
8840
8980
|
ignore: "none",
|
|
8841
8981
|
permissions: "none"
|
|
8842
8982
|
};
|
|
@@ -8856,7 +8996,7 @@ var init_codex_cli2 = __esm({
|
|
|
8856
8996
|
agents: "native",
|
|
8857
8997
|
skills: "native",
|
|
8858
8998
|
mcp: "native",
|
|
8859
|
-
hooks: "
|
|
8999
|
+
hooks: "native",
|
|
8860
9000
|
ignore: "none",
|
|
8861
9001
|
permissions: "none"
|
|
8862
9002
|
},
|
|
@@ -9012,6 +9152,40 @@ var init_generator10 = __esm({
|
|
|
9012
9152
|
init_constants9();
|
|
9013
9153
|
}
|
|
9014
9154
|
});
|
|
9155
|
+
function serializeContinuePermissions(permissions) {
|
|
9156
|
+
if (!permissions) return null;
|
|
9157
|
+
const allow = permissions.allow ?? [];
|
|
9158
|
+
const ask = permissions.ask ?? [];
|
|
9159
|
+
const exclude = permissions.deny ?? [];
|
|
9160
|
+
if (allow.length === 0 && ask.length === 0 && exclude.length === 0) return null;
|
|
9161
|
+
const out = {};
|
|
9162
|
+
if (allow.length > 0) out.allow = allow;
|
|
9163
|
+
if (ask.length > 0) out.ask = ask;
|
|
9164
|
+
if (exclude.length > 0) out.exclude = exclude;
|
|
9165
|
+
return stringify(out).trimEnd() + "\n";
|
|
9166
|
+
}
|
|
9167
|
+
function parseContinuePermissions(content) {
|
|
9168
|
+
let parsed;
|
|
9169
|
+
try {
|
|
9170
|
+
parsed = parse(content);
|
|
9171
|
+
} catch {
|
|
9172
|
+
return null;
|
|
9173
|
+
}
|
|
9174
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
9175
|
+
const record = parsed;
|
|
9176
|
+
const allow = toStringArray5(record.allow);
|
|
9177
|
+
const ask = toStringArray5(record.ask);
|
|
9178
|
+
const deny = toStringArray5(record.exclude);
|
|
9179
|
+
if (allow.length === 0 && ask.length === 0 && deny.length === 0) return null;
|
|
9180
|
+
const permissions = { allow, deny };
|
|
9181
|
+
if (ask.length > 0) permissions.ask = ask;
|
|
9182
|
+
return permissions;
|
|
9183
|
+
}
|
|
9184
|
+
var init_permissions = __esm({
|
|
9185
|
+
"src/targets/continue/permissions.ts"() {
|
|
9186
|
+
init_shared_import_helpers();
|
|
9187
|
+
}
|
|
9188
|
+
});
|
|
9015
9189
|
function readMcpServers(content, extension) {
|
|
9016
9190
|
const parsed = extension === ".json" ? JSON.parse(content) : parse(content) ?? {};
|
|
9017
9191
|
const rawServers = parsed.mcpServers;
|
|
@@ -9066,12 +9240,29 @@ async function importMcp2(projectRoot, results) {
|
|
|
9066
9240
|
});
|
|
9067
9241
|
}
|
|
9068
9242
|
}
|
|
9069
|
-
async function
|
|
9243
|
+
async function importPermissions(projectRoot, results) {
|
|
9244
|
+
const srcPath = join(projectRoot, CONTINUE_GLOBAL_PERMISSIONS);
|
|
9245
|
+
const content = await readFileSafe(srcPath);
|
|
9246
|
+
if (content === null) return;
|
|
9247
|
+
const permissions = parseContinuePermissions(content);
|
|
9248
|
+
if (!permissions) return;
|
|
9249
|
+
const destPath = join(projectRoot, CONTINUE_CANONICAL_PERMISSIONS);
|
|
9250
|
+
await mkdirp(dirname(destPath));
|
|
9251
|
+
await writeFileAtomic(destPath, stringify(permissions).trimEnd() + "\n");
|
|
9252
|
+
results.push({
|
|
9253
|
+
fromTool: CONTINUE_TARGET,
|
|
9254
|
+
fromPath: srcPath,
|
|
9255
|
+
toPath: CONTINUE_CANONICAL_PERMISSIONS,
|
|
9256
|
+
feature: "permissions"
|
|
9257
|
+
});
|
|
9258
|
+
}
|
|
9259
|
+
async function importFromContinue(projectRoot, options = {}) {
|
|
9070
9260
|
const results = [];
|
|
9071
9261
|
const normalize = await createImportReferenceNormalizer(CONTINUE_TARGET, projectRoot);
|
|
9072
9262
|
results.push(...await runDescriptorImport(descriptor9, projectRoot, "project", { normalize }));
|
|
9073
9263
|
await importEmbeddedSkills(projectRoot, CONTINUE_SKILLS_DIR, CONTINUE_TARGET, results, normalize);
|
|
9074
9264
|
await importMcp2(projectRoot, results);
|
|
9265
|
+
if (options.scope === "global") await importPermissions(projectRoot, results);
|
|
9075
9266
|
return results;
|
|
9076
9267
|
}
|
|
9077
9268
|
var init_importer9 = __esm({
|
|
@@ -9083,6 +9274,7 @@ var init_importer9 = __esm({
|
|
|
9083
9274
|
init_mcp_merge();
|
|
9084
9275
|
init_shared_import_helpers();
|
|
9085
9276
|
init_constants9();
|
|
9277
|
+
init_permissions();
|
|
9086
9278
|
init_continue2();
|
|
9087
9279
|
}
|
|
9088
9280
|
});
|
|
@@ -9248,6 +9440,7 @@ var init_scope_extras = __esm({
|
|
|
9248
9440
|
init_fs();
|
|
9249
9441
|
init_constants9();
|
|
9250
9442
|
init_global_config();
|
|
9443
|
+
init_permissions();
|
|
9251
9444
|
generateContinueScopeExtras = async (canonical, projectRoot, scope, enabledFeatures) => {
|
|
9252
9445
|
const configResults = await generateContinueGlobalConfig(
|
|
9253
9446
|
canonical,
|
|
@@ -9255,21 +9448,36 @@ var init_scope_extras = __esm({
|
|
|
9255
9448
|
scope,
|
|
9256
9449
|
enabledFeatures
|
|
9257
9450
|
);
|
|
9258
|
-
if (scope !== "global"
|
|
9259
|
-
const
|
|
9260
|
-
if (
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9451
|
+
if (scope !== "global") return configResults;
|
|
9452
|
+
const results = [...configResults];
|
|
9453
|
+
if (enabledFeatures.has("permissions")) {
|
|
9454
|
+
const content = serializeContinuePermissions(canonical.permissions);
|
|
9455
|
+
if (content) {
|
|
9456
|
+
const existing = await readFileSafe(join(projectRoot, CONTINUE_GLOBAL_PERMISSIONS));
|
|
9457
|
+
results.push({
|
|
9458
|
+
target: "continue",
|
|
9459
|
+
path: CONTINUE_GLOBAL_PERMISSIONS,
|
|
9460
|
+
content,
|
|
9461
|
+
currentContent: existing ?? void 0,
|
|
9462
|
+
status: computeStatus3(existing, content)
|
|
9463
|
+
});
|
|
9271
9464
|
}
|
|
9272
|
-
|
|
9465
|
+
}
|
|
9466
|
+
if (enabledFeatures.has("rules")) {
|
|
9467
|
+
const root = canonical.rules.find((r) => r.root);
|
|
9468
|
+
if (root) {
|
|
9469
|
+
const content = root.body.trim();
|
|
9470
|
+
const existing = await readFileSafe(join(projectRoot, CONTINUE_GLOBAL_AGENTS_MD));
|
|
9471
|
+
results.push({
|
|
9472
|
+
target: "continue",
|
|
9473
|
+
path: CONTINUE_GLOBAL_AGENTS_MD,
|
|
9474
|
+
content,
|
|
9475
|
+
currentContent: existing ?? void 0,
|
|
9476
|
+
status: computeStatus3(existing, content)
|
|
9477
|
+
});
|
|
9478
|
+
}
|
|
9479
|
+
}
|
|
9480
|
+
return results;
|
|
9273
9481
|
};
|
|
9274
9482
|
}
|
|
9275
9483
|
});
|
|
@@ -9325,7 +9533,12 @@ var init_continue2 = __esm({
|
|
|
9325
9533
|
skillDir: CONTINUE_SKILLS_DIR,
|
|
9326
9534
|
managedOutputs: {
|
|
9327
9535
|
dirs: [CONTINUE_RULES_DIR, CONTINUE_PROMPTS_DIR, CONTINUE_SKILLS_DIR, ".agents/skills"],
|
|
9328
|
-
files: [
|
|
9536
|
+
files: [
|
|
9537
|
+
CONTINUE_MCP_FILE,
|
|
9538
|
+
CONTINUE_GLOBAL_AGENTS_MD,
|
|
9539
|
+
CONTINUE_GLOBAL_CONFIG,
|
|
9540
|
+
CONTINUE_GLOBAL_PERMISSIONS
|
|
9541
|
+
]
|
|
9329
9542
|
},
|
|
9330
9543
|
mirrorGlobalPath(path, _activeTargets) {
|
|
9331
9544
|
if (path.startsWith(`${CONTINUE_SKILLS_DIR}/`)) {
|
|
@@ -9354,7 +9567,7 @@ var init_continue2 = __esm({
|
|
|
9354
9567
|
mcp: "native",
|
|
9355
9568
|
hooks: "none",
|
|
9356
9569
|
ignore: "none",
|
|
9357
|
-
permissions: "
|
|
9570
|
+
permissions: "native"
|
|
9358
9571
|
};
|
|
9359
9572
|
descriptor9 = {
|
|
9360
9573
|
id: "continue",
|
|
@@ -10251,7 +10464,7 @@ var init_capabilities4 = __esm({
|
|
|
10251
10464
|
agents: "native",
|
|
10252
10465
|
skills: "native",
|
|
10253
10466
|
mcp: "native",
|
|
10254
|
-
hooks: "
|
|
10467
|
+
hooks: "native",
|
|
10255
10468
|
ignore: "none",
|
|
10256
10469
|
permissions: "none"
|
|
10257
10470
|
};
|
|
@@ -10533,11 +10746,12 @@ async function importFromCrush(projectRoot, options = {}) {
|
|
|
10533
10746
|
results.push(...await runDescriptorImport(descriptor11, projectRoot, scope, { normalize }));
|
|
10534
10747
|
const skillsDir = scope === "global" ? CRUSH_GLOBAL_SKILLS_DIR : CRUSH_SKILLS_DIR;
|
|
10535
10748
|
await importEmbeddedSkills(projectRoot, skillsDir, CRUSH_TARGET, results, normalize);
|
|
10536
|
-
await importCrushConfigJson(projectRoot, results);
|
|
10749
|
+
await importCrushConfigJson(projectRoot, scope, results);
|
|
10537
10750
|
return results;
|
|
10538
10751
|
}
|
|
10539
|
-
async function importCrushConfigJson(projectRoot, results) {
|
|
10540
|
-
const
|
|
10752
|
+
async function importCrushConfigJson(projectRoot, scope, results) {
|
|
10753
|
+
const configRel = scope === "global" ? CRUSH_GLOBAL_CONFIG_FILE : CRUSH_CONFIG_FILE;
|
|
10754
|
+
const configPath = join(projectRoot, configRel);
|
|
10541
10755
|
const content = await readFileSafe(configPath);
|
|
10542
10756
|
if (content === null) return;
|
|
10543
10757
|
let parsed;
|
|
@@ -11039,33 +11253,81 @@ var init_agents2 = __esm({
|
|
|
11039
11253
|
function generatePermissions4(_canonical) {
|
|
11040
11254
|
return [];
|
|
11041
11255
|
}
|
|
11042
|
-
var
|
|
11256
|
+
var init_permissions2 = __esm({
|
|
11043
11257
|
"src/targets/cursor/generator/permissions.ts"() {
|
|
11044
11258
|
}
|
|
11045
11259
|
});
|
|
11046
11260
|
|
|
11047
|
-
// src/targets/cursor/
|
|
11261
|
+
// src/targets/cursor/hook-format.ts
|
|
11262
|
+
function unmappedCursorHookEvents(hooks) {
|
|
11263
|
+
return Object.keys(hooks).filter(
|
|
11264
|
+
(event) => Array.isArray(hooks[event]) && hooks[event].length > 0 && !(event in CANONICAL_TO_CURSOR)
|
|
11265
|
+
);
|
|
11266
|
+
}
|
|
11048
11267
|
function toCursorHooks(hooks) {
|
|
11049
11268
|
const result = {};
|
|
11050
11269
|
for (const [event, entries] of Object.entries(hooks)) {
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
const
|
|
11057
|
-
const
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11270
|
+
const cursorEvent = CANONICAL_TO_CURSOR[event];
|
|
11271
|
+
if (!cursorEvent || !Array.isArray(entries)) continue;
|
|
11272
|
+
const flat = [];
|
|
11273
|
+
for (const entry of entries) {
|
|
11274
|
+
if (!hasHookText(entry)) continue;
|
|
11275
|
+
const value = getHookText(entry);
|
|
11276
|
+
const hook = entry.type === "prompt" ? { type: "prompt", prompt: value } : { type: "command", command: value };
|
|
11277
|
+
if (entry.matcher) hook.matcher = entry.matcher;
|
|
11278
|
+
if (entry.timeout !== void 0) hook.timeout = entry.timeout;
|
|
11279
|
+
flat.push(hook);
|
|
11280
|
+
}
|
|
11281
|
+
if (flat.length > 0) result[cursorEvent] = flat;
|
|
11282
|
+
}
|
|
11283
|
+
return result;
|
|
11284
|
+
}
|
|
11285
|
+
function cursorHooksToCanonical(hooks) {
|
|
11286
|
+
const result = {};
|
|
11287
|
+
for (const [cursorEvent, entries] of Object.entries(hooks)) {
|
|
11288
|
+
const canonicalEvent = CURSOR_TO_CANONICAL.get(cursorEvent);
|
|
11289
|
+
if (!canonicalEvent || !Array.isArray(entries)) continue;
|
|
11290
|
+
const list = [];
|
|
11291
|
+
for (const entry of entries) {
|
|
11292
|
+
if (!entry || typeof entry !== "object") continue;
|
|
11293
|
+
const e = entry;
|
|
11294
|
+
const type = e.type === "prompt" ? "prompt" : "command";
|
|
11295
|
+
if (!hasHookText({ ...e, type })) continue;
|
|
11296
|
+
const value = getHookText({ ...e, type });
|
|
11297
|
+
const item = {
|
|
11298
|
+
matcher: typeof e.matcher === "string" ? e.matcher : "",
|
|
11299
|
+
type,
|
|
11300
|
+
command: value
|
|
11061
11301
|
};
|
|
11062
|
-
if (e.timeout
|
|
11063
|
-
|
|
11302
|
+
if (typeof e.timeout === "number") item.timeout = e.timeout;
|
|
11303
|
+
list.push(item);
|
|
11064
11304
|
}
|
|
11065
|
-
if (
|
|
11305
|
+
if (list.length > 0) result[canonicalEvent] = [...result[canonicalEvent] ?? [], ...list];
|
|
11066
11306
|
}
|
|
11067
11307
|
return result;
|
|
11068
11308
|
}
|
|
11309
|
+
var CANONICAL_TO_CURSOR, CURSOR_TO_CANONICAL;
|
|
11310
|
+
var init_hook_format = __esm({
|
|
11311
|
+
"src/targets/cursor/hook-format.ts"() {
|
|
11312
|
+
init_hook_command();
|
|
11313
|
+
CANONICAL_TO_CURSOR = {
|
|
11314
|
+
PreToolUse: "preToolUse",
|
|
11315
|
+
PostToolUse: "postToolUse",
|
|
11316
|
+
UserPromptSubmit: "beforeSubmitPrompt",
|
|
11317
|
+
SubagentStart: "subagentStart",
|
|
11318
|
+
SubagentStop: "subagentStop",
|
|
11319
|
+
Stop: "stop",
|
|
11320
|
+
SessionStart: "sessionStart",
|
|
11321
|
+
SessionEnd: "sessionEnd",
|
|
11322
|
+
PreCompact: "preCompact"
|
|
11323
|
+
};
|
|
11324
|
+
CURSOR_TO_CANONICAL = new Map(
|
|
11325
|
+
Object.entries(CANONICAL_TO_CURSOR).map(([canonical, cursor]) => [cursor, canonical])
|
|
11326
|
+
);
|
|
11327
|
+
}
|
|
11328
|
+
});
|
|
11329
|
+
|
|
11330
|
+
// src/targets/cursor/generator/hooks.ts
|
|
11069
11331
|
function generateHooks7(canonical) {
|
|
11070
11332
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
11071
11333
|
const cursorHooks = toCursorHooks(canonical.hooks);
|
|
@@ -11075,8 +11337,8 @@ function generateHooks7(canonical) {
|
|
|
11075
11337
|
}
|
|
11076
11338
|
var init_hooks2 = __esm({
|
|
11077
11339
|
"src/targets/cursor/generator/hooks.ts"() {
|
|
11078
|
-
init_hook_command();
|
|
11079
11340
|
init_constants11();
|
|
11341
|
+
init_hook_format();
|
|
11080
11342
|
}
|
|
11081
11343
|
});
|
|
11082
11344
|
|
|
@@ -11100,7 +11362,7 @@ var init_generator13 = __esm({
|
|
|
11100
11362
|
init_mcp2();
|
|
11101
11363
|
init_skills2();
|
|
11102
11364
|
init_agents2();
|
|
11103
|
-
|
|
11365
|
+
init_permissions2();
|
|
11104
11366
|
init_hooks2();
|
|
11105
11367
|
init_ignore();
|
|
11106
11368
|
}
|
|
@@ -11278,30 +11540,6 @@ var init_importer_rules3 = __esm({
|
|
|
11278
11540
|
init_constants11();
|
|
11279
11541
|
}
|
|
11280
11542
|
});
|
|
11281
|
-
function cursorHooksToCanonical(hooks) {
|
|
11282
|
-
const result = {};
|
|
11283
|
-
for (const [event, entries] of Object.entries(hooks)) {
|
|
11284
|
-
if (!Array.isArray(entries)) continue;
|
|
11285
|
-
const canonical = [];
|
|
11286
|
-
for (const entry of entries) {
|
|
11287
|
-
if (!entry || typeof entry !== "object") continue;
|
|
11288
|
-
const e = entry;
|
|
11289
|
-
const matcher = typeof e.matcher === "string" ? e.matcher : "";
|
|
11290
|
-
if (!matcher) continue;
|
|
11291
|
-
const hookList = Array.isArray(e.hooks) ? e.hooks : [];
|
|
11292
|
-
for (const hook of hookList) {
|
|
11293
|
-
const type = hook.type === "prompt" ? "prompt" : "command";
|
|
11294
|
-
if (!hasHookText({ ...hook, type })) continue;
|
|
11295
|
-
const value = type === "prompt" ? getHookPrompt(hook) || getHookCommand(hook) : getHookCommand(hook) || getHookPrompt(hook);
|
|
11296
|
-
const item = { matcher, type, command: value };
|
|
11297
|
-
if (typeof hook.timeout === "number") item.timeout = hook.timeout;
|
|
11298
|
-
canonical.push(item);
|
|
11299
|
-
}
|
|
11300
|
-
}
|
|
11301
|
-
if (canonical.length > 0) result[event] = canonical;
|
|
11302
|
-
}
|
|
11303
|
-
return result;
|
|
11304
|
-
}
|
|
11305
11543
|
async function importSettings2(projectRoot, results) {
|
|
11306
11544
|
let hooksImportedFromHooksJson = false;
|
|
11307
11545
|
const hooksJsonPath = join(projectRoot, CURSOR_HOOKS);
|
|
@@ -11403,7 +11641,7 @@ async function importIgnore(projectRoot, results) {
|
|
|
11403
11641
|
}
|
|
11404
11642
|
var init_settings_helpers3 = __esm({
|
|
11405
11643
|
"src/targets/cursor/settings-helpers.ts"() {
|
|
11406
|
-
|
|
11644
|
+
init_hook_format();
|
|
11407
11645
|
init_fs();
|
|
11408
11646
|
init_constants11();
|
|
11409
11647
|
}
|
|
@@ -11714,6 +11952,18 @@ var init_linter12 = __esm({
|
|
|
11714
11952
|
});
|
|
11715
11953
|
|
|
11716
11954
|
// src/targets/cursor/lint.ts
|
|
11955
|
+
function lintHooks6(canonical) {
|
|
11956
|
+
if (!canonical.hooks) return [];
|
|
11957
|
+
const unmapped = unmappedCursorHookEvents(canonical.hooks);
|
|
11958
|
+
if (unmapped.length === 0) return [];
|
|
11959
|
+
return [
|
|
11960
|
+
createWarning(
|
|
11961
|
+
".agentsmesh/hooks.yaml",
|
|
11962
|
+
"cursor",
|
|
11963
|
+
`Cursor has no equivalent for hook event(s) ${unmapped.join(", ")}; they are not projected to .cursor/hooks.json.`
|
|
11964
|
+
)
|
|
11965
|
+
];
|
|
11966
|
+
}
|
|
11717
11967
|
function lintCommands5(canonical) {
|
|
11718
11968
|
return canonical.commands.filter((command) => command.description.length > 0 || command.allowedTools.length > 0).map(
|
|
11719
11969
|
(command) => createWarning(
|
|
@@ -11758,6 +12008,7 @@ function lintPermissions4(canonical) {
|
|
|
11758
12008
|
var init_lint11 = __esm({
|
|
11759
12009
|
"src/targets/cursor/lint.ts"() {
|
|
11760
12010
|
init_helpers();
|
|
12011
|
+
init_hook_format();
|
|
11761
12012
|
}
|
|
11762
12013
|
});
|
|
11763
12014
|
|
|
@@ -11862,7 +12113,7 @@ var init_cursor2 = __esm({
|
|
|
11862
12113
|
};
|
|
11863
12114
|
globalCapabilities10 = {
|
|
11864
12115
|
rules: "native",
|
|
11865
|
-
additionalRules: "
|
|
12116
|
+
additionalRules: "native",
|
|
11866
12117
|
commands: "native",
|
|
11867
12118
|
agents: "native",
|
|
11868
12119
|
skills: "native",
|
|
@@ -11882,7 +12133,7 @@ var init_cursor2 = __esm({
|
|
|
11882
12133
|
generators: target12,
|
|
11883
12134
|
capabilities: {
|
|
11884
12135
|
rules: "native",
|
|
11885
|
-
additionalRules: "
|
|
12136
|
+
additionalRules: "native",
|
|
11886
12137
|
commands: "native",
|
|
11887
12138
|
agents: "native",
|
|
11888
12139
|
skills: "native",
|
|
@@ -11896,7 +12147,8 @@ var init_cursor2 = __esm({
|
|
|
11896
12147
|
lint: {
|
|
11897
12148
|
commands: lintCommands5,
|
|
11898
12149
|
mcp: lintMcp3,
|
|
11899
|
-
permissions: lintPermissions4
|
|
12150
|
+
permissions: lintPermissions4,
|
|
12151
|
+
hooks: lintHooks6
|
|
11900
12152
|
},
|
|
11901
12153
|
project: project12,
|
|
11902
12154
|
globalSupport: {
|
|
@@ -12267,10 +12519,18 @@ function generateSkills13(canonical) {
|
|
|
12267
12519
|
return generateEmbeddedSkills(canonical, FACTORY_DROID_SKILLS_DIR);
|
|
12268
12520
|
}
|
|
12269
12521
|
function generateCommands13(canonical) {
|
|
12270
|
-
return canonical.commands.map((command) =>
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12522
|
+
return canonical.commands.map((command) => {
|
|
12523
|
+
const frontmatter = {
|
|
12524
|
+
description: command.description || void 0,
|
|
12525
|
+
"allowed-tools": command.allowedTools.length > 0 ? command.allowedTools : void 0
|
|
12526
|
+
};
|
|
12527
|
+
if (frontmatter.description === void 0) delete frontmatter.description;
|
|
12528
|
+
if (frontmatter["allowed-tools"] === void 0) delete frontmatter["allowed-tools"];
|
|
12529
|
+
return {
|
|
12530
|
+
path: `${FACTORY_DROID_COMMANDS_DIR}/${command.name}.md`,
|
|
12531
|
+
content: serializeFrontmatter(frontmatter, command.body.trim() || "")
|
|
12532
|
+
};
|
|
12533
|
+
});
|
|
12274
12534
|
}
|
|
12275
12535
|
function generateAgents14(canonical) {
|
|
12276
12536
|
return canonical.agents.map((agent) => ({
|
|
@@ -12279,10 +12539,7 @@ function generateAgents14(canonical) {
|
|
|
12279
12539
|
}));
|
|
12280
12540
|
}
|
|
12281
12541
|
function generateHooks9(canonical) {
|
|
12282
|
-
|
|
12283
|
-
const hooks = buildClaudeHooksObjectFromCanonical(canonical);
|
|
12284
|
-
if (Object.keys(hooks).length === 0) return [];
|
|
12285
|
-
return [{ path: FACTORY_DROID_HOOKS_FILE, content: JSON.stringify(hooks, null, 2) }];
|
|
12542
|
+
return buildWrappedCommandHooks(canonical, FACTORY_DROID_HOOKS_FILE);
|
|
12286
12543
|
}
|
|
12287
12544
|
function generateMcp11(canonical) {
|
|
12288
12545
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
@@ -12297,8 +12554,8 @@ var init_generator16 = __esm({
|
|
|
12297
12554
|
"src/targets/factory-droid/generator.ts"() {
|
|
12298
12555
|
init_embedded_skill();
|
|
12299
12556
|
init_managed_blocks();
|
|
12300
|
-
|
|
12301
|
-
|
|
12557
|
+
init_markdown();
|
|
12558
|
+
init_wrapped_command_hooks();
|
|
12302
12559
|
init_droid_serializer();
|
|
12303
12560
|
init_constants13();
|
|
12304
12561
|
}
|
|
@@ -12351,6 +12608,13 @@ async function importFromFactoryDroid(projectRoot, options = {}) {
|
|
|
12351
12608
|
await importEmbeddedSkills(projectRoot, skillsDir, FACTORY_DROID_TARGET, results, normalize);
|
|
12352
12609
|
const mcpFile = scope === "global" ? FACTORY_DROID_GLOBAL_MCP_FILE : FACTORY_DROID_MCP_FILE;
|
|
12353
12610
|
await importFactoryDroidMcp(projectRoot, mcpFile, results);
|
|
12611
|
+
await importWrappedCommandHooks({
|
|
12612
|
+
projectRoot,
|
|
12613
|
+
hooksFile: FACTORY_DROID_HOOKS_FILE,
|
|
12614
|
+
canonicalHooksPath: FACTORY_DROID_CANONICAL_HOOKS,
|
|
12615
|
+
targetName: FACTORY_DROID_TARGET,
|
|
12616
|
+
results
|
|
12617
|
+
});
|
|
12354
12618
|
return results;
|
|
12355
12619
|
}
|
|
12356
12620
|
var init_importer14 = __esm({
|
|
@@ -12358,6 +12622,7 @@ var init_importer14 = __esm({
|
|
|
12358
12622
|
init_import_rewriter();
|
|
12359
12623
|
init_embedded_skill();
|
|
12360
12624
|
init_descriptor_import_runner();
|
|
12625
|
+
init_wrapped_command_hooks();
|
|
12361
12626
|
init_mcp_import2();
|
|
12362
12627
|
init_constants13();
|
|
12363
12628
|
init_factory_droid2();
|
|
@@ -12420,7 +12685,6 @@ var init_factory_droid2 = __esm({
|
|
|
12420
12685
|
init_linter14();
|
|
12421
12686
|
init_lint13();
|
|
12422
12687
|
init_import_map_builders();
|
|
12423
|
-
init_command_skill();
|
|
12424
12688
|
target14 = {
|
|
12425
12689
|
name: FACTORY_DROID_TARGET,
|
|
12426
12690
|
primaryRootInstructionPath: FACTORY_DROID_ROOT_FILE,
|
|
@@ -12436,7 +12700,7 @@ var init_factory_droid2 = __esm({
|
|
|
12436
12700
|
rootInstructionPath: FACTORY_DROID_ROOT_FILE,
|
|
12437
12701
|
skillDir: FACTORY_DROID_SKILLS_DIR,
|
|
12438
12702
|
managedOutputs: {
|
|
12439
|
-
dirs: [FACTORY_DROID_SKILLS_DIR, FACTORY_DROID_DROIDS_DIR],
|
|
12703
|
+
dirs: [FACTORY_DROID_SKILLS_DIR, FACTORY_DROID_COMMANDS_DIR, FACTORY_DROID_DROIDS_DIR],
|
|
12440
12704
|
files: [FACTORY_DROID_ROOT_FILE, FACTORY_DROID_HOOKS_FILE, FACTORY_DROID_MCP_FILE]
|
|
12441
12705
|
},
|
|
12442
12706
|
paths: {
|
|
@@ -12444,7 +12708,7 @@ var init_factory_droid2 = __esm({
|
|
|
12444
12708
|
return FACTORY_DROID_ROOT_FILE;
|
|
12445
12709
|
},
|
|
12446
12710
|
commandPath(name) {
|
|
12447
|
-
return `${
|
|
12711
|
+
return `${FACTORY_DROID_COMMANDS_DIR}/${name}.md`;
|
|
12448
12712
|
},
|
|
12449
12713
|
agentPath(name) {
|
|
12450
12714
|
return `${FACTORY_DROID_DROIDS_DIR}/${name}.md`;
|
|
@@ -12455,8 +12719,16 @@ var init_factory_droid2 = __esm({
|
|
|
12455
12719
|
rootInstructionPath: FACTORY_DROID_GLOBAL_ROOT_FILE,
|
|
12456
12720
|
skillDir: FACTORY_DROID_GLOBAL_SKILLS_DIR,
|
|
12457
12721
|
managedOutputs: {
|
|
12458
|
-
dirs: [
|
|
12459
|
-
|
|
12722
|
+
dirs: [
|
|
12723
|
+
FACTORY_DROID_GLOBAL_SKILLS_DIR,
|
|
12724
|
+
FACTORY_DROID_GLOBAL_COMMANDS_DIR,
|
|
12725
|
+
FACTORY_DROID_GLOBAL_DROIDS_DIR
|
|
12726
|
+
],
|
|
12727
|
+
files: [
|
|
12728
|
+
FACTORY_DROID_GLOBAL_ROOT_FILE,
|
|
12729
|
+
FACTORY_DROID_GLOBAL_HOOKS_FILE,
|
|
12730
|
+
FACTORY_DROID_GLOBAL_MCP_FILE
|
|
12731
|
+
]
|
|
12460
12732
|
},
|
|
12461
12733
|
rewriteGeneratedPath(path) {
|
|
12462
12734
|
if (path === FACTORY_DROID_ROOT_FILE) return FACTORY_DROID_GLOBAL_ROOT_FILE;
|
|
@@ -12474,7 +12746,7 @@ var init_factory_droid2 = __esm({
|
|
|
12474
12746
|
return FACTORY_DROID_GLOBAL_ROOT_FILE;
|
|
12475
12747
|
},
|
|
12476
12748
|
commandPath(name) {
|
|
12477
|
-
return `${
|
|
12749
|
+
return `${FACTORY_DROID_GLOBAL_COMMANDS_DIR}/${name}.md`;
|
|
12478
12750
|
},
|
|
12479
12751
|
agentPath(name) {
|
|
12480
12752
|
return `${FACTORY_DROID_GLOBAL_DROIDS_DIR}/${name}.md`;
|
|
@@ -12484,7 +12756,7 @@ var init_factory_droid2 = __esm({
|
|
|
12484
12756
|
capabilities6 = {
|
|
12485
12757
|
rules: "native",
|
|
12486
12758
|
additionalRules: "embedded",
|
|
12487
|
-
commands: "
|
|
12759
|
+
commands: "native",
|
|
12488
12760
|
agents: "native",
|
|
12489
12761
|
skills: "native",
|
|
12490
12762
|
mcp: "native",
|
|
@@ -12508,7 +12780,6 @@ var init_factory_droid2 = __esm({
|
|
|
12508
12780
|
permissions: lintPermissions6,
|
|
12509
12781
|
ignore: lintIgnore3
|
|
12510
12782
|
},
|
|
12511
|
-
supportsConversion: { commands: true },
|
|
12512
12783
|
project: project14,
|
|
12513
12784
|
globalSupport: {
|
|
12514
12785
|
capabilities: capabilities6,
|
|
@@ -12530,6 +12801,28 @@ var init_factory_droid2 = __esm({
|
|
|
12530
12801
|
canonicalDir: FACTORY_DROID_CANONICAL_RULES_DIR,
|
|
12531
12802
|
canonicalRootFilename: "_root.md",
|
|
12532
12803
|
markAsRoot: true
|
|
12804
|
+
},
|
|
12805
|
+
commands: {
|
|
12806
|
+
feature: "commands",
|
|
12807
|
+
mode: "directory",
|
|
12808
|
+
source: {
|
|
12809
|
+
project: [FACTORY_DROID_COMMANDS_DIR],
|
|
12810
|
+
global: [FACTORY_DROID_GLOBAL_COMMANDS_DIR]
|
|
12811
|
+
},
|
|
12812
|
+
canonicalDir: FACTORY_DROID_CANONICAL_COMMANDS_DIR,
|
|
12813
|
+
extensions: [".md"],
|
|
12814
|
+
preset: "command"
|
|
12815
|
+
},
|
|
12816
|
+
agents: {
|
|
12817
|
+
feature: "agents",
|
|
12818
|
+
mode: "directory",
|
|
12819
|
+
source: {
|
|
12820
|
+
project: [FACTORY_DROID_DROIDS_DIR],
|
|
12821
|
+
global: [FACTORY_DROID_GLOBAL_DROIDS_DIR]
|
|
12822
|
+
},
|
|
12823
|
+
canonicalDir: FACTORY_DROID_CANONICAL_AGENTS_DIR,
|
|
12824
|
+
extensions: [".md"],
|
|
12825
|
+
preset: "agent"
|
|
12533
12826
|
}
|
|
12534
12827
|
},
|
|
12535
12828
|
buildImportPaths: buildFactoryDroidImportPaths,
|
|
@@ -12539,7 +12832,7 @@ var init_factory_droid2 = __esm({
|
|
|
12539
12832
|
});
|
|
12540
12833
|
|
|
12541
12834
|
// src/targets/gemini-cli/constants.ts
|
|
12542
|
-
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;
|
|
12835
|
+
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, GEMINI_GLOBAL_POLICIES_FILE;
|
|
12543
12836
|
var init_constants30 = __esm({
|
|
12544
12837
|
"src/targets/gemini-cli/constants.ts"() {
|
|
12545
12838
|
GEMINI_TARGET = "gemini-cli";
|
|
@@ -12569,6 +12862,7 @@ var init_constants30 = __esm({
|
|
|
12569
12862
|
GEMINI_GLOBAL_COMMANDS_DIR = ".gemini/commands";
|
|
12570
12863
|
GEMINI_GLOBAL_SKILLS_DIR = ".gemini/skills";
|
|
12571
12864
|
GEMINI_GLOBAL_AGENTS_DIR = ".gemini/agents";
|
|
12865
|
+
GEMINI_GLOBAL_POLICIES_FILE = ".gemini/policies/permissions.toml";
|
|
12572
12866
|
}
|
|
12573
12867
|
});
|
|
12574
12868
|
|
|
@@ -13462,7 +13756,7 @@ function lintCommands6(canonical) {
|
|
|
13462
13756
|
)
|
|
13463
13757
|
);
|
|
13464
13758
|
}
|
|
13465
|
-
function
|
|
13759
|
+
function lintHooks7(canonical) {
|
|
13466
13760
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
13467
13761
|
const supported = ["PreToolUse", "PostToolUse", "Notification"];
|
|
13468
13762
|
const supportedSet = new Set(supported);
|
|
@@ -13572,7 +13866,12 @@ var init_gemini_cli2 = __esm({
|
|
|
13572
13866
|
skillDir: GEMINI_GLOBAL_SKILLS_DIR,
|
|
13573
13867
|
managedOutputs: {
|
|
13574
13868
|
dirs: [GEMINI_GLOBAL_COMMANDS_DIR, GEMINI_GLOBAL_SKILLS_DIR, GEMINI_GLOBAL_AGENTS_DIR],
|
|
13575
|
-
files: [
|
|
13869
|
+
files: [
|
|
13870
|
+
GEMINI_GLOBAL_ROOT,
|
|
13871
|
+
GEMINI_GLOBAL_COMPAT_AGENTS,
|
|
13872
|
+
GEMINI_GLOBAL_SETTINGS,
|
|
13873
|
+
GEMINI_GLOBAL_POLICIES_FILE
|
|
13874
|
+
]
|
|
13576
13875
|
},
|
|
13577
13876
|
rewriteGeneratedPath(path) {
|
|
13578
13877
|
if (path === GEMINI_ROOT) {
|
|
@@ -13593,7 +13892,7 @@ var init_gemini_cli2 = __esm({
|
|
|
13593
13892
|
if (path.startsWith(`${GEMINI_AGENTS_DIR}/`)) {
|
|
13594
13893
|
return path.replace(`${GEMINI_AGENTS_DIR}/`, `${GEMINI_GLOBAL_AGENTS_DIR}/`);
|
|
13595
13894
|
}
|
|
13596
|
-
if (path
|
|
13895
|
+
if (path === ".geminiignore") {
|
|
13597
13896
|
return null;
|
|
13598
13897
|
}
|
|
13599
13898
|
return path;
|
|
@@ -13628,7 +13927,7 @@ var init_gemini_cli2 = __esm({
|
|
|
13628
13927
|
mcp: "native",
|
|
13629
13928
|
hooks: "partial",
|
|
13630
13929
|
ignore: "none",
|
|
13631
|
-
permissions: "
|
|
13930
|
+
permissions: "native"
|
|
13632
13931
|
};
|
|
13633
13932
|
descriptor15 = {
|
|
13634
13933
|
id: "gemini-cli",
|
|
@@ -13654,7 +13953,7 @@ var init_gemini_cli2 = __esm({
|
|
|
13654
13953
|
lintRules: lintRules15,
|
|
13655
13954
|
lint: {
|
|
13656
13955
|
commands: lintCommands6,
|
|
13657
|
-
hooks:
|
|
13956
|
+
hooks: lintHooks7
|
|
13658
13957
|
},
|
|
13659
13958
|
emitScopedSettings: emitScopedGeminiSettings,
|
|
13660
13959
|
mergeGeneratedOutputContent(existing, pending, newContent, resolvedPath) {
|
|
@@ -13729,6 +14028,9 @@ function generateIgnore8(canonical) {
|
|
|
13729
14028
|
if (canonical.ignore.length === 0) return [];
|
|
13730
14029
|
return [{ path: GOOSE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
13731
14030
|
}
|
|
14031
|
+
function generateHooks10(canonical) {
|
|
14032
|
+
return buildWrappedCommandHooks(canonical, GOOSE_HOOKS_FILE);
|
|
14033
|
+
}
|
|
13732
14034
|
function mcpServerToExtension(name, server) {
|
|
13733
14035
|
const base = {
|
|
13734
14036
|
bundled: null,
|
|
@@ -13762,11 +14064,52 @@ var init_generator19 = __esm({
|
|
|
13762
14064
|
init_managed_blocks();
|
|
13763
14065
|
init_projected_agent_skill();
|
|
13764
14066
|
init_command_skill();
|
|
14067
|
+
init_wrapped_command_hooks();
|
|
13765
14068
|
init_constants14();
|
|
13766
14069
|
}
|
|
13767
14070
|
});
|
|
13768
|
-
|
|
13769
|
-
|
|
14071
|
+
function parseYamlObject(content) {
|
|
14072
|
+
if (content === null) return {};
|
|
14073
|
+
try {
|
|
14074
|
+
const parsed = parse(content);
|
|
14075
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
14076
|
+
return parsed;
|
|
14077
|
+
}
|
|
14078
|
+
} catch {
|
|
14079
|
+
}
|
|
14080
|
+
return {};
|
|
14081
|
+
}
|
|
14082
|
+
function serializeGoosePermissions(permissions, existingContent) {
|
|
14083
|
+
const allow = permissions?.allow ?? [];
|
|
14084
|
+
const ask = permissions?.ask ?? [];
|
|
14085
|
+
const deny = permissions?.deny ?? [];
|
|
14086
|
+
if (allow.length === 0 && ask.length === 0 && deny.length === 0) return null;
|
|
14087
|
+
const user = {};
|
|
14088
|
+
if (allow.length > 0) user.always_allow = allow;
|
|
14089
|
+
if (ask.length > 0) user.ask_before = ask;
|
|
14090
|
+
if (deny.length > 0) user.never_allow = deny;
|
|
14091
|
+
const root = parseYamlObject(existingContent);
|
|
14092
|
+
root.user = user;
|
|
14093
|
+
return stringify(root).trimEnd() + "\n";
|
|
14094
|
+
}
|
|
14095
|
+
function parseGoosePermissions(content) {
|
|
14096
|
+
const root = parseYamlObject(content);
|
|
14097
|
+
const user = root.user;
|
|
14098
|
+
if (!user || typeof user !== "object" || Array.isArray(user)) return null;
|
|
14099
|
+
const block = user;
|
|
14100
|
+
const allow = toStringArray5(block.always_allow);
|
|
14101
|
+
const ask = toStringArray5(block.ask_before);
|
|
14102
|
+
const deny = toStringArray5(block.never_allow);
|
|
14103
|
+
if (allow.length === 0 && ask.length === 0 && deny.length === 0) return null;
|
|
14104
|
+
const permissions = { allow, deny };
|
|
14105
|
+
if (ask.length > 0) permissions.ask = ask;
|
|
14106
|
+
return permissions;
|
|
14107
|
+
}
|
|
14108
|
+
var init_permissions3 = __esm({
|
|
14109
|
+
"src/targets/goose/permissions.ts"() {
|
|
14110
|
+
init_shared_import_helpers();
|
|
14111
|
+
}
|
|
14112
|
+
});
|
|
13770
14113
|
async function importFromGoose(projectRoot, options = {}) {
|
|
13771
14114
|
const scope = options.scope ?? "project";
|
|
13772
14115
|
const results = [];
|
|
@@ -13774,14 +14117,41 @@ async function importFromGoose(projectRoot, options = {}) {
|
|
|
13774
14117
|
results.push(...await runDescriptorImport(descriptor16, projectRoot, scope, { normalize }));
|
|
13775
14118
|
const skillsDir = scope === "global" ? GOOSE_GLOBAL_SKILLS_DIR : GOOSE_SKILLS_DIR;
|
|
13776
14119
|
await importEmbeddedSkills(projectRoot, skillsDir, GOOSE_TARGET, results, normalize);
|
|
14120
|
+
await importWrappedCommandHooks({
|
|
14121
|
+
projectRoot,
|
|
14122
|
+
hooksFile: GOOSE_HOOKS_FILE,
|
|
14123
|
+
canonicalHooksPath: GOOSE_CANONICAL_HOOKS,
|
|
14124
|
+
targetName: GOOSE_TARGET,
|
|
14125
|
+
results
|
|
14126
|
+
});
|
|
14127
|
+
if (scope === "global") await importPermissions2(projectRoot, results);
|
|
13777
14128
|
return results;
|
|
13778
14129
|
}
|
|
14130
|
+
async function importPermissions2(projectRoot, results) {
|
|
14131
|
+
const srcPath = join(projectRoot, GOOSE_GLOBAL_PERMISSIONS);
|
|
14132
|
+
const content = await readFileSafe(srcPath);
|
|
14133
|
+
if (content === null) return;
|
|
14134
|
+
const permissions = parseGoosePermissions(content);
|
|
14135
|
+
if (!permissions) return;
|
|
14136
|
+
const destPath = join(projectRoot, GOOSE_CANONICAL_PERMISSIONS);
|
|
14137
|
+
await mkdirp(dirname(destPath));
|
|
14138
|
+
await writeFileAtomic(destPath, stringify(permissions).trimEnd() + "\n");
|
|
14139
|
+
results.push({
|
|
14140
|
+
fromTool: GOOSE_TARGET,
|
|
14141
|
+
fromPath: srcPath,
|
|
14142
|
+
toPath: GOOSE_CANONICAL_PERMISSIONS,
|
|
14143
|
+
feature: "permissions"
|
|
14144
|
+
});
|
|
14145
|
+
}
|
|
13779
14146
|
var init_importer16 = __esm({
|
|
13780
14147
|
"src/targets/goose/importer.ts"() {
|
|
13781
14148
|
init_import_rewriter();
|
|
14149
|
+
init_fs();
|
|
13782
14150
|
init_embedded_skill();
|
|
13783
14151
|
init_descriptor_import_runner();
|
|
14152
|
+
init_wrapped_command_hooks();
|
|
13784
14153
|
init_constants14();
|
|
14154
|
+
init_permissions3();
|
|
13785
14155
|
init_goose2();
|
|
13786
14156
|
}
|
|
13787
14157
|
});
|
|
@@ -13907,6 +14277,34 @@ var init_importer_spec3 = __esm({
|
|
|
13907
14277
|
};
|
|
13908
14278
|
}
|
|
13909
14279
|
});
|
|
14280
|
+
function computeStatus5(existing, content) {
|
|
14281
|
+
if (existing === null) return "created";
|
|
14282
|
+
if (existing !== content) return "updated";
|
|
14283
|
+
return "unchanged";
|
|
14284
|
+
}
|
|
14285
|
+
var generateGooseScopeExtras;
|
|
14286
|
+
var init_scope_extras3 = __esm({
|
|
14287
|
+
"src/targets/goose/scope-extras.ts"() {
|
|
14288
|
+
init_fs();
|
|
14289
|
+
init_constants14();
|
|
14290
|
+
init_permissions3();
|
|
14291
|
+
generateGooseScopeExtras = async (canonical, projectRoot, scope, enabledFeatures) => {
|
|
14292
|
+
if (scope !== "global" || !enabledFeatures.has("permissions")) return [];
|
|
14293
|
+
const existing = await readFileSafe(join(projectRoot, GOOSE_GLOBAL_PERMISSIONS));
|
|
14294
|
+
const content = serializeGoosePermissions(canonical.permissions, existing);
|
|
14295
|
+
if (!content) return [];
|
|
14296
|
+
return [
|
|
14297
|
+
{
|
|
14298
|
+
target: "goose",
|
|
14299
|
+
path: GOOSE_GLOBAL_PERMISSIONS,
|
|
14300
|
+
content,
|
|
14301
|
+
currentContent: existing ?? void 0,
|
|
14302
|
+
status: computeStatus5(existing, content)
|
|
14303
|
+
}
|
|
14304
|
+
];
|
|
14305
|
+
};
|
|
14306
|
+
}
|
|
14307
|
+
});
|
|
13910
14308
|
|
|
13911
14309
|
// src/targets/goose/linter.ts
|
|
13912
14310
|
function lintRules16(canonical, projectRoot, projectFiles, options) {
|
|
@@ -13925,21 +14323,9 @@ var init_linter16 = __esm({
|
|
|
13925
14323
|
});
|
|
13926
14324
|
|
|
13927
14325
|
// src/targets/goose/lint.ts
|
|
13928
|
-
function
|
|
13929
|
-
|
|
13930
|
-
|
|
13931
|
-
(entries) => Array.isArray(entries) && entries.length > 0
|
|
13932
|
-
);
|
|
13933
|
-
if (!hasEntries) return [];
|
|
13934
|
-
return [
|
|
13935
|
-
createWarning(
|
|
13936
|
-
".agentsmesh/hooks.yaml",
|
|
13937
|
-
"goose",
|
|
13938
|
-
"Goose has no lifecycle hook system; canonical hooks are not projected."
|
|
13939
|
-
)
|
|
13940
|
-
];
|
|
13941
|
-
}
|
|
13942
|
-
function lintPermissions7(canonical) {
|
|
14326
|
+
function lintPermissions7(canonical, options) {
|
|
14327
|
+
const scope = options?.scope;
|
|
14328
|
+
if (scope === "global") return [];
|
|
13943
14329
|
if (!canonical.permissions) return [];
|
|
13944
14330
|
const { allow, deny } = canonical.permissions;
|
|
13945
14331
|
const ask = canonical.permissions.ask ?? [];
|
|
@@ -13948,7 +14334,7 @@ function lintPermissions7(canonical) {
|
|
|
13948
14334
|
createWarning(
|
|
13949
14335
|
".agentsmesh/permissions.yaml",
|
|
13950
14336
|
"goose",
|
|
13951
|
-
"Goose permissions
|
|
14337
|
+
"Goose applies tool permissions only at global scope (~/.config/goose/permission.yaml); project-scope permissions are not projected."
|
|
13952
14338
|
)
|
|
13953
14339
|
];
|
|
13954
14340
|
}
|
|
@@ -13978,6 +14364,7 @@ var init_goose2 = __esm({
|
|
|
13978
14364
|
init_skill_mirror();
|
|
13979
14365
|
init_importer16();
|
|
13980
14366
|
init_importer_spec3();
|
|
14367
|
+
init_scope_extras3();
|
|
13981
14368
|
init_linter16();
|
|
13982
14369
|
init_lint15();
|
|
13983
14370
|
init_import_map_builders();
|
|
@@ -13991,6 +14378,7 @@ var init_goose2 = __esm({
|
|
|
13991
14378
|
generateSkills: generateSkills15,
|
|
13992
14379
|
generateIgnore: generateIgnore8,
|
|
13993
14380
|
generateMcp: generateMcp12,
|
|
14381
|
+
generateHooks: generateHooks10,
|
|
13994
14382
|
importFrom: importFromGoose
|
|
13995
14383
|
};
|
|
13996
14384
|
project16 = {
|
|
@@ -13998,7 +14386,7 @@ var init_goose2 = __esm({
|
|
|
13998
14386
|
skillDir: GOOSE_SKILLS_DIR,
|
|
13999
14387
|
managedOutputs: {
|
|
14000
14388
|
dirs: [GOOSE_SKILLS_DIR],
|
|
14001
|
-
files: [GOOSE_ROOT_FILE, GOOSE_IGNORE]
|
|
14389
|
+
files: [GOOSE_ROOT_FILE, GOOSE_IGNORE, GOOSE_HOOKS_FILE]
|
|
14002
14390
|
},
|
|
14003
14391
|
paths: {
|
|
14004
14392
|
rulePath(_slug) {
|
|
@@ -14017,7 +14405,13 @@ var init_goose2 = __esm({
|
|
|
14017
14405
|
skillDir: GOOSE_GLOBAL_SKILLS_DIR,
|
|
14018
14406
|
managedOutputs: {
|
|
14019
14407
|
dirs: [GOOSE_GLOBAL_SKILLS_DIR],
|
|
14020
|
-
files: [
|
|
14408
|
+
files: [
|
|
14409
|
+
GOOSE_GLOBAL_ROOT_FILE,
|
|
14410
|
+
GOOSE_GLOBAL_IGNORE,
|
|
14411
|
+
GOOSE_GLOBAL_CONFIG,
|
|
14412
|
+
GOOSE_HOOKS_FILE,
|
|
14413
|
+
GOOSE_GLOBAL_PERMISSIONS
|
|
14414
|
+
]
|
|
14021
14415
|
},
|
|
14022
14416
|
rewriteGeneratedPath(path) {
|
|
14023
14417
|
if (path === GOOSE_ROOT_FILE) return GOOSE_GLOBAL_ROOT_FILE;
|
|
@@ -14046,7 +14440,7 @@ var init_goose2 = __esm({
|
|
|
14046
14440
|
agents: "none",
|
|
14047
14441
|
skills: "native",
|
|
14048
14442
|
mcp: "none",
|
|
14049
|
-
hooks: "
|
|
14443
|
+
hooks: "native",
|
|
14050
14444
|
ignore: "native",
|
|
14051
14445
|
permissions: "none"
|
|
14052
14446
|
};
|
|
@@ -14057,9 +14451,9 @@ var init_goose2 = __esm({
|
|
|
14057
14451
|
agents: "none",
|
|
14058
14452
|
skills: "native",
|
|
14059
14453
|
mcp: "native",
|
|
14060
|
-
hooks: "
|
|
14454
|
+
hooks: "native",
|
|
14061
14455
|
ignore: "native",
|
|
14062
|
-
permissions: "
|
|
14456
|
+
permissions: "native"
|
|
14063
14457
|
};
|
|
14064
14458
|
descriptor16 = {
|
|
14065
14459
|
id: GOOSE_TARGET,
|
|
@@ -14074,7 +14468,6 @@ var init_goose2 = __esm({
|
|
|
14074
14468
|
emptyImportMessage: "No Goose config found (.goosehints, .agents/skills, or .gooseignore).",
|
|
14075
14469
|
lintRules: lintRules16,
|
|
14076
14470
|
lint: {
|
|
14077
|
-
hooks: lintHooks7,
|
|
14078
14471
|
permissions: lintPermissions7,
|
|
14079
14472
|
mcp: lintMcp4
|
|
14080
14473
|
},
|
|
@@ -14088,7 +14481,8 @@ var init_goose2 = __esm({
|
|
|
14088
14481
|
GOOSE_GLOBAL_SKILLS_DIR,
|
|
14089
14482
|
GOOSE_GLOBAL_CONFIG
|
|
14090
14483
|
],
|
|
14091
|
-
layout: globalLayout16
|
|
14484
|
+
layout: globalLayout16,
|
|
14485
|
+
scopeExtras: generateGooseScopeExtras
|
|
14092
14486
|
},
|
|
14093
14487
|
importer: gooseImporter,
|
|
14094
14488
|
sharedArtifacts: {
|
|
@@ -15390,7 +15784,7 @@ function serializeCanonicalHooks(hooks) {
|
|
|
15390
15784
|
return stringify(hooks).trimEnd();
|
|
15391
15785
|
}
|
|
15392
15786
|
var CANONICAL_TO_KIRO, KIRO_TO_CANONICAL;
|
|
15393
|
-
var
|
|
15787
|
+
var init_hook_format2 = __esm({
|
|
15394
15788
|
"src/targets/kiro/hook-format.ts"() {
|
|
15395
15789
|
CANONICAL_TO_KIRO = {
|
|
15396
15790
|
UserPromptSubmit: "promptSubmit",
|
|
@@ -15456,7 +15850,7 @@ function generateMcp15(canonical) {
|
|
|
15456
15850
|
}
|
|
15457
15851
|
];
|
|
15458
15852
|
}
|
|
15459
|
-
function
|
|
15853
|
+
function generateHooks11(canonical) {
|
|
15460
15854
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
15461
15855
|
return generateKiroHooks(canonical.hooks).map((hook) => ({
|
|
15462
15856
|
path: `${KIRO_HOOKS_DIR}/${hook.name}`,
|
|
@@ -15487,7 +15881,7 @@ var init_generator23 = __esm({
|
|
|
15487
15881
|
init_embedded_skill();
|
|
15488
15882
|
init_command_skill();
|
|
15489
15883
|
init_markdown();
|
|
15490
|
-
|
|
15884
|
+
init_hook_format2();
|
|
15491
15885
|
init_constants18();
|
|
15492
15886
|
}
|
|
15493
15887
|
});
|
|
@@ -15592,7 +15986,7 @@ var init_importer20 = __esm({
|
|
|
15592
15986
|
init_shared_import_helpers();
|
|
15593
15987
|
init_fs();
|
|
15594
15988
|
init_markdown();
|
|
15595
|
-
|
|
15989
|
+
init_hook_format2();
|
|
15596
15990
|
init_constants18();
|
|
15597
15991
|
init_kiro2();
|
|
15598
15992
|
}
|
|
@@ -15649,7 +16043,7 @@ var init_kiro2 = __esm({
|
|
|
15649
16043
|
generateAgents: generateAgents19,
|
|
15650
16044
|
generateSkills: generateSkills18,
|
|
15651
16045
|
generateMcp: generateMcp15,
|
|
15652
|
-
generateHooks:
|
|
16046
|
+
generateHooks: generateHooks11,
|
|
15653
16047
|
generateIgnore: generateIgnore11,
|
|
15654
16048
|
importFrom: importFromKiro
|
|
15655
16049
|
};
|
|
@@ -15968,7 +16362,7 @@ async function importMcp4(projectRoot, scope, results) {
|
|
|
15968
16362
|
toPath: OPENCODE_CANONICAL_MCP
|
|
15969
16363
|
});
|
|
15970
16364
|
}
|
|
15971
|
-
async function
|
|
16365
|
+
async function importPermissions3(projectRoot, scope, results) {
|
|
15972
16366
|
const configFile = scope === "global" ? OPENCODE_GLOBAL_CONFIG_FILE : OPENCODE_CONFIG_FILE;
|
|
15973
16367
|
const srcPath = join(projectRoot, configFile);
|
|
15974
16368
|
const content = await readFileSafe(srcPath);
|
|
@@ -16006,7 +16400,7 @@ async function importFromOpenCode(projectRoot, options = {}) {
|
|
|
16006
16400
|
results.push(...await runDescriptorImport(descriptor21, projectRoot, scope, { normalize }));
|
|
16007
16401
|
await importEmbeddedSkills(projectRoot, OPENCODE_SKILLS_DIR, OPENCODE_TARGET, results, normalize);
|
|
16008
16402
|
await importMcp4(projectRoot, scope, results);
|
|
16009
|
-
await
|
|
16403
|
+
await importPermissions3(projectRoot, scope, results);
|
|
16010
16404
|
return results;
|
|
16011
16405
|
}
|
|
16012
16406
|
var init_importer21 = __esm({
|
|
@@ -16354,10 +16748,14 @@ function generateSkills20(canonical) {
|
|
|
16354
16748
|
return generateEmbeddedSkills(canonical, PI_AGENT_SKILLS_DIR);
|
|
16355
16749
|
}
|
|
16356
16750
|
function generateCommands20(canonical) {
|
|
16357
|
-
return canonical.commands.map((command) =>
|
|
16358
|
-
|
|
16359
|
-
|
|
16360
|
-
|
|
16751
|
+
return canonical.commands.map((command) => {
|
|
16752
|
+
const frontmatter = {};
|
|
16753
|
+
if (command.description) frontmatter.description = command.description;
|
|
16754
|
+
return {
|
|
16755
|
+
path: `${PI_AGENT_COMMANDS_DIR}/${command.name}.md`,
|
|
16756
|
+
content: serializeFrontmatter(frontmatter, command.body.trim() || "")
|
|
16757
|
+
};
|
|
16758
|
+
});
|
|
16361
16759
|
}
|
|
16362
16760
|
function generateAgents21(canonical) {
|
|
16363
16761
|
return canonical.agents.map((agent) => ({
|
|
@@ -16369,8 +16767,8 @@ var init_generator25 = __esm({
|
|
|
16369
16767
|
"src/targets/pi-agent/generator.ts"() {
|
|
16370
16768
|
init_embedded_skill();
|
|
16371
16769
|
init_managed_blocks();
|
|
16770
|
+
init_markdown();
|
|
16372
16771
|
init_projected_agent_skill();
|
|
16373
|
-
init_command_skill();
|
|
16374
16772
|
init_constants20();
|
|
16375
16773
|
}
|
|
16376
16774
|
});
|
|
@@ -16469,7 +16867,6 @@ var init_lint21 = __esm({
|
|
|
16469
16867
|
var target22, project22, globalLayout21, capabilities11, descriptor22;
|
|
16470
16868
|
var init_pi_agent2 = __esm({
|
|
16471
16869
|
"src/targets/pi-agent/index.ts"() {
|
|
16472
|
-
init_command_skill();
|
|
16473
16870
|
init_projected_agent_skill();
|
|
16474
16871
|
init_generator25();
|
|
16475
16872
|
init_skill_mirror();
|
|
@@ -16491,7 +16888,7 @@ var init_pi_agent2 = __esm({
|
|
|
16491
16888
|
rootInstructionPath: PI_AGENT_ROOT_FILE,
|
|
16492
16889
|
skillDir: PI_AGENT_SKILLS_DIR,
|
|
16493
16890
|
managedOutputs: {
|
|
16494
|
-
dirs: [PI_AGENT_SKILLS_DIR],
|
|
16891
|
+
dirs: [PI_AGENT_SKILLS_DIR, PI_AGENT_COMMANDS_DIR],
|
|
16495
16892
|
files: [PI_AGENT_ROOT_FILE]
|
|
16496
16893
|
},
|
|
16497
16894
|
paths: {
|
|
@@ -16499,7 +16896,7 @@ var init_pi_agent2 = __esm({
|
|
|
16499
16896
|
return PI_AGENT_ROOT_FILE;
|
|
16500
16897
|
},
|
|
16501
16898
|
commandPath(name) {
|
|
16502
|
-
return `${
|
|
16899
|
+
return `${PI_AGENT_COMMANDS_DIR}/${name}.md`;
|
|
16503
16900
|
},
|
|
16504
16901
|
agentPath(name) {
|
|
16505
16902
|
return `${PI_AGENT_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
@@ -16510,11 +16907,14 @@ var init_pi_agent2 = __esm({
|
|
|
16510
16907
|
rootInstructionPath: PI_AGENT_GLOBAL_ROOT_FILE,
|
|
16511
16908
|
skillDir: PI_AGENT_GLOBAL_SKILLS_DIR,
|
|
16512
16909
|
managedOutputs: {
|
|
16513
|
-
dirs: [PI_AGENT_GLOBAL_SKILLS_DIR],
|
|
16910
|
+
dirs: [PI_AGENT_GLOBAL_SKILLS_DIR, PI_AGENT_GLOBAL_COMMANDS_DIR],
|
|
16514
16911
|
files: [PI_AGENT_GLOBAL_ROOT_FILE]
|
|
16515
16912
|
},
|
|
16516
16913
|
rewriteGeneratedPath(path) {
|
|
16517
16914
|
if (path === PI_AGENT_ROOT_FILE) return PI_AGENT_GLOBAL_ROOT_FILE;
|
|
16915
|
+
if (path.startsWith(`${PI_AGENT_COMMANDS_DIR}/`)) {
|
|
16916
|
+
return path.replace(`${PI_AGENT_COMMANDS_DIR}/`, `${PI_AGENT_GLOBAL_COMMANDS_DIR}/`);
|
|
16917
|
+
}
|
|
16518
16918
|
if (path.startsWith(`${PI_AGENT_SKILLS_DIR}/`)) {
|
|
16519
16919
|
return path.replace(`${PI_AGENT_SKILLS_DIR}/`, `${PI_AGENT_GLOBAL_SKILLS_DIR}/`);
|
|
16520
16920
|
}
|
|
@@ -16528,7 +16928,7 @@ var init_pi_agent2 = __esm({
|
|
|
16528
16928
|
return PI_AGENT_GLOBAL_ROOT_FILE;
|
|
16529
16929
|
},
|
|
16530
16930
|
commandPath(name) {
|
|
16531
|
-
return `${
|
|
16931
|
+
return `${PI_AGENT_GLOBAL_COMMANDS_DIR}/${name}.md`;
|
|
16532
16932
|
},
|
|
16533
16933
|
agentPath(name) {
|
|
16534
16934
|
return `${PI_AGENT_GLOBAL_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
@@ -16538,7 +16938,7 @@ var init_pi_agent2 = __esm({
|
|
|
16538
16938
|
capabilities11 = {
|
|
16539
16939
|
rules: "native",
|
|
16540
16940
|
additionalRules: "embedded",
|
|
16541
|
-
commands: "
|
|
16941
|
+
commands: "native",
|
|
16542
16942
|
agents: "none",
|
|
16543
16943
|
skills: "native",
|
|
16544
16944
|
mcp: "none",
|
|
@@ -16551,7 +16951,7 @@ var init_pi_agent2 = __esm({
|
|
|
16551
16951
|
metadata: {
|
|
16552
16952
|
displayName: "Pi Agent",
|
|
16553
16953
|
category: "cli",
|
|
16554
|
-
officialUrl: "https://github.com/
|
|
16954
|
+
officialUrl: "https://github.com/earendil-works/pi",
|
|
16555
16955
|
shortDescription: "Pi coding agent"
|
|
16556
16956
|
},
|
|
16557
16957
|
generators: target22,
|
|
@@ -16564,7 +16964,7 @@ var init_pi_agent2 = __esm({
|
|
|
16564
16964
|
ignore: lintIgnore6,
|
|
16565
16965
|
mcp: lintMcp7
|
|
16566
16966
|
},
|
|
16567
|
-
supportsConversion: {
|
|
16967
|
+
supportsConversion: { agents: true },
|
|
16568
16968
|
project: project22,
|
|
16569
16969
|
globalSupport: {
|
|
16570
16970
|
capabilities: capabilities11,
|
|
@@ -16582,6 +16982,17 @@ var init_pi_agent2 = __esm({
|
|
|
16582
16982
|
canonicalDir: PI_AGENT_CANONICAL_RULES_DIR,
|
|
16583
16983
|
canonicalRootFilename: "_root.md",
|
|
16584
16984
|
markAsRoot: true
|
|
16985
|
+
},
|
|
16986
|
+
commands: {
|
|
16987
|
+
feature: "commands",
|
|
16988
|
+
mode: "directory",
|
|
16989
|
+
source: {
|
|
16990
|
+
project: [PI_AGENT_COMMANDS_DIR],
|
|
16991
|
+
global: [PI_AGENT_GLOBAL_COMMANDS_DIR]
|
|
16992
|
+
},
|
|
16993
|
+
canonicalDir: PI_AGENT_CANONICAL_COMMANDS_DIR,
|
|
16994
|
+
extensions: [".md"],
|
|
16995
|
+
preset: "command"
|
|
16585
16996
|
}
|
|
16586
16997
|
},
|
|
16587
16998
|
sharedArtifacts: {
|
|
@@ -16671,7 +17082,7 @@ function generateIgnore12(canonical) {
|
|
|
16671
17082
|
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
16672
17083
|
return [{ path: QWEN_IGNORE, content: canonical.ignore.join("\n") }];
|
|
16673
17084
|
}
|
|
16674
|
-
function
|
|
17085
|
+
function generateHooks12(canonical) {
|
|
16675
17086
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
16676
17087
|
const hooks = buildClaudeHooksObjectFromCanonical(canonical);
|
|
16677
17088
|
if (Object.keys(hooks).length === 0) return [];
|
|
@@ -16845,7 +17256,7 @@ var init_qwen_code2 = __esm({
|
|
|
16845
17256
|
generateSkills: generateSkills21,
|
|
16846
17257
|
generateMcp: generateMcp17,
|
|
16847
17258
|
generateIgnore: generateIgnore12,
|
|
16848
|
-
generateHooks:
|
|
17259
|
+
generateHooks: generateHooks12,
|
|
16849
17260
|
generatePermissions: generatePermissions8,
|
|
16850
17261
|
importFrom: importFromQwenCode
|
|
16851
17262
|
};
|
|
@@ -17316,6 +17727,43 @@ var init_import_mappers9 = __esm({
|
|
|
17316
17727
|
};
|
|
17317
17728
|
}
|
|
17318
17729
|
});
|
|
17730
|
+
async function importRooModes(projectRoot, results, normalize) {
|
|
17731
|
+
const srcPath = join(projectRoot, ROO_CODE_MODES_FILE);
|
|
17732
|
+
const content = await readFileSafe(srcPath);
|
|
17733
|
+
if (content === null) return;
|
|
17734
|
+
let parsed;
|
|
17735
|
+
try {
|
|
17736
|
+
parsed = parse(content);
|
|
17737
|
+
} catch {
|
|
17738
|
+
return;
|
|
17739
|
+
}
|
|
17740
|
+
const modes = parsed?.customModes;
|
|
17741
|
+
if (!Array.isArray(modes)) return;
|
|
17742
|
+
const destDir = join(projectRoot, ROO_CODE_CANONICAL_AGENTS_DIR);
|
|
17743
|
+
for (const mode of modes) {
|
|
17744
|
+
if (!mode || typeof mode !== "object") continue;
|
|
17745
|
+
const m = mode;
|
|
17746
|
+
const slug = typeof m.slug === "string" && m.slug ? m.slug : typeof m.name === "string" && m.name ? m.name : null;
|
|
17747
|
+
if (!slug) continue;
|
|
17748
|
+
const name = typeof m.name === "string" ? m.name : slug;
|
|
17749
|
+
const description = typeof m.description === "string" ? m.description : "";
|
|
17750
|
+
const body = typeof m.roleDefinition === "string" ? m.roleDefinition : "";
|
|
17751
|
+
const destPath = join(destDir, `${slug}.md`);
|
|
17752
|
+
const fileContent = await serializeImportedAgentWithFallback(
|
|
17753
|
+
destPath,
|
|
17754
|
+
{ name, description, tools: [] },
|
|
17755
|
+
normalize(body, srcPath, destPath)
|
|
17756
|
+
);
|
|
17757
|
+
await mkdirp(dirname(destPath));
|
|
17758
|
+
await writeFileAtomic(destPath, fileContent);
|
|
17759
|
+
results.push({
|
|
17760
|
+
fromTool: ROO_CODE_TARGET,
|
|
17761
|
+
fromPath: srcPath,
|
|
17762
|
+
toPath: `${ROO_CODE_CANONICAL_AGENTS_DIR}/${slug}.md`,
|
|
17763
|
+
feature: "agents"
|
|
17764
|
+
});
|
|
17765
|
+
}
|
|
17766
|
+
}
|
|
17319
17767
|
async function importPerModeRules(projectRoot, results, normalize) {
|
|
17320
17768
|
const rooDir = join(projectRoot, ROO_CODE_DIR);
|
|
17321
17769
|
let entries;
|
|
@@ -17355,15 +17803,18 @@ async function importFromRooCode(projectRoot, options = {}) {
|
|
|
17355
17803
|
const normalize = await createImportReferenceNormalizer(ROO_CODE_TARGET, projectRoot, scope);
|
|
17356
17804
|
results.push(...await runDescriptorImport(descriptor25, projectRoot, scope, { normalize }));
|
|
17357
17805
|
await importPerModeRules(projectRoot, results, normalize);
|
|
17806
|
+
if (scope === "project") await importRooModes(projectRoot, results, normalize);
|
|
17358
17807
|
await importEmbeddedSkills(projectRoot, ROO_CODE_SKILLS_DIR, ROO_CODE_TARGET, results, normalize);
|
|
17359
17808
|
return results;
|
|
17360
17809
|
}
|
|
17361
17810
|
var init_importer25 = __esm({
|
|
17362
17811
|
"src/targets/roo-code/importer.ts"() {
|
|
17363
17812
|
init_import_rewriter();
|
|
17813
|
+
init_fs();
|
|
17364
17814
|
init_embedded_skill();
|
|
17365
17815
|
init_import_orchestrator();
|
|
17366
17816
|
init_descriptor_import_runner();
|
|
17817
|
+
init_import_metadata();
|
|
17367
17818
|
init_import_mappers9();
|
|
17368
17819
|
init_constants23();
|
|
17369
17820
|
init_roo_code2();
|
|
@@ -17405,7 +17856,7 @@ var init_lint23 = __esm({
|
|
|
17405
17856
|
init_helpers();
|
|
17406
17857
|
}
|
|
17407
17858
|
});
|
|
17408
|
-
function
|
|
17859
|
+
function computeStatus6(existing, content) {
|
|
17409
17860
|
if (existing === null) return "created";
|
|
17410
17861
|
if (existing !== content) return "updated";
|
|
17411
17862
|
return "unchanged";
|
|
@@ -17471,7 +17922,7 @@ var init_roo_code2 = __esm({
|
|
|
17471
17922
|
path: ROO_CODE_GLOBAL_MODES_FILE,
|
|
17472
17923
|
content,
|
|
17473
17924
|
currentContent: existing ?? void 0,
|
|
17474
|
-
status:
|
|
17925
|
+
status: computeStatus6(existing, content)
|
|
17475
17926
|
}
|
|
17476
17927
|
];
|
|
17477
17928
|
};
|
|
@@ -17555,7 +18006,7 @@ var init_roo_code2 = __esm({
|
|
|
17555
18006
|
rules: "native",
|
|
17556
18007
|
additionalRules: "native",
|
|
17557
18008
|
commands: "native",
|
|
17558
|
-
agents: "
|
|
18009
|
+
agents: "native",
|
|
17559
18010
|
skills: "native",
|
|
17560
18011
|
mcp: "native",
|
|
17561
18012
|
hooks: "none",
|
|
@@ -18698,7 +19149,7 @@ function toWindsurfHooks(hooks) {
|
|
|
18698
19149
|
}
|
|
18699
19150
|
return result;
|
|
18700
19151
|
}
|
|
18701
|
-
function
|
|
19152
|
+
function generateHooks13(canonical) {
|
|
18702
19153
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
18703
19154
|
const hooks = toWindsurfHooks(canonical.hooks);
|
|
18704
19155
|
if (Object.keys(hooks).length === 0) return [];
|
|
@@ -19162,7 +19613,7 @@ var init_windsurf2 = __esm({
|
|
|
19162
19613
|
generateAgents: generateAgents27,
|
|
19163
19614
|
generateSkills: generateSkills27,
|
|
19164
19615
|
generateMcp: generateMcp22,
|
|
19165
|
-
generateHooks:
|
|
19616
|
+
generateHooks: generateHooks13,
|
|
19166
19617
|
generateIgnore: generateIgnore15,
|
|
19167
19618
|
importFrom: importFromWindsurf
|
|
19168
19619
|
};
|