agentsmesh 0.40.0 → 0.41.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 +75 -0
- package/README.md +1 -1
- package/dist/canonical.js +299 -238
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +271 -332
- package/dist/engine.d.ts +7 -8
- package/dist/engine.js +771 -276
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1733 -521
- package/dist/index.js.map +1 -1
- package/dist/{init-B1qdo3Dl.d.ts → init-DruMEhnc.d.ts} +97 -42
- package/dist/lessons.d.ts +7 -4
- package/dist/lessons.js +2091 -613
- package/dist/lessons.js.map +1 -1
- package/dist/{target-descriptor-CvTJyDxd.d.ts → target-descriptor-CMV6vxVE.d.ts} +7 -0
- package/dist/targets.d.ts +2 -2
- package/dist/targets.js +265 -219
- package/dist/targets.js.map +1 -1
- package/package.json +3 -2
package/dist/targets.js
CHANGED
|
@@ -177,6 +177,7 @@ var init_target_descriptor_schema = __esm({
|
|
|
177
177
|
emitScopedSettings: z.function().optional(),
|
|
178
178
|
mergeGeneratedOutputContent: z.function().optional(),
|
|
179
179
|
postProcessHookOutputs: z.function().optional(),
|
|
180
|
+
hookContextEvents: z.array(z.string()).optional(),
|
|
180
181
|
preservesManualActivation: z.boolean().optional()
|
|
181
182
|
}).passthrough();
|
|
182
183
|
targetDescriptorSchema = targetDescriptorSchemaBase.superRefine((value, ctx) => {
|
|
@@ -548,10 +549,16 @@ var init_guards = __esm({
|
|
|
548
549
|
"src/utils/types/guards.ts"() {
|
|
549
550
|
}
|
|
550
551
|
});
|
|
551
|
-
var
|
|
552
|
+
var init_cli_invocation = __esm({
|
|
553
|
+
"src/lessons/cli-invocation.ts"() {
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
var RECALL_SUBCOMMAND, RECALL_HOOK_COMMAND;
|
|
552
557
|
var init_recall_hook_scaffold = __esm({
|
|
553
558
|
"src/lessons/recall-hook-scaffold.ts"() {
|
|
554
|
-
|
|
559
|
+
init_cli_invocation();
|
|
560
|
+
RECALL_SUBCOMMAND = "lessons hook";
|
|
561
|
+
RECALL_HOOK_COMMAND = `agentsmesh ${RECALL_SUBCOMMAND}`;
|
|
555
562
|
}
|
|
556
563
|
});
|
|
557
564
|
|
|
@@ -1884,6 +1891,15 @@ var init_constants = __esm({
|
|
|
1884
1891
|
}
|
|
1885
1892
|
});
|
|
1886
1893
|
|
|
1894
|
+
// src/targets/catalog/ignore-output.ts
|
|
1895
|
+
function ignoreOutput(path) {
|
|
1896
|
+
return (canonical) => canonical.ignore.length === 0 ? [] : [{ path, content: canonical.ignore.join("\n") }];
|
|
1897
|
+
}
|
|
1898
|
+
var init_ignore_output = __esm({
|
|
1899
|
+
"src/targets/catalog/ignore-output.ts"() {
|
|
1900
|
+
}
|
|
1901
|
+
});
|
|
1902
|
+
|
|
1887
1903
|
// src/targets/aider/generator.ts
|
|
1888
1904
|
function buildAiderConventions(canonical) {
|
|
1889
1905
|
const root = canonical.rules.find((rule) => rule.root);
|
|
@@ -1913,11 +1929,7 @@ function generateAgents(canonical) {
|
|
|
1913
1929
|
content: serializeProjectedAgentSkill(agent)
|
|
1914
1930
|
}));
|
|
1915
1931
|
}
|
|
1916
|
-
|
|
1917
|
-
if (canonical.ignore.length === 0) return [];
|
|
1918
|
-
return [{ path: AIDER_IGNORE, content: canonical.ignore.join("\n") }];
|
|
1919
|
-
}
|
|
1920
|
-
var generateMcp, generatePermissions;
|
|
1932
|
+
var generateIgnore, generateMcp, generatePermissions;
|
|
1921
1933
|
var init_generator = __esm({
|
|
1922
1934
|
"src/targets/aider/generator.ts"() {
|
|
1923
1935
|
init_no_outputs();
|
|
@@ -1926,6 +1938,8 @@ var init_generator = __esm({
|
|
|
1926
1938
|
init_projected_agent_skill();
|
|
1927
1939
|
init_command_skill();
|
|
1928
1940
|
init_constants();
|
|
1941
|
+
init_ignore_output();
|
|
1942
|
+
generateIgnore = ignoreOutput(AIDER_IGNORE);
|
|
1929
1943
|
generateMcp = NO_OUTPUTS;
|
|
1930
1944
|
generatePermissions = NO_OUTPUTS;
|
|
1931
1945
|
}
|
|
@@ -6769,10 +6783,6 @@ function generateAgents4(canonical) {
|
|
|
6769
6783
|
content: serializeAntigravityAgent(agent)
|
|
6770
6784
|
}));
|
|
6771
6785
|
}
|
|
6772
|
-
function generateIgnore3(canonical) {
|
|
6773
|
-
if (canonical.ignore.length === 0) return [];
|
|
6774
|
-
return [{ path: ANTIGRAVITY_IGNORE_FILE, content: canonical.ignore.join("\n") }];
|
|
6775
|
-
}
|
|
6776
6786
|
function renderAntigravityGlobalInstructions(canonical) {
|
|
6777
6787
|
const root = canonical.rules.find((rule) => rule.root);
|
|
6778
6788
|
const nonRootRules = canonical.rules.filter((rule) => {
|
|
@@ -6787,7 +6797,7 @@ function generateHooks2(canonical) {
|
|
|
6787
6797
|
if (Object.keys(hooks).length === 0) return [];
|
|
6788
6798
|
return [{ path: ANTIGRAVITY_HOOKS_FILE, content: JSON.stringify(hooks, null, 2) }];
|
|
6789
6799
|
}
|
|
6790
|
-
var generatePermissions3;
|
|
6800
|
+
var generateIgnore3, generatePermissions3;
|
|
6791
6801
|
var init_generator4 = __esm({
|
|
6792
6802
|
"src/targets/antigravity/generator.ts"() {
|
|
6793
6803
|
init_no_outputs();
|
|
@@ -6796,6 +6806,8 @@ var init_generator4 = __esm({
|
|
|
6796
6806
|
init_hooks_format2();
|
|
6797
6807
|
init_agents_format();
|
|
6798
6808
|
init_constants5();
|
|
6809
|
+
init_ignore_output();
|
|
6810
|
+
generateIgnore3 = ignoreOutput(ANTIGRAVITY_IGNORE_FILE);
|
|
6799
6811
|
generatePermissions3 = NO_OUTPUTS;
|
|
6800
6812
|
}
|
|
6801
6813
|
});
|
|
@@ -8385,16 +8397,14 @@ function generateHooks3(canonical) {
|
|
|
8385
8397
|
const content = JSON.stringify({ hooks: claudeHooks }, null, 2);
|
|
8386
8398
|
return [{ path: CLAUDE_SETTINGS, content }];
|
|
8387
8399
|
}
|
|
8388
|
-
|
|
8389
|
-
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
8390
|
-
const content = canonical.ignore.join("\n");
|
|
8391
|
-
return [{ path: CLAUDE_IGNORE, content }];
|
|
8392
|
-
}
|
|
8400
|
+
var generateIgnore5;
|
|
8393
8401
|
var init_generator6 = __esm({
|
|
8394
8402
|
"src/targets/claude-code/generator.ts"() {
|
|
8395
8403
|
init_markdown();
|
|
8396
8404
|
init_constants7();
|
|
8397
8405
|
init_hooks_format2();
|
|
8406
|
+
init_ignore_output();
|
|
8407
|
+
generateIgnore5 = ignoreOutput(CLAUDE_IGNORE);
|
|
8398
8408
|
}
|
|
8399
8409
|
});
|
|
8400
8410
|
function ruleSectionTitle(rule) {
|
|
@@ -10213,11 +10223,7 @@ function generateMcp5(canonical) {
|
|
|
10213
10223
|
if (!canonical.mcp || Object.keys(canonical.mcp.mcpServers).length === 0) return [];
|
|
10214
10224
|
return [{ path: CODEBUFF_MCP_FILE, content: serializeCodebuffMcp(canonical.mcp) }];
|
|
10215
10225
|
}
|
|
10216
|
-
|
|
10217
|
-
if (canonical.ignore.length === 0) return [];
|
|
10218
|
-
return [{ path: CODEBUFF_IGNORE_FILE, content: canonical.ignore.join("\n") }];
|
|
10219
|
-
}
|
|
10220
|
-
var generateAgents8, generateHooks5, generatePermissions6;
|
|
10226
|
+
var generateIgnore7, generateAgents8, generateHooks5, generatePermissions6;
|
|
10221
10227
|
var init_generator8 = __esm({
|
|
10222
10228
|
"src/targets/codebuff/generator.ts"() {
|
|
10223
10229
|
init_no_outputs();
|
|
@@ -10227,6 +10233,8 @@ var init_generator8 = __esm({
|
|
|
10227
10233
|
init_nested_rules();
|
|
10228
10234
|
init_mcp_format2();
|
|
10229
10235
|
init_constants9();
|
|
10236
|
+
init_ignore_output();
|
|
10237
|
+
generateIgnore7 = ignoreOutput(CODEBUFF_IGNORE_FILE);
|
|
10230
10238
|
generateAgents8 = NO_OUTPUTS;
|
|
10231
10239
|
generateHooks5 = NO_OUTPUTS;
|
|
10232
10240
|
generatePermissions6 = NO_OUTPUTS;
|
|
@@ -12739,53 +12747,37 @@ var init_mcp_generator = __esm({
|
|
|
12739
12747
|
}
|
|
12740
12748
|
});
|
|
12741
12749
|
|
|
12742
|
-
// src/targets/copilot/hook-entry.ts
|
|
12743
|
-
function hasHookCommand2(entry) {
|
|
12744
|
-
return hasHookCommand(entry);
|
|
12745
|
-
}
|
|
12746
|
-
var init_hook_entry = __esm({
|
|
12747
|
-
"src/targets/copilot/hook-entry.ts"() {
|
|
12748
|
-
init_hook_command();
|
|
12749
|
-
}
|
|
12750
|
-
});
|
|
12751
|
-
|
|
12752
12750
|
// src/targets/copilot/hook-format.ts
|
|
12753
|
-
function
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
}
|
|
12751
|
+
function copilotHookGroups(hooks) {
|
|
12752
|
+
return Object.entries(hooks ?? {}).flatMap(([event, entries]) => {
|
|
12753
|
+
const copilotEvent = CANONICAL_TO_COPILOT.get(event);
|
|
12754
|
+
if (!copilotEvent || !Array.isArray(entries)) return [];
|
|
12755
|
+
const kept = entries.filter(
|
|
12756
|
+
(entry) => typeof entry === "object" && entry !== null && hasHookCommand(entry)
|
|
12757
|
+
);
|
|
12758
|
+
return kept.length > 0 ? [{ event, copilotEvent, entries: kept }] : [];
|
|
12759
|
+
});
|
|
12760
|
+
}
|
|
12761
|
+
function wrapperScriptName(event, index) {
|
|
12762
|
+
return `${event.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase()}-${index}.sh`;
|
|
12766
12763
|
}
|
|
12767
12764
|
function buildCopilotHooksObject(hooks) {
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
(entry) => typeof entry === "object" && entry !== null && hasHookCommand2(entry)
|
|
12775
|
-
).map((entry, index) => {
|
|
12776
|
-
const safePhase = event.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase();
|
|
12765
|
+
const groups = copilotHookGroups(hooks);
|
|
12766
|
+
if (groups.length === 0) return null;
|
|
12767
|
+
return Object.fromEntries(
|
|
12768
|
+
groups.map(({ event, copilotEvent, entries }) => [
|
|
12769
|
+
copilotEvent,
|
|
12770
|
+
entries.map((entry, index) => {
|
|
12777
12771
|
const hook = {
|
|
12778
12772
|
type: "command",
|
|
12779
|
-
bash: `./scripts/${
|
|
12773
|
+
bash: `./scripts/${wrapperScriptName(event, index)}`
|
|
12780
12774
|
};
|
|
12781
12775
|
if (entry.matcher && entry.matcher !== "*") hook.matcher = entry.matcher;
|
|
12782
12776
|
if (entry.timeout !== void 0) hook.timeoutSec = Math.ceil(entry.timeout / 1e3);
|
|
12783
12777
|
return hook;
|
|
12784
|
-
})
|
|
12785
|
-
|
|
12786
|
-
})
|
|
12778
|
+
})
|
|
12779
|
+
])
|
|
12787
12780
|
);
|
|
12788
|
-
return Object.keys(result2).length > 0 ? result2 : null;
|
|
12789
12781
|
}
|
|
12790
12782
|
function generateHooks8(canonical) {
|
|
12791
12783
|
const hooks = buildCopilotHooksObject(canonical.hooks);
|
|
@@ -12797,10 +12789,24 @@ function generateHooks8(canonical) {
|
|
|
12797
12789
|
}
|
|
12798
12790
|
];
|
|
12799
12791
|
}
|
|
12792
|
+
var COPILOT_HOOK_CONTEXT_EVENTS, CANONICAL_TO_COPILOT;
|
|
12800
12793
|
var init_hook_format = __esm({
|
|
12801
12794
|
"src/targets/copilot/hook-format.ts"() {
|
|
12802
12795
|
init_constants32();
|
|
12803
|
-
|
|
12796
|
+
init_hook_command();
|
|
12797
|
+
COPILOT_HOOK_CONTEXT_EVENTS = [
|
|
12798
|
+
"SessionStart",
|
|
12799
|
+
"PostToolUse",
|
|
12800
|
+
"PostToolUseFailure"
|
|
12801
|
+
];
|
|
12802
|
+
CANONICAL_TO_COPILOT = /* @__PURE__ */ new Map([
|
|
12803
|
+
["PreToolUse", "preToolUse"],
|
|
12804
|
+
["PostToolUse", "postToolUse"],
|
|
12805
|
+
["PostToolUseFailure", "postToolUseFailure"],
|
|
12806
|
+
["Notification", "notification"],
|
|
12807
|
+
["UserPromptSubmit", "userPromptSubmitted"],
|
|
12808
|
+
["SessionStart", "sessionStart"]
|
|
12809
|
+
]);
|
|
12804
12810
|
}
|
|
12805
12811
|
});
|
|
12806
12812
|
function ruleSlug2(source) {
|
|
@@ -12906,18 +12912,7 @@ var init_generator12 = __esm({
|
|
|
12906
12912
|
}
|
|
12907
12913
|
});
|
|
12908
12914
|
function mapCopilotHookEvent(event) {
|
|
12909
|
-
|
|
12910
|
-
case "preToolUse":
|
|
12911
|
-
return "PreToolUse";
|
|
12912
|
-
case "postToolUse":
|
|
12913
|
-
return "PostToolUse";
|
|
12914
|
-
case "notification":
|
|
12915
|
-
return "Notification";
|
|
12916
|
-
case "userPromptSubmitted":
|
|
12917
|
-
return "UserPromptSubmit";
|
|
12918
|
-
default:
|
|
12919
|
-
return null;
|
|
12920
|
-
}
|
|
12915
|
+
return COPILOT_TO_CANONICAL.get(event) ?? null;
|
|
12921
12916
|
}
|
|
12922
12917
|
function extractMatcher(comment) {
|
|
12923
12918
|
if (typeof comment !== "string") return "*";
|
|
@@ -13005,11 +13000,16 @@ async function importHooks(projectRoot, results, options = {}) {
|
|
|
13005
13000
|
feature: "hooks"
|
|
13006
13001
|
});
|
|
13007
13002
|
}
|
|
13003
|
+
var COPILOT_TO_CANONICAL;
|
|
13008
13004
|
var init_hook_parser = __esm({
|
|
13009
13005
|
"src/targets/copilot/hook-parser.ts"() {
|
|
13010
13006
|
init_canonical_paths();
|
|
13011
13007
|
init_fs();
|
|
13012
13008
|
init_constants32();
|
|
13009
|
+
init_hook_format();
|
|
13010
|
+
COPILOT_TO_CANONICAL = new Map(
|
|
13011
|
+
[...CANONICAL_TO_COPILOT].map(([canonical, copilot]) => [copilot, canonical])
|
|
13012
|
+
);
|
|
13013
13013
|
}
|
|
13014
13014
|
});
|
|
13015
13015
|
async function importSkills2(projectRoot, results, normalize, skillsDirRel = COPILOT_SKILLS_DIR) {
|
|
@@ -13246,7 +13246,7 @@ function lintCommands4(canonical) {
|
|
|
13246
13246
|
}
|
|
13247
13247
|
function lintHooks9(canonical) {
|
|
13248
13248
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
13249
|
-
const supported = [
|
|
13249
|
+
const supported = [...CANONICAL_TO_COPILOT.keys()];
|
|
13250
13250
|
const diagnostics = unsupportedHookEventNames(canonical.hooks, supported).map(
|
|
13251
13251
|
(event) => createUnsupportedHookWarning(event, "copilot", supported, {
|
|
13252
13252
|
unsupportedBy: "Copilot hooks"
|
|
@@ -13269,11 +13269,9 @@ function lintHooks9(canonical) {
|
|
|
13269
13269
|
var init_lint10 = __esm({
|
|
13270
13270
|
"src/targets/copilot/lint.ts"() {
|
|
13271
13271
|
init_helpers();
|
|
13272
|
+
init_hook_format();
|
|
13272
13273
|
}
|
|
13273
13274
|
});
|
|
13274
|
-
function safePhaseName(phase) {
|
|
13275
|
-
return phase.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase();
|
|
13276
|
-
}
|
|
13277
13275
|
function toRepoRelative(projectRoot, sourcePath) {
|
|
13278
13276
|
const repoRelative = relative(projectRoot, sourcePath).replace(/\\/g, "/");
|
|
13279
13277
|
if (!repoRelative || repoRelative.startsWith("../")) return null;
|
|
@@ -13301,9 +13299,6 @@ async function buildAssetOutput(projectRoot, command, hooksDirRel) {
|
|
|
13301
13299
|
rewrittenCommand: rewriteWrapperCommand(command, repoRelative)
|
|
13302
13300
|
};
|
|
13303
13301
|
}
|
|
13304
|
-
function wrapperPath(event, index, hooksDirRel) {
|
|
13305
|
-
return `${hooksDirRel}/scripts/${safePhaseName(event)}-${index}.sh`;
|
|
13306
|
-
}
|
|
13307
13302
|
function safeShellLine2(value) {
|
|
13308
13303
|
return value.replace(/[\r\n]+/g, " ");
|
|
13309
13304
|
}
|
|
@@ -13318,15 +13313,13 @@ function buildWrapper(command, matcher) {
|
|
|
13318
13313
|
].join("\n");
|
|
13319
13314
|
}
|
|
13320
13315
|
async function addHookScriptAssets(projectRoot, canonical, outputs, hooksDirRel = COPILOT_HOOKS_DIR) {
|
|
13321
|
-
|
|
13316
|
+
const groups = copilotHookGroups(canonical.hooks);
|
|
13317
|
+
if (groups.length === 0) return outputs;
|
|
13322
13318
|
const wrapperOutputs = [];
|
|
13323
13319
|
const assetOutputs = /* @__PURE__ */ new Map();
|
|
13324
|
-
for (const
|
|
13325
|
-
|
|
13326
|
-
|
|
13327
|
-
for (const entry of entries) {
|
|
13328
|
-
if (!hasHookCommand2(entry)) continue;
|
|
13329
|
-
const scriptPath = wrapperPath(event, index, hooksDirRel);
|
|
13320
|
+
for (const { event, entries } of groups) {
|
|
13321
|
+
for (const [index, entry] of entries.entries()) {
|
|
13322
|
+
const scriptPath = `${hooksDirRel}/scripts/${wrapperScriptName(event, index)}`;
|
|
13330
13323
|
let command = entry.command;
|
|
13331
13324
|
const asset = await buildAssetOutput(projectRoot, entry.command, hooksDirRel);
|
|
13332
13325
|
if (asset) {
|
|
@@ -13340,7 +13333,6 @@ async function addHookScriptAssets(projectRoot, canonical, outputs, hooksDirRel
|
|
|
13340
13333
|
'set -eu\nHOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"\n'
|
|
13341
13334
|
);
|
|
13342
13335
|
wrapperOutputs.push({ path: scriptPath, content: wrapper });
|
|
13343
|
-
index++;
|
|
13344
13336
|
}
|
|
13345
13337
|
}
|
|
13346
13338
|
return [...outputs, ...wrapperOutputs, ...assetOutputs.values()];
|
|
@@ -13350,7 +13342,7 @@ var init_hook_assets = __esm({
|
|
|
13350
13342
|
"src/targets/copilot/hook-assets.ts"() {
|
|
13351
13343
|
init_fs();
|
|
13352
13344
|
init_constants32();
|
|
13353
|
-
|
|
13345
|
+
init_hook_format();
|
|
13354
13346
|
SCRIPT_PREFIX_RE = /^(?<prefix>\s*(?:(?:bash|sh|zsh)\s+)?)["']?(?<path>(?:\.\.\/|\.\/|[^/\s"'`]+\/)[^\s"'`]+)["']?(?<suffix>(?:\s.*)?)$/;
|
|
13355
13347
|
}
|
|
13356
13348
|
});
|
|
@@ -13668,6 +13660,7 @@ var init_copilot2 = __esm({
|
|
|
13668
13660
|
init_command_prompt();
|
|
13669
13661
|
init_lint10();
|
|
13670
13662
|
init_hook_assets();
|
|
13663
|
+
init_hook_format();
|
|
13671
13664
|
init_scope_extras2();
|
|
13672
13665
|
init_importer_spec2();
|
|
13673
13666
|
init_capabilities6();
|
|
@@ -13798,6 +13791,7 @@ var init_copilot2 = __esm({
|
|
|
13798
13791
|
permissions: lintPermissions7
|
|
13799
13792
|
},
|
|
13800
13793
|
postProcessHookOutputs: async (projectRoot, canonical, outputs) => addHookScriptAssets(projectRoot, canonical, [...outputs]),
|
|
13794
|
+
hookContextEvents: COPILOT_HOOK_CONTEXT_EVENTS,
|
|
13801
13795
|
mergeGeneratedOutputContent: mergeCopilotMcpJson,
|
|
13802
13796
|
project: project7,
|
|
13803
13797
|
globalSupport: {
|
|
@@ -13885,11 +13879,6 @@ function generatePermissions8(canonical) {
|
|
|
13885
13879
|
});
|
|
13886
13880
|
return [{ path: CRUSH_CONFIG_FILE, content: JSON.stringify(crushConfig, null, 2) }];
|
|
13887
13881
|
}
|
|
13888
|
-
function generateIgnore9(canonical) {
|
|
13889
|
-
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
13890
|
-
const content = canonical.ignore.join("\n");
|
|
13891
|
-
return [{ path: CRUSH_IGNORE, content }];
|
|
13892
|
-
}
|
|
13893
13882
|
function buildCrushHooksFromCanonical(canonical) {
|
|
13894
13883
|
if (!canonical.hooks) return {};
|
|
13895
13884
|
const result2 = {};
|
|
@@ -13907,7 +13896,7 @@ function buildCrushHooksFromCanonical(canonical) {
|
|
|
13907
13896
|
}
|
|
13908
13897
|
return result2;
|
|
13909
13898
|
}
|
|
13910
|
-
var generateRules12;
|
|
13899
|
+
var generateRules12, generateIgnore9;
|
|
13911
13900
|
var init_generator13 = __esm({
|
|
13912
13901
|
"src/targets/crush/generator.ts"() {
|
|
13913
13902
|
init_managed_blocks();
|
|
@@ -13916,7 +13905,9 @@ var init_generator13 = __esm({
|
|
|
13916
13905
|
init_command_skill();
|
|
13917
13906
|
init_constants12();
|
|
13918
13907
|
init_config_format();
|
|
13908
|
+
init_ignore_output();
|
|
13919
13909
|
generateRules12 = (canonical) => embeddedRootRule(canonical, CRUSH_TARGET, CRUSH_ROOT_FILE);
|
|
13910
|
+
generateIgnore9 = ignoreOutput(CRUSH_IGNORE);
|
|
13920
13911
|
}
|
|
13921
13912
|
});
|
|
13922
13913
|
async function importFromCrush(projectRoot, options = {}) {
|
|
@@ -14452,7 +14443,7 @@ function cursorHooksToCanonical(hooks) {
|
|
|
14452
14443
|
}
|
|
14453
14444
|
return result2;
|
|
14454
14445
|
}
|
|
14455
|
-
var CANONICAL_TO_CURSOR, CURSOR_TO_CANONICAL;
|
|
14446
|
+
var CANONICAL_TO_CURSOR, CURSOR_HOOK_CONTEXT_EVENTS, CURSOR_TO_CANONICAL;
|
|
14456
14447
|
var init_hook_format2 = __esm({
|
|
14457
14448
|
"src/targets/cursor/hook-format.ts"() {
|
|
14458
14449
|
init_hook_types();
|
|
@@ -14460,6 +14451,7 @@ var init_hook_format2 = __esm({
|
|
|
14460
14451
|
CANONICAL_TO_CURSOR = {
|
|
14461
14452
|
PreToolUse: "preToolUse",
|
|
14462
14453
|
PostToolUse: "postToolUse",
|
|
14454
|
+
PostToolUseFailure: "postToolUseFailure",
|
|
14463
14455
|
UserPromptSubmit: "beforeSubmitPrompt",
|
|
14464
14456
|
SubagentStart: "subagentStart",
|
|
14465
14457
|
SubagentStop: "subagentStop",
|
|
@@ -14468,6 +14460,11 @@ var init_hook_format2 = __esm({
|
|
|
14468
14460
|
SessionEnd: "sessionEnd",
|
|
14469
14461
|
PreCompact: "preCompact"
|
|
14470
14462
|
};
|
|
14463
|
+
CURSOR_HOOK_CONTEXT_EVENTS = [
|
|
14464
|
+
"SessionStart",
|
|
14465
|
+
"PostToolUse",
|
|
14466
|
+
"PostToolUseFailure"
|
|
14467
|
+
];
|
|
14471
14468
|
CURSOR_TO_CANONICAL = new Map(
|
|
14472
14469
|
Object.entries(CANONICAL_TO_CURSOR).map(([canonical, cursor]) => [cursor, canonical])
|
|
14473
14470
|
);
|
|
@@ -14476,7 +14473,7 @@ var init_hook_format2 = __esm({
|
|
|
14476
14473
|
|
|
14477
14474
|
// src/targets/cursor/generator/hooks.ts
|
|
14478
14475
|
function generateHooks10(canonical) {
|
|
14479
|
-
if (!canonical.hooks
|
|
14476
|
+
if (!canonical.hooks) return [];
|
|
14480
14477
|
const cursorHooks = toCursorHooks(canonical.hooks);
|
|
14481
14478
|
if (Object.keys(cursorHooks).length === 0) return [];
|
|
14482
14479
|
const content = JSON.stringify({ version: 1, hooks: cursorHooks }, null, 2);
|
|
@@ -14490,14 +14487,12 @@ var init_hooks3 = __esm({
|
|
|
14490
14487
|
});
|
|
14491
14488
|
|
|
14492
14489
|
// src/targets/cursor/generator/ignore.ts
|
|
14493
|
-
|
|
14494
|
-
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
14495
|
-
const content = canonical.ignore.join("\n");
|
|
14496
|
-
return [{ path: CURSOR_IGNORE, content }];
|
|
14497
|
-
}
|
|
14490
|
+
var generateIgnore10;
|
|
14498
14491
|
var init_ignore = __esm({
|
|
14499
14492
|
"src/targets/cursor/generator/ignore.ts"() {
|
|
14500
14493
|
init_constants13();
|
|
14494
|
+
init_ignore_output();
|
|
14495
|
+
generateIgnore10 = ignoreOutput(CURSOR_IGNORE);
|
|
14501
14496
|
}
|
|
14502
14497
|
});
|
|
14503
14498
|
|
|
@@ -15193,6 +15188,7 @@ var init_cursor2 = __esm({
|
|
|
15193
15188
|
init_linter13();
|
|
15194
15189
|
init_import_map_builders();
|
|
15195
15190
|
init_lint12();
|
|
15191
|
+
init_hook_format2();
|
|
15196
15192
|
target13 = {
|
|
15197
15193
|
name: "cursor",
|
|
15198
15194
|
primaryRootInstructionPath: CURSOR_GENERAL_RULE,
|
|
@@ -15314,6 +15310,7 @@ var init_cursor2 = __esm({
|
|
|
15314
15310
|
permissions: "native"
|
|
15315
15311
|
},
|
|
15316
15312
|
emptyImportMessage: "No Cursor config found (AGENTS.md or .cursor/rules/*.mdc; with --global: ~/.cursor/{rules/*.mdc,AGENTS.md,mcp.json,hooks.json,cursorignore,skills/,agents/,commands/} and legacy ~/.agentsmesh-exports/cursor/user-rules.md).",
|
|
15313
|
+
hookContextEvents: CURSOR_HOOK_CONTEXT_EVENTS,
|
|
15317
15314
|
lintRules: lintRules13,
|
|
15318
15315
|
lint: {
|
|
15319
15316
|
commands: lintCommands6,
|
|
@@ -16575,25 +16572,127 @@ var init_skills3 = __esm({
|
|
|
16575
16572
|
}
|
|
16576
16573
|
});
|
|
16577
16574
|
|
|
16578
|
-
// src/targets/gemini-cli/
|
|
16579
|
-
function
|
|
16580
|
-
|
|
16581
|
-
|
|
16582
|
-
|
|
16583
|
-
|
|
16584
|
-
|
|
16585
|
-
|
|
16586
|
-
|
|
16587
|
-
|
|
16588
|
-
|
|
16589
|
-
|
|
16590
|
-
|
|
16591
|
-
|
|
16592
|
-
|
|
16593
|
-
|
|
16594
|
-
|
|
16575
|
+
// src/targets/gemini-cli/hook-map.ts
|
|
16576
|
+
function geminiHookEvent(event) {
|
|
16577
|
+
return CANONICAL_TO_GEMINI.get(event) ?? null;
|
|
16578
|
+
}
|
|
16579
|
+
function mapGeminiHookEvent(event) {
|
|
16580
|
+
return GEMINI_TO_CANONICAL.get(event) ?? null;
|
|
16581
|
+
}
|
|
16582
|
+
function splitNames(list, separator) {
|
|
16583
|
+
return list.split(separator).map((name) => name.trim()).filter((name) => name.length > 0);
|
|
16584
|
+
}
|
|
16585
|
+
function toGeminiMatcher(geminiEvent, matcher) {
|
|
16586
|
+
if (!TOOL_EVENTS.has(geminiEvent) || !NAME_LIST.test(matcher)) return matcher;
|
|
16587
|
+
const tools = unique(
|
|
16588
|
+
splitNames(matcher, /[|,]/).flatMap((name) => CANONICAL_TO_GEMINI_TOOLS.get(name) ?? [name])
|
|
16589
|
+
);
|
|
16590
|
+
return tools.length > 0 ? `^(?:${tools.join("|")})$` : matcher;
|
|
16591
|
+
}
|
|
16592
|
+
function fromGeminiMatcher(geminiEvent, matcher) {
|
|
16593
|
+
if (!TOOL_EVENTS.has(geminiEvent)) return matcher;
|
|
16594
|
+
const list = ANCHORED_LIST.exec(matcher)?.[1] ?? matcher;
|
|
16595
|
+
if (!NAME_LIST.test(list) || list.includes(",")) return matcher;
|
|
16596
|
+
return unique(
|
|
16597
|
+
splitNames(list, /\|/).map((name) => GEMINI_TO_CANONICAL_TOOLS.get(name) ?? name)
|
|
16598
|
+
).join("|");
|
|
16599
|
+
}
|
|
16600
|
+
var GEMINI_HOOK_CONTEXT_EVENTS, CANONICAL_TO_GEMINI, GEMINI_TO_CANONICAL, TOOL_EVENTS, CANONICAL_TO_GEMINI_TOOLS, GEMINI_TO_CANONICAL_TOOLS, NAME_LIST, ANCHORED_LIST, unique;
|
|
16601
|
+
var init_hook_map = __esm({
|
|
16602
|
+
"src/targets/gemini-cli/hook-map.ts"() {
|
|
16603
|
+
GEMINI_HOOK_CONTEXT_EVENTS = [
|
|
16604
|
+
"UserPromptSubmit",
|
|
16605
|
+
"SessionStart",
|
|
16606
|
+
"PostToolUse"
|
|
16607
|
+
];
|
|
16608
|
+
CANONICAL_TO_GEMINI = /* @__PURE__ */ new Map([
|
|
16609
|
+
["PreToolUse", "BeforeTool"],
|
|
16610
|
+
["PostToolUse", "AfterTool"],
|
|
16611
|
+
["Notification", "Notification"],
|
|
16612
|
+
// BeforeAgent fires after the user submits a prompt and carries `prompt`.
|
|
16613
|
+
["UserPromptSubmit", "BeforeAgent"],
|
|
16614
|
+
// Older mapping, kept so existing SubagentStart hooks still reach Gemini.
|
|
16615
|
+
["SubagentStart", "BeforeAgent"],
|
|
16616
|
+
["SubagentStop", "AfterAgent"],
|
|
16617
|
+
["SessionStart", "SessionStart"]
|
|
16618
|
+
]);
|
|
16619
|
+
GEMINI_TO_CANONICAL = new Map([
|
|
16620
|
+
...[...CANONICAL_TO_GEMINI].map(([canonical, gemini]) => [gemini, canonical]),
|
|
16621
|
+
// BeforeAgent is shared with SubagentStart; import it as the prompt event.
|
|
16622
|
+
["BeforeAgent", "UserPromptSubmit"],
|
|
16623
|
+
// Legacy lowercase names.
|
|
16624
|
+
["preToolUse", "PreToolUse"],
|
|
16625
|
+
["postToolUse", "PostToolUse"],
|
|
16626
|
+
["notification", "Notification"]
|
|
16627
|
+
]);
|
|
16628
|
+
TOOL_EVENTS = /* @__PURE__ */ new Set(["BeforeTool", "AfterTool"]);
|
|
16629
|
+
CANONICAL_TO_GEMINI_TOOLS = /* @__PURE__ */ new Map([
|
|
16630
|
+
["Bash", ["run_shell_command"]],
|
|
16631
|
+
["PowerShell", ["run_shell_command"]],
|
|
16632
|
+
["Edit", ["replace"]],
|
|
16633
|
+
["MultiEdit", ["replace"]],
|
|
16634
|
+
["Write", ["write_file"]],
|
|
16635
|
+
["NotebookEdit", []],
|
|
16636
|
+
["Read", ["read_file", "read_many_files"]],
|
|
16637
|
+
["Grep", ["grep_search"]],
|
|
16638
|
+
["Glob", ["glob"]],
|
|
16639
|
+
["LS", ["list_directory"]],
|
|
16640
|
+
["WebFetch", ["web_fetch"]],
|
|
16641
|
+
["WebSearch", ["google_web_search"]],
|
|
16642
|
+
["TodoWrite", ["write_todos"]]
|
|
16643
|
+
]);
|
|
16644
|
+
GEMINI_TO_CANONICAL_TOOLS = /* @__PURE__ */ new Map([
|
|
16645
|
+
["run_shell_command", "Bash"],
|
|
16646
|
+
["replace", "Edit"],
|
|
16647
|
+
["write_file", "Write"],
|
|
16648
|
+
["read_file", "Read"],
|
|
16649
|
+
["read_many_files", "Read"],
|
|
16650
|
+
["grep_search", "Grep"],
|
|
16651
|
+
["search_file_content", "Grep"],
|
|
16652
|
+
["glob", "Glob"],
|
|
16653
|
+
["list_directory", "LS"],
|
|
16654
|
+
["web_fetch", "WebFetch"],
|
|
16655
|
+
["google_web_search", "WebSearch"],
|
|
16656
|
+
["write_todos", "TodoWrite"]
|
|
16657
|
+
]);
|
|
16658
|
+
NAME_LIST = /^[\w\s,|-]+$/;
|
|
16659
|
+
ANCHORED_LIST = /^\^\(\?:(.*)\)\$$/;
|
|
16660
|
+
unique = (values) => [...new Set(values)];
|
|
16661
|
+
}
|
|
16662
|
+
});
|
|
16663
|
+
|
|
16664
|
+
// src/targets/gemini-cli/generator/hooks.ts
|
|
16665
|
+
function buildGeminiHooks(hooks) {
|
|
16666
|
+
const result2 = {};
|
|
16667
|
+
for (const [event, entries] of Object.entries(hooks ?? {})) {
|
|
16668
|
+
const geminiEvent = geminiHookEvent(event);
|
|
16669
|
+
if (!geminiEvent || !Array.isArray(entries)) continue;
|
|
16670
|
+
for (const entry of entries) {
|
|
16671
|
+
if (typeof entry !== "object" || entry === null || !hasHookCommand(entry)) continue;
|
|
16672
|
+
const list = result2[geminiEvent] ??= [];
|
|
16673
|
+
list.push({
|
|
16674
|
+
matcher: typeof entry.matcher === "string" ? toGeminiMatcher(geminiEvent, entry.matcher) : entry.matcher,
|
|
16675
|
+
hooks: [
|
|
16676
|
+
{
|
|
16677
|
+
name: `${geminiEvent}-${list.length + 1}`,
|
|
16678
|
+
type: "command",
|
|
16679
|
+
command: getHookCommand(entry),
|
|
16680
|
+
timeout: entry.timeout
|
|
16681
|
+
}
|
|
16682
|
+
]
|
|
16683
|
+
});
|
|
16684
|
+
}
|
|
16595
16685
|
}
|
|
16686
|
+
return Object.keys(result2).length > 0 ? result2 : null;
|
|
16596
16687
|
}
|
|
16688
|
+
var init_hooks4 = __esm({
|
|
16689
|
+
"src/targets/gemini-cli/generator/hooks.ts"() {
|
|
16690
|
+
init_hook_command();
|
|
16691
|
+
init_hook_map();
|
|
16692
|
+
}
|
|
16693
|
+
});
|
|
16694
|
+
|
|
16695
|
+
// src/targets/gemini-cli/generator/settings.ts
|
|
16597
16696
|
function generateGeminiSettingsFiles(canonical, enabledFeatures) {
|
|
16598
16697
|
const settings = {};
|
|
16599
16698
|
let hasAnyNativeSettings = false;
|
|
@@ -16605,29 +16704,10 @@ function generateGeminiSettingsFiles(canonical, enabledFeatures) {
|
|
|
16605
16704
|
settings.experimental = { enableAgents: true };
|
|
16606
16705
|
hasAnyNativeSettings = true;
|
|
16607
16706
|
}
|
|
16608
|
-
|
|
16609
|
-
|
|
16610
|
-
|
|
16611
|
-
|
|
16612
|
-
const mappedEntries = entries.filter(
|
|
16613
|
-
(entry) => typeof entry === "object" && entry !== null && hasHookCommand(entry)
|
|
16614
|
-
).map((entry, index) => ({
|
|
16615
|
-
matcher: entry.matcher,
|
|
16616
|
-
hooks: [
|
|
16617
|
-
{
|
|
16618
|
-
name: `${mappedEvent}-${index + 1}`,
|
|
16619
|
-
type: "command",
|
|
16620
|
-
command: getHookCommand(entry),
|
|
16621
|
-
timeout: entry.timeout
|
|
16622
|
-
}
|
|
16623
|
-
]
|
|
16624
|
-
}));
|
|
16625
|
-
return mappedEntries.length > 0 ? [[mappedEvent, mappedEntries]] : [];
|
|
16626
|
-
});
|
|
16627
|
-
if (hookEntries.length > 0) {
|
|
16628
|
-
settings.hooks = Object.fromEntries(hookEntries);
|
|
16629
|
-
hasAnyNativeSettings = true;
|
|
16630
|
-
}
|
|
16707
|
+
const hooks = enabledFeatures.has("hooks") ? buildGeminiHooks(canonical.hooks) : null;
|
|
16708
|
+
if (hooks) {
|
|
16709
|
+
settings.hooks = hooks;
|
|
16710
|
+
hasAnyNativeSettings = true;
|
|
16631
16711
|
}
|
|
16632
16712
|
if (hasAnyNativeSettings) {
|
|
16633
16713
|
settings.context = { fileName: [GEMINI_ROOT, GEMINI_COMPAT_AGENTS] };
|
|
@@ -16637,19 +16717,18 @@ function generateGeminiSettingsFiles(canonical, enabledFeatures) {
|
|
|
16637
16717
|
}
|
|
16638
16718
|
var init_settings2 = __esm({
|
|
16639
16719
|
"src/targets/gemini-cli/generator/settings.ts"() {
|
|
16640
|
-
init_hook_command();
|
|
16641
16720
|
init_constants33();
|
|
16721
|
+
init_hooks4();
|
|
16642
16722
|
}
|
|
16643
16723
|
});
|
|
16644
16724
|
|
|
16645
16725
|
// src/targets/gemini-cli/generator/ignore.ts
|
|
16646
|
-
|
|
16647
|
-
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
16648
|
-
return [{ path: GEMINI_IGNORE, content: canonical.ignore.join("\n") }];
|
|
16649
|
-
}
|
|
16726
|
+
var generateIgnore13;
|
|
16650
16727
|
var init_ignore2 = __esm({
|
|
16651
16728
|
"src/targets/gemini-cli/generator/ignore.ts"() {
|
|
16652
16729
|
init_constants33();
|
|
16730
|
+
init_ignore_output();
|
|
16731
|
+
generateIgnore13 = ignoreOutput(GEMINI_IGNORE);
|
|
16653
16732
|
}
|
|
16654
16733
|
});
|
|
16655
16734
|
|
|
@@ -16928,27 +17007,6 @@ var init_layout6 = __esm({
|
|
|
16928
17007
|
};
|
|
16929
17008
|
}
|
|
16930
17009
|
});
|
|
16931
|
-
function mapGeminiHookEvent(event) {
|
|
16932
|
-
switch (event) {
|
|
16933
|
-
case "BeforeTool":
|
|
16934
|
-
case "preToolUse":
|
|
16935
|
-
return "PreToolUse";
|
|
16936
|
-
case "AfterTool":
|
|
16937
|
-
case "postToolUse":
|
|
16938
|
-
return "PostToolUse";
|
|
16939
|
-
case "Notification":
|
|
16940
|
-
case "notification":
|
|
16941
|
-
return "Notification";
|
|
16942
|
-
case "BeforeAgent":
|
|
16943
|
-
return "SubagentStart";
|
|
16944
|
-
case "AfterAgent":
|
|
16945
|
-
return "SubagentStop";
|
|
16946
|
-
case "SessionStart":
|
|
16947
|
-
return "SessionStart";
|
|
16948
|
-
default:
|
|
16949
|
-
return null;
|
|
16950
|
-
}
|
|
16951
|
-
}
|
|
16952
17010
|
function parseFlexibleFrontmatter(content) {
|
|
16953
17011
|
const yamlOpen = content.indexOf("---");
|
|
16954
17012
|
const tomlOpen = content.indexOf("+++");
|
|
@@ -17022,7 +17080,7 @@ async function importGeminiSettings(projectRoot, results) {
|
|
|
17022
17080
|
(entry) => entry.hooks.filter(
|
|
17023
17081
|
(hook) => hook !== null && typeof hook === "object" && hasHookCommand(hook)
|
|
17024
17082
|
).map((hook) => ({
|
|
17025
|
-
matcher: entry.matcher,
|
|
17083
|
+
matcher: fromGeminiMatcher(event, entry.matcher),
|
|
17026
17084
|
command: getHookCommand(hook),
|
|
17027
17085
|
type: "command",
|
|
17028
17086
|
timeout: typeof hook.timeout === "number" ? hook.timeout : void 0
|
|
@@ -17032,7 +17090,7 @@ async function importGeminiSettings(projectRoot, results) {
|
|
|
17032
17090
|
const legacyMapped = value.filter(
|
|
17033
17091
|
(entry) => entry !== null && typeof entry === "object" && typeof entry.matcher === "string" && hasHookCommand(entry)
|
|
17034
17092
|
).map((entry) => ({
|
|
17035
|
-
matcher: entry.matcher,
|
|
17093
|
+
matcher: fromGeminiMatcher(event, entry.matcher),
|
|
17036
17094
|
command: getHookCommand(entry),
|
|
17037
17095
|
type: "command"
|
|
17038
17096
|
}));
|
|
@@ -17061,7 +17119,7 @@ var init_format_helpers_settings = __esm({
|
|
|
17061
17119
|
init_hook_command();
|
|
17062
17120
|
init_fs();
|
|
17063
17121
|
init_constants33();
|
|
17064
|
-
|
|
17122
|
+
init_hook_map();
|
|
17065
17123
|
}
|
|
17066
17124
|
});
|
|
17067
17125
|
async function importGeminiIgnore(projectRoot, results) {
|
|
@@ -17557,14 +17615,7 @@ function lintPermissions10(canonical, options) {
|
|
|
17557
17615
|
}
|
|
17558
17616
|
function lintHooks12(canonical) {
|
|
17559
17617
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
17560
|
-
const supported = [
|
|
17561
|
-
"PreToolUse",
|
|
17562
|
-
"PostToolUse",
|
|
17563
|
-
"Notification",
|
|
17564
|
-
"SubagentStart",
|
|
17565
|
-
"SubagentStop",
|
|
17566
|
-
"SessionStart"
|
|
17567
|
-
];
|
|
17618
|
+
const supported = [...CANONICAL_TO_GEMINI.keys()];
|
|
17568
17619
|
return unsupportedHookEventNames(canonical.hooks, supported).map(
|
|
17569
17620
|
(event) => createUnsupportedHookWarning(event, "gemini-cli", supported)
|
|
17570
17621
|
);
|
|
@@ -17572,6 +17623,7 @@ function lintHooks12(canonical) {
|
|
|
17572
17623
|
var init_lint15 = __esm({
|
|
17573
17624
|
"src/targets/gemini-cli/lint.ts"() {
|
|
17574
17625
|
init_helpers();
|
|
17626
|
+
init_hook_map();
|
|
17575
17627
|
}
|
|
17576
17628
|
});
|
|
17577
17629
|
|
|
@@ -17608,6 +17660,7 @@ var init_gemini_cli2 = __esm({
|
|
|
17608
17660
|
init_import_map_builders();
|
|
17609
17661
|
init_lint15();
|
|
17610
17662
|
init_scoped_settings_emit();
|
|
17663
|
+
init_hook_map();
|
|
17611
17664
|
init_settings();
|
|
17612
17665
|
target16 = {
|
|
17613
17666
|
name: "gemini-cli",
|
|
@@ -17658,6 +17711,7 @@ var init_gemini_cli2 = __esm({
|
|
|
17658
17711
|
permissions: lintPermissions10
|
|
17659
17712
|
},
|
|
17660
17713
|
emitScopedSettings: emitScopedGeminiSettings,
|
|
17714
|
+
hookContextEvents: GEMINI_HOOK_CONTEXT_EVENTS,
|
|
17661
17715
|
mergeGeneratedOutputContent(existing, pending, newContent, resolvedPath) {
|
|
17662
17716
|
const base = pending?.content ?? existing;
|
|
17663
17717
|
if (base !== null && resolvedPath === GEMINI_SETTINGS) {
|
|
@@ -17750,14 +17804,10 @@ function generateAgents17(canonical) {
|
|
|
17750
17804
|
content: serializeProjectedAgentSkill(agent)
|
|
17751
17805
|
}));
|
|
17752
17806
|
}
|
|
17753
|
-
function generateIgnore14(canonical) {
|
|
17754
|
-
if (canonical.ignore.length === 0) return [];
|
|
17755
|
-
return [{ path: GOOSE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
17756
|
-
}
|
|
17757
17807
|
function generateHooks12(canonical) {
|
|
17758
17808
|
return buildWrappedCommandHooks(canonical, GOOSE_HOOKS_FILE);
|
|
17759
17809
|
}
|
|
17760
|
-
var generateRules17, generatePermissions12;
|
|
17810
|
+
var generateRules17, generateIgnore14, generatePermissions12;
|
|
17761
17811
|
var init_generator20 = __esm({
|
|
17762
17812
|
"src/targets/goose/generator.ts"() {
|
|
17763
17813
|
init_managed_blocks();
|
|
@@ -17767,7 +17817,9 @@ var init_generator20 = __esm({
|
|
|
17767
17817
|
init_command_skill();
|
|
17768
17818
|
init_wrapped_command_hooks();
|
|
17769
17819
|
init_constants16();
|
|
17820
|
+
init_ignore_output();
|
|
17770
17821
|
generateRules17 = (canonical) => embeddedRootRule(canonical, GOOSE_TARGET, GOOSE_ROOT_FILE);
|
|
17822
|
+
generateIgnore14 = ignoreOutput(GOOSE_IGNORE);
|
|
17771
17823
|
generatePermissions12 = NO_OUTPUTS;
|
|
17772
17824
|
}
|
|
17773
17825
|
});
|
|
@@ -18672,10 +18724,6 @@ function generateAgents18(canonical) {
|
|
|
18672
18724
|
};
|
|
18673
18725
|
});
|
|
18674
18726
|
}
|
|
18675
|
-
function generateIgnore16(canonical) {
|
|
18676
|
-
if (canonical.ignore.length === 0) return [];
|
|
18677
|
-
return [{ path: JUNIE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
18678
|
-
}
|
|
18679
18727
|
function generateSkills17(canonical) {
|
|
18680
18728
|
return generateEmbeddedSkills(canonical, JUNIE_SKILLS_DIR);
|
|
18681
18729
|
}
|
|
@@ -18687,6 +18735,7 @@ function renderJunieGlobalInstructions(canonical) {
|
|
|
18687
18735
|
});
|
|
18688
18736
|
return appendEmbeddedRulesBlock(root?.body.trim() ?? "", nonRootRules);
|
|
18689
18737
|
}
|
|
18738
|
+
var generateIgnore16;
|
|
18690
18739
|
var init_generator22 = __esm({
|
|
18691
18740
|
"src/targets/junie/generator.ts"() {
|
|
18692
18741
|
init_mcp_servers();
|
|
@@ -18694,7 +18743,9 @@ var init_generator22 = __esm({
|
|
|
18694
18743
|
init_managed_blocks();
|
|
18695
18744
|
init_markdown();
|
|
18696
18745
|
init_constants18();
|
|
18746
|
+
init_ignore_output();
|
|
18697
18747
|
init_global_config2();
|
|
18748
|
+
generateIgnore16 = ignoreOutput(JUNIE_IGNORE);
|
|
18698
18749
|
}
|
|
18699
18750
|
});
|
|
18700
18751
|
|
|
@@ -19110,10 +19161,6 @@ function generateMcp15(canonical) {
|
|
|
19110
19161
|
}
|
|
19111
19162
|
];
|
|
19112
19163
|
}
|
|
19113
|
-
function generateIgnore17(canonical) {
|
|
19114
|
-
if (canonical.ignore.length === 0) return [];
|
|
19115
|
-
return [{ path: KILO_CODE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
19116
|
-
}
|
|
19117
19164
|
function generatePermissions15(canonical) {
|
|
19118
19165
|
if (!canonical.permissions) return [];
|
|
19119
19166
|
const { allow, deny } = canonical.permissions;
|
|
@@ -19128,11 +19175,14 @@ function generatePermissions15(canonical) {
|
|
|
19128
19175
|
function generateSkills18(canonical) {
|
|
19129
19176
|
return generateEmbeddedSkills(canonical, KILO_CODE_SKILLS_DIR);
|
|
19130
19177
|
}
|
|
19178
|
+
var generateIgnore17;
|
|
19131
19179
|
var init_generator23 = __esm({
|
|
19132
19180
|
"src/targets/kilo-code/generator.ts"() {
|
|
19133
19181
|
init_embedded_skill();
|
|
19134
19182
|
init_markdown();
|
|
19135
19183
|
init_constants19();
|
|
19184
|
+
init_ignore_output();
|
|
19185
|
+
generateIgnore17 = ignoreOutput(KILO_CODE_IGNORE);
|
|
19136
19186
|
}
|
|
19137
19187
|
});
|
|
19138
19188
|
var kiloNonRootRuleMapper, kiloCommandMapper, kiloAgentMapper;
|
|
@@ -20877,11 +20927,7 @@ function buildKiroAgentOutputs(canonical, rules = []) {
|
|
|
20877
20927
|
function generateAgents21(canonical) {
|
|
20878
20928
|
return buildKiroAgentOutputs(canonical);
|
|
20879
20929
|
}
|
|
20880
|
-
|
|
20881
|
-
if (canonical.ignore.length === 0) return [];
|
|
20882
|
-
return [{ path: KIRO_IGNORE, content: canonical.ignore.join("\n") }];
|
|
20883
|
-
}
|
|
20884
|
-
var generatePermissions17;
|
|
20930
|
+
var generateIgnore18, generatePermissions17;
|
|
20885
20931
|
var init_generator25 = __esm({
|
|
20886
20932
|
"src/targets/kiro/generator.ts"() {
|
|
20887
20933
|
init_no_outputs();
|
|
@@ -20890,6 +20936,8 @@ var init_generator25 = __esm({
|
|
|
20890
20936
|
init_markdown();
|
|
20891
20937
|
init_hook_format3();
|
|
20892
20938
|
init_constants21();
|
|
20939
|
+
init_ignore_output();
|
|
20940
|
+
generateIgnore18 = ignoreOutput(KIRO_IGNORE);
|
|
20893
20941
|
generatePermissions17 = NO_OUTPUTS;
|
|
20894
20942
|
}
|
|
20895
20943
|
});
|
|
@@ -23532,10 +23580,6 @@ function generateMcp19(canonical) {
|
|
|
23532
23580
|
const content = JSON.stringify({ mcpServers: canonical.mcp.mcpServers }, null, 2);
|
|
23533
23581
|
return [{ path: QWEN_SETTINGS, content }];
|
|
23534
23582
|
}
|
|
23535
|
-
function generateIgnore21(canonical) {
|
|
23536
|
-
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
23537
|
-
return [{ path: QWEN_IGNORE, content: canonical.ignore.join("\n") }];
|
|
23538
|
-
}
|
|
23539
23583
|
function generateHooks18(canonical) {
|
|
23540
23584
|
if (!canonical.hooks || Object.keys(canonical.hooks).length === 0) return [];
|
|
23541
23585
|
const hooks = buildClaudeHooksObjectFromCanonical(canonical);
|
|
@@ -23553,11 +23597,14 @@ function generatePermissions21(canonical) {
|
|
|
23553
23597
|
if (ask.length > 0) permissions.ask = ask;
|
|
23554
23598
|
return [{ path: QWEN_SETTINGS, content: JSON.stringify({ permissions }, null, 2) }];
|
|
23555
23599
|
}
|
|
23600
|
+
var generateIgnore21;
|
|
23556
23601
|
var init_generator29 = __esm({
|
|
23557
23602
|
"src/targets/qwen-code/generator.ts"() {
|
|
23558
23603
|
init_markdown();
|
|
23559
23604
|
init_hooks_format2();
|
|
23560
23605
|
init_constants25();
|
|
23606
|
+
init_ignore_output();
|
|
23607
|
+
generateIgnore21 = ignoreOutput(QWEN_IGNORE);
|
|
23561
23608
|
}
|
|
23562
23609
|
});
|
|
23563
23610
|
|
|
@@ -25255,10 +25302,6 @@ function generateMcp23(canonical) {
|
|
|
25255
25302
|
}
|
|
25256
25303
|
];
|
|
25257
25304
|
}
|
|
25258
|
-
function generateIgnore24(canonical) {
|
|
25259
|
-
if (canonical.ignore.length === 0) return [];
|
|
25260
|
-
return [{ path: TRAE_IGNORE, content: canonical.ignore.join("\n") }];
|
|
25261
|
-
}
|
|
25262
25305
|
function generateHooks20(canonical) {
|
|
25263
25306
|
if (!canonical.hooks) return [];
|
|
25264
25307
|
const hooks = {};
|
|
@@ -25279,12 +25322,15 @@ function generateHooks20(canonical) {
|
|
|
25279
25322
|
if (Object.keys(hooks).length === 0) return [];
|
|
25280
25323
|
return [{ path: TRAE_HOOKS_FILE, content: JSON.stringify({ version: 1, hooks }, null, 2) }];
|
|
25281
25324
|
}
|
|
25325
|
+
var generateIgnore24;
|
|
25282
25326
|
var init_generator33 = __esm({
|
|
25283
25327
|
"src/targets/trae/generator.ts"() {
|
|
25284
25328
|
init_embedded_skill();
|
|
25285
25329
|
init_markdown();
|
|
25286
25330
|
init_hook_command();
|
|
25287
25331
|
init_constants29();
|
|
25332
|
+
init_ignore_output();
|
|
25333
|
+
generateIgnore24 = ignoreOutput(TRAE_IGNORE);
|
|
25288
25334
|
}
|
|
25289
25335
|
});
|
|
25290
25336
|
|
|
@@ -25991,11 +26037,7 @@ function generateMcp24(canonical, ctx) {
|
|
|
25991
26037
|
const content = JSON.stringify({ mcpServers: canonical.mcp.mcpServers }, null, 2);
|
|
25992
26038
|
return [{ path, content }];
|
|
25993
26039
|
}
|
|
25994
|
-
|
|
25995
|
-
if (canonical.ignore.length === 0) return [];
|
|
25996
|
-
return [{ path: WARP_IGNORE_FILE, content: canonical.ignore.join("\n") }];
|
|
25997
|
-
}
|
|
25998
|
-
var generateRules31, generatePermissions24, generateHooks21;
|
|
26040
|
+
var generateRules31, generatePermissions24, generateHooks21, generateIgnore25;
|
|
25999
26041
|
var init_generator34 = __esm({
|
|
26000
26042
|
"src/targets/warp/generator.ts"() {
|
|
26001
26043
|
init_managed_blocks();
|
|
@@ -26004,9 +26046,11 @@ var init_generator34 = __esm({
|
|
|
26004
26046
|
init_projected_agent_skill();
|
|
26005
26047
|
init_command_skill();
|
|
26006
26048
|
init_constants30();
|
|
26049
|
+
init_ignore_output();
|
|
26007
26050
|
generateRules31 = (canonical) => embeddedRootRule(canonical, WARP_TARGET, WARP_ROOT_FILE);
|
|
26008
26051
|
generatePermissions24 = NO_OUTPUTS;
|
|
26009
26052
|
generateHooks21 = NO_OUTPUTS;
|
|
26053
|
+
generateIgnore25 = ignoreOutput(WARP_IGNORE_FILE);
|
|
26010
26054
|
}
|
|
26011
26055
|
});
|
|
26012
26056
|
|
|
@@ -26631,13 +26675,12 @@ var init_rules4 = __esm({
|
|
|
26631
26675
|
});
|
|
26632
26676
|
|
|
26633
26677
|
// src/targets/windsurf/generator/ignore.ts
|
|
26634
|
-
|
|
26635
|
-
if (!canonical.ignore || canonical.ignore.length === 0) return [];
|
|
26636
|
-
return [{ path: CODEIUM_IGNORE, content: canonical.ignore.join("\n") }];
|
|
26637
|
-
}
|
|
26678
|
+
var generateIgnore26;
|
|
26638
26679
|
var init_ignore3 = __esm({
|
|
26639
26680
|
"src/targets/windsurf/generator/ignore.ts"() {
|
|
26640
26681
|
init_constants34();
|
|
26682
|
+
init_ignore_output();
|
|
26683
|
+
generateIgnore26 = ignoreOutput(CODEIUM_IGNORE);
|
|
26641
26684
|
}
|
|
26642
26685
|
});
|
|
26643
26686
|
|
|
@@ -26703,7 +26746,7 @@ function canonicalHookEventName(event) {
|
|
|
26703
26746
|
if (KNOWN_CANONICAL_HOOK_EVENTS.includes(event)) return event;
|
|
26704
26747
|
return WINDSURF_TO_CANONICAL.get(event) ?? null;
|
|
26705
26748
|
}
|
|
26706
|
-
var KNOWN_CANONICAL_HOOK_EVENTS, WINDSURF_TO_CANONICAL;
|
|
26749
|
+
var KNOWN_CANONICAL_HOOK_EVENTS, WINDSURF_HOOK_CONTEXT_EVENTS, WINDSURF_TO_CANONICAL;
|
|
26707
26750
|
var init_hook_events = __esm({
|
|
26708
26751
|
"src/targets/windsurf/hook-events.ts"() {
|
|
26709
26752
|
init_hook_types();
|
|
@@ -26716,6 +26759,7 @@ var init_hook_events = __esm({
|
|
|
26716
26759
|
"SubagentStop",
|
|
26717
26760
|
...BEST_EFFORT_HOOK_EVENTS
|
|
26718
26761
|
];
|
|
26762
|
+
WINDSURF_HOOK_CONTEXT_EVENTS = [];
|
|
26719
26763
|
WINDSURF_TO_CANONICAL = new Map(
|
|
26720
26764
|
KNOWN_CANONICAL_HOOK_EVENTS.map((event) => [windsurfEventName(event), event])
|
|
26721
26765
|
);
|
|
@@ -26741,12 +26785,12 @@ function toWindsurfHooks(hooks) {
|
|
|
26741
26785
|
return result2;
|
|
26742
26786
|
}
|
|
26743
26787
|
function generateHooks22(canonical) {
|
|
26744
|
-
if (!canonical.hooks
|
|
26788
|
+
if (!canonical.hooks) return [];
|
|
26745
26789
|
const hooks = toWindsurfHooks(canonical.hooks);
|
|
26746
26790
|
if (Object.keys(hooks).length === 0) return [];
|
|
26747
26791
|
return [{ path: WINDSURF_HOOKS_FILE, content: JSON.stringify({ hooks }, null, 2) }];
|
|
26748
26792
|
}
|
|
26749
|
-
var
|
|
26793
|
+
var init_hooks5 = __esm({
|
|
26750
26794
|
"src/targets/windsurf/generator/hooks.ts"() {
|
|
26751
26795
|
init_hook_command();
|
|
26752
26796
|
init_constants34();
|
|
@@ -26798,7 +26842,7 @@ var init_generator35 = __esm({
|
|
|
26798
26842
|
init_workflows();
|
|
26799
26843
|
init_agents4();
|
|
26800
26844
|
init_mcp4();
|
|
26801
|
-
|
|
26845
|
+
init_hooks5();
|
|
26802
26846
|
init_skills4();
|
|
26803
26847
|
init_permissions6();
|
|
26804
26848
|
}
|
|
@@ -26917,7 +26961,7 @@ async function parseHooks(hooksPath, onParseError) {
|
|
|
26917
26961
|
return result2;
|
|
26918
26962
|
}
|
|
26919
26963
|
var VALID_TYPES;
|
|
26920
|
-
var
|
|
26964
|
+
var init_hooks6 = __esm({
|
|
26921
26965
|
"src/canonical/features/hooks.ts"() {
|
|
26922
26966
|
init_syntax_error();
|
|
26923
26967
|
init_fs();
|
|
@@ -26998,7 +27042,7 @@ var WILDCARD_MATCHER;
|
|
|
26998
27042
|
var init_importer_hooks2 = __esm({
|
|
26999
27043
|
"src/targets/windsurf/importer-hooks.ts"() {
|
|
27000
27044
|
init_canonical_paths();
|
|
27001
|
-
|
|
27045
|
+
init_hooks6();
|
|
27002
27046
|
init_fs();
|
|
27003
27047
|
init_constants34();
|
|
27004
27048
|
init_hook_events();
|
|
@@ -27299,6 +27343,7 @@ var init_windsurf2 = __esm({
|
|
|
27299
27343
|
init_merge14();
|
|
27300
27344
|
init_linter32();
|
|
27301
27345
|
init_lint31();
|
|
27346
|
+
init_hook_events();
|
|
27302
27347
|
init_import_map_builders();
|
|
27303
27348
|
init_conversions();
|
|
27304
27349
|
init_projected_agent_skill();
|
|
@@ -27430,6 +27475,7 @@ var init_windsurf2 = __esm({
|
|
|
27430
27475
|
},
|
|
27431
27476
|
emptyImportMessage: "No Windsurf config found (.windsurfrules, .windsurf/rules, .windsurfignore, or .codeiumignore).",
|
|
27432
27477
|
supportsConversion: { agents: true },
|
|
27478
|
+
hookContextEvents: WINDSURF_HOOK_CONTEXT_EVENTS,
|
|
27433
27479
|
lintRules: lintRules32,
|
|
27434
27480
|
lint: {
|
|
27435
27481
|
commands: lintCommands10,
|