@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.mjs
CHANGED
|
@@ -1520,21 +1520,11 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1520
1520
|
}
|
|
1521
1521
|
const allMcpServers = {};
|
|
1522
1522
|
for (const [name, config] of Object.entries(mcpServers)) {
|
|
1523
|
-
|
|
1524
|
-
if (config.command) server.command = config.command;
|
|
1525
|
-
if (config.args) server.args = [...config.args];
|
|
1526
|
-
if (config.url) server.url = config.url;
|
|
1527
|
-
if (config.env) server.env = { ...config.env };
|
|
1528
|
-
allMcpServers[name] = server;
|
|
1523
|
+
allMcpServers[name] = _ClaudeRenderer.buildMcpServerObj(config);
|
|
1529
1524
|
}
|
|
1530
1525
|
if (settings?.mcpServers) {
|
|
1531
1526
|
for (const [name, config] of Object.entries(settings.mcpServers)) {
|
|
1532
|
-
|
|
1533
|
-
if (config.command) server.command = config.command;
|
|
1534
|
-
if (config.args) server.args = [...config.args];
|
|
1535
|
-
if (config.url) server.url = config.url;
|
|
1536
|
-
if (config.env) server.env = { ...config.env };
|
|
1537
|
-
allMcpServers[name] = server;
|
|
1527
|
+
allMcpServers[name] = _ClaudeRenderer.buildMcpServerObj(config);
|
|
1538
1528
|
}
|
|
1539
1529
|
}
|
|
1540
1530
|
if (Object.keys(allMcpServers).length > 0) {
|
|
@@ -1545,6 +1535,10 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1545
1535
|
obj.allowedMcpServers = [...settings.allowedMcpServers];
|
|
1546
1536
|
hasContent = true;
|
|
1547
1537
|
}
|
|
1538
|
+
if (settings?.deniedMcpServers?.length) {
|
|
1539
|
+
obj.deniedMcpServers = [...settings.deniedMcpServers];
|
|
1540
|
+
hasContent = true;
|
|
1541
|
+
}
|
|
1548
1542
|
if (settings?.env && Object.keys(settings.env).length > 0) {
|
|
1549
1543
|
obj.env = { ...settings.env };
|
|
1550
1544
|
hasContent = true;
|
|
@@ -1585,10 +1579,26 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1585
1579
|
obj.excludeSensitivePatterns = [...settings.excludeSensitivePatterns];
|
|
1586
1580
|
hasContent = true;
|
|
1587
1581
|
}
|
|
1582
|
+
if (settings?.model) {
|
|
1583
|
+
obj.model = settings.model;
|
|
1584
|
+
hasContent = true;
|
|
1585
|
+
}
|
|
1586
|
+
if (settings?.effortLevel) {
|
|
1587
|
+
obj.effortLevel = settings.effortLevel;
|
|
1588
|
+
hasContent = true;
|
|
1589
|
+
}
|
|
1588
1590
|
if (settings?.attribution) {
|
|
1589
1591
|
obj.attribution = settings.attribution;
|
|
1590
1592
|
hasContent = true;
|
|
1591
1593
|
}
|
|
1594
|
+
if (settings?.claudeMdExcludes?.length) {
|
|
1595
|
+
obj.claudeMdExcludes = [...settings.claudeMdExcludes];
|
|
1596
|
+
hasContent = true;
|
|
1597
|
+
}
|
|
1598
|
+
if (settings?.respectGitignore !== void 0) {
|
|
1599
|
+
obj.respectGitignore = settings.respectGitignore;
|
|
1600
|
+
hasContent = true;
|
|
1601
|
+
}
|
|
1592
1602
|
if (!hasContent) return;
|
|
1593
1603
|
new JsonFile2(component, ".claude/settings.json", { obj });
|
|
1594
1604
|
}
|
|
@@ -1697,24 +1707,54 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1697
1707
|
lines.push(` - "${tool}"`);
|
|
1698
1708
|
}
|
|
1699
1709
|
}
|
|
1710
|
+
if (agent.disallowedTools && agent.disallowedTools.length > 0) {
|
|
1711
|
+
lines.push(`disallowedTools:`);
|
|
1712
|
+
for (const tool of agent.disallowedTools) {
|
|
1713
|
+
lines.push(` - "${tool}"`);
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1700
1716
|
if (agent.maxTurns) {
|
|
1701
|
-
lines.push(`
|
|
1717
|
+
lines.push(`maxTurns: ${agent.maxTurns}`);
|
|
1718
|
+
}
|
|
1719
|
+
if (agent.skills && agent.skills.length > 0) {
|
|
1720
|
+
lines.push(`skills:`);
|
|
1721
|
+
for (const skill of agent.skills) {
|
|
1722
|
+
lines.push(` - "${skill}"`);
|
|
1723
|
+
}
|
|
1702
1724
|
}
|
|
1703
1725
|
if (agent.platforms?.claude?.permissionMode) {
|
|
1704
|
-
lines.push(`
|
|
1726
|
+
lines.push(`permissionMode: ${agent.platforms.claude.permissionMode}`);
|
|
1705
1727
|
}
|
|
1706
1728
|
if (agent.platforms?.claude?.isolation) {
|
|
1707
1729
|
lines.push(`isolation: ${agent.platforms.claude.isolation}`);
|
|
1708
1730
|
}
|
|
1731
|
+
if (agent.platforms?.claude?.background) {
|
|
1732
|
+
lines.push(`background: true`);
|
|
1733
|
+
}
|
|
1709
1734
|
if (agent.platforms?.claude?.effort) {
|
|
1710
1735
|
lines.push(`effort: ${agent.platforms.claude.effort}`);
|
|
1711
1736
|
}
|
|
1737
|
+
if (agent.platforms?.claude?.memory) {
|
|
1738
|
+
lines.push(`memory: ${agent.platforms.claude.memory}`);
|
|
1739
|
+
}
|
|
1712
1740
|
lines.push("---");
|
|
1713
1741
|
lines.push("");
|
|
1714
1742
|
lines.push(...agent.prompt.split("\n"));
|
|
1715
1743
|
new TextFile2(component, `.claude/agents/${agent.name}.md`, { lines });
|
|
1716
1744
|
}
|
|
1717
1745
|
}
|
|
1746
|
+
static buildMcpServerObj(config) {
|
|
1747
|
+
const server = {};
|
|
1748
|
+
if (config.transport) server.type = config.transport;
|
|
1749
|
+
if (config.command) server.command = config.command;
|
|
1750
|
+
if (config.args) server.args = [...config.args];
|
|
1751
|
+
if (config.url) server.url = config.url;
|
|
1752
|
+
if (config.headers && Object.keys(config.headers).length > 0) {
|
|
1753
|
+
server.headers = { ...config.headers };
|
|
1754
|
+
}
|
|
1755
|
+
if (config.env) server.env = { ...config.env };
|
|
1756
|
+
return server;
|
|
1757
|
+
}
|
|
1718
1758
|
/**
|
|
1719
1759
|
* Determine the default Claude rule target based on rule scope.
|
|
1720
1760
|
* ALWAYS-scoped rules default to CLAUDE_MD; FILE_PATTERN rules default to SCOPED_FILE.
|
|
@@ -1835,9 +1875,13 @@ var CursorRenderer = class _CursorRenderer {
|
|
|
1835
1875
|
const servers = obj.mcpServers;
|
|
1836
1876
|
for (const [name, config] of Object.entries(mcpServers)) {
|
|
1837
1877
|
const server = {};
|
|
1878
|
+
if (config.transport) server.transport = config.transport;
|
|
1838
1879
|
if (config.command) server.command = config.command;
|
|
1839
1880
|
if (config.args) server.args = [...config.args];
|
|
1840
1881
|
if (config.url) server.url = config.url;
|
|
1882
|
+
if (config.headers && Object.keys(config.headers).length > 0) {
|
|
1883
|
+
server.headers = { ...config.headers };
|
|
1884
|
+
}
|
|
1841
1885
|
if (config.env) server.env = { ...config.env };
|
|
1842
1886
|
servers[name] = server;
|
|
1843
1887
|
}
|
|
@@ -1846,38 +1890,14 @@ var CursorRenderer = class _CursorRenderer {
|
|
|
1846
1890
|
static renderHooks(component, settings) {
|
|
1847
1891
|
if (!settings?.hooks) return;
|
|
1848
1892
|
const hooks = {};
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
}
|
|
1857
|
-
if (beforeSubmitPrompt?.length) {
|
|
1858
|
-
hooks.beforeSubmitPrompt = beforeSubmitPrompt.map((h) => ({
|
|
1859
|
-
command: h.command
|
|
1860
|
-
}));
|
|
1861
|
-
}
|
|
1862
|
-
if (beforeShellExecution?.length) {
|
|
1863
|
-
hooks.beforeShellExecution = beforeShellExecution.map((h) => ({
|
|
1864
|
-
command: h.command
|
|
1865
|
-
}));
|
|
1866
|
-
}
|
|
1867
|
-
if (beforeMCPExecution?.length) {
|
|
1868
|
-
hooks.beforeMCPExecution = beforeMCPExecution.map((h) => ({
|
|
1869
|
-
command: h.command
|
|
1870
|
-
}));
|
|
1871
|
-
}
|
|
1872
|
-
if (beforeReadFile?.length) {
|
|
1873
|
-
hooks.beforeReadFile = beforeReadFile.map((h) => ({
|
|
1874
|
-
command: h.command
|
|
1875
|
-
}));
|
|
1876
|
-
}
|
|
1877
|
-
if (afterFileEdit?.length) {
|
|
1878
|
-
hooks.afterFileEdit = afterFileEdit.map((h) => ({ command: h.command }));
|
|
1879
|
-
}
|
|
1880
|
-
if (stop?.length) hooks.stop = stop.map((h) => ({ command: h.command }));
|
|
1893
|
+
const hookEntries = settings.hooks;
|
|
1894
|
+
for (const [event, actions] of Object.entries(hookEntries)) {
|
|
1895
|
+
if (actions && actions.length > 0) {
|
|
1896
|
+
hooks[event] = actions.map((h) => ({
|
|
1897
|
+
command: h.command
|
|
1898
|
+
}));
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1881
1901
|
if (Object.keys(hooks).length === 0) return;
|
|
1882
1902
|
new JsonFile3(component, ".cursor/hooks.json", {
|
|
1883
1903
|
obj: { version: 1, hooks }
|
|
@@ -2701,6 +2721,16 @@ var TypeScriptProject = class extends typescript.TypeScriptProject {
|
|
|
2701
2721
|
turbo.compileTask?.outputs.push("dist/**");
|
|
2702
2722
|
turbo.compileTask?.outputs.push("lib/**");
|
|
2703
2723
|
}
|
|
2724
|
+
const parentHasAgentConfig = userOptions.parent instanceof MonorepoProject && AgentConfig.of(userOptions.parent) !== void 0;
|
|
2725
|
+
if (options.agentConfig !== false) {
|
|
2726
|
+
const shouldEnable = typeof options.agentConfig === "object" || options.agentConfig === true || parentHasAgentConfig;
|
|
2727
|
+
if (shouldEnable) {
|
|
2728
|
+
new AgentConfig(
|
|
2729
|
+
this,
|
|
2730
|
+
typeof options.agentConfig === "object" ? options.agentConfig : {}
|
|
2731
|
+
);
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2704
2734
|
if (options.resetTask !== false) {
|
|
2705
2735
|
const defaultResetTaskOptions = {
|
|
2706
2736
|
pathsToRemove: [
|
|
@@ -3198,7 +3228,10 @@ var MonorepoProject = class extends TypeScriptAppProject {
|
|
|
3198
3228
|
);
|
|
3199
3229
|
}
|
|
3200
3230
|
if (options.agentConfig) {
|
|
3201
|
-
new AgentConfig(
|
|
3231
|
+
new AgentConfig(
|
|
3232
|
+
this,
|
|
3233
|
+
typeof options.agentConfig === "object" ? options.agentConfig : {}
|
|
3234
|
+
);
|
|
3202
3235
|
}
|
|
3203
3236
|
if (this.buildWorkflow) {
|
|
3204
3237
|
addBuildCompleteJob(this.buildWorkflow);
|