@codedrifters/configulator 0.0.153 → 0.0.154

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/lib/index.js CHANGED
@@ -175,11 +175,18 @@ var require_lib = __commonJS({
175
175
  // src/index.ts
176
176
  var index_exports = {};
177
177
  __export(index_exports, {
178
+ AGENT_MODEL: () => AGENT_MODEL,
179
+ AGENT_PLATFORM: () => AGENT_PLATFORM,
180
+ AGENT_RULE_SCOPE: () => AGENT_RULE_SCOPE,
181
+ AgentConfig: () => AgentConfig,
178
182
  AwsDeployWorkflow: () => AwsDeployWorkflow,
179
183
  AwsDeploymentConfig: () => AwsDeploymentConfig,
180
184
  AwsDeploymentTarget: () => AwsDeploymentTarget,
185
+ BUILT_IN_BUNDLES: () => BUILT_IN_BUNDLES,
186
+ CLAUDE_RULE_TARGET: () => CLAUDE_RULE_TARGET,
181
187
  COMPLETE_JOB_ID: () => COMPLETE_JOB_ID,
182
188
  JsiiFaker: () => JsiiFaker,
189
+ MCP_TRANSPORT: () => MCP_TRANSPORT,
183
190
  MERGE_METHODS: () => MERGE_METHODS,
184
191
  MIMIMUM_RELEASE_AGE: () => MIMIMUM_RELEASE_AGE,
185
192
  MonorepoProject: () => MonorepoProject,
@@ -204,10 +211,628 @@ __export(index_exports, {
204
211
  });
205
212
  module.exports = __toCommonJS(index_exports);
206
213
 
214
+ // src/agent/agent-config.ts
215
+ var import_projen3 = require("projen");
216
+
217
+ // src/agent/bundles/index.ts
218
+ var BUILT_IN_BUNDLES = [];
219
+
220
+ // src/agent/renderers/claude-renderer.ts
221
+ var import_projen = require("projen");
222
+ var import_textfile = require("projen/lib/textfile");
223
+
224
+ // src/agent/types.ts
225
+ var AGENT_RULE_SCOPE = {
226
+ ALWAYS: "always",
227
+ FILE_PATTERN: "file-pattern"
228
+ };
229
+ var AGENT_PLATFORM = {
230
+ CURSOR: "cursor",
231
+ CLAUDE: "claude",
232
+ CODEX: "codex",
233
+ COPILOT: "copilot"
234
+ };
235
+ var CLAUDE_RULE_TARGET = {
236
+ SCOPED_FILE: "scoped-file",
237
+ AGENTS_MD: "agents-md",
238
+ CLAUDE_MD: "claude-md"
239
+ };
240
+ var AGENT_MODEL = {
241
+ INHERIT: "inherit",
242
+ FAST: "fast",
243
+ BALANCED: "balanced",
244
+ POWERFUL: "powerful"
245
+ };
246
+ var MCP_TRANSPORT = {
247
+ STDIO: "stdio",
248
+ HTTP: "http",
249
+ SSE: "sse"
250
+ };
251
+
252
+ // src/agent/renderers/claude-renderer.ts
253
+ var GENERATED_MARKER = "<!-- ~~ Generated by @codedrifters/configulator. Edits welcome \u2014 please contribute improvements back. ~~ -->";
254
+ var ClaudeRenderer = class _ClaudeRenderer {
255
+ /**
256
+ * Render all Claude Code configuration files.
257
+ */
258
+ static render(component, rules, skills, subAgents, mcpServers, settings) {
259
+ _ClaudeRenderer.renderClaudeMd(component, rules);
260
+ _ClaudeRenderer.renderScopedRules(component, rules);
261
+ _ClaudeRenderer.renderSettings(component, mcpServers, settings);
262
+ _ClaudeRenderer.renderSkills(component, skills);
263
+ _ClaudeRenderer.renderSubAgents(component, subAgents);
264
+ }
265
+ static renderClaudeMd(component, rules) {
266
+ const claudeMdRules = rules.filter((r) => {
267
+ if (r.platforms?.claude?.exclude) return false;
268
+ const target = r.platforms?.claude?.target ?? _ClaudeRenderer.defaultTarget(r);
269
+ return target === CLAUDE_RULE_TARGET.CLAUDE_MD;
270
+ });
271
+ if (claudeMdRules.length === 0) return;
272
+ const lines = [GENERATED_MARKER, ""];
273
+ for (let i = 0; i < claudeMdRules.length; i++) {
274
+ if (i > 0) lines.push("", "---", "");
275
+ lines.push(...claudeMdRules[i].content.split("\n"));
276
+ }
277
+ new import_textfile.TextFile(component, "CLAUDE.md", { lines });
278
+ }
279
+ static renderScopedRules(component, rules) {
280
+ const scopedRules = rules.filter((r) => {
281
+ if (r.platforms?.claude?.exclude) return false;
282
+ const target = r.platforms?.claude?.target ?? _ClaudeRenderer.defaultTarget(r);
283
+ return target === CLAUDE_RULE_TARGET.SCOPED_FILE;
284
+ });
285
+ for (const rule of scopedRules) {
286
+ const lines = [];
287
+ if (rule.filePatterns && rule.filePatterns.length > 0) {
288
+ lines.push("---");
289
+ lines.push("paths:");
290
+ for (const pattern of rule.filePatterns) {
291
+ lines.push(` - "${pattern}"`);
292
+ }
293
+ lines.push("---");
294
+ lines.push("");
295
+ }
296
+ lines.push(...rule.content.split("\n"));
297
+ new import_textfile.TextFile(component, `.claude/rules/${rule.name}.md`, { lines });
298
+ }
299
+ }
300
+ static renderSettings(component, mcpServers, settings) {
301
+ const obj = {};
302
+ let hasContent = false;
303
+ if (settings?.defaultMode) {
304
+ obj.defaultMode = settings.defaultMode;
305
+ hasContent = true;
306
+ }
307
+ if (settings?.permissions) {
308
+ const perms = {};
309
+ if (settings.permissions.allow?.length) {
310
+ perms.allow = [...settings.permissions.allow];
311
+ }
312
+ if (settings.permissions.deny?.length) {
313
+ perms.deny = [...settings.permissions.deny];
314
+ }
315
+ if (settings.permissions.ask?.length) {
316
+ perms.ask = [...settings.permissions.ask];
317
+ }
318
+ if (settings.permissions.additionalDirectories?.length) {
319
+ perms.additionalDirectories = [
320
+ ...settings.permissions.additionalDirectories
321
+ ];
322
+ }
323
+ if (Object.keys(perms).length > 0) {
324
+ obj.permissions = perms;
325
+ hasContent = true;
326
+ }
327
+ }
328
+ if (settings?.hooks) {
329
+ const hooks = {};
330
+ for (const [event, entries] of Object.entries(settings.hooks)) {
331
+ if (entries && entries.length > 0) {
332
+ hooks[event] = entries;
333
+ }
334
+ }
335
+ if (Object.keys(hooks).length > 0) {
336
+ obj.hooks = hooks;
337
+ hasContent = true;
338
+ }
339
+ }
340
+ const allMcpServers = {};
341
+ for (const [name, config] of Object.entries(mcpServers)) {
342
+ const server = {};
343
+ if (config.command) server.command = config.command;
344
+ if (config.args) server.args = [...config.args];
345
+ if (config.url) server.url = config.url;
346
+ if (config.env) server.env = { ...config.env };
347
+ allMcpServers[name] = server;
348
+ }
349
+ if (settings?.mcpServers) {
350
+ for (const [name, config] of Object.entries(settings.mcpServers)) {
351
+ const server = {};
352
+ if (config.command) server.command = config.command;
353
+ if (config.args) server.args = [...config.args];
354
+ if (config.url) server.url = config.url;
355
+ if (config.env) server.env = { ...config.env };
356
+ allMcpServers[name] = server;
357
+ }
358
+ }
359
+ if (Object.keys(allMcpServers).length > 0) {
360
+ obj.mcpServers = allMcpServers;
361
+ hasContent = true;
362
+ }
363
+ if (settings?.allowedMcpServers?.length) {
364
+ obj.allowedMcpServers = [...settings.allowedMcpServers];
365
+ hasContent = true;
366
+ }
367
+ if (settings?.env && Object.keys(settings.env).length > 0) {
368
+ obj.env = { ...settings.env };
369
+ hasContent = true;
370
+ }
371
+ if (settings?.sandbox) {
372
+ obj.sandbox = _ClaudeRenderer.buildSandboxObj(settings.sandbox);
373
+ hasContent = true;
374
+ }
375
+ if (settings?.autoMode) {
376
+ const autoMode = {};
377
+ if (settings.autoMode.environment?.length) {
378
+ autoMode.environment = [...settings.autoMode.environment];
379
+ }
380
+ if (settings.autoMode.allow?.length) {
381
+ autoMode.allow = [...settings.autoMode.allow];
382
+ }
383
+ if (settings.autoMode.soft_deny?.length) {
384
+ autoMode.soft_deny = [...settings.autoMode.soft_deny];
385
+ }
386
+ if (Object.keys(autoMode).length > 0) {
387
+ obj.autoMode = autoMode;
388
+ hasContent = true;
389
+ }
390
+ }
391
+ if (settings?.disableBypassPermissionsMode) {
392
+ obj.disableBypassPermissionsMode = settings.disableBypassPermissionsMode;
393
+ hasContent = true;
394
+ }
395
+ if (settings?.disableAutoMode) {
396
+ obj.disableAutoMode = settings.disableAutoMode;
397
+ hasContent = true;
398
+ }
399
+ if (settings?.disableAllHooks !== void 0) {
400
+ obj.disableAllHooks = settings.disableAllHooks;
401
+ hasContent = true;
402
+ }
403
+ if (settings?.excludeSensitivePatterns?.length) {
404
+ obj.excludeSensitivePatterns = [...settings.excludeSensitivePatterns];
405
+ hasContent = true;
406
+ }
407
+ if (settings?.attribution) {
408
+ obj.attribution = settings.attribution;
409
+ hasContent = true;
410
+ }
411
+ if (!hasContent) return;
412
+ new import_projen.JsonFile(component, ".claude/settings.json", { obj });
413
+ }
414
+ static buildSandboxObj(sandbox) {
415
+ const obj = {};
416
+ if (sandbox.enabled !== void 0) obj.enabled = sandbox.enabled;
417
+ if (sandbox.mode) obj.mode = sandbox.mode;
418
+ if (sandbox.failIfUnavailable !== void 0) {
419
+ obj.failIfUnavailable = sandbox.failIfUnavailable;
420
+ }
421
+ if (sandbox.autoAllowBashIfSandboxed !== void 0) {
422
+ obj.autoAllowBashIfSandboxed = sandbox.autoAllowBashIfSandboxed;
423
+ }
424
+ if (sandbox.excludedCommands?.length) {
425
+ obj.excludedCommands = [...sandbox.excludedCommands];
426
+ }
427
+ if (sandbox.filesystem) {
428
+ const fs = {};
429
+ if (sandbox.filesystem.allowRead?.length) {
430
+ fs.allowRead = [...sandbox.filesystem.allowRead];
431
+ }
432
+ if (sandbox.filesystem.denyRead?.length) {
433
+ fs.denyRead = [...sandbox.filesystem.denyRead];
434
+ }
435
+ if (sandbox.filesystem.allowWrite?.length) {
436
+ fs.allowWrite = [...sandbox.filesystem.allowWrite];
437
+ }
438
+ if (sandbox.filesystem.denyWrite?.length) {
439
+ fs.denyWrite = [...sandbox.filesystem.denyWrite];
440
+ }
441
+ if (Object.keys(fs).length > 0) obj.filesystem = fs;
442
+ }
443
+ if (sandbox.network) {
444
+ const net = {};
445
+ if (sandbox.network.allowedDomains?.length) {
446
+ net.allowedDomains = [...sandbox.network.allowedDomains];
447
+ }
448
+ if (sandbox.network.denyDomains?.length) {
449
+ net.denyDomains = [...sandbox.network.denyDomains];
450
+ }
451
+ if (Object.keys(net).length > 0) obj.network = net;
452
+ }
453
+ return obj;
454
+ }
455
+ static renderSkills(component, skills) {
456
+ for (const skill of skills) {
457
+ const lines = [];
458
+ lines.push("---");
459
+ lines.push(`name: "${skill.name}"`);
460
+ lines.push(`description: "${skill.description}"`);
461
+ if (skill.disableModelInvocation) {
462
+ lines.push(`disable-model-invocation: true`);
463
+ }
464
+ if (skill.userInvocable === false) {
465
+ lines.push(`user-invocable: false`);
466
+ }
467
+ if (skill.model) {
468
+ lines.push(`model: "${skill.model}"`);
469
+ }
470
+ if (skill.effort) {
471
+ lines.push(`effort: "${skill.effort}"`);
472
+ }
473
+ if (skill.paths && skill.paths.length > 0) {
474
+ lines.push(`paths:`);
475
+ for (const p of skill.paths) {
476
+ lines.push(` - "${p}"`);
477
+ }
478
+ }
479
+ if (skill.allowedTools && skill.allowedTools.length > 0) {
480
+ lines.push(`allowed-tools:`);
481
+ for (const tool of skill.allowedTools) {
482
+ lines.push(` - "${tool}"`);
483
+ }
484
+ }
485
+ lines.push("---");
486
+ lines.push("");
487
+ lines.push(...skill.instructions.split("\n"));
488
+ new import_textfile.TextFile(component, `.claude/skills/${skill.name}/SKILL.md`, {
489
+ lines
490
+ });
491
+ }
492
+ }
493
+ static renderSubAgents(component, subAgents) {
494
+ for (const agent of subAgents) {
495
+ if (agent.platforms?.claude?.exclude) continue;
496
+ const lines = [];
497
+ lines.push("---");
498
+ lines.push(`name: ${agent.name}`);
499
+ lines.push(`description: >-`);
500
+ lines.push(` ${agent.description}`);
501
+ if (agent.model) {
502
+ lines.push(`model: ${agent.model}`);
503
+ }
504
+ if (agent.tools && agent.tools.length > 0) {
505
+ lines.push(`tools:`);
506
+ for (const tool of agent.tools) {
507
+ lines.push(` - "${tool}"`);
508
+ }
509
+ }
510
+ if (agent.maxTurns) {
511
+ lines.push(`max_turns: ${agent.maxTurns}`);
512
+ }
513
+ if (agent.platforms?.claude?.permissionMode) {
514
+ lines.push(`permission_mode: ${agent.platforms.claude.permissionMode}`);
515
+ }
516
+ if (agent.platforms?.claude?.isolation) {
517
+ lines.push(`isolation: ${agent.platforms.claude.isolation}`);
518
+ }
519
+ if (agent.platforms?.claude?.effort) {
520
+ lines.push(`effort: ${agent.platforms.claude.effort}`);
521
+ }
522
+ lines.push("---");
523
+ lines.push("");
524
+ lines.push(...agent.prompt.split("\n"));
525
+ new import_textfile.TextFile(component, `.claude/agents/${agent.name}.md`, { lines });
526
+ }
527
+ }
528
+ /**
529
+ * Determine the default Claude rule target based on rule scope.
530
+ * ALWAYS-scoped rules default to CLAUDE_MD; FILE_PATTERN rules default to SCOPED_FILE.
531
+ */
532
+ static defaultTarget(rule) {
533
+ return rule.scope === AGENT_RULE_SCOPE.ALWAYS ? CLAUDE_RULE_TARGET.CLAUDE_MD : CLAUDE_RULE_TARGET.SCOPED_FILE;
534
+ }
535
+ };
536
+
537
+ // src/agent/renderers/codex-renderer.ts
538
+ var CodexRenderer = class {
539
+ static render(_component, _rules, _skills, _subAgents) {
540
+ }
541
+ };
542
+
543
+ // src/agent/renderers/copilot-renderer.ts
544
+ var CopilotRenderer = class {
545
+ static render(_component, _rules, _skills, _subAgents) {
546
+ }
547
+ };
548
+
549
+ // src/agent/renderers/cursor-renderer.ts
550
+ var import_projen2 = require("projen");
551
+ var import_textfile2 = require("projen/lib/textfile");
552
+ var GENERATED_MARKER2 = "# ~~ Generated by @codedrifters/configulator. Edits welcome \u2014 please contribute improvements back. ~~";
553
+ var CursorRenderer = class _CursorRenderer {
554
+ /**
555
+ * Render all Cursor configuration files.
556
+ */
557
+ static render(component, rules, skills, subAgents, mcpServers, settings) {
558
+ _CursorRenderer.renderRules(component, rules);
559
+ _CursorRenderer.renderSkills(component, skills);
560
+ _CursorRenderer.renderSubAgents(component, subAgents);
561
+ _CursorRenderer.renderMcpServers(component, mcpServers);
562
+ _CursorRenderer.renderHooks(component, settings);
563
+ _CursorRenderer.renderIgnoreFiles(component, settings);
564
+ }
565
+ static renderRules(component, rules) {
566
+ for (const rule of rules) {
567
+ if (rule.platforms?.cursor?.exclude) continue;
568
+ const lines = [];
569
+ const description = rule.platforms?.cursor?.description ?? rule.description;
570
+ const isAlways = rule.scope === AGENT_RULE_SCOPE.ALWAYS;
571
+ lines.push("---");
572
+ lines.push(`description: "${description}"`);
573
+ lines.push(`alwaysApply: ${isAlways}`);
574
+ if (!isAlways && rule.filePatterns && rule.filePatterns.length > 0) {
575
+ lines.push(`path: ${JSON.stringify([...rule.filePatterns])}`);
576
+ }
577
+ lines.push("---");
578
+ lines.push("");
579
+ lines.push(...rule.content.split("\n"));
580
+ new import_textfile2.TextFile(component, `.cursor/rules/${rule.name}.mdc`, { lines });
581
+ }
582
+ }
583
+ static renderSkills(component, skills) {
584
+ for (const skill of skills) {
585
+ const lines = [];
586
+ lines.push("---");
587
+ lines.push(`name: "${skill.name}"`);
588
+ lines.push(`description: "${skill.description}"`);
589
+ if (skill.disableModelInvocation) {
590
+ lines.push(`disable-model-invocation: true`);
591
+ }
592
+ if (skill.userInvocable === false) {
593
+ lines.push(`user-invocable: false`);
594
+ }
595
+ if (skill.allowedTools && skill.allowedTools.length > 0) {
596
+ lines.push(`allowed-tools:`);
597
+ for (const tool of skill.allowedTools) {
598
+ lines.push(` - "${tool}"`);
599
+ }
600
+ }
601
+ lines.push("---");
602
+ lines.push("");
603
+ lines.push(...skill.instructions.split("\n"));
604
+ new import_textfile2.TextFile(component, `.cursor/skills/${skill.name}/SKILL.md`, {
605
+ lines
606
+ });
607
+ }
608
+ }
609
+ static renderSubAgents(component, subAgents) {
610
+ for (const agent of subAgents) {
611
+ if (agent.platforms?.cursor?.exclude) continue;
612
+ const lines = [];
613
+ lines.push("---");
614
+ lines.push(`name: ${agent.name}`);
615
+ lines.push(`description: >-`);
616
+ lines.push(` ${agent.description}`);
617
+ if (agent.model) {
618
+ lines.push(`model: ${agent.model}`);
619
+ }
620
+ if (agent.platforms?.cursor?.readonly) {
621
+ lines.push(`readonly: true`);
622
+ }
623
+ if (agent.platforms?.cursor?.isBackground) {
624
+ lines.push(`is_background: true`);
625
+ }
626
+ lines.push("---");
627
+ lines.push("");
628
+ lines.push(...agent.prompt.split("\n"));
629
+ new import_textfile2.TextFile(component, `.cursor/agents/${agent.name}.md`, { lines });
630
+ }
631
+ }
632
+ static renderMcpServers(component, mcpServers) {
633
+ const serverNames = Object.keys(mcpServers);
634
+ if (serverNames.length === 0) return;
635
+ const obj = { mcpServers: {} };
636
+ const servers = obj.mcpServers;
637
+ for (const [name, config] of Object.entries(mcpServers)) {
638
+ const server = {};
639
+ if (config.command) server.command = config.command;
640
+ if (config.args) server.args = [...config.args];
641
+ if (config.url) server.url = config.url;
642
+ if (config.env) server.env = { ...config.env };
643
+ servers[name] = server;
644
+ }
645
+ new import_projen2.JsonFile(component, ".cursor/mcp.json", { obj });
646
+ }
647
+ static renderHooks(component, settings) {
648
+ if (!settings?.hooks) return;
649
+ const hooks = {};
650
+ const {
651
+ beforeSubmitPrompt,
652
+ beforeShellExecution,
653
+ beforeMCPExecution,
654
+ beforeReadFile,
655
+ afterFileEdit,
656
+ stop
657
+ } = settings.hooks;
658
+ if (beforeSubmitPrompt?.length) {
659
+ hooks.beforeSubmitPrompt = beforeSubmitPrompt.map((h) => ({
660
+ command: h.command
661
+ }));
662
+ }
663
+ if (beforeShellExecution?.length) {
664
+ hooks.beforeShellExecution = beforeShellExecution.map((h) => ({
665
+ command: h.command
666
+ }));
667
+ }
668
+ if (beforeMCPExecution?.length) {
669
+ hooks.beforeMCPExecution = beforeMCPExecution.map((h) => ({
670
+ command: h.command
671
+ }));
672
+ }
673
+ if (beforeReadFile?.length) {
674
+ hooks.beforeReadFile = beforeReadFile.map((h) => ({
675
+ command: h.command
676
+ }));
677
+ }
678
+ if (afterFileEdit?.length) {
679
+ hooks.afterFileEdit = afterFileEdit.map((h) => ({ command: h.command }));
680
+ }
681
+ if (stop?.length) hooks.stop = stop.map((h) => ({ command: h.command }));
682
+ if (Object.keys(hooks).length === 0) return;
683
+ new import_projen2.JsonFile(component, ".cursor/hooks.json", {
684
+ obj: { version: 1, hooks }
685
+ });
686
+ }
687
+ static renderIgnoreFiles(component, settings) {
688
+ if (settings?.ignorePatterns && settings.ignorePatterns.length > 0) {
689
+ new import_textfile2.TextFile(component, ".cursorignore", {
690
+ lines: [GENERATED_MARKER2, "", ...settings.ignorePatterns]
691
+ });
692
+ }
693
+ if (settings?.indexingIgnorePatterns && settings.indexingIgnorePatterns.length > 0) {
694
+ new import_textfile2.TextFile(component, ".cursorindexingignore", {
695
+ lines: [GENERATED_MARKER2, "", ...settings.indexingIgnorePatterns]
696
+ });
697
+ }
698
+ }
699
+ };
700
+
701
+ // src/agent/agent-config.ts
702
+ var AgentConfig = class _AgentConfig extends import_projen3.Component {
703
+ /**
704
+ * Find the AgentConfig component on a project.
705
+ */
706
+ static of(project) {
707
+ const isAgentConfig = (c) => c instanceof _AgentConfig;
708
+ return project.components.find(isAgentConfig);
709
+ }
710
+ constructor(project, options = {}) {
711
+ super(project);
712
+ this.options = options;
713
+ }
714
+ preSynthesize() {
715
+ super.preSynthesize();
716
+ const platforms = this.resolvePlatforms();
717
+ const rules = this.resolveRules();
718
+ const skills = this.resolveSkills();
719
+ const subAgents = this.resolveSubAgents();
720
+ const mcpServers = this.options.mcpServers ?? {};
721
+ if (platforms.includes(AGENT_PLATFORM.CURSOR)) {
722
+ CursorRenderer.render(
723
+ this,
724
+ rules,
725
+ skills,
726
+ subAgents,
727
+ mcpServers,
728
+ this.options.cursorSettings
729
+ );
730
+ }
731
+ if (platforms.includes(AGENT_PLATFORM.CLAUDE)) {
732
+ ClaudeRenderer.render(
733
+ this,
734
+ rules,
735
+ skills,
736
+ subAgents,
737
+ mcpServers,
738
+ this.options.claudeSettings
739
+ );
740
+ }
741
+ if (platforms.includes(AGENT_PLATFORM.CODEX)) {
742
+ CodexRenderer.render(this, rules, skills, subAgents);
743
+ }
744
+ if (platforms.includes(AGENT_PLATFORM.COPILOT)) {
745
+ CopilotRenderer.render(this, rules, skills, subAgents);
746
+ }
747
+ }
748
+ resolvePlatforms() {
749
+ return this.options.platforms ?? [AGENT_PLATFORM.CURSOR, AGENT_PLATFORM.CLAUDE];
750
+ }
751
+ resolveRules() {
752
+ const ruleMap = /* @__PURE__ */ new Map();
753
+ if (this.options.autoDetectBundles !== false) {
754
+ for (const bundle of BUILT_IN_BUNDLES) {
755
+ if (this.options.excludeBundles?.includes(bundle.name)) continue;
756
+ if (bundle.appliesWhen(this.project)) {
757
+ for (const rule of bundle.rules) {
758
+ ruleMap.set(rule.name, rule);
759
+ }
760
+ }
761
+ }
762
+ }
763
+ if (this.options.includeBundles) {
764
+ for (const bundleName of this.options.includeBundles) {
765
+ const bundle = BUILT_IN_BUNDLES.find((b) => b.name === bundleName);
766
+ if (bundle) {
767
+ for (const rule of bundle.rules) {
768
+ ruleMap.set(rule.name, rule);
769
+ }
770
+ }
771
+ }
772
+ }
773
+ if (this.options.rules) {
774
+ for (const rule of this.options.rules) {
775
+ ruleMap.set(rule.name, rule);
776
+ }
777
+ }
778
+ if (this.options.excludeRules) {
779
+ for (const name of this.options.excludeRules) {
780
+ ruleMap.delete(name);
781
+ }
782
+ }
783
+ return [...ruleMap.values()].sort((a, b) => {
784
+ if (a.name === "project-overview") return -1;
785
+ if (b.name === "project-overview") return 1;
786
+ const tagA = a.tags?.[0] ?? "\uFFFF";
787
+ const tagB = b.tags?.[0] ?? "\uFFFF";
788
+ if (tagA !== tagB) return tagA.localeCompare(tagB);
789
+ return a.name.localeCompare(b.name);
790
+ });
791
+ }
792
+ resolveSkills() {
793
+ const skillMap = /* @__PURE__ */ new Map();
794
+ if (this.options.autoDetectBundles !== false) {
795
+ for (const bundle of BUILT_IN_BUNDLES) {
796
+ if (this.options.excludeBundles?.includes(bundle.name)) continue;
797
+ if (bundle.appliesWhen(this.project) && bundle.skills) {
798
+ for (const skill of bundle.skills) {
799
+ skillMap.set(skill.name, skill);
800
+ }
801
+ }
802
+ }
803
+ }
804
+ if (this.options.skills) {
805
+ for (const skill of this.options.skills) {
806
+ skillMap.set(skill.name, skill);
807
+ }
808
+ }
809
+ return [...skillMap.values()];
810
+ }
811
+ resolveSubAgents() {
812
+ const agentMap = /* @__PURE__ */ new Map();
813
+ if (this.options.autoDetectBundles !== false) {
814
+ for (const bundle of BUILT_IN_BUNDLES) {
815
+ if (this.options.excludeBundles?.includes(bundle.name)) continue;
816
+ if (bundle.appliesWhen(this.project) && bundle.subAgents) {
817
+ for (const agent of bundle.subAgents) {
818
+ agentMap.set(agent.name, agent);
819
+ }
820
+ }
821
+ }
822
+ }
823
+ if (this.options.subAgents) {
824
+ for (const agent of this.options.subAgents) {
825
+ agentMap.set(agent.name, agent);
826
+ }
827
+ }
828
+ return [...agentMap.values()];
829
+ }
830
+ };
831
+
207
832
  // src/aws/aws-deployment-config.ts
208
833
  var import_node_path = require("path");
209
834
  var import_utils = __toESM(require_lib());
210
- var import_projen = require("projen");
835
+ var import_projen4 = require("projen");
211
836
 
212
837
  // src/turbo/turbo-repo-task.ts
213
838
  var import_lib = require("projen/lib");
@@ -459,7 +1084,7 @@ _TurboRepo.buildWorkflowOptions = (remoteCacheOptions) => {
459
1084
  var TurboRepo = _TurboRepo;
460
1085
 
461
1086
  // src/aws/aws-deployment-config.ts
462
- var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen.Component {
1087
+ var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen4.Component {
463
1088
  constructor(project) {
464
1089
  super(project);
465
1090
  /**
@@ -576,8 +1201,8 @@ var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen.Compo
576
1201
 
577
1202
  // src/aws/aws-deployment-target.ts
578
1203
  var import_utils2 = __toESM(require_lib());
579
- var import_projen2 = require("projen");
580
- var AwsDeploymentTarget = class _AwsDeploymentTarget extends import_projen2.Component {
1204
+ var import_projen5 = require("projen");
1205
+ var AwsDeploymentTarget = class _AwsDeploymentTarget extends import_projen5.Component {
581
1206
  constructor(project, options) {
582
1207
  super(project);
583
1208
  /**
@@ -839,12 +1464,12 @@ var VERSION = {
839
1464
 
840
1465
  // src/jsii/jsii-faker.ts
841
1466
  var spec = __toESM(require("@jsii/spec"));
842
- var import_projen3 = require("projen");
1467
+ var import_projen6 = require("projen");
843
1468
  var ProjenBaseFqn = {
844
1469
  TYPESCRIPT_PROJECT: "projen.typescript.TypeScriptProject",
845
1470
  TYPESCRIPT_PROJECT_OPTIONS: "projen.typescript.TypeScriptProjectOptions"
846
1471
  };
847
- var JsiiFaker = class _JsiiFaker extends import_projen3.Component {
1472
+ var JsiiFaker = class _JsiiFaker extends import_projen6.Component {
848
1473
  constructor(project) {
849
1474
  super(project);
850
1475
  this.project = project;
@@ -855,7 +1480,7 @@ var JsiiFaker = class _JsiiFaker extends import_projen3.Component {
855
1480
  };
856
1481
  };
857
1482
  this._assemblyName = this.project.package.packageName;
858
- new import_projen3.JsonFile(project, ".jsii", {
1483
+ new import_projen6.JsonFile(project, ".jsii", {
859
1484
  obj: () => {
860
1485
  return {
861
1486
  name: this._assemblyName,
@@ -894,7 +1519,7 @@ var JsiiFaker = class _JsiiFaker extends import_projen3.Component {
894
1519
 
895
1520
  // src/pnpm/pnpm-workspace.ts
896
1521
  var import_path = require("path");
897
- var import_projen4 = require("projen");
1522
+ var import_projen7 = require("projen");
898
1523
  var MIMIMUM_RELEASE_AGE = {
899
1524
  ZERO_DAYS: 0,
900
1525
  ONE_HOUR: 60,
@@ -908,7 +1533,7 @@ var MIMIMUM_RELEASE_AGE = {
908
1533
  SIX_DAYS: 8640,
909
1534
  ONE_WEEK: 10080
910
1535
  };
911
- var PnpmWorkspace = class _PnpmWorkspace extends import_projen4.Component {
1536
+ var PnpmWorkspace = class _PnpmWorkspace extends import_projen7.Component {
912
1537
  /**
913
1538
  * Get the pnpm workspace component of a project. If it does not exist,
914
1539
  * return undefined.
@@ -932,7 +1557,7 @@ var PnpmWorkspace = class _PnpmWorkspace extends import_projen4.Component {
932
1557
  this.defaultCatalog = options.defaultCatalog;
933
1558
  this.namedCatalogs = options.namedCatalogs;
934
1559
  project.addPackageIgnore(this.fileName);
935
- new import_projen4.YamlFile(this.project, this.fileName, {
1560
+ new import_projen7.YamlFile(this.project, this.fileName, {
936
1561
  obj: () => {
937
1562
  const pnpmConfig = {};
938
1563
  const packages = new Array();
@@ -978,19 +1603,19 @@ var import_typescript = require("projen/lib/typescript");
978
1603
  var import_ts_deepmerge2 = require("ts-deepmerge");
979
1604
 
980
1605
  // src/tasks/reset-task.ts
981
- var import_projen7 = require("projen");
1606
+ var import_projen10 = require("projen");
982
1607
 
983
1608
  // src/projects/typescript-project.ts
984
- var import_projen6 = require("projen");
1609
+ var import_projen9 = require("projen");
985
1610
  var import_javascript2 = require("projen/lib/javascript");
986
1611
  var import_release = require("projen/lib/release");
987
1612
  var import_ts_deepmerge = require("ts-deepmerge");
988
1613
 
989
1614
  // src/vitest/vitest-component.ts
990
- var import_projen5 = require("projen");
1615
+ var import_projen8 = require("projen");
991
1616
  var import_javascript = require("projen/lib/javascript");
992
- var import_textfile = require("projen/lib/textfile");
993
- var Vitest = class _Vitest extends import_projen5.Component {
1617
+ var import_textfile3 = require("projen/lib/textfile");
1618
+ var Vitest = class _Vitest extends import_projen8.Component {
994
1619
  constructor(project, options = {}) {
995
1620
  super(project);
996
1621
  this.project = project;
@@ -1046,7 +1671,7 @@ var Vitest = class _Vitest extends import_projen5.Component {
1046
1671
  }
1047
1672
  synthesizeConfig() {
1048
1673
  this.project.tryRemoveFile(this.configFilePath);
1049
- new import_textfile.TextFile(this, this.configFilePath, {
1674
+ new import_textfile3.TextFile(this, this.configFilePath, {
1050
1675
  lines: this.renderConfig()
1051
1676
  });
1052
1677
  }
@@ -1077,7 +1702,7 @@ var TestRunner = {
1077
1702
  JEST: "jest",
1078
1703
  VITEST: "vitest"
1079
1704
  };
1080
- var TypeScriptProject = class extends import_projen6.typescript.TypeScriptProject {
1705
+ var TypeScriptProject = class extends import_projen9.typescript.TypeScriptProject {
1081
1706
  constructor(userOptions) {
1082
1707
  const pnpmVersion = userOptions.parent && userOptions.parent instanceof MonorepoProject ? userOptions.parent.pnpmVersion : VERSION.PNPM_VERSION;
1083
1708
  const pnpmWorkspace = userOptions.parent && userOptions.parent instanceof MonorepoProject ? PnpmWorkspace.of(userOptions.parent) : void 0;
@@ -1237,7 +1862,7 @@ var TypeScriptProject = class extends import_projen6.typescript.TypeScriptProjec
1237
1862
  };
1238
1863
 
1239
1864
  // src/tasks/reset-task.ts
1240
- var ResetTask = class _ResetTask extends import_projen7.Component {
1865
+ var ResetTask = class _ResetTask extends import_projen10.Component {
1241
1866
  constructor(project, options = {}) {
1242
1867
  super(project);
1243
1868
  this.project = project;
@@ -1310,12 +1935,12 @@ var ResetTask = class _ResetTask extends import_projen7.Component {
1310
1935
  };
1311
1936
 
1312
1937
  // src/vscode/vscode.ts
1313
- var import_projen8 = require("projen");
1314
- var VSCodeConfig = class extends import_projen8.Component {
1938
+ var import_projen11 = require("projen");
1939
+ var VSCodeConfig = class extends import_projen11.Component {
1315
1940
  constructor(project) {
1316
1941
  super(project);
1317
- const vsConfig = new import_projen8.vscode.VsCode(project);
1318
- const vsSettings = new import_projen8.vscode.VsCodeSettings(vsConfig);
1942
+ const vsConfig = new import_projen11.vscode.VsCode(project);
1943
+ const vsSettings = new import_projen11.vscode.VsCodeSettings(vsConfig);
1319
1944
  vsSettings.addSetting("editor.tabSize", 2);
1320
1945
  vsSettings.addSetting("editor.detectIndentation", false);
1321
1946
  vsSettings.addSetting("editor.bracketPairColorization.enabled", true);
@@ -1745,9 +2370,9 @@ var MonorepoProject = class extends import_typescript.TypeScriptAppProject {
1745
2370
 
1746
2371
  // src/typescript/typescript-config.ts
1747
2372
  var import_node_path2 = require("path");
1748
- var import_projen9 = require("projen");
2373
+ var import_projen12 = require("projen");
1749
2374
  var import_path2 = require("projen/lib/util/path");
1750
- var TypeScriptConfig = class extends import_projen9.Component {
2375
+ var TypeScriptConfig = class extends import_projen12.Component {
1751
2376
  constructor(project) {
1752
2377
  super(project);
1753
2378
  let tsPaths = {};
@@ -1775,12 +2400,12 @@ var TypeScriptConfig = class extends import_projen9.Component {
1775
2400
 
1776
2401
  // src/workflows/aws-deploy-workflow.ts
1777
2402
  var import_utils3 = __toESM(require_lib());
1778
- var import_projen10 = require("projen");
2403
+ var import_projen13 = require("projen");
1779
2404
  var import_build = require("projen/lib/build");
1780
2405
  var import_github = require("projen/lib/github");
1781
2406
  var import_workflows_model4 = require("projen/lib/github/workflows-model");
1782
2407
  var PROD_DEPLOY_NAME = "prod-deploy";
1783
- var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen10.Component {
2408
+ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen13.Component {
1784
2409
  constructor(project, options = {}) {
1785
2410
  super(project);
1786
2411
  this.project = project;
@@ -2045,11 +2670,18 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen10.Compone
2045
2670
  };
2046
2671
  // Annotate the CommonJS export names for ESM import in node:
2047
2672
  0 && (module.exports = {
2673
+ AGENT_MODEL,
2674
+ AGENT_PLATFORM,
2675
+ AGENT_RULE_SCOPE,
2676
+ AgentConfig,
2048
2677
  AwsDeployWorkflow,
2049
2678
  AwsDeploymentConfig,
2050
2679
  AwsDeploymentTarget,
2680
+ BUILT_IN_BUNDLES,
2681
+ CLAUDE_RULE_TARGET,
2051
2682
  COMPLETE_JOB_ID,
2052
2683
  JsiiFaker,
2684
+ MCP_TRANSPORT,
2053
2685
  MERGE_METHODS,
2054
2686
  MIMIMUM_RELEASE_AGE,
2055
2687
  MonorepoProject,