@codedrifters/configulator 0.0.158 → 0.0.160
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.d.mts +144 -10
- package/lib/index.d.ts +144 -10
- package/lib/index.js +80 -47
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +80 -47
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1569,21 +1569,11 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1569
1569
|
}
|
|
1570
1570
|
const allMcpServers = {};
|
|
1571
1571
|
for (const [name, config] of Object.entries(mcpServers)) {
|
|
1572
|
-
|
|
1573
|
-
if (config.command) server.command = config.command;
|
|
1574
|
-
if (config.args) server.args = [...config.args];
|
|
1575
|
-
if (config.url) server.url = config.url;
|
|
1576
|
-
if (config.env) server.env = { ...config.env };
|
|
1577
|
-
allMcpServers[name] = server;
|
|
1572
|
+
allMcpServers[name] = _ClaudeRenderer.buildMcpServerObj(config);
|
|
1578
1573
|
}
|
|
1579
1574
|
if (settings?.mcpServers) {
|
|
1580
1575
|
for (const [name, config] of Object.entries(settings.mcpServers)) {
|
|
1581
|
-
|
|
1582
|
-
if (config.command) server.command = config.command;
|
|
1583
|
-
if (config.args) server.args = [...config.args];
|
|
1584
|
-
if (config.url) server.url = config.url;
|
|
1585
|
-
if (config.env) server.env = { ...config.env };
|
|
1586
|
-
allMcpServers[name] = server;
|
|
1576
|
+
allMcpServers[name] = _ClaudeRenderer.buildMcpServerObj(config);
|
|
1587
1577
|
}
|
|
1588
1578
|
}
|
|
1589
1579
|
if (Object.keys(allMcpServers).length > 0) {
|
|
@@ -1594,6 +1584,10 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1594
1584
|
obj.allowedMcpServers = [...settings.allowedMcpServers];
|
|
1595
1585
|
hasContent = true;
|
|
1596
1586
|
}
|
|
1587
|
+
if (settings?.deniedMcpServers?.length) {
|
|
1588
|
+
obj.deniedMcpServers = [...settings.deniedMcpServers];
|
|
1589
|
+
hasContent = true;
|
|
1590
|
+
}
|
|
1597
1591
|
if (settings?.env && Object.keys(settings.env).length > 0) {
|
|
1598
1592
|
obj.env = { ...settings.env };
|
|
1599
1593
|
hasContent = true;
|
|
@@ -1634,10 +1628,26 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1634
1628
|
obj.excludeSensitivePatterns = [...settings.excludeSensitivePatterns];
|
|
1635
1629
|
hasContent = true;
|
|
1636
1630
|
}
|
|
1631
|
+
if (settings?.model) {
|
|
1632
|
+
obj.model = settings.model;
|
|
1633
|
+
hasContent = true;
|
|
1634
|
+
}
|
|
1635
|
+
if (settings?.effortLevel) {
|
|
1636
|
+
obj.effortLevel = settings.effortLevel;
|
|
1637
|
+
hasContent = true;
|
|
1638
|
+
}
|
|
1637
1639
|
if (settings?.attribution) {
|
|
1638
1640
|
obj.attribution = settings.attribution;
|
|
1639
1641
|
hasContent = true;
|
|
1640
1642
|
}
|
|
1643
|
+
if (settings?.claudeMdExcludes?.length) {
|
|
1644
|
+
obj.claudeMdExcludes = [...settings.claudeMdExcludes];
|
|
1645
|
+
hasContent = true;
|
|
1646
|
+
}
|
|
1647
|
+
if (settings?.respectGitignore !== void 0) {
|
|
1648
|
+
obj.respectGitignore = settings.respectGitignore;
|
|
1649
|
+
hasContent = true;
|
|
1650
|
+
}
|
|
1641
1651
|
if (!hasContent) return;
|
|
1642
1652
|
new import_projen6.JsonFile(component, ".claude/settings.json", { obj });
|
|
1643
1653
|
}
|
|
@@ -1746,24 +1756,54 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1746
1756
|
lines.push(` - "${tool}"`);
|
|
1747
1757
|
}
|
|
1748
1758
|
}
|
|
1759
|
+
if (agent.disallowedTools && agent.disallowedTools.length > 0) {
|
|
1760
|
+
lines.push(`disallowedTools:`);
|
|
1761
|
+
for (const tool of agent.disallowedTools) {
|
|
1762
|
+
lines.push(` - "${tool}"`);
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1749
1765
|
if (agent.maxTurns) {
|
|
1750
|
-
lines.push(`
|
|
1766
|
+
lines.push(`maxTurns: ${agent.maxTurns}`);
|
|
1767
|
+
}
|
|
1768
|
+
if (agent.skills && agent.skills.length > 0) {
|
|
1769
|
+
lines.push(`skills:`);
|
|
1770
|
+
for (const skill of agent.skills) {
|
|
1771
|
+
lines.push(` - "${skill}"`);
|
|
1772
|
+
}
|
|
1751
1773
|
}
|
|
1752
1774
|
if (agent.platforms?.claude?.permissionMode) {
|
|
1753
|
-
lines.push(`
|
|
1775
|
+
lines.push(`permissionMode: ${agent.platforms.claude.permissionMode}`);
|
|
1754
1776
|
}
|
|
1755
1777
|
if (agent.platforms?.claude?.isolation) {
|
|
1756
1778
|
lines.push(`isolation: ${agent.platforms.claude.isolation}`);
|
|
1757
1779
|
}
|
|
1780
|
+
if (agent.platforms?.claude?.background) {
|
|
1781
|
+
lines.push(`background: true`);
|
|
1782
|
+
}
|
|
1758
1783
|
if (agent.platforms?.claude?.effort) {
|
|
1759
1784
|
lines.push(`effort: ${agent.platforms.claude.effort}`);
|
|
1760
1785
|
}
|
|
1786
|
+
if (agent.platforms?.claude?.memory) {
|
|
1787
|
+
lines.push(`memory: ${agent.platforms.claude.memory}`);
|
|
1788
|
+
}
|
|
1761
1789
|
lines.push("---");
|
|
1762
1790
|
lines.push("");
|
|
1763
1791
|
lines.push(...agent.prompt.split("\n"));
|
|
1764
1792
|
new import_textfile2.TextFile(component, `.claude/agents/${agent.name}.md`, { lines });
|
|
1765
1793
|
}
|
|
1766
1794
|
}
|
|
1795
|
+
static buildMcpServerObj(config) {
|
|
1796
|
+
const server = {};
|
|
1797
|
+
if (config.transport) server.type = config.transport;
|
|
1798
|
+
if (config.command) server.command = config.command;
|
|
1799
|
+
if (config.args) server.args = [...config.args];
|
|
1800
|
+
if (config.url) server.url = config.url;
|
|
1801
|
+
if (config.headers && Object.keys(config.headers).length > 0) {
|
|
1802
|
+
server.headers = { ...config.headers };
|
|
1803
|
+
}
|
|
1804
|
+
if (config.env) server.env = { ...config.env };
|
|
1805
|
+
return server;
|
|
1806
|
+
}
|
|
1767
1807
|
/**
|
|
1768
1808
|
* Determine the default Claude rule target based on rule scope.
|
|
1769
1809
|
* ALWAYS-scoped rules default to CLAUDE_MD; FILE_PATTERN rules default to SCOPED_FILE.
|
|
@@ -1884,9 +1924,13 @@ var CursorRenderer = class _CursorRenderer {
|
|
|
1884
1924
|
const servers = obj.mcpServers;
|
|
1885
1925
|
for (const [name, config] of Object.entries(mcpServers)) {
|
|
1886
1926
|
const server = {};
|
|
1927
|
+
if (config.transport) server.transport = config.transport;
|
|
1887
1928
|
if (config.command) server.command = config.command;
|
|
1888
1929
|
if (config.args) server.args = [...config.args];
|
|
1889
1930
|
if (config.url) server.url = config.url;
|
|
1931
|
+
if (config.headers && Object.keys(config.headers).length > 0) {
|
|
1932
|
+
server.headers = { ...config.headers };
|
|
1933
|
+
}
|
|
1890
1934
|
if (config.env) server.env = { ...config.env };
|
|
1891
1935
|
servers[name] = server;
|
|
1892
1936
|
}
|
|
@@ -1895,38 +1939,14 @@ var CursorRenderer = class _CursorRenderer {
|
|
|
1895
1939
|
static renderHooks(component, settings) {
|
|
1896
1940
|
if (!settings?.hooks) return;
|
|
1897
1941
|
const hooks = {};
|
|
1898
|
-
const
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
}
|
|
1906
|
-
if (beforeSubmitPrompt?.length) {
|
|
1907
|
-
hooks.beforeSubmitPrompt = beforeSubmitPrompt.map((h) => ({
|
|
1908
|
-
command: h.command
|
|
1909
|
-
}));
|
|
1910
|
-
}
|
|
1911
|
-
if (beforeShellExecution?.length) {
|
|
1912
|
-
hooks.beforeShellExecution = beforeShellExecution.map((h) => ({
|
|
1913
|
-
command: h.command
|
|
1914
|
-
}));
|
|
1915
|
-
}
|
|
1916
|
-
if (beforeMCPExecution?.length) {
|
|
1917
|
-
hooks.beforeMCPExecution = beforeMCPExecution.map((h) => ({
|
|
1918
|
-
command: h.command
|
|
1919
|
-
}));
|
|
1920
|
-
}
|
|
1921
|
-
if (beforeReadFile?.length) {
|
|
1922
|
-
hooks.beforeReadFile = beforeReadFile.map((h) => ({
|
|
1923
|
-
command: h.command
|
|
1924
|
-
}));
|
|
1925
|
-
}
|
|
1926
|
-
if (afterFileEdit?.length) {
|
|
1927
|
-
hooks.afterFileEdit = afterFileEdit.map((h) => ({ command: h.command }));
|
|
1928
|
-
}
|
|
1929
|
-
if (stop?.length) hooks.stop = stop.map((h) => ({ command: h.command }));
|
|
1942
|
+
const hookEntries = settings.hooks;
|
|
1943
|
+
for (const [event, actions] of Object.entries(hookEntries)) {
|
|
1944
|
+
if (actions && actions.length > 0) {
|
|
1945
|
+
hooks[event] = actions.map((h) => ({
|
|
1946
|
+
command: h.command
|
|
1947
|
+
}));
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1930
1950
|
if (Object.keys(hooks).length === 0) return;
|
|
1931
1951
|
new import_projen7.JsonFile(component, ".cursor/hooks.json", {
|
|
1932
1952
|
obj: { version: 1, hooks }
|
|
@@ -2741,6 +2761,16 @@ var TypeScriptProject = class extends import_projen12.typescript.TypeScriptProje
|
|
|
2741
2761
|
turbo.compileTask?.outputs.push("dist/**");
|
|
2742
2762
|
turbo.compileTask?.outputs.push("lib/**");
|
|
2743
2763
|
}
|
|
2764
|
+
const parentHasAgentConfig = userOptions.parent instanceof MonorepoProject && AgentConfig.of(userOptions.parent) !== void 0;
|
|
2765
|
+
if (options.agentConfig !== false) {
|
|
2766
|
+
const shouldEnable = typeof options.agentConfig === "object" || options.agentConfig === true || parentHasAgentConfig;
|
|
2767
|
+
if (shouldEnable) {
|
|
2768
|
+
new AgentConfig(
|
|
2769
|
+
this,
|
|
2770
|
+
typeof options.agentConfig === "object" ? options.agentConfig : {}
|
|
2771
|
+
);
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2744
2774
|
if (options.resetTask !== false) {
|
|
2745
2775
|
const defaultResetTaskOptions = {
|
|
2746
2776
|
pathsToRemove: [
|
|
@@ -3238,7 +3268,10 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
|
|
|
3238
3268
|
);
|
|
3239
3269
|
}
|
|
3240
3270
|
if (options.agentConfig) {
|
|
3241
|
-
new AgentConfig(
|
|
3271
|
+
new AgentConfig(
|
|
3272
|
+
this,
|
|
3273
|
+
typeof options.agentConfig === "object" ? options.agentConfig : {}
|
|
3274
|
+
);
|
|
3242
3275
|
}
|
|
3243
3276
|
if (this.buildWorkflow) {
|
|
3244
3277
|
addBuildCompleteJob(this.buildWorkflow);
|