agentsmesh 0.25.0 → 0.27.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 +49 -0
- package/README.md +113 -466
- package/dist/canonical.js +692 -241
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +253 -248
- package/dist/engine.js +695 -244
- package/dist/engine.js.map +1 -1
- package/dist/index.js +695 -244
- package/dist/index.js.map +1 -1
- package/dist/targets.js +692 -241
- package/dist/targets.js.map +1 -1
- package/package.json +3 -2
package/dist/canonical.js
CHANGED
|
@@ -497,16 +497,21 @@ function canUseScopedSettings(feature) {
|
|
|
497
497
|
return settingsBackedFeatures.includes(feature);
|
|
498
498
|
}
|
|
499
499
|
function validateCapabilityImplementations(descriptor31, capabilities17, ctx, pathPrefix) {
|
|
500
|
+
const isGlobalScope = pathPrefix[0] === "globalSupport";
|
|
501
|
+
const hasScopeExtras = isGlobalScope && typeof descriptor31.globalSupport?.scopeExtras === "function";
|
|
500
502
|
for (const requirement of generatorRequirements) {
|
|
501
503
|
const level = capabilityLevel(capabilities17[requirement.feature]);
|
|
502
504
|
if (level === "none") continue;
|
|
505
|
+
const settingsBacked = canUseScopedSettings(requirement.feature);
|
|
503
506
|
const hasGenerator = typeof descriptor31.generators[requirement.generator] === "function";
|
|
504
|
-
const hasSettingsEmitter =
|
|
505
|
-
|
|
507
|
+
const hasSettingsEmitter = settingsBacked && typeof descriptor31.emitScopedSettings === "function";
|
|
508
|
+
const hasScopeExtrasEmitter = settingsBacked && hasScopeExtras;
|
|
509
|
+
if (hasGenerator || hasSettingsEmitter || hasScopeExtrasEmitter) continue;
|
|
510
|
+
const settingsHint = settingsBacked ? isGlobalScope ? " or emitScopedSettings or globalSupport.scopeExtras" : " or emitScopedSettings" : "";
|
|
506
511
|
ctx.addIssue({
|
|
507
512
|
code: "custom",
|
|
508
513
|
path: [...pathPrefix, requirement.feature],
|
|
509
|
-
message: `Capability "${requirement.feature}" is "${level}" but generators.${requirement.generator}
|
|
514
|
+
message: `Capability "${requirement.feature}" is "${level}" but generators.${requirement.generator}${settingsHint} is missing.`
|
|
510
515
|
});
|
|
511
516
|
}
|
|
512
517
|
}
|
|
@@ -1426,13 +1431,14 @@ var init_embedded_skill = __esm({
|
|
|
1426
1431
|
});
|
|
1427
1432
|
|
|
1428
1433
|
// src/targets/aider/constants.ts
|
|
1429
|
-
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;
|
|
1434
|
+
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;
|
|
1430
1435
|
var init_constants = __esm({
|
|
1431
1436
|
"src/targets/aider/constants.ts"() {
|
|
1432
1437
|
AIDER_TARGET = "aider";
|
|
1433
1438
|
AIDER_CONVENTIONS = "CONVENTIONS.md";
|
|
1434
1439
|
AIDER_SKILLS_DIR = ".aider/skills";
|
|
1435
1440
|
AIDER_IGNORE = ".aiderignore";
|
|
1441
|
+
AIDER_CONF_FILE = ".aider.conf.yml";
|
|
1436
1442
|
AIDER_GLOBAL_CONVENTIONS = "CONVENTIONS.md";
|
|
1437
1443
|
AIDER_GLOBAL_SKILLS_DIR = ".aider/skills";
|
|
1438
1444
|
AIDER_GLOBAL_IGNORE = ".aiderignore";
|
|
@@ -1440,8 +1446,6 @@ var init_constants = __esm({
|
|
|
1440
1446
|
AIDER_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
1441
1447
|
}
|
|
1442
1448
|
});
|
|
1443
|
-
|
|
1444
|
-
// src/targets/aider/generator.ts
|
|
1445
1449
|
function generateRules(canonical) {
|
|
1446
1450
|
const root = canonical.rules.find((rule) => rule.root);
|
|
1447
1451
|
const nonRootRules = canonical.rules.filter((rule) => {
|
|
@@ -1451,7 +1455,10 @@ function generateRules(canonical) {
|
|
|
1451
1455
|
const rootBody = root?.body.trim() ?? "";
|
|
1452
1456
|
const content = appendEmbeddedRulesBlock(rootBody, nonRootRules);
|
|
1453
1457
|
if (!content) return [];
|
|
1454
|
-
return [
|
|
1458
|
+
return [
|
|
1459
|
+
{ path: AIDER_CONVENTIONS, content },
|
|
1460
|
+
{ path: AIDER_CONF_FILE, content: stringify({ read: [AIDER_CONVENTIONS] }) }
|
|
1461
|
+
];
|
|
1455
1462
|
}
|
|
1456
1463
|
function generateSkills(canonical) {
|
|
1457
1464
|
return generateEmbeddedSkills(canonical, AIDER_SKILLS_DIR);
|
|
@@ -3246,7 +3253,7 @@ var init_antigravity = __esm({
|
|
|
3246
3253
|
});
|
|
3247
3254
|
|
|
3248
3255
|
// src/targets/augment-code/constants.ts
|
|
3249
|
-
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;
|
|
3256
|
+
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;
|
|
3250
3257
|
var init_constants6 = __esm({
|
|
3251
3258
|
"src/targets/augment-code/constants.ts"() {
|
|
3252
3259
|
AUGMENT_CODE_TARGET = "augment-code";
|
|
@@ -3268,6 +3275,7 @@ var init_constants6 = __esm({
|
|
|
3268
3275
|
AUGMENT_CODE_CANONICAL_MCP = ".agentsmesh/mcp.json";
|
|
3269
3276
|
AUGMENT_CODE_CANONICAL_HOOKS = ".agentsmesh/hooks.yaml";
|
|
3270
3277
|
AUGMENT_CODE_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
3278
|
+
AUGMENT_CODE_CANONICAL_PERMISSIONS = ".agentsmesh/permissions.yaml";
|
|
3271
3279
|
}
|
|
3272
3280
|
});
|
|
3273
3281
|
|
|
@@ -3480,7 +3488,7 @@ var init_codex_cli = __esm({
|
|
|
3480
3488
|
});
|
|
3481
3489
|
|
|
3482
3490
|
// src/targets/continue/constants.ts
|
|
3483
|
-
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;
|
|
3491
|
+
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;
|
|
3484
3492
|
var init_constants9 = __esm({
|
|
3485
3493
|
"src/targets/continue/constants.ts"() {
|
|
3486
3494
|
CONTINUE_TARGET = "continue";
|
|
@@ -3493,9 +3501,11 @@ var init_constants9 = __esm({
|
|
|
3493
3501
|
CONTINUE_SKILLS_DIR = ".continue/skills";
|
|
3494
3502
|
CONTINUE_GLOBAL_AGENTS_MD = ".continue/AGENTS.md";
|
|
3495
3503
|
CONTINUE_GLOBAL_CONFIG = ".continue/config.yaml";
|
|
3504
|
+
CONTINUE_GLOBAL_PERMISSIONS = ".continue/permissions.yaml";
|
|
3496
3505
|
CONTINUE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
3497
3506
|
CONTINUE_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
3498
3507
|
CONTINUE_CANONICAL_MCP = ".agentsmesh/mcp.json";
|
|
3508
|
+
CONTINUE_CANONICAL_PERMISSIONS = ".agentsmesh/permissions.yaml";
|
|
3499
3509
|
}
|
|
3500
3510
|
});
|
|
3501
3511
|
async function buildContinueImportPaths(refs, projectRoot, scope = "project") {
|
|
@@ -3712,21 +3722,26 @@ var init_deepagents_cli = __esm({
|
|
|
3712
3722
|
});
|
|
3713
3723
|
|
|
3714
3724
|
// src/targets/factory-droid/constants.ts
|
|
3715
|
-
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;
|
|
3725
|
+
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;
|
|
3716
3726
|
var init_constants13 = __esm({
|
|
3717
3727
|
"src/targets/factory-droid/constants.ts"() {
|
|
3718
3728
|
FACTORY_DROID_TARGET = "factory-droid";
|
|
3719
3729
|
FACTORY_DROID_ROOT_FILE = "AGENTS.md";
|
|
3720
3730
|
FACTORY_DROID_SKILLS_DIR = ".factory/skills";
|
|
3731
|
+
FACTORY_DROID_COMMANDS_DIR = ".factory/commands";
|
|
3721
3732
|
FACTORY_DROID_DROIDS_DIR = ".factory/droids";
|
|
3722
3733
|
FACTORY_DROID_MCP_FILE = ".factory/mcp.json";
|
|
3723
3734
|
FACTORY_DROID_GLOBAL_ROOT_FILE = ".factory/AGENTS.md";
|
|
3724
3735
|
FACTORY_DROID_GLOBAL_SKILLS_DIR = ".factory/skills";
|
|
3736
|
+
FACTORY_DROID_GLOBAL_COMMANDS_DIR = ".factory/commands";
|
|
3725
3737
|
FACTORY_DROID_GLOBAL_DROIDS_DIR = ".factory/droids";
|
|
3726
3738
|
FACTORY_DROID_GLOBAL_MCP_FILE = ".factory/mcp.json";
|
|
3727
3739
|
FACTORY_DROID_HOOKS_FILE = ".factory/hooks.json";
|
|
3728
3740
|
FACTORY_DROID_GLOBAL_HOOKS_FILE = ".factory/hooks.json";
|
|
3729
3741
|
FACTORY_DROID_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
3742
|
+
FACTORY_DROID_CANONICAL_AGENTS_DIR = ".agentsmesh/agents";
|
|
3743
|
+
FACTORY_DROID_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
3744
|
+
FACTORY_DROID_CANONICAL_HOOKS = ".agentsmesh/hooks.yaml";
|
|
3730
3745
|
}
|
|
3731
3746
|
});
|
|
3732
3747
|
|
|
@@ -3734,6 +3749,9 @@ var init_constants13 = __esm({
|
|
|
3734
3749
|
async function buildFactoryDroidImportPaths(refs, projectRoot, scope = "project") {
|
|
3735
3750
|
if (scope === "global") {
|
|
3736
3751
|
refs.set(FACTORY_DROID_GLOBAL_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
3752
|
+
for (const absPath of await listFiles(projectRoot, FACTORY_DROID_GLOBAL_COMMANDS_DIR)) {
|
|
3753
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3754
|
+
}
|
|
3737
3755
|
for (const absPath of await listFiles(projectRoot, FACTORY_DROID_GLOBAL_DROIDS_DIR)) {
|
|
3738
3756
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3739
3757
|
}
|
|
@@ -3744,6 +3762,9 @@ async function buildFactoryDroidImportPaths(refs, projectRoot, scope = "project"
|
|
|
3744
3762
|
return;
|
|
3745
3763
|
}
|
|
3746
3764
|
refs.set(FACTORY_DROID_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
3765
|
+
for (const absPath of await listFiles(projectRoot, FACTORY_DROID_COMMANDS_DIR)) {
|
|
3766
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
3767
|
+
}
|
|
3747
3768
|
for (const absPath of await listFiles(projectRoot, FACTORY_DROID_DROIDS_DIR)) {
|
|
3748
3769
|
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_AGENTS3, ".md");
|
|
3749
3770
|
}
|
|
@@ -3790,7 +3811,7 @@ var init_gemini_cli = __esm({
|
|
|
3790
3811
|
});
|
|
3791
3812
|
|
|
3792
3813
|
// src/targets/goose/constants.ts
|
|
3793
|
-
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;
|
|
3814
|
+
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;
|
|
3794
3815
|
var init_constants14 = __esm({
|
|
3795
3816
|
"src/targets/goose/constants.ts"() {
|
|
3796
3817
|
GOOSE_TARGET = "goose";
|
|
@@ -3802,8 +3823,12 @@ var init_constants14 = __esm({
|
|
|
3802
3823
|
GOOSE_GLOBAL_IGNORE = `${GOOSE_GLOBAL_DIR}/.gooseignore`;
|
|
3803
3824
|
GOOSE_GLOBAL_CONFIG = `${GOOSE_GLOBAL_DIR}/config.yaml`;
|
|
3804
3825
|
GOOSE_GLOBAL_SKILLS_DIR = ".agents/skills";
|
|
3826
|
+
GOOSE_GLOBAL_PERMISSIONS = `${GOOSE_GLOBAL_DIR}/permission.yaml`;
|
|
3827
|
+
GOOSE_HOOKS_FILE = ".agents/plugins/agentsmesh/hooks/hooks.json";
|
|
3805
3828
|
GOOSE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
3806
3829
|
GOOSE_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
3830
|
+
GOOSE_CANONICAL_HOOKS = ".agentsmesh/hooks.yaml";
|
|
3831
|
+
GOOSE_CANONICAL_PERMISSIONS = ".agentsmesh/permissions.yaml";
|
|
3807
3832
|
}
|
|
3808
3833
|
});
|
|
3809
3834
|
|
|
@@ -4144,16 +4169,19 @@ var init_opencode = __esm({
|
|
|
4144
4169
|
});
|
|
4145
4170
|
|
|
4146
4171
|
// src/targets/pi-agent/constants.ts
|
|
4147
|
-
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;
|
|
4172
|
+
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;
|
|
4148
4173
|
var init_constants20 = __esm({
|
|
4149
4174
|
"src/targets/pi-agent/constants.ts"() {
|
|
4150
4175
|
PI_AGENT_TARGET = "pi-agent";
|
|
4151
4176
|
PI_AGENT_ROOT_FILE = "AGENTS.md";
|
|
4152
4177
|
PI_AGENT_SKILLS_DIR = ".pi/skills";
|
|
4178
|
+
PI_AGENT_COMMANDS_DIR = ".pi/prompts";
|
|
4153
4179
|
PI_AGENT_GLOBAL_DIR = ".pi/agent";
|
|
4154
4180
|
PI_AGENT_GLOBAL_ROOT_FILE = `${PI_AGENT_GLOBAL_DIR}/AGENTS.md`;
|
|
4155
4181
|
PI_AGENT_GLOBAL_SKILLS_DIR = `${PI_AGENT_GLOBAL_DIR}/skills`;
|
|
4182
|
+
PI_AGENT_GLOBAL_COMMANDS_DIR = `${PI_AGENT_GLOBAL_DIR}/prompts`;
|
|
4156
4183
|
PI_AGENT_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
4184
|
+
PI_AGENT_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
4157
4185
|
}
|
|
4158
4186
|
});
|
|
4159
4187
|
|
|
@@ -4161,12 +4189,18 @@ var init_constants20 = __esm({
|
|
|
4161
4189
|
async function buildPiAgentImportPaths(refs, projectRoot, scope = "project") {
|
|
4162
4190
|
if (scope === "global") {
|
|
4163
4191
|
refs.set(PI_AGENT_GLOBAL_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
4192
|
+
for (const absPath of await listFiles(projectRoot, PI_AGENT_GLOBAL_COMMANDS_DIR)) {
|
|
4193
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
4194
|
+
}
|
|
4164
4195
|
for (const absPath of await listFiles(projectRoot, PI_AGENT_GLOBAL_SKILLS_DIR)) {
|
|
4165
4196
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), PI_AGENT_GLOBAL_SKILLS_DIR);
|
|
4166
4197
|
}
|
|
4167
4198
|
return;
|
|
4168
4199
|
}
|
|
4169
4200
|
refs.set(PI_AGENT_ROOT_FILE, `${AB_RULES2}/_root.md`);
|
|
4201
|
+
for (const absPath of await listFiles(projectRoot, PI_AGENT_COMMANDS_DIR)) {
|
|
4202
|
+
addSimpleFileMapping(refs, rel(projectRoot, absPath), AB_COMMANDS3, ".md");
|
|
4203
|
+
}
|
|
4170
4204
|
for (const absPath of await listFiles(projectRoot, PI_AGENT_SKILLS_DIR)) {
|
|
4171
4205
|
addSkillLikeMapping(refs, rel(projectRoot, absPath), PI_AGENT_SKILLS_DIR);
|
|
4172
4206
|
}
|
|
@@ -4272,7 +4306,7 @@ var init_replit_agent = __esm({
|
|
|
4272
4306
|
});
|
|
4273
4307
|
|
|
4274
4308
|
// src/targets/roo-code/constants.ts
|
|
4275
|
-
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;
|
|
4309
|
+
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;
|
|
4276
4310
|
var init_constants23 = __esm({
|
|
4277
4311
|
"src/targets/roo-code/constants.ts"() {
|
|
4278
4312
|
ROO_CODE_TARGET = "roo-code";
|
|
@@ -4295,6 +4329,7 @@ var init_constants23 = __esm({
|
|
|
4295
4329
|
ROO_CODE_GLOBAL_AGENTS_MD = `${ROO_CODE_GLOBAL_DIR}/AGENTS.md`;
|
|
4296
4330
|
ROO_CODE_GLOBAL_AGENTS_SKILLS_DIR = ".agents/skills";
|
|
4297
4331
|
ROO_CODE_CANONICAL_RULES_DIR = ".agentsmesh/rules";
|
|
4332
|
+
ROO_CODE_CANONICAL_AGENTS_DIR = ".agentsmesh/agents";
|
|
4298
4333
|
ROO_CODE_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
|
|
4299
4334
|
ROO_CODE_CANONICAL_MCP = ".agentsmesh/mcp.json";
|
|
4300
4335
|
ROO_CODE_CANONICAL_IGNORE = ".agentsmesh/ignore";
|
|
@@ -4584,8 +4619,26 @@ var init_import_map_builders = __esm({
|
|
|
4584
4619
|
init_import_maps();
|
|
4585
4620
|
}
|
|
4586
4621
|
});
|
|
4587
|
-
|
|
4588
|
-
|
|
4622
|
+
function mergeAiderConf(existing, newContent) {
|
|
4623
|
+
if (existing === null) return newContent;
|
|
4624
|
+
let parsed;
|
|
4625
|
+
try {
|
|
4626
|
+
parsed = parse(existing);
|
|
4627
|
+
} catch {
|
|
4628
|
+
return newContent;
|
|
4629
|
+
}
|
|
4630
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return newContent;
|
|
4631
|
+
const base = parsed;
|
|
4632
|
+
const reads = /* @__PURE__ */ new Set();
|
|
4633
|
+
const existingRead = base.read;
|
|
4634
|
+
if (typeof existingRead === "string") reads.add(existingRead);
|
|
4635
|
+
else if (Array.isArray(existingRead)) {
|
|
4636
|
+
for (const entry of existingRead) if (typeof entry === "string") reads.add(entry);
|
|
4637
|
+
}
|
|
4638
|
+
reads.add(AIDER_CONVENTIONS);
|
|
4639
|
+
base.read = [...reads];
|
|
4640
|
+
return stringify(base);
|
|
4641
|
+
}
|
|
4589
4642
|
var target, project, globalLayout, capabilities, descriptor;
|
|
4590
4643
|
var init_aider2 = __esm({
|
|
4591
4644
|
"src/targets/aider/index.ts"() {
|
|
@@ -4612,7 +4665,7 @@ var init_aider2 = __esm({
|
|
|
4612
4665
|
skillDir: AIDER_SKILLS_DIR,
|
|
4613
4666
|
managedOutputs: {
|
|
4614
4667
|
dirs: [AIDER_SKILLS_DIR],
|
|
4615
|
-
files: [AIDER_CONVENTIONS, AIDER_IGNORE]
|
|
4668
|
+
files: [AIDER_CONVENTIONS, AIDER_CONF_FILE, AIDER_IGNORE]
|
|
4616
4669
|
},
|
|
4617
4670
|
paths: {
|
|
4618
4671
|
rulePath(_slug) {
|
|
@@ -4636,6 +4689,7 @@ var init_aider2 = __esm({
|
|
|
4636
4689
|
rewriteGeneratedPath(path) {
|
|
4637
4690
|
if (path === AIDER_CONVENTIONS) return AIDER_GLOBAL_CONVENTIONS;
|
|
4638
4691
|
if (path === AIDER_IGNORE) return AIDER_GLOBAL_IGNORE;
|
|
4692
|
+
if (path === AIDER_CONF_FILE) return null;
|
|
4639
4693
|
if (path.startsWith(`${AIDER_SKILLS_DIR}/`)) {
|
|
4640
4694
|
return path.replace(`${AIDER_SKILLS_DIR}/`, `${AIDER_GLOBAL_SKILLS_DIR}/`);
|
|
4641
4695
|
}
|
|
@@ -4711,6 +4765,10 @@ var init_aider2 = __esm({
|
|
|
4711
4765
|
canonicalFilename: AIDER_CANONICAL_IGNORE
|
|
4712
4766
|
}
|
|
4713
4767
|
},
|
|
4768
|
+
mergeGeneratedOutputContent(existing, _pending, newContent, resolvedPath) {
|
|
4769
|
+
if (resolvedPath === AIDER_CONF_FILE) return mergeAiderConf(existing, newContent);
|
|
4770
|
+
return null;
|
|
4771
|
+
},
|
|
4714
4772
|
buildImportPaths: buildAiderImportPaths,
|
|
4715
4773
|
detectionPaths: [AIDER_CONVENTIONS, AIDER_IGNORE]
|
|
4716
4774
|
};
|
|
@@ -4735,7 +4793,7 @@ function generateAgents2(canonical) {
|
|
|
4735
4793
|
{
|
|
4736
4794
|
name: agent.name,
|
|
4737
4795
|
...agent.description ? { description: agent.description } : {},
|
|
4738
|
-
|
|
4796
|
+
prompt: agent.body.trim(),
|
|
4739
4797
|
...agent.tools.length > 0 ? { allowedTools: agent.tools } : {}
|
|
4740
4798
|
},
|
|
4741
4799
|
null,
|
|
@@ -4834,7 +4892,7 @@ async function amazonQAgentMapper(ctx) {
|
|
|
4834
4892
|
const name = typeof raw.name === "string" ? raw.name : agentName;
|
|
4835
4893
|
const description = typeof raw.description === "string" ? raw.description : "";
|
|
4836
4894
|
const tools = Array.isArray(raw.allowedTools) ? raw.allowedTools.filter((t) => typeof t === "string") : [];
|
|
4837
|
-
const body = typeof raw.systemPrompt === "string" ? raw.systemPrompt : "";
|
|
4895
|
+
const body = typeof raw.prompt === "string" ? raw.prompt : typeof raw.systemPrompt === "string" ? raw.systemPrompt : "";
|
|
4838
4896
|
const content = await serializeImportedAgentWithFallback(
|
|
4839
4897
|
destPath,
|
|
4840
4898
|
{ name, description, tools },
|
|
@@ -4894,7 +4952,7 @@ var init_capabilities2 = __esm({
|
|
|
4894
4952
|
"src/targets/amazon-q/capabilities.ts"() {
|
|
4895
4953
|
projectCapabilities = {
|
|
4896
4954
|
rules: "native",
|
|
4897
|
-
additionalRules: "
|
|
4955
|
+
additionalRules: "native",
|
|
4898
4956
|
commands: "none",
|
|
4899
4957
|
agents: "native",
|
|
4900
4958
|
skills: "none",
|
|
@@ -5831,16 +5889,13 @@ var init_antigravity2 = __esm({
|
|
|
5831
5889
|
});
|
|
5832
5890
|
function ruleFrontmatter(rule) {
|
|
5833
5891
|
const fm = {};
|
|
5834
|
-
if (rule.description) {
|
|
5835
|
-
fm.description = rule.description;
|
|
5836
|
-
}
|
|
5837
5892
|
if (rule.globs.length > 0 || rule.trigger === "manual" || rule.trigger === "model_decision") {
|
|
5838
|
-
fm.
|
|
5839
|
-
if (rule.
|
|
5840
|
-
|
|
5841
|
-
}
|
|
5893
|
+
fm.type = "agent_requested";
|
|
5894
|
+
if (rule.description) fm.description = rule.description;
|
|
5895
|
+
if (rule.globs.length > 0) fm.globs = rule.globs;
|
|
5842
5896
|
} else {
|
|
5843
|
-
fm.
|
|
5897
|
+
fm.type = "always_apply";
|
|
5898
|
+
if (rule.description) fm.description = rule.description;
|
|
5844
5899
|
}
|
|
5845
5900
|
return fm;
|
|
5846
5901
|
}
|
|
@@ -5856,7 +5911,7 @@ function generateRules5(canonical) {
|
|
|
5856
5911
|
for (const rule of canonical.rules) {
|
|
5857
5912
|
if (rule.targets.length > 0 && !rule.targets.includes(AUGMENT_CODE_TARGET)) continue;
|
|
5858
5913
|
if (rule.root) {
|
|
5859
|
-
const fm = {
|
|
5914
|
+
const fm = { type: "always_apply" };
|
|
5860
5915
|
if (rule.description) fm.description = rule.description;
|
|
5861
5916
|
outputs.push({
|
|
5862
5917
|
path: `${AUGMENT_CODE_RULES_DIR}/_root.md`,
|
|
@@ -5908,6 +5963,27 @@ var init_generator5 = __esm({
|
|
|
5908
5963
|
init_constants6();
|
|
5909
5964
|
}
|
|
5910
5965
|
});
|
|
5966
|
+
function parseToolPermissions(raw) {
|
|
5967
|
+
if (!Array.isArray(raw)) return null;
|
|
5968
|
+
const allow = [];
|
|
5969
|
+
const deny = [];
|
|
5970
|
+
const ask = [];
|
|
5971
|
+
for (const entry of raw) {
|
|
5972
|
+
if (!entry || typeof entry !== "object") continue;
|
|
5973
|
+
const e = entry;
|
|
5974
|
+
const toolName = typeof e.toolName === "string" ? e.toolName : void 0;
|
|
5975
|
+
const permission = e.permission;
|
|
5976
|
+
if (!toolName || !permission || typeof permission !== "object") continue;
|
|
5977
|
+
if (e.shellInputRegex !== void 0) continue;
|
|
5978
|
+
if (permission.type === "allow") allow.push(toolName);
|
|
5979
|
+
else if (permission.type === "deny") deny.push(toolName);
|
|
5980
|
+
else if (permission.type === "ask-user") ask.push(toolName);
|
|
5981
|
+
}
|
|
5982
|
+
if (allow.length === 0 && deny.length === 0 && ask.length === 0) return null;
|
|
5983
|
+
const permissions = { allow, deny };
|
|
5984
|
+
if (ask.length > 0) permissions.ask = ask;
|
|
5985
|
+
return permissions;
|
|
5986
|
+
}
|
|
5911
5987
|
function augmentHooksToCanonical(hooks) {
|
|
5912
5988
|
const result = {};
|
|
5913
5989
|
for (const [event, entries] of Object.entries(hooks)) {
|
|
@@ -5930,7 +6006,7 @@ function augmentHooksToCanonical(hooks) {
|
|
|
5930
6006
|
}
|
|
5931
6007
|
return result;
|
|
5932
6008
|
}
|
|
5933
|
-
async function importAugmentSettings(projectRoot, settingsPath, results) {
|
|
6009
|
+
async function importAugmentSettings(projectRoot, settingsPath, results, options = {}) {
|
|
5934
6010
|
const content = await readFileSafe(join(projectRoot, settingsPath));
|
|
5935
6011
|
if (content === null) return;
|
|
5936
6012
|
let settings;
|
|
@@ -5964,6 +6040,20 @@ async function importAugmentSettings(projectRoot, settingsPath, results) {
|
|
|
5964
6040
|
});
|
|
5965
6041
|
}
|
|
5966
6042
|
}
|
|
6043
|
+
if (options.includePermissions) {
|
|
6044
|
+
const permissions = parseToolPermissions(settings.toolPermissions);
|
|
6045
|
+
if (permissions) {
|
|
6046
|
+
const destPath = join(projectRoot, AUGMENT_CODE_CANONICAL_PERMISSIONS);
|
|
6047
|
+
await mkdirp(dirname(destPath));
|
|
6048
|
+
await writeFileAtomic(destPath, stringify(permissions));
|
|
6049
|
+
results.push({
|
|
6050
|
+
fromTool: AUGMENT_CODE_TARGET,
|
|
6051
|
+
fromPath: join(projectRoot, settingsPath),
|
|
6052
|
+
toPath: AUGMENT_CODE_CANONICAL_PERMISSIONS,
|
|
6053
|
+
feature: "permissions"
|
|
6054
|
+
});
|
|
6055
|
+
}
|
|
6056
|
+
}
|
|
5967
6057
|
}
|
|
5968
6058
|
async function importAugmentIgnore(projectRoot, ignorePath, results) {
|
|
5969
6059
|
const content = await readFileSafe(join(projectRoot, ignorePath));
|
|
@@ -5993,7 +6083,7 @@ function canonicalRuleMeta(frontmatter, isRoot) {
|
|
|
5993
6083
|
description: typeof frontmatter.description === "string" ? frontmatter.description : void 0,
|
|
5994
6084
|
globs: Array.isArray(frontmatter.globs) ? frontmatter.globs : []
|
|
5995
6085
|
};
|
|
5996
|
-
if (frontmatter.agent_requested === true) {
|
|
6086
|
+
if (frontmatter.type === "agent_requested" || frontmatter.agent_requested === true) {
|
|
5997
6087
|
meta.trigger = "model_decision";
|
|
5998
6088
|
}
|
|
5999
6089
|
return meta;
|
|
@@ -6088,7 +6178,9 @@ async function importFromAugmentCode(projectRoot, options = {}) {
|
|
|
6088
6178
|
const skillsDir = scope === "global" ? AUGMENT_CODE_GLOBAL_SKILLS_DIR : AUGMENT_CODE_SKILLS_DIR;
|
|
6089
6179
|
await importEmbeddedSkills(projectRoot, skillsDir, AUGMENT_CODE_TARGET, results, normalize);
|
|
6090
6180
|
const settingsFile = scope === "global" ? AUGMENT_CODE_GLOBAL_SETTINGS_FILE : AUGMENT_CODE_SETTINGS_FILE;
|
|
6091
|
-
await importAugmentSettings(projectRoot, settingsFile, results
|
|
6181
|
+
await importAugmentSettings(projectRoot, settingsFile, results, {
|
|
6182
|
+
includePermissions: scope === "global"
|
|
6183
|
+
});
|
|
6092
6184
|
if (scope === "project") {
|
|
6093
6185
|
await importAugmentIgnore(projectRoot, AUGMENT_CODE_IGNORE_FILE, results);
|
|
6094
6186
|
}
|
|
@@ -6146,12 +6238,12 @@ var init_lint5 = __esm({
|
|
|
6146
6238
|
}
|
|
6147
6239
|
});
|
|
6148
6240
|
|
|
6149
|
-
// src/targets/augment-code/
|
|
6241
|
+
// src/targets/augment-code/settings-build.ts
|
|
6150
6242
|
function serializeHooksForSettings(hooks) {
|
|
6151
6243
|
const result = {};
|
|
6152
6244
|
for (const [event, entries] of Object.entries(hooks)) {
|
|
6153
6245
|
if (!entries || entries.length === 0) continue;
|
|
6154
|
-
|
|
6246
|
+
result[event] = entries.map((entry) => ({
|
|
6155
6247
|
matcher: entry.matcher,
|
|
6156
6248
|
hooks: [
|
|
6157
6249
|
{
|
|
@@ -6161,10 +6253,38 @@ function serializeHooksForSettings(hooks) {
|
|
|
6161
6253
|
}
|
|
6162
6254
|
]
|
|
6163
6255
|
}));
|
|
6164
|
-
result[event] = serialized;
|
|
6165
6256
|
}
|
|
6166
6257
|
return result;
|
|
6167
6258
|
}
|
|
6259
|
+
function serializeToolPermissions(permissions) {
|
|
6260
|
+
if (!permissions) return void 0;
|
|
6261
|
+
const entries = [];
|
|
6262
|
+
for (const toolName of permissions.allow ?? []) {
|
|
6263
|
+
entries.push({ toolName, permission: { type: "allow" } });
|
|
6264
|
+
}
|
|
6265
|
+
for (const toolName of permissions.deny ?? []) {
|
|
6266
|
+
entries.push({ toolName, permission: { type: "deny" } });
|
|
6267
|
+
}
|
|
6268
|
+
for (const toolName of permissions.ask ?? []) {
|
|
6269
|
+
entries.push({ toolName, permission: { type: "ask-user" } });
|
|
6270
|
+
}
|
|
6271
|
+
return entries.length > 0 ? entries : void 0;
|
|
6272
|
+
}
|
|
6273
|
+
function buildSettingsContent(canonical, enabledFeatures, scope) {
|
|
6274
|
+
const settings = {};
|
|
6275
|
+
if (enabledFeatures.has("mcp") && canonical.mcp && Object.keys(canonical.mcp.mcpServers).length > 0) {
|
|
6276
|
+
settings.mcpServers = canonical.mcp.mcpServers;
|
|
6277
|
+
}
|
|
6278
|
+
if (enabledFeatures.has("hooks") && canonical.hooks && Object.keys(canonical.hooks).length > 0) {
|
|
6279
|
+
settings.hooks = serializeHooksForSettings(canonical.hooks);
|
|
6280
|
+
}
|
|
6281
|
+
if (scope === "global" && enabledFeatures.has("permissions")) {
|
|
6282
|
+
const toolPermissions = serializeToolPermissions(canonical.permissions);
|
|
6283
|
+
if (toolPermissions) settings.toolPermissions = toolPermissions;
|
|
6284
|
+
}
|
|
6285
|
+
if (Object.keys(settings).length === 0) return null;
|
|
6286
|
+
return JSON.stringify(settings, null, 2);
|
|
6287
|
+
}
|
|
6168
6288
|
function mergeAugmentSettings(existing, newContent) {
|
|
6169
6289
|
if (existing === null) return newContent;
|
|
6170
6290
|
let base;
|
|
@@ -6179,19 +6299,15 @@ function mergeAugmentSettings(existing, newContent) {
|
|
|
6179
6299
|
const overlay = incoming;
|
|
6180
6300
|
if (overlay.mcpServers !== void 0) base.mcpServers = overlay.mcpServers;
|
|
6181
6301
|
if (overlay.hooks !== void 0) base.hooks = overlay.hooks;
|
|
6302
|
+
if (overlay.toolPermissions !== void 0) base.toolPermissions = overlay.toolPermissions;
|
|
6182
6303
|
return JSON.stringify(base, null, 2);
|
|
6183
6304
|
}
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
if (enabledFeatures.has("mcp") && canonical.mcp && Object.keys(canonical.mcp.mcpServers).length > 0) {
|
|
6187
|
-
settings.mcpServers = canonical.mcp.mcpServers;
|
|
6305
|
+
var init_settings_build = __esm({
|
|
6306
|
+
"src/targets/augment-code/settings-build.ts"() {
|
|
6188
6307
|
}
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
if (Object.keys(settings).length === 0) return null;
|
|
6193
|
-
return JSON.stringify(settings, null, 2);
|
|
6194
|
-
}
|
|
6308
|
+
});
|
|
6309
|
+
|
|
6310
|
+
// src/targets/augment-code/index.ts
|
|
6195
6311
|
var target5, project5, globalLayout5, capabilities3, globalCapabilities3, descriptor5;
|
|
6196
6312
|
var init_augment_code2 = __esm({
|
|
6197
6313
|
"src/targets/augment-code/index.ts"() {
|
|
@@ -6200,6 +6316,7 @@ var init_augment_code2 = __esm({
|
|
|
6200
6316
|
init_linter5();
|
|
6201
6317
|
init_lint5();
|
|
6202
6318
|
init_import_map_builders();
|
|
6319
|
+
init_settings_build();
|
|
6203
6320
|
init_constants6();
|
|
6204
6321
|
target5 = {
|
|
6205
6322
|
name: AUGMENT_CODE_TARGET,
|
|
@@ -6213,7 +6330,12 @@ var init_augment_code2 = __esm({
|
|
|
6213
6330
|
project5 = {
|
|
6214
6331
|
skillDir: AUGMENT_CODE_SKILLS_DIR,
|
|
6215
6332
|
managedOutputs: {
|
|
6216
|
-
dirs: [
|
|
6333
|
+
dirs: [
|
|
6334
|
+
AUGMENT_CODE_RULES_DIR,
|
|
6335
|
+
AUGMENT_CODE_COMMANDS_DIR,
|
|
6336
|
+
AUGMENT_CODE_AGENTS_DIR,
|
|
6337
|
+
AUGMENT_CODE_SKILLS_DIR
|
|
6338
|
+
],
|
|
6217
6339
|
files: [AUGMENT_CODE_SETTINGS_FILE, AUGMENT_CODE_IGNORE_FILE]
|
|
6218
6340
|
},
|
|
6219
6341
|
paths: {
|
|
@@ -6289,7 +6411,7 @@ var init_augment_code2 = __esm({
|
|
|
6289
6411
|
mcp: "native",
|
|
6290
6412
|
hooks: "none",
|
|
6291
6413
|
ignore: "none",
|
|
6292
|
-
permissions: "
|
|
6414
|
+
permissions: "native"
|
|
6293
6415
|
};
|
|
6294
6416
|
descriptor5 = {
|
|
6295
6417
|
id: AUGMENT_CODE_TARGET,
|
|
@@ -6317,8 +6439,8 @@ var init_augment_code2 = __esm({
|
|
|
6317
6439
|
],
|
|
6318
6440
|
layout: globalLayout5
|
|
6319
6441
|
},
|
|
6320
|
-
emitScopedSettings(canonical,
|
|
6321
|
-
const content = buildSettingsContent(canonical, enabledFeatures);
|
|
6442
|
+
emitScopedSettings(canonical, scope, enabledFeatures) {
|
|
6443
|
+
const content = buildSettingsContent(canonical, enabledFeatures, scope);
|
|
6322
6444
|
if (content === null) return [];
|
|
6323
6445
|
return [{ path: AUGMENT_CODE_SETTINGS_FILE, content }];
|
|
6324
6446
|
},
|
|
@@ -8277,30 +8399,79 @@ var init_mcp = __esm({
|
|
|
8277
8399
|
init_constants28();
|
|
8278
8400
|
}
|
|
8279
8401
|
});
|
|
8280
|
-
|
|
8281
|
-
// src/targets/codex-cli/generator/hooks.ts
|
|
8282
|
-
function generateHooks4(canonical) {
|
|
8402
|
+
function buildWrappedCommandHooks(canonical, hooksFilePath) {
|
|
8283
8403
|
if (!canonical.hooks) return [];
|
|
8284
8404
|
const hooks = {};
|
|
8285
8405
|
for (const [event, entries] of Object.entries(canonical.hooks)) {
|
|
8286
8406
|
if (!Array.isArray(entries)) continue;
|
|
8287
8407
|
const mapped = entries.flatMap((entry) => {
|
|
8288
8408
|
if (!hasHookCommand(entry) || entry.type === "prompt") return [];
|
|
8289
|
-
const hook = {
|
|
8290
|
-
type: "command",
|
|
8291
|
-
command: getHookCommand(entry)
|
|
8292
|
-
};
|
|
8409
|
+
const hook = { type: "command", command: getHookCommand(entry) };
|
|
8293
8410
|
if (entry.timeout !== void 0) hook.timeout = entry.timeout;
|
|
8294
8411
|
return [{ matcher: entry.matcher, hooks: [hook] }];
|
|
8295
8412
|
});
|
|
8296
8413
|
if (mapped.length > 0) hooks[event] = mapped;
|
|
8297
8414
|
}
|
|
8298
8415
|
if (Object.keys(hooks).length === 0) return [];
|
|
8299
|
-
return [{ path:
|
|
8416
|
+
return [{ path: hooksFilePath, content: JSON.stringify({ hooks }, null, 2) }];
|
|
8417
|
+
}
|
|
8418
|
+
async function importWrappedCommandHooks(options) {
|
|
8419
|
+
const { projectRoot, hooksFile, canonicalHooksPath, targetName, results } = options;
|
|
8420
|
+
const srcPath = join(projectRoot, hooksFile);
|
|
8421
|
+
const content = await readFileSafe(srcPath);
|
|
8422
|
+
if (content === null) return;
|
|
8423
|
+
let parsed;
|
|
8424
|
+
try {
|
|
8425
|
+
parsed = JSON.parse(content);
|
|
8426
|
+
} catch {
|
|
8427
|
+
return;
|
|
8428
|
+
}
|
|
8429
|
+
if (!parsed || typeof parsed !== "object") return;
|
|
8430
|
+
const rawHooks = parsed.hooks;
|
|
8431
|
+
if (!rawHooks || typeof rawHooks !== "object" || Array.isArray(rawHooks)) return;
|
|
8432
|
+
const hooks = {};
|
|
8433
|
+
for (const [event, groups] of Object.entries(rawHooks)) {
|
|
8434
|
+
if (!Array.isArray(groups)) continue;
|
|
8435
|
+
for (const group of groups) {
|
|
8436
|
+
if (!group || typeof group !== "object") continue;
|
|
8437
|
+
const record = group;
|
|
8438
|
+
const matcher = typeof record.matcher === "string" ? record.matcher : "*";
|
|
8439
|
+
if (!Array.isArray(record.hooks)) continue;
|
|
8440
|
+
for (const raw of record.hooks) {
|
|
8441
|
+
if (!raw || typeof raw !== "object") continue;
|
|
8442
|
+
const hook = raw;
|
|
8443
|
+
if (hook.type !== "command" || typeof hook.command !== "string") continue;
|
|
8444
|
+
const imported = { matcher, command: hook.command, type: "command" };
|
|
8445
|
+
if (typeof hook.timeout === "number") imported.timeout = hook.timeout;
|
|
8446
|
+
(hooks[event] ??= []).push(imported);
|
|
8447
|
+
}
|
|
8448
|
+
}
|
|
8449
|
+
}
|
|
8450
|
+
if (Object.keys(hooks).length === 0) return;
|
|
8451
|
+
const destPath = join(projectRoot, canonicalHooksPath);
|
|
8452
|
+
await mkdirp(dirname(destPath));
|
|
8453
|
+
await writeFileAtomic(destPath, stringify(hooks));
|
|
8454
|
+
results.push({
|
|
8455
|
+
fromTool: targetName,
|
|
8456
|
+
fromPath: srcPath,
|
|
8457
|
+
toPath: canonicalHooksPath,
|
|
8458
|
+
feature: "hooks"
|
|
8459
|
+
});
|
|
8460
|
+
}
|
|
8461
|
+
var init_wrapped_command_hooks = __esm({
|
|
8462
|
+
"src/targets/import/wrapped-command-hooks.ts"() {
|
|
8463
|
+
init_hook_command();
|
|
8464
|
+
init_fs();
|
|
8465
|
+
}
|
|
8466
|
+
});
|
|
8467
|
+
|
|
8468
|
+
// src/targets/codex-cli/generator/hooks.ts
|
|
8469
|
+
function generateHooks4(canonical) {
|
|
8470
|
+
return buildWrappedCommandHooks(canonical, CODEX_HOOKS_FILE);
|
|
8300
8471
|
}
|
|
8301
8472
|
var init_hooks = __esm({
|
|
8302
8473
|
"src/targets/codex-cli/generator/hooks.ts"() {
|
|
8303
|
-
|
|
8474
|
+
init_wrapped_command_hooks();
|
|
8304
8475
|
init_constants28();
|
|
8305
8476
|
}
|
|
8306
8477
|
});
|
|
@@ -8691,51 +8862,20 @@ var init_importer_rules2 = __esm({
|
|
|
8691
8862
|
init_instruction_mirror();
|
|
8692
8863
|
}
|
|
8693
8864
|
});
|
|
8865
|
+
|
|
8866
|
+
// src/targets/codex-cli/importer-hooks.ts
|
|
8694
8867
|
async function importCodexHooks(projectRoot, results) {
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
} catch {
|
|
8702
|
-
return;
|
|
8703
|
-
}
|
|
8704
|
-
if (!parsed || typeof parsed !== "object") return;
|
|
8705
|
-
const rawHooks = parsed.hooks;
|
|
8706
|
-
if (!rawHooks || typeof rawHooks !== "object" || Array.isArray(rawHooks)) return;
|
|
8707
|
-
const hooks = {};
|
|
8708
|
-
for (const [event, groups] of Object.entries(rawHooks)) {
|
|
8709
|
-
if (!Array.isArray(groups)) continue;
|
|
8710
|
-
for (const group of groups) {
|
|
8711
|
-
if (!group || typeof group !== "object") continue;
|
|
8712
|
-
const record = group;
|
|
8713
|
-
const matcher = typeof record.matcher === "string" ? record.matcher : "*";
|
|
8714
|
-
if (!Array.isArray(record.hooks)) continue;
|
|
8715
|
-
for (const raw of record.hooks) {
|
|
8716
|
-
if (!raw || typeof raw !== "object") continue;
|
|
8717
|
-
const hook = raw;
|
|
8718
|
-
if (hook.type !== "command" || typeof hook.command !== "string") continue;
|
|
8719
|
-
const imported = { matcher, command: hook.command, type: "command" };
|
|
8720
|
-
if (typeof hook.timeout === "number") imported.timeout = hook.timeout;
|
|
8721
|
-
(hooks[event] ??= []).push(imported);
|
|
8722
|
-
}
|
|
8723
|
-
}
|
|
8724
|
-
}
|
|
8725
|
-
if (Object.keys(hooks).length === 0) return;
|
|
8726
|
-
const destPath = join(projectRoot, CODEX_CANONICAL_HOOKS);
|
|
8727
|
-
await mkdirp(dirname(destPath));
|
|
8728
|
-
await writeFileAtomic(destPath, stringify(hooks));
|
|
8729
|
-
results.push({
|
|
8730
|
-
fromTool: CODEX_TARGET,
|
|
8731
|
-
fromPath: srcPath,
|
|
8732
|
-
toPath: CODEX_CANONICAL_HOOKS,
|
|
8733
|
-
feature: "hooks"
|
|
8868
|
+
await importWrappedCommandHooks({
|
|
8869
|
+
projectRoot,
|
|
8870
|
+
hooksFile: CODEX_HOOKS_FILE,
|
|
8871
|
+
canonicalHooksPath: CODEX_CANONICAL_HOOKS,
|
|
8872
|
+
targetName: CODEX_TARGET,
|
|
8873
|
+
results
|
|
8734
8874
|
});
|
|
8735
8875
|
}
|
|
8736
8876
|
var init_importer_hooks = __esm({
|
|
8737
8877
|
"src/targets/codex-cli/importer-hooks.ts"() {
|
|
8738
|
-
|
|
8878
|
+
init_wrapped_command_hooks();
|
|
8739
8879
|
init_constants28();
|
|
8740
8880
|
}
|
|
8741
8881
|
});
|
|
@@ -8916,7 +9056,7 @@ var init_codex_cli2 = __esm({
|
|
|
8916
9056
|
agents: "native",
|
|
8917
9057
|
skills: "native",
|
|
8918
9058
|
mcp: "native",
|
|
8919
|
-
hooks: "
|
|
9059
|
+
hooks: "native",
|
|
8920
9060
|
ignore: "none",
|
|
8921
9061
|
permissions: "none"
|
|
8922
9062
|
};
|
|
@@ -8936,7 +9076,7 @@ var init_codex_cli2 = __esm({
|
|
|
8936
9076
|
agents: "native",
|
|
8937
9077
|
skills: "native",
|
|
8938
9078
|
mcp: "native",
|
|
8939
|
-
hooks: "
|
|
9079
|
+
hooks: "native",
|
|
8940
9080
|
ignore: "none",
|
|
8941
9081
|
permissions: "none"
|
|
8942
9082
|
},
|
|
@@ -9092,6 +9232,40 @@ var init_generator10 = __esm({
|
|
|
9092
9232
|
init_constants9();
|
|
9093
9233
|
}
|
|
9094
9234
|
});
|
|
9235
|
+
function serializeContinuePermissions(permissions) {
|
|
9236
|
+
if (!permissions) return null;
|
|
9237
|
+
const allow = permissions.allow ?? [];
|
|
9238
|
+
const ask = permissions.ask ?? [];
|
|
9239
|
+
const exclude = permissions.deny ?? [];
|
|
9240
|
+
if (allow.length === 0 && ask.length === 0 && exclude.length === 0) return null;
|
|
9241
|
+
const out2 = {};
|
|
9242
|
+
if (allow.length > 0) out2.allow = allow;
|
|
9243
|
+
if (ask.length > 0) out2.ask = ask;
|
|
9244
|
+
if (exclude.length > 0) out2.exclude = exclude;
|
|
9245
|
+
return stringify(out2).trimEnd() + "\n";
|
|
9246
|
+
}
|
|
9247
|
+
function parseContinuePermissions(content) {
|
|
9248
|
+
let parsed;
|
|
9249
|
+
try {
|
|
9250
|
+
parsed = parse(content);
|
|
9251
|
+
} catch {
|
|
9252
|
+
return null;
|
|
9253
|
+
}
|
|
9254
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
9255
|
+
const record = parsed;
|
|
9256
|
+
const allow = toStringArray5(record.allow);
|
|
9257
|
+
const ask = toStringArray5(record.ask);
|
|
9258
|
+
const deny = toStringArray5(record.exclude);
|
|
9259
|
+
if (allow.length === 0 && ask.length === 0 && deny.length === 0) return null;
|
|
9260
|
+
const permissions = { allow, deny };
|
|
9261
|
+
if (ask.length > 0) permissions.ask = ask;
|
|
9262
|
+
return permissions;
|
|
9263
|
+
}
|
|
9264
|
+
var init_permissions = __esm({
|
|
9265
|
+
"src/targets/continue/permissions.ts"() {
|
|
9266
|
+
init_shared_import_helpers();
|
|
9267
|
+
}
|
|
9268
|
+
});
|
|
9095
9269
|
function readMcpServers(content, extension) {
|
|
9096
9270
|
const parsed = extension === ".json" ? JSON.parse(content) : parse(content) ?? {};
|
|
9097
9271
|
const rawServers = parsed.mcpServers;
|
|
@@ -9146,12 +9320,29 @@ async function importMcp2(projectRoot, results) {
|
|
|
9146
9320
|
});
|
|
9147
9321
|
}
|
|
9148
9322
|
}
|
|
9149
|
-
async function
|
|
9323
|
+
async function importPermissions(projectRoot, results) {
|
|
9324
|
+
const srcPath = join(projectRoot, CONTINUE_GLOBAL_PERMISSIONS);
|
|
9325
|
+
const content = await readFileSafe(srcPath);
|
|
9326
|
+
if (content === null) return;
|
|
9327
|
+
const permissions = parseContinuePermissions(content);
|
|
9328
|
+
if (!permissions) return;
|
|
9329
|
+
const destPath = join(projectRoot, CONTINUE_CANONICAL_PERMISSIONS);
|
|
9330
|
+
await mkdirp(dirname(destPath));
|
|
9331
|
+
await writeFileAtomic(destPath, stringify(permissions).trimEnd() + "\n");
|
|
9332
|
+
results.push({
|
|
9333
|
+
fromTool: CONTINUE_TARGET,
|
|
9334
|
+
fromPath: srcPath,
|
|
9335
|
+
toPath: CONTINUE_CANONICAL_PERMISSIONS,
|
|
9336
|
+
feature: "permissions"
|
|
9337
|
+
});
|
|
9338
|
+
}
|
|
9339
|
+
async function importFromContinue(projectRoot, options = {}) {
|
|
9150
9340
|
const results = [];
|
|
9151
9341
|
const normalize = await createImportReferenceNormalizer(CONTINUE_TARGET, projectRoot);
|
|
9152
9342
|
results.push(...await runDescriptorImport(descriptor9, projectRoot, "project", { normalize }));
|
|
9153
9343
|
await importEmbeddedSkills(projectRoot, CONTINUE_SKILLS_DIR, CONTINUE_TARGET, results, normalize);
|
|
9154
9344
|
await importMcp2(projectRoot, results);
|
|
9345
|
+
if (options.scope === "global") await importPermissions(projectRoot, results);
|
|
9155
9346
|
return results;
|
|
9156
9347
|
}
|
|
9157
9348
|
var init_importer9 = __esm({
|
|
@@ -9163,6 +9354,7 @@ var init_importer9 = __esm({
|
|
|
9163
9354
|
init_mcp_merge();
|
|
9164
9355
|
init_shared_import_helpers();
|
|
9165
9356
|
init_constants9();
|
|
9357
|
+
init_permissions();
|
|
9166
9358
|
init_continue2();
|
|
9167
9359
|
}
|
|
9168
9360
|
});
|
|
@@ -9328,6 +9520,7 @@ var init_scope_extras = __esm({
|
|
|
9328
9520
|
init_fs();
|
|
9329
9521
|
init_constants9();
|
|
9330
9522
|
init_global_config();
|
|
9523
|
+
init_permissions();
|
|
9331
9524
|
generateContinueScopeExtras = async (canonical, projectRoot, scope, enabledFeatures) => {
|
|
9332
9525
|
const configResults = await generateContinueGlobalConfig(
|
|
9333
9526
|
canonical,
|
|
@@ -9335,21 +9528,36 @@ var init_scope_extras = __esm({
|
|
|
9335
9528
|
scope,
|
|
9336
9529
|
enabledFeatures
|
|
9337
9530
|
);
|
|
9338
|
-
if (scope !== "global"
|
|
9339
|
-
const
|
|
9340
|
-
if (
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9531
|
+
if (scope !== "global") return configResults;
|
|
9532
|
+
const results = [...configResults];
|
|
9533
|
+
if (enabledFeatures.has("permissions")) {
|
|
9534
|
+
const content = serializeContinuePermissions(canonical.permissions);
|
|
9535
|
+
if (content) {
|
|
9536
|
+
const existing = await readFileSafe(join(projectRoot, CONTINUE_GLOBAL_PERMISSIONS));
|
|
9537
|
+
results.push({
|
|
9538
|
+
target: "continue",
|
|
9539
|
+
path: CONTINUE_GLOBAL_PERMISSIONS,
|
|
9540
|
+
content,
|
|
9541
|
+
currentContent: existing ?? void 0,
|
|
9542
|
+
status: computeStatus3(existing, content)
|
|
9543
|
+
});
|
|
9351
9544
|
}
|
|
9352
|
-
|
|
9545
|
+
}
|
|
9546
|
+
if (enabledFeatures.has("rules")) {
|
|
9547
|
+
const root = canonical.rules.find((r) => r.root);
|
|
9548
|
+
if (root) {
|
|
9549
|
+
const content = root.body.trim();
|
|
9550
|
+
const existing = await readFileSafe(join(projectRoot, CONTINUE_GLOBAL_AGENTS_MD));
|
|
9551
|
+
results.push({
|
|
9552
|
+
target: "continue",
|
|
9553
|
+
path: CONTINUE_GLOBAL_AGENTS_MD,
|
|
9554
|
+
content,
|
|
9555
|
+
currentContent: existing ?? void 0,
|
|
9556
|
+
status: computeStatus3(existing, content)
|
|
9557
|
+
});
|
|
9558
|
+
}
|
|
9559
|
+
}
|
|
9560
|
+
return results;
|
|
9353
9561
|
};
|
|
9354
9562
|
}
|
|
9355
9563
|
});
|
|
@@ -9405,7 +9613,12 @@ var init_continue2 = __esm({
|
|
|
9405
9613
|
skillDir: CONTINUE_SKILLS_DIR,
|
|
9406
9614
|
managedOutputs: {
|
|
9407
9615
|
dirs: [CONTINUE_RULES_DIR, CONTINUE_PROMPTS_DIR, CONTINUE_SKILLS_DIR, ".agents/skills"],
|
|
9408
|
-
files: [
|
|
9616
|
+
files: [
|
|
9617
|
+
CONTINUE_MCP_FILE,
|
|
9618
|
+
CONTINUE_GLOBAL_AGENTS_MD,
|
|
9619
|
+
CONTINUE_GLOBAL_CONFIG,
|
|
9620
|
+
CONTINUE_GLOBAL_PERMISSIONS
|
|
9621
|
+
]
|
|
9409
9622
|
},
|
|
9410
9623
|
mirrorGlobalPath(path, _activeTargets) {
|
|
9411
9624
|
if (path.startsWith(`${CONTINUE_SKILLS_DIR}/`)) {
|
|
@@ -9434,7 +9647,7 @@ var init_continue2 = __esm({
|
|
|
9434
9647
|
mcp: "native",
|
|
9435
9648
|
hooks: "none",
|
|
9436
9649
|
ignore: "none",
|
|
9437
|
-
permissions: "
|
|
9650
|
+
permissions: "native"
|
|
9438
9651
|
};
|
|
9439
9652
|
descriptor9 = {
|
|
9440
9653
|
id: "continue",
|
|
@@ -10331,7 +10544,7 @@ var init_capabilities4 = __esm({
|
|
|
10331
10544
|
agents: "native",
|
|
10332
10545
|
skills: "native",
|
|
10333
10546
|
mcp: "native",
|
|
10334
|
-
hooks: "
|
|
10547
|
+
hooks: "native",
|
|
10335
10548
|
ignore: "none",
|
|
10336
10549
|
permissions: "none"
|
|
10337
10550
|
};
|
|
@@ -10613,11 +10826,12 @@ async function importFromCrush(projectRoot, options = {}) {
|
|
|
10613
10826
|
results.push(...await runDescriptorImport(descriptor11, projectRoot, scope, { normalize }));
|
|
10614
10827
|
const skillsDir = scope === "global" ? CRUSH_GLOBAL_SKILLS_DIR : CRUSH_SKILLS_DIR;
|
|
10615
10828
|
await importEmbeddedSkills(projectRoot, skillsDir, CRUSH_TARGET, results, normalize);
|
|
10616
|
-
await importCrushConfigJson(projectRoot, results);
|
|
10829
|
+
await importCrushConfigJson(projectRoot, scope, results);
|
|
10617
10830
|
return results;
|
|
10618
10831
|
}
|
|
10619
|
-
async function importCrushConfigJson(projectRoot, results) {
|
|
10620
|
-
const
|
|
10832
|
+
async function importCrushConfigJson(projectRoot, scope, results) {
|
|
10833
|
+
const configRel = scope === "global" ? CRUSH_GLOBAL_CONFIG_FILE : CRUSH_CONFIG_FILE;
|
|
10834
|
+
const configPath = join(projectRoot, configRel);
|
|
10621
10835
|
const content = await readFileSafe(configPath);
|
|
10622
10836
|
if (content === null) return;
|
|
10623
10837
|
let parsed;
|
|
@@ -11119,33 +11333,81 @@ var init_agents2 = __esm({
|
|
|
11119
11333
|
function generatePermissions4(_canonical) {
|
|
11120
11334
|
return [];
|
|
11121
11335
|
}
|
|
11122
|
-
var
|
|
11336
|
+
var init_permissions2 = __esm({
|
|
11123
11337
|
"src/targets/cursor/generator/permissions.ts"() {
|
|
11124
11338
|
}
|
|
11125
11339
|
});
|
|
11126
11340
|
|
|
11127
|
-
// src/targets/cursor/
|
|
11341
|
+
// src/targets/cursor/hook-format.ts
|
|
11342
|
+
function unmappedCursorHookEvents(hooks) {
|
|
11343
|
+
return Object.keys(hooks).filter(
|
|
11344
|
+
(event) => Array.isArray(hooks[event]) && hooks[event].length > 0 && !(event in CANONICAL_TO_CURSOR)
|
|
11345
|
+
);
|
|
11346
|
+
}
|
|
11128
11347
|
function toCursorHooks(hooks) {
|
|
11129
11348
|
const result = {};
|
|
11130
11349
|
for (const [event, entries] of Object.entries(hooks)) {
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
const
|
|
11137
|
-
const
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11350
|
+
const cursorEvent = CANONICAL_TO_CURSOR[event];
|
|
11351
|
+
if (!cursorEvent || !Array.isArray(entries)) continue;
|
|
11352
|
+
const flat = [];
|
|
11353
|
+
for (const entry of entries) {
|
|
11354
|
+
if (!hasHookText(entry)) continue;
|
|
11355
|
+
const value = getHookText(entry);
|
|
11356
|
+
const hook = entry.type === "prompt" ? { type: "prompt", prompt: value } : { type: "command", command: value };
|
|
11357
|
+
if (entry.matcher) hook.matcher = entry.matcher;
|
|
11358
|
+
if (entry.timeout !== void 0) hook.timeout = entry.timeout;
|
|
11359
|
+
flat.push(hook);
|
|
11360
|
+
}
|
|
11361
|
+
if (flat.length > 0) result[cursorEvent] = flat;
|
|
11362
|
+
}
|
|
11363
|
+
return result;
|
|
11364
|
+
}
|
|
11365
|
+
function cursorHooksToCanonical(hooks) {
|
|
11366
|
+
const result = {};
|
|
11367
|
+
for (const [cursorEvent, entries] of Object.entries(hooks)) {
|
|
11368
|
+
const canonicalEvent = CURSOR_TO_CANONICAL.get(cursorEvent);
|
|
11369
|
+
if (!canonicalEvent || !Array.isArray(entries)) continue;
|
|
11370
|
+
const list = [];
|
|
11371
|
+
for (const entry of entries) {
|
|
11372
|
+
if (!entry || typeof entry !== "object") continue;
|
|
11373
|
+
const e = entry;
|
|
11374
|
+
const type = e.type === "prompt" ? "prompt" : "command";
|
|
11375
|
+
if (!hasHookText({ ...e, type })) continue;
|
|
11376
|
+
const value = getHookText({ ...e, type });
|
|
11377
|
+
const item = {
|
|
11378
|
+
matcher: typeof e.matcher === "string" ? e.matcher : "",
|
|
11379
|
+
type,
|
|
11380
|
+
command: value
|
|
11141
11381
|
};
|
|
11142
|
-
if (e.timeout
|
|
11143
|
-
|
|
11382
|
+
if (typeof e.timeout === "number") item.timeout = e.timeout;
|
|
11383
|
+
list.push(item);
|
|
11144
11384
|
}
|
|
11145
|
-
if (
|
|
11385
|
+
if (list.length > 0) result[canonicalEvent] = [...result[canonicalEvent] ?? [], ...list];
|
|
11146
11386
|
}
|
|
11147
11387
|
return result;
|
|
11148
11388
|
}
|
|
11389
|
+
var CANONICAL_TO_CURSOR, CURSOR_TO_CANONICAL;
|
|
11390
|
+
var init_hook_format = __esm({
|
|
11391
|
+
"src/targets/cursor/hook-format.ts"() {
|
|
11392
|
+
init_hook_command();
|
|
11393
|
+
CANONICAL_TO_CURSOR = {
|
|
11394
|
+
PreToolUse: "preToolUse",
|
|
11395
|
+
PostToolUse: "postToolUse",
|
|
11396
|
+
UserPromptSubmit: "beforeSubmitPrompt",
|
|
11397
|
+
SubagentStart: "subagentStart",
|
|
11398
|
+
SubagentStop: "subagentStop",
|
|
11399
|
+
Stop: "stop",
|
|
11400
|
+
SessionStart: "sessionStart",
|
|
11401
|
+
SessionEnd: "sessionEnd",
|
|
11402
|
+
PreCompact: "preCompact"
|
|
11403
|
+
};
|
|
11404
|
+
CURSOR_TO_CANONICAL = new Map(
|
|
11405
|
+
Object.entries(CANONICAL_TO_CURSOR).map(([canonical, cursor]) => [cursor, canonical])
|
|
11406
|
+
);
|
|
11407
|
+
}
|
|
11408
|
+
});
|
|
11409
|
+
|
|
11410
|
+
// src/targets/cursor/generator/hooks.ts
|
|
11149
11411
|
function generateHooks7(canonical) {
|
|
11150
11412
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
11151
11413
|
const cursorHooks = toCursorHooks(canonical.hooks);
|
|
@@ -11155,8 +11417,8 @@ function generateHooks7(canonical) {
|
|
|
11155
11417
|
}
|
|
11156
11418
|
var init_hooks2 = __esm({
|
|
11157
11419
|
"src/targets/cursor/generator/hooks.ts"() {
|
|
11158
|
-
init_hook_command();
|
|
11159
11420
|
init_constants11();
|
|
11421
|
+
init_hook_format();
|
|
11160
11422
|
}
|
|
11161
11423
|
});
|
|
11162
11424
|
|
|
@@ -11180,7 +11442,7 @@ var init_generator13 = __esm({
|
|
|
11180
11442
|
init_mcp2();
|
|
11181
11443
|
init_skills2();
|
|
11182
11444
|
init_agents2();
|
|
11183
|
-
|
|
11445
|
+
init_permissions2();
|
|
11184
11446
|
init_hooks2();
|
|
11185
11447
|
init_ignore();
|
|
11186
11448
|
}
|
|
@@ -11358,30 +11620,6 @@ var init_importer_rules3 = __esm({
|
|
|
11358
11620
|
init_constants11();
|
|
11359
11621
|
}
|
|
11360
11622
|
});
|
|
11361
|
-
function cursorHooksToCanonical(hooks) {
|
|
11362
|
-
const result = {};
|
|
11363
|
-
for (const [event, entries] of Object.entries(hooks)) {
|
|
11364
|
-
if (!Array.isArray(entries)) continue;
|
|
11365
|
-
const canonical = [];
|
|
11366
|
-
for (const entry of entries) {
|
|
11367
|
-
if (!entry || typeof entry !== "object") continue;
|
|
11368
|
-
const e = entry;
|
|
11369
|
-
const matcher = typeof e.matcher === "string" ? e.matcher : "";
|
|
11370
|
-
if (!matcher) continue;
|
|
11371
|
-
const hookList = Array.isArray(e.hooks) ? e.hooks : [];
|
|
11372
|
-
for (const hook of hookList) {
|
|
11373
|
-
const type = hook.type === "prompt" ? "prompt" : "command";
|
|
11374
|
-
if (!hasHookText({ ...hook, type })) continue;
|
|
11375
|
-
const value = type === "prompt" ? getHookPrompt(hook) || getHookCommand(hook) : getHookCommand(hook) || getHookPrompt(hook);
|
|
11376
|
-
const item = { matcher, type, command: value };
|
|
11377
|
-
if (typeof hook.timeout === "number") item.timeout = hook.timeout;
|
|
11378
|
-
canonical.push(item);
|
|
11379
|
-
}
|
|
11380
|
-
}
|
|
11381
|
-
if (canonical.length > 0) result[event] = canonical;
|
|
11382
|
-
}
|
|
11383
|
-
return result;
|
|
11384
|
-
}
|
|
11385
11623
|
async function importSettings2(projectRoot, results) {
|
|
11386
11624
|
let hooksImportedFromHooksJson = false;
|
|
11387
11625
|
const hooksJsonPath = join(projectRoot, CURSOR_HOOKS);
|
|
@@ -11483,7 +11721,7 @@ async function importIgnore(projectRoot, results) {
|
|
|
11483
11721
|
}
|
|
11484
11722
|
var init_settings_helpers3 = __esm({
|
|
11485
11723
|
"src/targets/cursor/settings-helpers.ts"() {
|
|
11486
|
-
|
|
11724
|
+
init_hook_format();
|
|
11487
11725
|
init_fs();
|
|
11488
11726
|
init_constants11();
|
|
11489
11727
|
}
|
|
@@ -11794,6 +12032,18 @@ var init_linter12 = __esm({
|
|
|
11794
12032
|
});
|
|
11795
12033
|
|
|
11796
12034
|
// src/targets/cursor/lint.ts
|
|
12035
|
+
function lintHooks6(canonical) {
|
|
12036
|
+
if (!canonical.hooks) return [];
|
|
12037
|
+
const unmapped = unmappedCursorHookEvents(canonical.hooks);
|
|
12038
|
+
if (unmapped.length === 0) return [];
|
|
12039
|
+
return [
|
|
12040
|
+
createWarning(
|
|
12041
|
+
".agentsmesh/hooks.yaml",
|
|
12042
|
+
"cursor",
|
|
12043
|
+
`Cursor has no equivalent for hook event(s) ${unmapped.join(", ")}; they are not projected to .cursor/hooks.json.`
|
|
12044
|
+
)
|
|
12045
|
+
];
|
|
12046
|
+
}
|
|
11797
12047
|
function lintCommands5(canonical) {
|
|
11798
12048
|
return canonical.commands.filter((command) => command.description.length > 0 || command.allowedTools.length > 0).map(
|
|
11799
12049
|
(command) => createWarning(
|
|
@@ -11838,6 +12088,7 @@ function lintPermissions4(canonical) {
|
|
|
11838
12088
|
var init_lint11 = __esm({
|
|
11839
12089
|
"src/targets/cursor/lint.ts"() {
|
|
11840
12090
|
init_helpers();
|
|
12091
|
+
init_hook_format();
|
|
11841
12092
|
}
|
|
11842
12093
|
});
|
|
11843
12094
|
|
|
@@ -11942,7 +12193,7 @@ var init_cursor2 = __esm({
|
|
|
11942
12193
|
};
|
|
11943
12194
|
globalCapabilities10 = {
|
|
11944
12195
|
rules: "native",
|
|
11945
|
-
additionalRules: "
|
|
12196
|
+
additionalRules: "native",
|
|
11946
12197
|
commands: "native",
|
|
11947
12198
|
agents: "native",
|
|
11948
12199
|
skills: "native",
|
|
@@ -11962,7 +12213,7 @@ var init_cursor2 = __esm({
|
|
|
11962
12213
|
generators: target12,
|
|
11963
12214
|
capabilities: {
|
|
11964
12215
|
rules: "native",
|
|
11965
|
-
additionalRules: "
|
|
12216
|
+
additionalRules: "native",
|
|
11966
12217
|
commands: "native",
|
|
11967
12218
|
agents: "native",
|
|
11968
12219
|
skills: "native",
|
|
@@ -11976,7 +12227,8 @@ var init_cursor2 = __esm({
|
|
|
11976
12227
|
lint: {
|
|
11977
12228
|
commands: lintCommands5,
|
|
11978
12229
|
mcp: lintMcp3,
|
|
11979
|
-
permissions: lintPermissions4
|
|
12230
|
+
permissions: lintPermissions4,
|
|
12231
|
+
hooks: lintHooks6
|
|
11980
12232
|
},
|
|
11981
12233
|
project: project12,
|
|
11982
12234
|
globalSupport: {
|
|
@@ -12347,10 +12599,18 @@ function generateSkills13(canonical) {
|
|
|
12347
12599
|
return generateEmbeddedSkills(canonical, FACTORY_DROID_SKILLS_DIR);
|
|
12348
12600
|
}
|
|
12349
12601
|
function generateCommands13(canonical) {
|
|
12350
|
-
return canonical.commands.map((command) =>
|
|
12351
|
-
|
|
12352
|
-
|
|
12353
|
-
|
|
12602
|
+
return canonical.commands.map((command) => {
|
|
12603
|
+
const frontmatter = {
|
|
12604
|
+
description: command.description || void 0,
|
|
12605
|
+
"allowed-tools": command.allowedTools.length > 0 ? command.allowedTools : void 0
|
|
12606
|
+
};
|
|
12607
|
+
if (frontmatter.description === void 0) delete frontmatter.description;
|
|
12608
|
+
if (frontmatter["allowed-tools"] === void 0) delete frontmatter["allowed-tools"];
|
|
12609
|
+
return {
|
|
12610
|
+
path: `${FACTORY_DROID_COMMANDS_DIR}/${command.name}.md`,
|
|
12611
|
+
content: serializeFrontmatter(frontmatter, command.body.trim() || "")
|
|
12612
|
+
};
|
|
12613
|
+
});
|
|
12354
12614
|
}
|
|
12355
12615
|
function generateAgents14(canonical) {
|
|
12356
12616
|
return canonical.agents.map((agent) => ({
|
|
@@ -12359,10 +12619,7 @@ function generateAgents14(canonical) {
|
|
|
12359
12619
|
}));
|
|
12360
12620
|
}
|
|
12361
12621
|
function generateHooks9(canonical) {
|
|
12362
|
-
|
|
12363
|
-
const hooks = buildClaudeHooksObjectFromCanonical(canonical);
|
|
12364
|
-
if (Object.keys(hooks).length === 0) return [];
|
|
12365
|
-
return [{ path: FACTORY_DROID_HOOKS_FILE, content: JSON.stringify(hooks, null, 2) }];
|
|
12622
|
+
return buildWrappedCommandHooks(canonical, FACTORY_DROID_HOOKS_FILE);
|
|
12366
12623
|
}
|
|
12367
12624
|
function generateMcp11(canonical) {
|
|
12368
12625
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
@@ -12377,8 +12634,8 @@ var init_generator16 = __esm({
|
|
|
12377
12634
|
"src/targets/factory-droid/generator.ts"() {
|
|
12378
12635
|
init_embedded_skill();
|
|
12379
12636
|
init_managed_blocks();
|
|
12380
|
-
|
|
12381
|
-
|
|
12637
|
+
init_markdown();
|
|
12638
|
+
init_wrapped_command_hooks();
|
|
12382
12639
|
init_droid_serializer();
|
|
12383
12640
|
init_constants13();
|
|
12384
12641
|
}
|
|
@@ -12431,6 +12688,13 @@ async function importFromFactoryDroid(projectRoot, options = {}) {
|
|
|
12431
12688
|
await importEmbeddedSkills(projectRoot, skillsDir, FACTORY_DROID_TARGET, results, normalize);
|
|
12432
12689
|
const mcpFile = scope === "global" ? FACTORY_DROID_GLOBAL_MCP_FILE : FACTORY_DROID_MCP_FILE;
|
|
12433
12690
|
await importFactoryDroidMcp(projectRoot, mcpFile, results);
|
|
12691
|
+
await importWrappedCommandHooks({
|
|
12692
|
+
projectRoot,
|
|
12693
|
+
hooksFile: FACTORY_DROID_HOOKS_FILE,
|
|
12694
|
+
canonicalHooksPath: FACTORY_DROID_CANONICAL_HOOKS,
|
|
12695
|
+
targetName: FACTORY_DROID_TARGET,
|
|
12696
|
+
results
|
|
12697
|
+
});
|
|
12434
12698
|
return results;
|
|
12435
12699
|
}
|
|
12436
12700
|
var init_importer14 = __esm({
|
|
@@ -12438,6 +12702,7 @@ var init_importer14 = __esm({
|
|
|
12438
12702
|
init_import_rewriter();
|
|
12439
12703
|
init_embedded_skill();
|
|
12440
12704
|
init_descriptor_import_runner();
|
|
12705
|
+
init_wrapped_command_hooks();
|
|
12441
12706
|
init_mcp_import2();
|
|
12442
12707
|
init_constants13();
|
|
12443
12708
|
init_factory_droid2();
|
|
@@ -12500,7 +12765,6 @@ var init_factory_droid2 = __esm({
|
|
|
12500
12765
|
init_linter14();
|
|
12501
12766
|
init_lint13();
|
|
12502
12767
|
init_import_map_builders();
|
|
12503
|
-
init_command_skill();
|
|
12504
12768
|
target14 = {
|
|
12505
12769
|
name: FACTORY_DROID_TARGET,
|
|
12506
12770
|
primaryRootInstructionPath: FACTORY_DROID_ROOT_FILE,
|
|
@@ -12516,7 +12780,7 @@ var init_factory_droid2 = __esm({
|
|
|
12516
12780
|
rootInstructionPath: FACTORY_DROID_ROOT_FILE,
|
|
12517
12781
|
skillDir: FACTORY_DROID_SKILLS_DIR,
|
|
12518
12782
|
managedOutputs: {
|
|
12519
|
-
dirs: [FACTORY_DROID_SKILLS_DIR, FACTORY_DROID_DROIDS_DIR],
|
|
12783
|
+
dirs: [FACTORY_DROID_SKILLS_DIR, FACTORY_DROID_COMMANDS_DIR, FACTORY_DROID_DROIDS_DIR],
|
|
12520
12784
|
files: [FACTORY_DROID_ROOT_FILE, FACTORY_DROID_HOOKS_FILE, FACTORY_DROID_MCP_FILE]
|
|
12521
12785
|
},
|
|
12522
12786
|
paths: {
|
|
@@ -12524,7 +12788,7 @@ var init_factory_droid2 = __esm({
|
|
|
12524
12788
|
return FACTORY_DROID_ROOT_FILE;
|
|
12525
12789
|
},
|
|
12526
12790
|
commandPath(name) {
|
|
12527
|
-
return `${
|
|
12791
|
+
return `${FACTORY_DROID_COMMANDS_DIR}/${name}.md`;
|
|
12528
12792
|
},
|
|
12529
12793
|
agentPath(name) {
|
|
12530
12794
|
return `${FACTORY_DROID_DROIDS_DIR}/${name}.md`;
|
|
@@ -12535,8 +12799,16 @@ var init_factory_droid2 = __esm({
|
|
|
12535
12799
|
rootInstructionPath: FACTORY_DROID_GLOBAL_ROOT_FILE,
|
|
12536
12800
|
skillDir: FACTORY_DROID_GLOBAL_SKILLS_DIR,
|
|
12537
12801
|
managedOutputs: {
|
|
12538
|
-
dirs: [
|
|
12539
|
-
|
|
12802
|
+
dirs: [
|
|
12803
|
+
FACTORY_DROID_GLOBAL_SKILLS_DIR,
|
|
12804
|
+
FACTORY_DROID_GLOBAL_COMMANDS_DIR,
|
|
12805
|
+
FACTORY_DROID_GLOBAL_DROIDS_DIR
|
|
12806
|
+
],
|
|
12807
|
+
files: [
|
|
12808
|
+
FACTORY_DROID_GLOBAL_ROOT_FILE,
|
|
12809
|
+
FACTORY_DROID_GLOBAL_HOOKS_FILE,
|
|
12810
|
+
FACTORY_DROID_GLOBAL_MCP_FILE
|
|
12811
|
+
]
|
|
12540
12812
|
},
|
|
12541
12813
|
rewriteGeneratedPath(path) {
|
|
12542
12814
|
if (path === FACTORY_DROID_ROOT_FILE) return FACTORY_DROID_GLOBAL_ROOT_FILE;
|
|
@@ -12554,7 +12826,7 @@ var init_factory_droid2 = __esm({
|
|
|
12554
12826
|
return FACTORY_DROID_GLOBAL_ROOT_FILE;
|
|
12555
12827
|
},
|
|
12556
12828
|
commandPath(name) {
|
|
12557
|
-
return `${
|
|
12829
|
+
return `${FACTORY_DROID_GLOBAL_COMMANDS_DIR}/${name}.md`;
|
|
12558
12830
|
},
|
|
12559
12831
|
agentPath(name) {
|
|
12560
12832
|
return `${FACTORY_DROID_GLOBAL_DROIDS_DIR}/${name}.md`;
|
|
@@ -12564,7 +12836,7 @@ var init_factory_droid2 = __esm({
|
|
|
12564
12836
|
capabilities6 = {
|
|
12565
12837
|
rules: "native",
|
|
12566
12838
|
additionalRules: "embedded",
|
|
12567
|
-
commands: "
|
|
12839
|
+
commands: "native",
|
|
12568
12840
|
agents: "native",
|
|
12569
12841
|
skills: "native",
|
|
12570
12842
|
mcp: "native",
|
|
@@ -12588,7 +12860,6 @@ var init_factory_droid2 = __esm({
|
|
|
12588
12860
|
permissions: lintPermissions6,
|
|
12589
12861
|
ignore: lintIgnore3
|
|
12590
12862
|
},
|
|
12591
|
-
supportsConversion: { commands: true },
|
|
12592
12863
|
project: project14,
|
|
12593
12864
|
globalSupport: {
|
|
12594
12865
|
capabilities: capabilities6,
|
|
@@ -12610,6 +12881,28 @@ var init_factory_droid2 = __esm({
|
|
|
12610
12881
|
canonicalDir: FACTORY_DROID_CANONICAL_RULES_DIR,
|
|
12611
12882
|
canonicalRootFilename: "_root.md",
|
|
12612
12883
|
markAsRoot: true
|
|
12884
|
+
},
|
|
12885
|
+
commands: {
|
|
12886
|
+
feature: "commands",
|
|
12887
|
+
mode: "directory",
|
|
12888
|
+
source: {
|
|
12889
|
+
project: [FACTORY_DROID_COMMANDS_DIR],
|
|
12890
|
+
global: [FACTORY_DROID_GLOBAL_COMMANDS_DIR]
|
|
12891
|
+
},
|
|
12892
|
+
canonicalDir: FACTORY_DROID_CANONICAL_COMMANDS_DIR,
|
|
12893
|
+
extensions: [".md"],
|
|
12894
|
+
preset: "command"
|
|
12895
|
+
},
|
|
12896
|
+
agents: {
|
|
12897
|
+
feature: "agents",
|
|
12898
|
+
mode: "directory",
|
|
12899
|
+
source: {
|
|
12900
|
+
project: [FACTORY_DROID_DROIDS_DIR],
|
|
12901
|
+
global: [FACTORY_DROID_GLOBAL_DROIDS_DIR]
|
|
12902
|
+
},
|
|
12903
|
+
canonicalDir: FACTORY_DROID_CANONICAL_AGENTS_DIR,
|
|
12904
|
+
extensions: [".md"],
|
|
12905
|
+
preset: "agent"
|
|
12613
12906
|
}
|
|
12614
12907
|
},
|
|
12615
12908
|
buildImportPaths: buildFactoryDroidImportPaths,
|
|
@@ -12619,7 +12912,7 @@ var init_factory_droid2 = __esm({
|
|
|
12619
12912
|
});
|
|
12620
12913
|
|
|
12621
12914
|
// src/targets/gemini-cli/constants.ts
|
|
12622
|
-
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;
|
|
12915
|
+
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;
|
|
12623
12916
|
var init_constants30 = __esm({
|
|
12624
12917
|
"src/targets/gemini-cli/constants.ts"() {
|
|
12625
12918
|
GEMINI_TARGET = "gemini-cli";
|
|
@@ -12649,6 +12942,7 @@ var init_constants30 = __esm({
|
|
|
12649
12942
|
GEMINI_GLOBAL_COMMANDS_DIR = ".gemini/commands";
|
|
12650
12943
|
GEMINI_GLOBAL_SKILLS_DIR = ".gemini/skills";
|
|
12651
12944
|
GEMINI_GLOBAL_AGENTS_DIR = ".gemini/agents";
|
|
12945
|
+
GEMINI_GLOBAL_POLICIES_FILE = ".gemini/policies/permissions.toml";
|
|
12652
12946
|
}
|
|
12653
12947
|
});
|
|
12654
12948
|
|
|
@@ -13542,7 +13836,7 @@ function lintCommands6(canonical) {
|
|
|
13542
13836
|
)
|
|
13543
13837
|
);
|
|
13544
13838
|
}
|
|
13545
|
-
function
|
|
13839
|
+
function lintHooks7(canonical) {
|
|
13546
13840
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
13547
13841
|
const supported = ["PreToolUse", "PostToolUse", "Notification"];
|
|
13548
13842
|
const supportedSet = new Set(supported);
|
|
@@ -13652,7 +13946,12 @@ var init_gemini_cli2 = __esm({
|
|
|
13652
13946
|
skillDir: GEMINI_GLOBAL_SKILLS_DIR,
|
|
13653
13947
|
managedOutputs: {
|
|
13654
13948
|
dirs: [GEMINI_GLOBAL_COMMANDS_DIR, GEMINI_GLOBAL_SKILLS_DIR, GEMINI_GLOBAL_AGENTS_DIR],
|
|
13655
|
-
files: [
|
|
13949
|
+
files: [
|
|
13950
|
+
GEMINI_GLOBAL_ROOT,
|
|
13951
|
+
GEMINI_GLOBAL_COMPAT_AGENTS,
|
|
13952
|
+
GEMINI_GLOBAL_SETTINGS,
|
|
13953
|
+
GEMINI_GLOBAL_POLICIES_FILE
|
|
13954
|
+
]
|
|
13656
13955
|
},
|
|
13657
13956
|
rewriteGeneratedPath(path) {
|
|
13658
13957
|
if (path === GEMINI_ROOT) {
|
|
@@ -13673,7 +13972,7 @@ var init_gemini_cli2 = __esm({
|
|
|
13673
13972
|
if (path.startsWith(`${GEMINI_AGENTS_DIR}/`)) {
|
|
13674
13973
|
return path.replace(`${GEMINI_AGENTS_DIR}/`, `${GEMINI_GLOBAL_AGENTS_DIR}/`);
|
|
13675
13974
|
}
|
|
13676
|
-
if (path
|
|
13975
|
+
if (path === ".geminiignore") {
|
|
13677
13976
|
return null;
|
|
13678
13977
|
}
|
|
13679
13978
|
return path;
|
|
@@ -13708,7 +14007,7 @@ var init_gemini_cli2 = __esm({
|
|
|
13708
14007
|
mcp: "native",
|
|
13709
14008
|
hooks: "partial",
|
|
13710
14009
|
ignore: "none",
|
|
13711
|
-
permissions: "
|
|
14010
|
+
permissions: "native"
|
|
13712
14011
|
};
|
|
13713
14012
|
descriptor15 = {
|
|
13714
14013
|
id: "gemini-cli",
|
|
@@ -13734,7 +14033,7 @@ var init_gemini_cli2 = __esm({
|
|
|
13734
14033
|
lintRules: lintRules15,
|
|
13735
14034
|
lint: {
|
|
13736
14035
|
commands: lintCommands6,
|
|
13737
|
-
hooks:
|
|
14036
|
+
hooks: lintHooks7
|
|
13738
14037
|
},
|
|
13739
14038
|
emitScopedSettings: emitScopedGeminiSettings,
|
|
13740
14039
|
mergeGeneratedOutputContent(existing, pending, newContent, resolvedPath) {
|
|
@@ -13809,6 +14108,9 @@ function generateIgnore8(canonical) {
|
|
|
13809
14108
|
if (canonical.ignore.length === 0) return [];
|
|
13810
14109
|
return [{ path: GOOSE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
13811
14110
|
}
|
|
14111
|
+
function generateHooks10(canonical) {
|
|
14112
|
+
return buildWrappedCommandHooks(canonical, GOOSE_HOOKS_FILE);
|
|
14113
|
+
}
|
|
13812
14114
|
function mcpServerToExtension(name, server) {
|
|
13813
14115
|
const base = {
|
|
13814
14116
|
bundled: null,
|
|
@@ -13842,11 +14144,52 @@ var init_generator19 = __esm({
|
|
|
13842
14144
|
init_managed_blocks();
|
|
13843
14145
|
init_projected_agent_skill();
|
|
13844
14146
|
init_command_skill();
|
|
14147
|
+
init_wrapped_command_hooks();
|
|
13845
14148
|
init_constants14();
|
|
13846
14149
|
}
|
|
13847
14150
|
});
|
|
13848
|
-
|
|
13849
|
-
|
|
14151
|
+
function parseYamlObject(content) {
|
|
14152
|
+
if (content === null) return {};
|
|
14153
|
+
try {
|
|
14154
|
+
const parsed = parse(content);
|
|
14155
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
14156
|
+
return parsed;
|
|
14157
|
+
}
|
|
14158
|
+
} catch {
|
|
14159
|
+
}
|
|
14160
|
+
return {};
|
|
14161
|
+
}
|
|
14162
|
+
function serializeGoosePermissions(permissions, existingContent) {
|
|
14163
|
+
const allow = permissions?.allow ?? [];
|
|
14164
|
+
const ask = permissions?.ask ?? [];
|
|
14165
|
+
const deny = permissions?.deny ?? [];
|
|
14166
|
+
if (allow.length === 0 && ask.length === 0 && deny.length === 0) return null;
|
|
14167
|
+
const user = {};
|
|
14168
|
+
if (allow.length > 0) user.always_allow = allow;
|
|
14169
|
+
if (ask.length > 0) user.ask_before = ask;
|
|
14170
|
+
if (deny.length > 0) user.never_allow = deny;
|
|
14171
|
+
const root = parseYamlObject(existingContent);
|
|
14172
|
+
root.user = user;
|
|
14173
|
+
return stringify(root).trimEnd() + "\n";
|
|
14174
|
+
}
|
|
14175
|
+
function parseGoosePermissions(content) {
|
|
14176
|
+
const root = parseYamlObject(content);
|
|
14177
|
+
const user = root.user;
|
|
14178
|
+
if (!user || typeof user !== "object" || Array.isArray(user)) return null;
|
|
14179
|
+
const block = user;
|
|
14180
|
+
const allow = toStringArray5(block.always_allow);
|
|
14181
|
+
const ask = toStringArray5(block.ask_before);
|
|
14182
|
+
const deny = toStringArray5(block.never_allow);
|
|
14183
|
+
if (allow.length === 0 && ask.length === 0 && deny.length === 0) return null;
|
|
14184
|
+
const permissions = { allow, deny };
|
|
14185
|
+
if (ask.length > 0) permissions.ask = ask;
|
|
14186
|
+
return permissions;
|
|
14187
|
+
}
|
|
14188
|
+
var init_permissions3 = __esm({
|
|
14189
|
+
"src/targets/goose/permissions.ts"() {
|
|
14190
|
+
init_shared_import_helpers();
|
|
14191
|
+
}
|
|
14192
|
+
});
|
|
13850
14193
|
async function importFromGoose(projectRoot, options = {}) {
|
|
13851
14194
|
const scope = options.scope ?? "project";
|
|
13852
14195
|
const results = [];
|
|
@@ -13854,14 +14197,41 @@ async function importFromGoose(projectRoot, options = {}) {
|
|
|
13854
14197
|
results.push(...await runDescriptorImport(descriptor16, projectRoot, scope, { normalize }));
|
|
13855
14198
|
const skillsDir = scope === "global" ? GOOSE_GLOBAL_SKILLS_DIR : GOOSE_SKILLS_DIR;
|
|
13856
14199
|
await importEmbeddedSkills(projectRoot, skillsDir, GOOSE_TARGET, results, normalize);
|
|
14200
|
+
await importWrappedCommandHooks({
|
|
14201
|
+
projectRoot,
|
|
14202
|
+
hooksFile: GOOSE_HOOKS_FILE,
|
|
14203
|
+
canonicalHooksPath: GOOSE_CANONICAL_HOOKS,
|
|
14204
|
+
targetName: GOOSE_TARGET,
|
|
14205
|
+
results
|
|
14206
|
+
});
|
|
14207
|
+
if (scope === "global") await importPermissions2(projectRoot, results);
|
|
13857
14208
|
return results;
|
|
13858
14209
|
}
|
|
14210
|
+
async function importPermissions2(projectRoot, results) {
|
|
14211
|
+
const srcPath = join(projectRoot, GOOSE_GLOBAL_PERMISSIONS);
|
|
14212
|
+
const content = await readFileSafe(srcPath);
|
|
14213
|
+
if (content === null) return;
|
|
14214
|
+
const permissions = parseGoosePermissions(content);
|
|
14215
|
+
if (!permissions) return;
|
|
14216
|
+
const destPath = join(projectRoot, GOOSE_CANONICAL_PERMISSIONS);
|
|
14217
|
+
await mkdirp(dirname(destPath));
|
|
14218
|
+
await writeFileAtomic(destPath, stringify(permissions).trimEnd() + "\n");
|
|
14219
|
+
results.push({
|
|
14220
|
+
fromTool: GOOSE_TARGET,
|
|
14221
|
+
fromPath: srcPath,
|
|
14222
|
+
toPath: GOOSE_CANONICAL_PERMISSIONS,
|
|
14223
|
+
feature: "permissions"
|
|
14224
|
+
});
|
|
14225
|
+
}
|
|
13859
14226
|
var init_importer16 = __esm({
|
|
13860
14227
|
"src/targets/goose/importer.ts"() {
|
|
13861
14228
|
init_import_rewriter();
|
|
14229
|
+
init_fs();
|
|
13862
14230
|
init_embedded_skill();
|
|
13863
14231
|
init_descriptor_import_runner();
|
|
14232
|
+
init_wrapped_command_hooks();
|
|
13864
14233
|
init_constants14();
|
|
14234
|
+
init_permissions3();
|
|
13865
14235
|
init_goose2();
|
|
13866
14236
|
}
|
|
13867
14237
|
});
|
|
@@ -13987,6 +14357,34 @@ var init_importer_spec3 = __esm({
|
|
|
13987
14357
|
};
|
|
13988
14358
|
}
|
|
13989
14359
|
});
|
|
14360
|
+
function computeStatus5(existing, content) {
|
|
14361
|
+
if (existing === null) return "created";
|
|
14362
|
+
if (existing !== content) return "updated";
|
|
14363
|
+
return "unchanged";
|
|
14364
|
+
}
|
|
14365
|
+
var generateGooseScopeExtras;
|
|
14366
|
+
var init_scope_extras3 = __esm({
|
|
14367
|
+
"src/targets/goose/scope-extras.ts"() {
|
|
14368
|
+
init_fs();
|
|
14369
|
+
init_constants14();
|
|
14370
|
+
init_permissions3();
|
|
14371
|
+
generateGooseScopeExtras = async (canonical, projectRoot, scope, enabledFeatures) => {
|
|
14372
|
+
if (scope !== "global" || !enabledFeatures.has("permissions")) return [];
|
|
14373
|
+
const existing = await readFileSafe(join(projectRoot, GOOSE_GLOBAL_PERMISSIONS));
|
|
14374
|
+
const content = serializeGoosePermissions(canonical.permissions, existing);
|
|
14375
|
+
if (!content) return [];
|
|
14376
|
+
return [
|
|
14377
|
+
{
|
|
14378
|
+
target: "goose",
|
|
14379
|
+
path: GOOSE_GLOBAL_PERMISSIONS,
|
|
14380
|
+
content,
|
|
14381
|
+
currentContent: existing ?? void 0,
|
|
14382
|
+
status: computeStatus5(existing, content)
|
|
14383
|
+
}
|
|
14384
|
+
];
|
|
14385
|
+
};
|
|
14386
|
+
}
|
|
14387
|
+
});
|
|
13990
14388
|
|
|
13991
14389
|
// src/targets/goose/linter.ts
|
|
13992
14390
|
function lintRules16(canonical, projectRoot, projectFiles, options) {
|
|
@@ -14005,21 +14403,9 @@ var init_linter16 = __esm({
|
|
|
14005
14403
|
});
|
|
14006
14404
|
|
|
14007
14405
|
// src/targets/goose/lint.ts
|
|
14008
|
-
function
|
|
14009
|
-
|
|
14010
|
-
|
|
14011
|
-
(entries) => Array.isArray(entries) && entries.length > 0
|
|
14012
|
-
);
|
|
14013
|
-
if (!hasEntries) return [];
|
|
14014
|
-
return [
|
|
14015
|
-
createWarning(
|
|
14016
|
-
".agentsmesh/hooks.yaml",
|
|
14017
|
-
"goose",
|
|
14018
|
-
"Goose has no lifecycle hook system; canonical hooks are not projected."
|
|
14019
|
-
)
|
|
14020
|
-
];
|
|
14021
|
-
}
|
|
14022
|
-
function lintPermissions7(canonical) {
|
|
14406
|
+
function lintPermissions7(canonical, options) {
|
|
14407
|
+
const scope = options?.scope;
|
|
14408
|
+
if (scope === "global") return [];
|
|
14023
14409
|
if (!canonical.permissions) return [];
|
|
14024
14410
|
const { allow, deny } = canonical.permissions;
|
|
14025
14411
|
const ask = canonical.permissions.ask ?? [];
|
|
@@ -14028,7 +14414,7 @@ function lintPermissions7(canonical) {
|
|
|
14028
14414
|
createWarning(
|
|
14029
14415
|
".agentsmesh/permissions.yaml",
|
|
14030
14416
|
"goose",
|
|
14031
|
-
"Goose permissions
|
|
14417
|
+
"Goose applies tool permissions only at global scope (~/.config/goose/permission.yaml); project-scope permissions are not projected."
|
|
14032
14418
|
)
|
|
14033
14419
|
];
|
|
14034
14420
|
}
|
|
@@ -14058,6 +14444,7 @@ var init_goose2 = __esm({
|
|
|
14058
14444
|
init_skill_mirror();
|
|
14059
14445
|
init_importer16();
|
|
14060
14446
|
init_importer_spec3();
|
|
14447
|
+
init_scope_extras3();
|
|
14061
14448
|
init_linter16();
|
|
14062
14449
|
init_lint15();
|
|
14063
14450
|
init_import_map_builders();
|
|
@@ -14071,6 +14458,7 @@ var init_goose2 = __esm({
|
|
|
14071
14458
|
generateSkills: generateSkills15,
|
|
14072
14459
|
generateIgnore: generateIgnore8,
|
|
14073
14460
|
generateMcp: generateMcp12,
|
|
14461
|
+
generateHooks: generateHooks10,
|
|
14074
14462
|
importFrom: importFromGoose
|
|
14075
14463
|
};
|
|
14076
14464
|
project16 = {
|
|
@@ -14078,7 +14466,7 @@ var init_goose2 = __esm({
|
|
|
14078
14466
|
skillDir: GOOSE_SKILLS_DIR,
|
|
14079
14467
|
managedOutputs: {
|
|
14080
14468
|
dirs: [GOOSE_SKILLS_DIR],
|
|
14081
|
-
files: [GOOSE_ROOT_FILE, GOOSE_IGNORE]
|
|
14469
|
+
files: [GOOSE_ROOT_FILE, GOOSE_IGNORE, GOOSE_HOOKS_FILE]
|
|
14082
14470
|
},
|
|
14083
14471
|
paths: {
|
|
14084
14472
|
rulePath(_slug) {
|
|
@@ -14097,7 +14485,13 @@ var init_goose2 = __esm({
|
|
|
14097
14485
|
skillDir: GOOSE_GLOBAL_SKILLS_DIR,
|
|
14098
14486
|
managedOutputs: {
|
|
14099
14487
|
dirs: [GOOSE_GLOBAL_SKILLS_DIR],
|
|
14100
|
-
files: [
|
|
14488
|
+
files: [
|
|
14489
|
+
GOOSE_GLOBAL_ROOT_FILE,
|
|
14490
|
+
GOOSE_GLOBAL_IGNORE,
|
|
14491
|
+
GOOSE_GLOBAL_CONFIG,
|
|
14492
|
+
GOOSE_HOOKS_FILE,
|
|
14493
|
+
GOOSE_GLOBAL_PERMISSIONS
|
|
14494
|
+
]
|
|
14101
14495
|
},
|
|
14102
14496
|
rewriteGeneratedPath(path) {
|
|
14103
14497
|
if (path === GOOSE_ROOT_FILE) return GOOSE_GLOBAL_ROOT_FILE;
|
|
@@ -14126,7 +14520,7 @@ var init_goose2 = __esm({
|
|
|
14126
14520
|
agents: "none",
|
|
14127
14521
|
skills: "native",
|
|
14128
14522
|
mcp: "none",
|
|
14129
|
-
hooks: "
|
|
14523
|
+
hooks: "native",
|
|
14130
14524
|
ignore: "native",
|
|
14131
14525
|
permissions: "none"
|
|
14132
14526
|
};
|
|
@@ -14137,9 +14531,9 @@ var init_goose2 = __esm({
|
|
|
14137
14531
|
agents: "none",
|
|
14138
14532
|
skills: "native",
|
|
14139
14533
|
mcp: "native",
|
|
14140
|
-
hooks: "
|
|
14534
|
+
hooks: "native",
|
|
14141
14535
|
ignore: "native",
|
|
14142
|
-
permissions: "
|
|
14536
|
+
permissions: "native"
|
|
14143
14537
|
};
|
|
14144
14538
|
descriptor16 = {
|
|
14145
14539
|
id: GOOSE_TARGET,
|
|
@@ -14154,7 +14548,6 @@ var init_goose2 = __esm({
|
|
|
14154
14548
|
emptyImportMessage: "No Goose config found (.goosehints, .agents/skills, or .gooseignore).",
|
|
14155
14549
|
lintRules: lintRules16,
|
|
14156
14550
|
lint: {
|
|
14157
|
-
hooks: lintHooks7,
|
|
14158
14551
|
permissions: lintPermissions7,
|
|
14159
14552
|
mcp: lintMcp4
|
|
14160
14553
|
},
|
|
@@ -14168,7 +14561,8 @@ var init_goose2 = __esm({
|
|
|
14168
14561
|
GOOSE_GLOBAL_SKILLS_DIR,
|
|
14169
14562
|
GOOSE_GLOBAL_CONFIG
|
|
14170
14563
|
],
|
|
14171
|
-
layout: globalLayout16
|
|
14564
|
+
layout: globalLayout16,
|
|
14565
|
+
scopeExtras: generateGooseScopeExtras
|
|
14172
14566
|
},
|
|
14173
14567
|
importer: gooseImporter,
|
|
14174
14568
|
sharedArtifacts: {
|
|
@@ -15470,7 +15864,7 @@ function serializeCanonicalHooks(hooks) {
|
|
|
15470
15864
|
return stringify(hooks).trimEnd();
|
|
15471
15865
|
}
|
|
15472
15866
|
var CANONICAL_TO_KIRO, KIRO_TO_CANONICAL;
|
|
15473
|
-
var
|
|
15867
|
+
var init_hook_format2 = __esm({
|
|
15474
15868
|
"src/targets/kiro/hook-format.ts"() {
|
|
15475
15869
|
CANONICAL_TO_KIRO = {
|
|
15476
15870
|
UserPromptSubmit: "promptSubmit",
|
|
@@ -15536,7 +15930,7 @@ function generateMcp15(canonical) {
|
|
|
15536
15930
|
}
|
|
15537
15931
|
];
|
|
15538
15932
|
}
|
|
15539
|
-
function
|
|
15933
|
+
function generateHooks11(canonical) {
|
|
15540
15934
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
15541
15935
|
return generateKiroHooks(canonical.hooks).map((hook) => ({
|
|
15542
15936
|
path: `${KIRO_HOOKS_DIR}/${hook.name}`,
|
|
@@ -15567,7 +15961,7 @@ var init_generator23 = __esm({
|
|
|
15567
15961
|
init_embedded_skill();
|
|
15568
15962
|
init_command_skill();
|
|
15569
15963
|
init_markdown();
|
|
15570
|
-
|
|
15964
|
+
init_hook_format2();
|
|
15571
15965
|
init_constants18();
|
|
15572
15966
|
}
|
|
15573
15967
|
});
|
|
@@ -15672,7 +16066,7 @@ var init_importer20 = __esm({
|
|
|
15672
16066
|
init_shared_import_helpers();
|
|
15673
16067
|
init_fs();
|
|
15674
16068
|
init_markdown();
|
|
15675
|
-
|
|
16069
|
+
init_hook_format2();
|
|
15676
16070
|
init_constants18();
|
|
15677
16071
|
init_kiro2();
|
|
15678
16072
|
}
|
|
@@ -15729,7 +16123,7 @@ var init_kiro2 = __esm({
|
|
|
15729
16123
|
generateAgents: generateAgents19,
|
|
15730
16124
|
generateSkills: generateSkills18,
|
|
15731
16125
|
generateMcp: generateMcp15,
|
|
15732
|
-
generateHooks:
|
|
16126
|
+
generateHooks: generateHooks11,
|
|
15733
16127
|
generateIgnore: generateIgnore11,
|
|
15734
16128
|
importFrom: importFromKiro
|
|
15735
16129
|
};
|
|
@@ -16048,7 +16442,7 @@ async function importMcp4(projectRoot, scope, results) {
|
|
|
16048
16442
|
toPath: OPENCODE_CANONICAL_MCP
|
|
16049
16443
|
});
|
|
16050
16444
|
}
|
|
16051
|
-
async function
|
|
16445
|
+
async function importPermissions3(projectRoot, scope, results) {
|
|
16052
16446
|
const configFile = scope === "global" ? OPENCODE_GLOBAL_CONFIG_FILE : OPENCODE_CONFIG_FILE;
|
|
16053
16447
|
const srcPath = join(projectRoot, configFile);
|
|
16054
16448
|
const content = await readFileSafe(srcPath);
|
|
@@ -16086,7 +16480,7 @@ async function importFromOpenCode(projectRoot, options = {}) {
|
|
|
16086
16480
|
results.push(...await runDescriptorImport(descriptor21, projectRoot, scope, { normalize }));
|
|
16087
16481
|
await importEmbeddedSkills(projectRoot, OPENCODE_SKILLS_DIR, OPENCODE_TARGET, results, normalize);
|
|
16088
16482
|
await importMcp4(projectRoot, scope, results);
|
|
16089
|
-
await
|
|
16483
|
+
await importPermissions3(projectRoot, scope, results);
|
|
16090
16484
|
return results;
|
|
16091
16485
|
}
|
|
16092
16486
|
var init_importer21 = __esm({
|
|
@@ -16434,10 +16828,14 @@ function generateSkills20(canonical) {
|
|
|
16434
16828
|
return generateEmbeddedSkills(canonical, PI_AGENT_SKILLS_DIR);
|
|
16435
16829
|
}
|
|
16436
16830
|
function generateCommands20(canonical) {
|
|
16437
|
-
return canonical.commands.map((command) =>
|
|
16438
|
-
|
|
16439
|
-
|
|
16440
|
-
|
|
16831
|
+
return canonical.commands.map((command) => {
|
|
16832
|
+
const frontmatter = {};
|
|
16833
|
+
if (command.description) frontmatter.description = command.description;
|
|
16834
|
+
return {
|
|
16835
|
+
path: `${PI_AGENT_COMMANDS_DIR}/${command.name}.md`,
|
|
16836
|
+
content: serializeFrontmatter(frontmatter, command.body.trim() || "")
|
|
16837
|
+
};
|
|
16838
|
+
});
|
|
16441
16839
|
}
|
|
16442
16840
|
function generateAgents21(canonical) {
|
|
16443
16841
|
return canonical.agents.map((agent) => ({
|
|
@@ -16449,8 +16847,8 @@ var init_generator25 = __esm({
|
|
|
16449
16847
|
"src/targets/pi-agent/generator.ts"() {
|
|
16450
16848
|
init_embedded_skill();
|
|
16451
16849
|
init_managed_blocks();
|
|
16850
|
+
init_markdown();
|
|
16452
16851
|
init_projected_agent_skill();
|
|
16453
|
-
init_command_skill();
|
|
16454
16852
|
init_constants20();
|
|
16455
16853
|
}
|
|
16456
16854
|
});
|
|
@@ -16549,7 +16947,6 @@ var init_lint21 = __esm({
|
|
|
16549
16947
|
var target22, project22, globalLayout21, capabilities11, descriptor22;
|
|
16550
16948
|
var init_pi_agent2 = __esm({
|
|
16551
16949
|
"src/targets/pi-agent/index.ts"() {
|
|
16552
|
-
init_command_skill();
|
|
16553
16950
|
init_projected_agent_skill();
|
|
16554
16951
|
init_generator25();
|
|
16555
16952
|
init_skill_mirror();
|
|
@@ -16571,7 +16968,7 @@ var init_pi_agent2 = __esm({
|
|
|
16571
16968
|
rootInstructionPath: PI_AGENT_ROOT_FILE,
|
|
16572
16969
|
skillDir: PI_AGENT_SKILLS_DIR,
|
|
16573
16970
|
managedOutputs: {
|
|
16574
|
-
dirs: [PI_AGENT_SKILLS_DIR],
|
|
16971
|
+
dirs: [PI_AGENT_SKILLS_DIR, PI_AGENT_COMMANDS_DIR],
|
|
16575
16972
|
files: [PI_AGENT_ROOT_FILE]
|
|
16576
16973
|
},
|
|
16577
16974
|
paths: {
|
|
@@ -16579,7 +16976,7 @@ var init_pi_agent2 = __esm({
|
|
|
16579
16976
|
return PI_AGENT_ROOT_FILE;
|
|
16580
16977
|
},
|
|
16581
16978
|
commandPath(name) {
|
|
16582
|
-
return `${
|
|
16979
|
+
return `${PI_AGENT_COMMANDS_DIR}/${name}.md`;
|
|
16583
16980
|
},
|
|
16584
16981
|
agentPath(name) {
|
|
16585
16982
|
return `${PI_AGENT_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
@@ -16590,11 +16987,14 @@ var init_pi_agent2 = __esm({
|
|
|
16590
16987
|
rootInstructionPath: PI_AGENT_GLOBAL_ROOT_FILE,
|
|
16591
16988
|
skillDir: PI_AGENT_GLOBAL_SKILLS_DIR,
|
|
16592
16989
|
managedOutputs: {
|
|
16593
|
-
dirs: [PI_AGENT_GLOBAL_SKILLS_DIR],
|
|
16990
|
+
dirs: [PI_AGENT_GLOBAL_SKILLS_DIR, PI_AGENT_GLOBAL_COMMANDS_DIR],
|
|
16594
16991
|
files: [PI_AGENT_GLOBAL_ROOT_FILE]
|
|
16595
16992
|
},
|
|
16596
16993
|
rewriteGeneratedPath(path) {
|
|
16597
16994
|
if (path === PI_AGENT_ROOT_FILE) return PI_AGENT_GLOBAL_ROOT_FILE;
|
|
16995
|
+
if (path.startsWith(`${PI_AGENT_COMMANDS_DIR}/`)) {
|
|
16996
|
+
return path.replace(`${PI_AGENT_COMMANDS_DIR}/`, `${PI_AGENT_GLOBAL_COMMANDS_DIR}/`);
|
|
16997
|
+
}
|
|
16598
16998
|
if (path.startsWith(`${PI_AGENT_SKILLS_DIR}/`)) {
|
|
16599
16999
|
return path.replace(`${PI_AGENT_SKILLS_DIR}/`, `${PI_AGENT_GLOBAL_SKILLS_DIR}/`);
|
|
16600
17000
|
}
|
|
@@ -16608,7 +17008,7 @@ var init_pi_agent2 = __esm({
|
|
|
16608
17008
|
return PI_AGENT_GLOBAL_ROOT_FILE;
|
|
16609
17009
|
},
|
|
16610
17010
|
commandPath(name) {
|
|
16611
|
-
return `${
|
|
17011
|
+
return `${PI_AGENT_GLOBAL_COMMANDS_DIR}/${name}.md`;
|
|
16612
17012
|
},
|
|
16613
17013
|
agentPath(name) {
|
|
16614
17014
|
return `${PI_AGENT_GLOBAL_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
|
|
@@ -16618,7 +17018,7 @@ var init_pi_agent2 = __esm({
|
|
|
16618
17018
|
capabilities11 = {
|
|
16619
17019
|
rules: "native",
|
|
16620
17020
|
additionalRules: "embedded",
|
|
16621
|
-
commands: "
|
|
17021
|
+
commands: "native",
|
|
16622
17022
|
agents: "none",
|
|
16623
17023
|
skills: "native",
|
|
16624
17024
|
mcp: "none",
|
|
@@ -16631,7 +17031,7 @@ var init_pi_agent2 = __esm({
|
|
|
16631
17031
|
metadata: {
|
|
16632
17032
|
displayName: "Pi Agent",
|
|
16633
17033
|
category: "cli",
|
|
16634
|
-
officialUrl: "https://github.com/
|
|
17034
|
+
officialUrl: "https://github.com/earendil-works/pi",
|
|
16635
17035
|
shortDescription: "Pi coding agent"
|
|
16636
17036
|
},
|
|
16637
17037
|
generators: target22,
|
|
@@ -16644,7 +17044,7 @@ var init_pi_agent2 = __esm({
|
|
|
16644
17044
|
ignore: lintIgnore6,
|
|
16645
17045
|
mcp: lintMcp7
|
|
16646
17046
|
},
|
|
16647
|
-
supportsConversion: {
|
|
17047
|
+
supportsConversion: { agents: true },
|
|
16648
17048
|
project: project22,
|
|
16649
17049
|
globalSupport: {
|
|
16650
17050
|
capabilities: capabilities11,
|
|
@@ -16662,6 +17062,17 @@ var init_pi_agent2 = __esm({
|
|
|
16662
17062
|
canonicalDir: PI_AGENT_CANONICAL_RULES_DIR,
|
|
16663
17063
|
canonicalRootFilename: "_root.md",
|
|
16664
17064
|
markAsRoot: true
|
|
17065
|
+
},
|
|
17066
|
+
commands: {
|
|
17067
|
+
feature: "commands",
|
|
17068
|
+
mode: "directory",
|
|
17069
|
+
source: {
|
|
17070
|
+
project: [PI_AGENT_COMMANDS_DIR],
|
|
17071
|
+
global: [PI_AGENT_GLOBAL_COMMANDS_DIR]
|
|
17072
|
+
},
|
|
17073
|
+
canonicalDir: PI_AGENT_CANONICAL_COMMANDS_DIR,
|
|
17074
|
+
extensions: [".md"],
|
|
17075
|
+
preset: "command"
|
|
16665
17076
|
}
|
|
16666
17077
|
},
|
|
16667
17078
|
sharedArtifacts: {
|
|
@@ -16751,7 +17162,7 @@ function generateIgnore12(canonical) {
|
|
|
16751
17162
|
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
16752
17163
|
return [{ path: QWEN_IGNORE, content: canonical.ignore.join("\n") }];
|
|
16753
17164
|
}
|
|
16754
|
-
function
|
|
17165
|
+
function generateHooks12(canonical) {
|
|
16755
17166
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
16756
17167
|
const hooks = buildClaudeHooksObjectFromCanonical(canonical);
|
|
16757
17168
|
if (Object.keys(hooks).length === 0) return [];
|
|
@@ -16925,7 +17336,7 @@ var init_qwen_code2 = __esm({
|
|
|
16925
17336
|
generateSkills: generateSkills21,
|
|
16926
17337
|
generateMcp: generateMcp17,
|
|
16927
17338
|
generateIgnore: generateIgnore12,
|
|
16928
|
-
generateHooks:
|
|
17339
|
+
generateHooks: generateHooks12,
|
|
16929
17340
|
generatePermissions: generatePermissions8,
|
|
16930
17341
|
importFrom: importFromQwenCode
|
|
16931
17342
|
};
|
|
@@ -17396,6 +17807,43 @@ var init_import_mappers9 = __esm({
|
|
|
17396
17807
|
};
|
|
17397
17808
|
}
|
|
17398
17809
|
});
|
|
17810
|
+
async function importRooModes(projectRoot, results, normalize) {
|
|
17811
|
+
const srcPath = join(projectRoot, ROO_CODE_MODES_FILE);
|
|
17812
|
+
const content = await readFileSafe(srcPath);
|
|
17813
|
+
if (content === null) return;
|
|
17814
|
+
let parsed;
|
|
17815
|
+
try {
|
|
17816
|
+
parsed = parse(content);
|
|
17817
|
+
} catch {
|
|
17818
|
+
return;
|
|
17819
|
+
}
|
|
17820
|
+
const modes = parsed?.customModes;
|
|
17821
|
+
if (!Array.isArray(modes)) return;
|
|
17822
|
+
const destDir = join(projectRoot, ROO_CODE_CANONICAL_AGENTS_DIR);
|
|
17823
|
+
for (const mode of modes) {
|
|
17824
|
+
if (!mode || typeof mode !== "object") continue;
|
|
17825
|
+
const m = mode;
|
|
17826
|
+
const slug = typeof m.slug === "string" && m.slug ? m.slug : typeof m.name === "string" && m.name ? m.name : null;
|
|
17827
|
+
if (!slug) continue;
|
|
17828
|
+
const name = typeof m.name === "string" ? m.name : slug;
|
|
17829
|
+
const description = typeof m.description === "string" ? m.description : "";
|
|
17830
|
+
const body = typeof m.roleDefinition === "string" ? m.roleDefinition : "";
|
|
17831
|
+
const destPath = join(destDir, `${slug}.md`);
|
|
17832
|
+
const fileContent = await serializeImportedAgentWithFallback(
|
|
17833
|
+
destPath,
|
|
17834
|
+
{ name, description, tools: [] },
|
|
17835
|
+
normalize(body, srcPath, destPath)
|
|
17836
|
+
);
|
|
17837
|
+
await mkdirp(dirname(destPath));
|
|
17838
|
+
await writeFileAtomic(destPath, fileContent);
|
|
17839
|
+
results.push({
|
|
17840
|
+
fromTool: ROO_CODE_TARGET,
|
|
17841
|
+
fromPath: srcPath,
|
|
17842
|
+
toPath: `${ROO_CODE_CANONICAL_AGENTS_DIR}/${slug}.md`,
|
|
17843
|
+
feature: "agents"
|
|
17844
|
+
});
|
|
17845
|
+
}
|
|
17846
|
+
}
|
|
17399
17847
|
async function importPerModeRules(projectRoot, results, normalize) {
|
|
17400
17848
|
const rooDir = join(projectRoot, ROO_CODE_DIR);
|
|
17401
17849
|
let entries;
|
|
@@ -17435,15 +17883,18 @@ async function importFromRooCode(projectRoot, options = {}) {
|
|
|
17435
17883
|
const normalize = await createImportReferenceNormalizer(ROO_CODE_TARGET, projectRoot, scope);
|
|
17436
17884
|
results.push(...await runDescriptorImport(descriptor25, projectRoot, scope, { normalize }));
|
|
17437
17885
|
await importPerModeRules(projectRoot, results, normalize);
|
|
17886
|
+
if (scope === "project") await importRooModes(projectRoot, results, normalize);
|
|
17438
17887
|
await importEmbeddedSkills(projectRoot, ROO_CODE_SKILLS_DIR, ROO_CODE_TARGET, results, normalize);
|
|
17439
17888
|
return results;
|
|
17440
17889
|
}
|
|
17441
17890
|
var init_importer25 = __esm({
|
|
17442
17891
|
"src/targets/roo-code/importer.ts"() {
|
|
17443
17892
|
init_import_rewriter();
|
|
17893
|
+
init_fs();
|
|
17444
17894
|
init_embedded_skill();
|
|
17445
17895
|
init_import_orchestrator();
|
|
17446
17896
|
init_descriptor_import_runner();
|
|
17897
|
+
init_import_metadata();
|
|
17447
17898
|
init_import_mappers9();
|
|
17448
17899
|
init_constants23();
|
|
17449
17900
|
init_roo_code2();
|
|
@@ -17485,7 +17936,7 @@ var init_lint23 = __esm({
|
|
|
17485
17936
|
init_helpers();
|
|
17486
17937
|
}
|
|
17487
17938
|
});
|
|
17488
|
-
function
|
|
17939
|
+
function computeStatus6(existing, content) {
|
|
17489
17940
|
if (existing === null) return "created";
|
|
17490
17941
|
if (existing !== content) return "updated";
|
|
17491
17942
|
return "unchanged";
|
|
@@ -17551,7 +18002,7 @@ var init_roo_code2 = __esm({
|
|
|
17551
18002
|
path: ROO_CODE_GLOBAL_MODES_FILE,
|
|
17552
18003
|
content,
|
|
17553
18004
|
currentContent: existing ?? void 0,
|
|
17554
|
-
status:
|
|
18005
|
+
status: computeStatus6(existing, content)
|
|
17555
18006
|
}
|
|
17556
18007
|
];
|
|
17557
18008
|
};
|
|
@@ -17635,7 +18086,7 @@ var init_roo_code2 = __esm({
|
|
|
17635
18086
|
rules: "native",
|
|
17636
18087
|
additionalRules: "native",
|
|
17637
18088
|
commands: "native",
|
|
17638
|
-
agents: "
|
|
18089
|
+
agents: "native",
|
|
17639
18090
|
skills: "native",
|
|
17640
18091
|
mcp: "native",
|
|
17641
18092
|
hooks: "none",
|
|
@@ -18778,7 +19229,7 @@ function toWindsurfHooks(hooks) {
|
|
|
18778
19229
|
}
|
|
18779
19230
|
return result;
|
|
18780
19231
|
}
|
|
18781
|
-
function
|
|
19232
|
+
function generateHooks13(canonical) {
|
|
18782
19233
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
18783
19234
|
const hooks = toWindsurfHooks(canonical.hooks);
|
|
18784
19235
|
if (Object.keys(hooks).length === 0) return [];
|
|
@@ -19242,7 +19693,7 @@ var init_windsurf2 = __esm({
|
|
|
19242
19693
|
generateAgents: generateAgents27,
|
|
19243
19694
|
generateSkills: generateSkills27,
|
|
19244
19695
|
generateMcp: generateMcp22,
|
|
19245
|
-
generateHooks:
|
|
19696
|
+
generateHooks: generateHooks13,
|
|
19246
19697
|
generateIgnore: generateIgnore15,
|
|
19247
19698
|
importFrom: importFromWindsurf
|
|
19248
19699
|
};
|