@iloom/cli 0.5.4 → 0.6.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/README.md +116 -4
- package/dist/{ClaudeContextManager-PQ46VILL.js → ClaudeContextManager-6J2EB4QU.js} +5 -5
- package/dist/{ClaudeService-6OMO552H.js → ClaudeService-O2PB22GX.js} +4 -4
- package/dist/{LoomLauncher-ZHDTPKED.js → LoomLauncher-5LFM4LXB.js} +5 -5
- package/dist/ProjectCapabilityDetector-S5FLNCFI.js +11 -0
- package/dist/{PromptTemplateManager-5GNF7FCP.js → PromptTemplateManager-C3DK6XZL.js} +2 -2
- package/dist/README.md +116 -4
- package/dist/{SettingsManager-CNYBGXDT.js → SettingsManager-35F5RUJH.js} +2 -2
- package/dist/agents/iloom-framework-detector.md +366 -0
- package/dist/agents/iloom-issue-analyze-and-plan.md +0 -10
- package/dist/agents/iloom-issue-implementer.md +1 -1
- package/dist/agents/iloom-issue-planner.md +0 -10
- package/dist/build-FJVYP7EV.js +27 -0
- package/dist/build-FJVYP7EV.js.map +1 -0
- package/dist/{chunk-SHVB3EFE.js → chunk-64O2UIWO.js} +44 -19
- package/dist/chunk-64O2UIWO.js.map +1 -0
- package/dist/{chunk-FXJKNVZW.js → chunk-6U6VI4SZ.js} +3 -3
- package/dist/{chunk-QPS6TZUW.js → chunk-7WANFUIK.js} +2 -2
- package/dist/{chunk-LVLRMP7V.js → chunk-AXX3QIKK.js} +58 -14
- package/dist/chunk-AXX3QIKK.js.map +1 -0
- package/dist/chunk-BXCPJJYM.js +133 -0
- package/dist/chunk-BXCPJJYM.js.map +1 -0
- package/dist/{chunk-ESP2FF52.js → chunk-EK3XCAAS.js} +2 -2
- package/dist/{chunk-IDUICCZY.js → chunk-F6WVM437.js} +3 -1
- package/dist/chunk-F6WVM437.js.map +1 -0
- package/dist/{chunk-TKL7RBEF.js → chunk-GEXP5IOF.js} +3 -3
- package/dist/{chunk-J7GHNTYK.js → chunk-K7SEEHKO.js} +3 -3
- package/dist/{chunk-NRDY6XO3.js → chunk-PMVWQBWS.js} +73 -17
- package/dist/chunk-PMVWQBWS.js.map +1 -0
- package/dist/{chunk-NKRQNER7.js → chunk-Q7POFB5Q.js} +1 -55
- package/dist/chunk-Q7POFB5Q.js.map +1 -0
- package/dist/{chunk-N4ZJVATC.js → chunk-SN3Z6EZO.js} +11 -7
- package/dist/chunk-SN3Z6EZO.js.map +1 -0
- package/dist/chunk-TRQ76ISK.js +159 -0
- package/dist/chunk-TRQ76ISK.js.map +1 -0
- package/dist/{chunk-ZXWTOJXA.js → chunk-UB4TFAXJ.js} +38 -9
- package/dist/chunk-UB4TFAXJ.js.map +1 -0
- package/dist/{chunk-YPOG7WY4.js → chunk-UQIXZ3BA.js} +2 -2
- package/dist/{chunk-K5G5SFWY.js → chunk-W6WVRHJ6.js} +13 -1
- package/dist/chunk-W6WVRHJ6.js.map +1 -0
- package/dist/{chunk-E4F7KASE.js → chunk-WIJWIKAN.js} +3 -3
- package/dist/{chunk-EBISESAP.js → chunk-ZPSTA5PR.js} +16 -6
- package/dist/chunk-ZPSTA5PR.js.map +1 -0
- package/dist/{cleanup-H5QUWBWE.js → cleanup-OU2HFOOG.js} +11 -11
- package/dist/cli.js +107 -69
- package/dist/cli.js.map +1 -1
- package/dist/compile-ULNO5F7Q.js +57 -0
- package/dist/compile-ULNO5F7Q.js.map +1 -0
- package/dist/{contribute-VP73TPAL.js → contribute-T7ENST5N.js} +3 -3
- package/dist/{dev-server-H5FFXIVX.js → dev-server-4RCDJ5MU.js} +9 -9
- package/dist/{feedback-567ZH2O7.js → feedback-O4Q55SVS.js} +8 -8
- package/dist/{git-UHUNQZBA.js → git-FVMGBHC2.js} +3 -3
- package/dist/{ignite-VPP4PMF4.js → ignite-VHV65WEZ.js} +12 -8
- package/dist/ignite-VHV65WEZ.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/{init-4ZR2XXZA.js → init-HB34Q5FH.js} +8 -7
- package/dist/lint-5JMCWE4Y.js +27 -0
- package/dist/lint-5JMCWE4Y.js.map +1 -0
- package/dist/{open-6HBQHPUL.js → open-WHVUYGPY.js} +9 -9
- package/dist/prompts/init-prompt.txt +108 -0
- package/dist/prompts/issue-prompt.txt +12 -12
- package/dist/{rebase-SRBOVC4M.js → rebase-5EY3Q6XP.js} +5 -5
- package/dist/{recap-X7FTTKPP.js → recap-VOOUXOGP.js} +5 -5
- package/dist/{run-5FU76FFE.js → run-NCRK5NPR.js} +9 -9
- package/dist/schema/settings.schema.json +8 -0
- package/dist/{shell-UQJDI36V.js → shell-SBLXVOVJ.js} +5 -5
- package/dist/{summary-MOKN7RM2.js → summary-CVFAMDOJ.js} +6 -6
- package/dist/test-3KIVXI6J.js +27 -0
- package/dist/test-3KIVXI6J.js.map +1 -0
- package/dist/{test-git-GB3B6QNT.js → test-git-ZB6AGGRW.js} +3 -3
- package/dist/{test-prefix-YQNNTCY3.js → test-prefix-FBGXKMPA.js} +3 -3
- package/package.json +2 -1
- package/dist/ProjectCapabilityDetector-34LU7JJ4.js +0 -9
- package/dist/chunk-2ZPFJQ3B.js +0 -63
- package/dist/chunk-2ZPFJQ3B.js.map +0 -1
- package/dist/chunk-EBISESAP.js.map +0 -1
- package/dist/chunk-IDUICCZY.js.map +0 -1
- package/dist/chunk-K5G5SFWY.js.map +0 -1
- package/dist/chunk-LVLRMP7V.js.map +0 -1
- package/dist/chunk-N4ZJVATC.js.map +0 -1
- package/dist/chunk-NKRQNER7.js.map +0 -1
- package/dist/chunk-NRDY6XO3.js.map +0 -1
- package/dist/chunk-SHVB3EFE.js.map +0 -1
- package/dist/chunk-ZXWTOJXA.js.map +0 -1
- package/dist/ignite-VPP4PMF4.js.map +0 -1
- /package/dist/{ClaudeContextManager-PQ46VILL.js.map → ClaudeContextManager-6J2EB4QU.js.map} +0 -0
- /package/dist/{ClaudeService-6OMO552H.js.map → ClaudeService-O2PB22GX.js.map} +0 -0
- /package/dist/{LoomLauncher-ZHDTPKED.js.map → LoomLauncher-5LFM4LXB.js.map} +0 -0
- /package/dist/{ProjectCapabilityDetector-34LU7JJ4.js.map → ProjectCapabilityDetector-S5FLNCFI.js.map} +0 -0
- /package/dist/{PromptTemplateManager-5GNF7FCP.js.map → PromptTemplateManager-C3DK6XZL.js.map} +0 -0
- /package/dist/{SettingsManager-CNYBGXDT.js.map → SettingsManager-35F5RUJH.js.map} +0 -0
- /package/dist/{chunk-FXJKNVZW.js.map → chunk-6U6VI4SZ.js.map} +0 -0
- /package/dist/{chunk-QPS6TZUW.js.map → chunk-7WANFUIK.js.map} +0 -0
- /package/dist/{chunk-ESP2FF52.js.map → chunk-EK3XCAAS.js.map} +0 -0
- /package/dist/{chunk-TKL7RBEF.js.map → chunk-GEXP5IOF.js.map} +0 -0
- /package/dist/{chunk-J7GHNTYK.js.map → chunk-K7SEEHKO.js.map} +0 -0
- /package/dist/{chunk-YPOG7WY4.js.map → chunk-UQIXZ3BA.js.map} +0 -0
- /package/dist/{chunk-E4F7KASE.js.map → chunk-WIJWIKAN.js.map} +0 -0
- /package/dist/{cleanup-H5QUWBWE.js.map → cleanup-OU2HFOOG.js.map} +0 -0
- /package/dist/{contribute-VP73TPAL.js.map → contribute-T7ENST5N.js.map} +0 -0
- /package/dist/{dev-server-H5FFXIVX.js.map → dev-server-4RCDJ5MU.js.map} +0 -0
- /package/dist/{feedback-567ZH2O7.js.map → feedback-O4Q55SVS.js.map} +0 -0
- /package/dist/{git-UHUNQZBA.js.map → git-FVMGBHC2.js.map} +0 -0
- /package/dist/{init-4ZR2XXZA.js.map → init-HB34Q5FH.js.map} +0 -0
- /package/dist/{open-6HBQHPUL.js.map → open-WHVUYGPY.js.map} +0 -0
- /package/dist/{rebase-SRBOVC4M.js.map → rebase-5EY3Q6XP.js.map} +0 -0
- /package/dist/{recap-X7FTTKPP.js.map → recap-VOOUXOGP.js.map} +0 -0
- /package/dist/{run-5FU76FFE.js.map → run-NCRK5NPR.js.map} +0 -0
- /package/dist/{shell-UQJDI36V.js.map → shell-SBLXVOVJ.js.map} +0 -0
- /package/dist/{summary-MOKN7RM2.js.map → summary-CVFAMDOJ.js.map} +0 -0
- /package/dist/{test-git-GB3B6QNT.js.map → test-git-ZB6AGGRW.js.map} +0 -0
- /package/dist/{test-prefix-YQNNTCY3.js.map → test-prefix-FBGXKMPA.js.map} +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
getPackageScripts
|
|
4
|
+
} from "./chunk-BXCPJJYM.js";
|
|
2
5
|
import {
|
|
3
6
|
getLogger
|
|
4
7
|
} from "./chunk-6MLEBAYZ.js";
|
|
@@ -55,9 +58,16 @@ async function installDependencies(cwd, frozen = true, quiet = false) {
|
|
|
55
58
|
getLogger().debug("Skipping dependency installation - no working directory provided");
|
|
56
59
|
return;
|
|
57
60
|
}
|
|
61
|
+
const scripts = await getPackageScripts(cwd);
|
|
62
|
+
if (scripts.install) {
|
|
63
|
+
getLogger().info("Installing dependencies with install script...");
|
|
64
|
+
await runScript("install", cwd, [], { quiet });
|
|
65
|
+
getLogger().success("Dependencies installed successfully");
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
58
68
|
const pkgPath = path.join(cwd, "package.json");
|
|
59
69
|
if (!await fs.pathExists(pkgPath)) {
|
|
60
|
-
getLogger().debug("Skipping dependency installation - no package.json found");
|
|
70
|
+
getLogger().debug("Skipping dependency installation - no package.json found and no install script");
|
|
61
71
|
return;
|
|
62
72
|
}
|
|
63
73
|
const packageManager = await detectPackageManager(cwd);
|
|
@@ -92,19 +102,53 @@ async function installDependencies(cwd, frozen = true, quiet = false) {
|
|
|
92
102
|
}
|
|
93
103
|
}
|
|
94
104
|
async function runScript(scriptName, cwd, args = [], options = {}) {
|
|
95
|
-
const
|
|
96
|
-
const
|
|
105
|
+
const scripts = await getPackageScripts(cwd);
|
|
106
|
+
const scriptConfig = scripts[scriptName];
|
|
107
|
+
const isDebugMode = getLogger().isDebugEnabled();
|
|
108
|
+
if (!scriptConfig) {
|
|
109
|
+
throw new Error(`Script '${scriptName}' not found`);
|
|
110
|
+
}
|
|
111
|
+
const env = {
|
|
112
|
+
...process.env,
|
|
113
|
+
...options.env
|
|
114
|
+
};
|
|
115
|
+
if (!options.noCi) {
|
|
116
|
+
env.CI = "true";
|
|
117
|
+
}
|
|
118
|
+
const stdio = options.foreground ? "inherit" : options.quiet ? "pipe" : "inherit";
|
|
97
119
|
try {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
120
|
+
let execaProcess;
|
|
121
|
+
if (scriptConfig.source === "iloom-config") {
|
|
122
|
+
getLogger().debug(`Executing shell command: ${scriptConfig.command} with args: ${args.join(" ")}`);
|
|
123
|
+
execaProcess = execa("sh", ["-c", `${scriptConfig.command} "$@"`, "--", ...args], {
|
|
124
|
+
cwd,
|
|
125
|
+
stdio,
|
|
126
|
+
...!options.foreground && { timeout: 6e5 },
|
|
127
|
+
// No timeout for foreground mode
|
|
128
|
+
env,
|
|
129
|
+
verbose: isDebugMode
|
|
130
|
+
});
|
|
131
|
+
} else {
|
|
132
|
+
const packageManager = await detectPackageManager(cwd);
|
|
133
|
+
const command = packageManager === "npm" ? ["run", scriptName] : [scriptName];
|
|
134
|
+
execaProcess = execa(packageManager, [...command, ...args], {
|
|
135
|
+
cwd,
|
|
136
|
+
stdio,
|
|
137
|
+
...!options.foreground && { timeout: 6e5 },
|
|
138
|
+
// No timeout for foreground mode
|
|
139
|
+
env,
|
|
140
|
+
verbose: isDebugMode
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const result = {};
|
|
144
|
+
if (options.foreground && execaProcess.pid !== void 0) {
|
|
145
|
+
result.pid = execaProcess.pid;
|
|
146
|
+
}
|
|
147
|
+
if (options.onStart) {
|
|
148
|
+
options.onStart(result.pid);
|
|
149
|
+
}
|
|
150
|
+
await execaProcess;
|
|
151
|
+
return result;
|
|
108
152
|
} catch (error) {
|
|
109
153
|
const execaError = error;
|
|
110
154
|
const stderr = execaError.stderr ?? execaError.message ?? "Unknown error";
|
|
@@ -117,4 +161,4 @@ export {
|
|
|
117
161
|
installDependencies,
|
|
118
162
|
runScript
|
|
119
163
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
164
|
+
//# sourceMappingURL=chunk-AXX3QIKK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/package-manager.ts"],"sourcesContent":["import { execa, type ExecaError } from 'execa'\nimport { getLogger } from './logger-context.js'\nimport { getPackageScripts } from './package-json.js'\nimport fs from 'fs-extra'\nimport path from 'path'\n\nexport type PackageManager = 'pnpm' | 'npm' | 'yarn'\n\n/**\n * Validate if a string is a supported package manager\n */\nfunction isValidPackageManager(manager: string): manager is PackageManager {\n return manager === 'pnpm' || manager === 'npm' || manager === 'yarn'\n}\n\n/**\n * Detect which package manager to use for a project\n * Checks in order:\n * 1. packageManager field in package.json (Node.js standard)\n * 2. Lock files (pnpm-lock.yaml, package-lock.json, yarn.lock)\n * 3. Installed package managers (system-wide check)\n * 4. Defaults to npm if all detection fails\n *\n * @param cwd Working directory to detect package manager in (defaults to process.cwd())\n * @returns The detected package manager, or 'npm' as default\n */\nexport async function detectPackageManager(cwd: string = process.cwd()): Promise<PackageManager> {\n // 1. Check packageManager field in package.json\n try {\n const packageJsonPath = path.join(cwd, 'package.json')\n if (await fs.pathExists(packageJsonPath)) {\n const packageJsonContent = await fs.readFile(packageJsonPath, 'utf-8')\n const packageJson = JSON.parse(packageJsonContent)\n\n if (packageJson.packageManager) {\n // Parse \"pnpm@8.15.0\" or \"pnpm@10.16.1+sha512...\" -> \"pnpm\"\n const manager = packageJson.packageManager.split('@')[0]\n if (isValidPackageManager(manager)) {\n getLogger().debug(`Detected package manager from package.json: ${manager}`)\n return manager\n }\n }\n }\n } catch (error) {\n // If package.json doesn't exist, is malformed, or unreadable, continue to next detection method\n getLogger().debug(`Could not read packageManager from package.json: ${error instanceof Error ? error.message : 'Unknown error'}`)\n }\n\n // 2. Check lock files (priority: pnpm > npm > yarn)\n const lockFiles: Array<{ file: string; manager: PackageManager }> = [\n { file: 'pnpm-lock.yaml', manager: 'pnpm' },\n { file: 'package-lock.json', manager: 'npm' },\n { file: 'yarn.lock', manager: 'yarn' },\n ]\n\n for (const { file, manager } of lockFiles) {\n if (await fs.pathExists(path.join(cwd, file))) {\n getLogger().debug(`Detected package manager from lock file ${file}: ${manager}`)\n return manager\n }\n }\n\n // 3. Check installed package managers (original behavior)\n const managers: PackageManager[] = ['pnpm', 'npm', 'yarn']\n for (const manager of managers) {\n try {\n await execa(manager, ['--version'])\n getLogger().debug(`Detected installed package manager: ${manager}`)\n return manager\n } catch {\n // Continue to next manager\n }\n }\n\n // 4. Default to npm (always available in Node.js environments)\n getLogger().debug('No package manager detected, defaulting to npm')\n return 'npm'\n}\n\n/**\n * Install dependencies using the detected package manager\n * @param cwd Working directory to run install in\n * @param frozen Whether to use frozen lockfile (for production installs)\n * @param quiet Whether to suppress command output (default: false)\n * @returns true if installation succeeded, throws Error on failure\n */\nexport async function installDependencies(\n cwd: string,\n frozen: boolean = true,\n quiet: boolean = false\n): Promise<void> {\n // Check if working directory is provided\n if (!cwd) {\n getLogger().debug('Skipping dependency installation - no working directory provided')\n return\n }\n\n // Check for install script in package.iloom.json or package.json\n const scripts = await getPackageScripts(cwd)\n if (scripts.install) {\n getLogger().info('Installing dependencies with install script...')\n // runScript handles both iloom-config (shell execution) and package-manager (npm/pnpm/yarn) sources\n await runScript('install', cwd, [], { quiet })\n getLogger().success('Dependencies installed successfully')\n return\n }\n\n // Fall back to Node.js package manager detection for projects without install script\n const pkgPath = path.join(cwd, 'package.json')\n if (!(await fs.pathExists(pkgPath))) {\n getLogger().debug('Skipping dependency installation - no package.json found and no install script')\n return\n }\n\n const packageManager = await detectPackageManager(cwd)\n\n getLogger().info(`Installing dependencies with ${packageManager}...`)\n\n const args: string[] = ['install']\n\n // Add frozen lockfile flag based on package manager\n if (frozen) {\n switch (packageManager) {\n case 'pnpm':\n args.push('--frozen-lockfile')\n break\n case 'yarn':\n args.push('--frozen-lockfile')\n break\n case 'npm':\n args.shift() // Remove 'install'\n args.push('ci') // npm ci is equivalent to frozen lockfile\n break\n }\n }\n\n try {\n await execa(packageManager, args, {\n cwd,\n stdio: quiet ? 'pipe' : 'inherit',\n timeout: 300000, // 5 minute timeout for install\n })\n\n getLogger().success('Dependencies installed successfully')\n } catch (error) {\n const execaError = error as ExecaError\n const stderr = execaError.stderr ?? execaError.message ?? 'Unknown error'\n throw new Error(`Failed to install dependencies: ${stderr}`)\n }\n}\n\n/**\n * Options for running a script\n */\nexport interface RunScriptOptions {\n /** Suppress command output (default: false) */\n quiet?: boolean\n /** Custom environment variables merged with process.env */\n env?: Record<string, string>\n /** Use inherited stdio, return process info (default: false) */\n foreground?: boolean\n /** Callback when process starts, receives PID */\n onStart?: (pid?: number) => void\n /** Don't set CI=true (for dev servers, default: false) */\n noCi?: boolean\n}\n\n/**\n * Run a package.json or iloom config script\n * Automatically detects whether to use package manager or direct shell execution\n * based on the script source.\n *\n * @param scriptName The script name from package.json or package.iloom.json\n * @param cwd Working directory\n * @param args Additional arguments to pass to the script\n * @param options Execution options\n * @returns Object with pid when foreground mode is enabled\n */\nexport async function runScript(\n scriptName: string,\n cwd: string,\n args: string[] = [],\n options: RunScriptOptions = {}\n): Promise<{ pid?: number }> {\n // Get scripts with source metadata\n const scripts = await getPackageScripts(cwd)\n const scriptConfig = scripts[scriptName]\n\n const isDebugMode = getLogger().isDebugEnabled()\n\n if (!scriptConfig) {\n throw new Error(`Script '${scriptName}' not found`)\n }\n\n // Build environment variables\n const env: Record<string, string> = {\n ...process.env as Record<string, string>,\n ...options.env,\n }\n\n // Add CI=true unless noCi is set\n if (!options.noCi) {\n env.CI = 'true'\n }\n\n // Determine stdio mode\n const stdio = options.foreground ? 'inherit' : (options.quiet ? 'pipe' : 'inherit')\n\n try {\n let execaProcess\n\n if (scriptConfig.source === 'iloom-config') {\n // Execute directly as shell command (for non-Node.js projects)\n // Use \"$@\" pattern to properly handle argument escaping via the shell\n getLogger().debug(`Executing shell command: ${scriptConfig.command} with args: ${args.join(' ')}`)\n\n execaProcess = execa('sh', ['-c', `${scriptConfig.command} \"$@\"`, '--', ...args], {\n cwd,\n stdio,\n ...(!options.foreground && { timeout: 600000 }), // No timeout for foreground mode\n env,\n verbose: isDebugMode,\n })\n } else {\n // Execute via package manager (for Node.js projects)\n const packageManager = await detectPackageManager(cwd)\n const command = packageManager === 'npm' ? ['run', scriptName] : [scriptName]\n\n execaProcess = execa(packageManager, [...command, ...args], {\n cwd,\n stdio,\n ...(!options.foreground && { timeout: 600000 }), // No timeout for foreground mode\n env,\n verbose: isDebugMode,\n })\n }\n\n // For foreground mode, get PID and call onStart callback immediately\n const result: { pid?: number } = {}\n if (options.foreground && execaProcess.pid !== undefined) {\n result.pid = execaProcess.pid\n }\n\n // Call onStart callback if provided\n if (options.onStart) {\n options.onStart(result.pid)\n }\n\n // Wait for process to complete\n await execaProcess\n\n return result\n } catch (error) {\n const execaError = error as ExecaError\n const stderr = execaError.stderr ?? execaError.message ?? 'Unknown error'\n throw new Error(`Failed to run script '${scriptName}': ${stderr}`)\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,aAA8B;AAGvC,OAAO,QAAQ;AACf,OAAO,UAAU;AAOjB,SAAS,sBAAsB,SAA4C;AACzE,SAAO,YAAY,UAAU,YAAY,SAAS,YAAY;AAChE;AAaA,eAAsB,qBAAqB,MAAc,QAAQ,IAAI,GAA4B;AAE/F,MAAI;AACF,UAAM,kBAAkB,KAAK,KAAK,KAAK,cAAc;AACrD,QAAI,MAAM,GAAG,WAAW,eAAe,GAAG;AACxC,YAAM,qBAAqB,MAAM,GAAG,SAAS,iBAAiB,OAAO;AACr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
3
|
+
getLogger
|
|
4
|
+
} from "./chunk-6MLEBAYZ.js";
|
|
5
|
+
|
|
6
|
+
// src/utils/package-json.ts
|
|
7
|
+
import fs from "fs-extra";
|
|
8
|
+
import path from "path";
|
|
9
|
+
var ILOOM_PACKAGE_PATH = ".iloom/package.iloom.json";
|
|
10
|
+
async function readPackageJson(dir) {
|
|
11
|
+
const pkgPath = path.join(dir, "package.json");
|
|
12
|
+
try {
|
|
13
|
+
const pkgJson = await fs.readJson(pkgPath);
|
|
14
|
+
return pkgJson;
|
|
15
|
+
} catch (error) {
|
|
16
|
+
if (error.code === "ENOENT") {
|
|
17
|
+
throw new Error(`package.json not found in ${dir}`);
|
|
18
|
+
}
|
|
19
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
20
|
+
throw new Error(`Invalid package.json in ${dir}: ${message}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function readIloomPackageScripts(dir) {
|
|
24
|
+
const iloomPkgPath = path.join(dir, ILOOM_PACKAGE_PATH);
|
|
25
|
+
try {
|
|
26
|
+
const exists = await fs.pathExists(iloomPkgPath);
|
|
27
|
+
if (!exists) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const content = await fs.readJson(iloomPkgPath);
|
|
31
|
+
return content;
|
|
32
|
+
} catch (error) {
|
|
33
|
+
const message = error instanceof Error ? error.message : "Unknown error";
|
|
34
|
+
getLogger().warn(`Failed to read ${ILOOM_PACKAGE_PATH}: ${message}`);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function getPackageConfig(dir) {
|
|
39
|
+
const iloomPackage = await readIloomPackageScripts(dir);
|
|
40
|
+
if (iloomPackage) {
|
|
41
|
+
try {
|
|
42
|
+
const basePackage = await readPackageJson(dir);
|
|
43
|
+
getLogger().debug("Merging scripts from .iloom/package.iloom.json over package.json");
|
|
44
|
+
return {
|
|
45
|
+
...basePackage,
|
|
46
|
+
scripts: {
|
|
47
|
+
...basePackage.scripts,
|
|
48
|
+
...iloomPackage.scripts
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
} catch {
|
|
52
|
+
getLogger().debug("Using scripts from .iloom/package.iloom.json (no package.json)");
|
|
53
|
+
return iloomPackage;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return readPackageJson(dir);
|
|
57
|
+
}
|
|
58
|
+
function parseBinField(bin, packageName) {
|
|
59
|
+
if (!bin) {
|
|
60
|
+
return {};
|
|
61
|
+
}
|
|
62
|
+
if (typeof bin === "string") {
|
|
63
|
+
return { [packageName]: bin };
|
|
64
|
+
}
|
|
65
|
+
return bin;
|
|
66
|
+
}
|
|
67
|
+
function hasWebDependencies(pkgJson) {
|
|
68
|
+
const webIndicators = [
|
|
69
|
+
"next",
|
|
70
|
+
"vite",
|
|
71
|
+
"express",
|
|
72
|
+
"react-scripts",
|
|
73
|
+
"nuxt",
|
|
74
|
+
"svelte-kit",
|
|
75
|
+
"astro",
|
|
76
|
+
"remix",
|
|
77
|
+
"fastify",
|
|
78
|
+
"koa",
|
|
79
|
+
"hapi",
|
|
80
|
+
"@angular/core",
|
|
81
|
+
"gatsby",
|
|
82
|
+
"@11ty/eleventy",
|
|
83
|
+
"ember-cli"
|
|
84
|
+
];
|
|
85
|
+
const allDeps = {
|
|
86
|
+
...pkgJson.dependencies,
|
|
87
|
+
...pkgJson.devDependencies
|
|
88
|
+
};
|
|
89
|
+
return webIndicators.some((indicator) => indicator in allDeps);
|
|
90
|
+
}
|
|
91
|
+
function hasScript(pkgJson, scriptName) {
|
|
92
|
+
var _a;
|
|
93
|
+
return !!((_a = pkgJson.scripts) == null ? void 0 : _a[scriptName]);
|
|
94
|
+
}
|
|
95
|
+
async function getPackageScripts(dir) {
|
|
96
|
+
const scripts = {};
|
|
97
|
+
const packageJsonPath = path.join(dir, "package.json");
|
|
98
|
+
if (await fs.pathExists(packageJsonPath)) {
|
|
99
|
+
const pkgJson = await readPackageJson(dir);
|
|
100
|
+
if (pkgJson.scripts) {
|
|
101
|
+
for (const [name, command] of Object.entries(pkgJson.scripts)) {
|
|
102
|
+
scripts[name] = { command, source: "package-manager" };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const iloomPackage = await readIloomPackageScripts(dir);
|
|
107
|
+
if (iloomPackage == null ? void 0 : iloomPackage.scripts) {
|
|
108
|
+
for (const [name, command] of Object.entries(iloomPackage.scripts)) {
|
|
109
|
+
scripts[name] = { command, source: "iloom-config" };
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return scripts;
|
|
113
|
+
}
|
|
114
|
+
var VALID_CAPABILITIES = ["cli", "web"];
|
|
115
|
+
function getExplicitCapabilities(pkgJson) {
|
|
116
|
+
if (!pkgJson.capabilities || !Array.isArray(pkgJson.capabilities)) {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
return pkgJson.capabilities.filter(
|
|
120
|
+
(cap) => VALID_CAPABILITIES.includes(cap)
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export {
|
|
125
|
+
readPackageJson,
|
|
126
|
+
getPackageConfig,
|
|
127
|
+
parseBinField,
|
|
128
|
+
hasWebDependencies,
|
|
129
|
+
hasScript,
|
|
130
|
+
getPackageScripts,
|
|
131
|
+
getExplicitCapabilities
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=chunk-BXCPJJYM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/package-json.ts"],"sourcesContent":["import fs from 'fs-extra'\nimport path from 'path'\nimport { getLogger } from './logger-context.js'\nimport type { ProjectCapability } from '../types/loom.js'\n\n/**\n * Path to the iloom package configuration file (relative to project root)\n * This file allows non-Node.js projects to define scripts for iloom workflows\n */\nexport const ILOOM_PACKAGE_PATH = '.iloom/package.iloom.json'\n\nexport interface PackageJson {\n name: string\n version?: string\n bin?: string | Record<string, string>\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n scripts?: Record<string, string>\n capabilities?: Array<'cli' | 'web'>\n [key: string]: unknown\n}\n\n/**\n * Source of a script - determines how it should be executed\n * - 'package-manager': Execute via package manager (pnpm/npm/yarn)\n * - 'iloom-config': Execute directly as shell command\n */\nexport type ScriptSource = 'package-manager' | 'iloom-config'\n\n/**\n * Configuration for a single script including its source\n * The source determines whether to use package manager or direct shell execution\n */\nexport interface PackageScriptConfig {\n /** The script command to execute */\n command: string\n /** Source of the script - determines execution method */\n source: ScriptSource\n}\n\n/**\n * Read and parse package.json from a directory\n * @param dir Directory containing package.json\n * @returns Parsed package.json object\n * @throws Error if package.json doesn't exist or contains invalid JSON\n */\nexport async function readPackageJson(dir: string): Promise<PackageJson> {\n const pkgPath = path.join(dir, 'package.json')\n\n try {\n const pkgJson = await fs.readJson(pkgPath)\n return pkgJson as PackageJson\n } catch (error) {\n if ((error as { code?: string }).code === 'ENOENT') {\n throw new Error(`package.json not found in ${dir}`)\n }\n const message = error instanceof Error ? error.message : 'Unknown error'\n throw new Error(`Invalid package.json in ${dir}: ${message}`)\n }\n}\n\n/**\n * Read scripts from .iloom/package.iloom.json if it exists\n * This file takes precedence over package.json and contains raw shell commands\n * @param dir Directory containing .iloom/package.iloom.json\n * @returns PackageJson-like object with scripts, or null if file doesn't exist\n */\nexport async function readIloomPackageScripts(dir: string): Promise<PackageJson | null> {\n const iloomPkgPath = path.join(dir, ILOOM_PACKAGE_PATH)\n\n try {\n const exists = await fs.pathExists(iloomPkgPath)\n if (!exists) {\n return null\n }\n\n const content = await fs.readJson(iloomPkgPath)\n return content as PackageJson\n } catch (error) {\n const message = error instanceof Error ? error.message : 'Unknown error'\n getLogger().warn(`Failed to read ${ILOOM_PACKAGE_PATH}: ${message}`)\n return null\n }\n}\n\n/**\n * Read package configuration for a project, merging .iloom/package.iloom.json scripts over package.json\n * This allows non-Node.js projects to define scripts for iloom workflows while preserving\n * all other package.json fields (name, version, bin, dependencies, etc.)\n *\n * @param dir Directory to read package configuration from\n * @returns PackageJson object with merged scripts (iloom scripts take precedence)\n * @throws Error if neither file exists or contains valid JSON\n */\nexport async function getPackageConfig(dir: string): Promise<PackageJson> {\n // Check for .iloom/package.iloom.json first\n const iloomPackage = await readIloomPackageScripts(dir)\n\n if (iloomPackage) {\n // Try to read package.json as base\n try {\n const basePackage = await readPackageJson(dir)\n getLogger().debug('Merging scripts from .iloom/package.iloom.json over package.json')\n // Merge: base package.json with iloom scripts taking precedence\n return {\n ...basePackage,\n scripts: {\n ...basePackage.scripts,\n ...iloomPackage.scripts,\n },\n }\n } catch {\n // No package.json - use iloom package as-is (non-Node project)\n getLogger().debug('Using scripts from .iloom/package.iloom.json (no package.json)')\n return iloomPackage\n }\n }\n\n // Fall back to package.json only\n return readPackageJson(dir)\n}\n\n/**\n * Parse bin field into normalized Record format\n * @param bin The bin field from package.json (string or object)\n * @param packageName Package name to use for string bin variant\n * @returns Normalized bin entries as Record<string, string>\n */\nexport function parseBinField(\n bin: string | Record<string, string> | undefined,\n packageName: string\n): Record<string, string> {\n if (!bin) {\n return {}\n }\n\n if (typeof bin === 'string') {\n return { [packageName]: bin }\n }\n\n return bin\n}\n\n/**\n * Check if package.json indicates a web application\n * @param pkgJson Parsed package.json object\n * @returns true if package has web framework dependencies\n */\nexport function hasWebDependencies(pkgJson: PackageJson): boolean {\n const webIndicators = [\n 'next',\n 'vite',\n 'express',\n 'react-scripts',\n 'nuxt',\n 'svelte-kit',\n 'astro',\n 'remix',\n 'fastify',\n 'koa',\n 'hapi',\n '@angular/core',\n 'gatsby',\n '@11ty/eleventy',\n 'ember-cli'\n ]\n\n const allDeps = {\n ...pkgJson.dependencies,\n ...pkgJson.devDependencies\n }\n\n return webIndicators.some(indicator => indicator in allDeps)\n}\n\n/**\n * Check if package.json has a specific script\n * @param pkgJson Parsed package.json object\n * @param scriptName Script name to check for\n * @returns true if script exists\n */\nexport function hasScript(pkgJson: PackageJson, scriptName: string): boolean {\n return !!pkgJson.scripts?.[scriptName]\n}\n\n/**\n * Get all scripts with their source metadata\n * Scripts from .iloom/package.iloom.json are marked as 'iloom-config' and should be executed directly\n * Scripts from package.json are marked as 'package-manager' and should use pnpm/npm/yarn\n *\n * @param dir Directory to read package configuration from\n * @returns Map of script names to their configurations including source\n */\nexport async function getPackageScripts(dir: string): Promise<Record<string, PackageScriptConfig>> {\n const scripts: Record<string, PackageScriptConfig> = {}\n\n // First, check if package.json exists and read scripts (these are package-manager sourced)\n const packageJsonPath = path.join(dir, 'package.json')\n if (await fs.pathExists(packageJsonPath)) {\n const pkgJson = await readPackageJson(dir)\n if (pkgJson.scripts) {\n for (const [name, command] of Object.entries(pkgJson.scripts)) {\n scripts[name] = { command, source: 'package-manager' }\n }\n }\n }\n\n // Then, read iloom package scripts (these override and are iloom-config sourced)\n const iloomPackage = await readIloomPackageScripts(dir)\n if (iloomPackage?.scripts) {\n for (const [name, command] of Object.entries(iloomPackage.scripts)) {\n scripts[name] = { command, source: 'iloom-config' }\n }\n }\n\n return scripts\n}\n\n/**\n * Valid capability values that can be explicitly declared\n */\nconst VALID_CAPABILITIES: readonly ProjectCapability[] = ['cli', 'web'] as const\n\n/**\n * Extract explicit capabilities from package configuration\n * Used for non-Node.js projects that declare capabilities in package.iloom.json\n * @param pkgJson Parsed package configuration object\n * @returns Array of valid ProjectCapability values, or empty array if none declared\n */\nexport function getExplicitCapabilities(pkgJson: PackageJson): ProjectCapability[] {\n // Return empty if no capabilities field or not an array\n if (!pkgJson.capabilities || !Array.isArray(pkgJson.capabilities)) {\n return []\n }\n\n // Filter to only valid ProjectCapability values\n return pkgJson.capabilities.filter(\n (cap): cap is ProjectCapability => VALID_CAPABILITIES.includes(cap as ProjectCapability)\n )\n}\n"],"mappings":";;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAQV,IAAM,qBAAqB;AAqClC,eAAsB,gBAAgB,KAAmC;AACvE,QAAM,UAAU,KAAK,KAAK,KAAK,cAAc;AAE7C,MAAI;AACF,UAAM,UAAU,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;AAAA,IAC1B,CAAC,QAAkC,mBAAmB,SAAS,GAAwB;AAAA,EACzF;AACF;","names":[]}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
isPRBranch,
|
|
12
12
|
isValidGitRepo,
|
|
13
13
|
parseWorktreeList
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GEXP5IOF.js";
|
|
15
15
|
import {
|
|
16
16
|
getLogger
|
|
17
17
|
} from "./chunk-6MLEBAYZ.js";
|
|
@@ -388,4 +388,4 @@ var GitWorktreeManager = class {
|
|
|
388
388
|
export {
|
|
389
389
|
GitWorktreeManager
|
|
390
390
|
};
|
|
391
|
-
//# sourceMappingURL=chunk-
|
|
391
|
+
//# sourceMappingURL=chunk-EK3XCAAS.js.map
|
|
@@ -99,6 +99,7 @@ var IloomSettingsSchema = z.object({
|
|
|
99
99
|
"Prefix for worktree directories. Empty string disables prefix. Defaults to <repo-name>-looms if not set."
|
|
100
100
|
),
|
|
101
101
|
protectedBranches: z.array(z.string().min(1, "Protected branch name cannot be empty")).optional().describe('List of branches that cannot be deleted (defaults to [mainBranch, "main", "master", "develop"])'),
|
|
102
|
+
copyGitIgnoredPatterns: z.array(z.string().min(1, "Pattern cannot be empty")).optional().describe(`Glob patterns for gitignored files to copy to looms (e.g., ["*.db", "data/*.sqlite"]). Great for local dbs and large test data files that are too big to commit to git. Note: .env (dotenv-flow) files, iloom's and claude's local settings are automatically copied and do not need to be specified here.`),
|
|
102
103
|
workflows: WorkflowsSettingsSchema.describe("Per-workflow-type permission configurations"),
|
|
103
104
|
agents: z.record(z.string(), AgentSettingsSchema).optional().nullable().describe(
|
|
104
105
|
"Per-agent configuration overrides. Available agents: iloom-issue-analyzer (analyzes issues), iloom-issue-planner (creates implementation plans), iloom-issue-analyze-and-plan (combined analysis and planning), iloom-issue-complexity-evaluator (evaluates complexity), iloom-issue-enhancer (enhances issue descriptions), iloom-issue-implementer (implements code changes), iloom-issue-reviewer (reviews code changes against requirements)"
|
|
@@ -170,6 +171,7 @@ var IloomSettingsSchemaNoDefaults = z.object({
|
|
|
170
171
|
"Prefix for worktree directories. Empty string disables prefix. Defaults to <repo-name>-looms if not set."
|
|
171
172
|
),
|
|
172
173
|
protectedBranches: z.array(z.string().min(1, "Protected branch name cannot be empty")).optional().describe('List of branches that cannot be deleted (defaults to [mainBranch, "main", "master", "develop"])'),
|
|
174
|
+
copyGitIgnoredPatterns: z.array(z.string().min(1, "Pattern cannot be empty")).optional().describe(`Glob patterns for gitignored files to copy to looms (e.g., ["*.db", "data/*.sqlite"]). Great for local dbs and large test data files that are too big to commit to git. Note: .env (dotenv-flow) files, iloom's and claude's local settings are automatically copied and do not need to be specified here.`),
|
|
173
175
|
workflows: WorkflowsSettingsSchemaNoDefaults.describe("Per-workflow-type permission configurations"),
|
|
174
176
|
agents: z.record(z.string(), AgentSettingsSchema).optional().nullable().describe(
|
|
175
177
|
"Per-agent configuration overrides. Available agents: iloom-issue-analyzer (analyzes issues), iloom-issue-planner (creates implementation plans), iloom-issue-analyze-and-plan (combined analysis and planning), iloom-issue-complexity-evaluator (evaluates complexity), iloom-issue-enhancer (enhances issue descriptions), iloom-issue-implementer (implements code changes), iloom-issue-reviewer (reviews code changes against requirements)"
|
|
@@ -455,4 +457,4 @@ export {
|
|
|
455
457
|
IloomSettingsSchemaNoDefaults,
|
|
456
458
|
SettingsManager
|
|
457
459
|
};
|
|
458
|
-
//# sourceMappingURL=chunk-
|
|
460
|
+
//# sourceMappingURL=chunk-F6WVM437.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/SettingsManager.ts"],"sourcesContent":["import { readFile } from 'fs/promises'\nimport path from 'path'\nimport os from 'os'\nimport { z } from 'zod'\nimport deepmerge from 'deepmerge'\nimport { logger } from '../utils/logger.js'\n\n/**\n * Zod schema for agent settings\n */\nexport const AgentSettingsSchema = z.object({\n\tmodel: z\n\t\t.enum(['sonnet', 'opus', 'haiku'])\n\t\t.optional()\n\t\t.describe('Claude model shorthand: sonnet, opus, or haiku'),\n\t// Future: could add other per-agent overrides\n})\n\n/**\n * Zod schema for spin agent settings with default model\n * Used for the spin orchestrator configuration\n */\nexport const SpinAgentSettingsSchema = z.object({\n\tmodel: z\n\t\t.enum(['sonnet', 'opus', 'haiku'])\n\t\t.default('opus')\n\t\t.describe('Claude model shorthand for spin orchestrator'),\n})\n\n/**\n * Zod schema for summary settings with default model\n * Used for session summary generation configuration\n */\nexport const SummarySettingsSchema = z.object({\n\tmodel: z\n\t\t.enum(['sonnet', 'opus', 'haiku'])\n\t\t.default('sonnet')\n\t\t.describe('Claude model shorthand for session summary generation'),\n})\n\n/**\n * Zod schema for workflow permission configuration\n */\nexport const WorkflowPermissionSchema = z.object({\n\tpermissionMode: z\n\t\t.enum(['plan', 'acceptEdits', 'bypassPermissions', 'default'])\n\t\t.optional()\n\t\t.describe('Permission mode for Claude CLI in this workflow type'),\n\tnoVerify: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe('Skip pre-commit hooks (--no-verify) when committing during finish workflow'),\n\tstartIde: z\n\t\t.boolean()\n\t\t.default(true)\n\t\t.describe('Launch IDE (code) when starting this workflow type'),\n\tstartDevServer: z\n\t\t.boolean()\n\t\t.default(true)\n\t\t.describe('Launch development server when starting this workflow type'),\n\tstartAiAgent: z\n\t\t.boolean()\n\t\t.default(true)\n\t\t.describe('Launch Claude Code agent when starting this workflow type'),\n\tstartTerminal: z\n\t\t.boolean()\n\t\t.default(false)\n\t\t.describe('Launch terminal window without dev server when starting this workflow type'),\n\tgenerateSummary: z\n\t\t.boolean()\n\t\t.default(true)\n\t\t.describe('Generate and post Claude session summary when finishing this workflow type'),\n})\n\n/**\n * Non-defaulting variant for pre-merge validation\n * This prevents Zod from polluting partial settings with default values before merge\n */\nexport const WorkflowPermissionSchemaNoDefaults = z.object({\n\tpermissionMode: z\n\t\t.enum(['plan', 'acceptEdits', 'bypassPermissions', 'default'])\n\t\t.optional()\n\t\t.describe('Permission mode for Claude CLI in this workflow type'),\n\tnoVerify: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe('Skip pre-commit hooks (--no-verify) when committing during finish workflow'),\n\tstartIde: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe('Launch IDE (code) when starting this workflow type'),\n\tstartDevServer: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe('Launch development server when starting this workflow type'),\n\tstartAiAgent: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe('Launch Claude Code agent when starting this workflow type'),\n\tstartTerminal: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe('Launch terminal window without dev server when starting this workflow type'),\n\tgenerateSummary: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe('Generate and post Claude session summary when finishing this workflow type'),\n})\n\n/**\n * Zod schema for workflows settings\n */\nexport const WorkflowsSettingsSchema = z\n\t.object({\n\t\tissue: WorkflowPermissionSchema.optional(),\n\t\tpr: WorkflowPermissionSchema.optional(),\n\t\tregular: WorkflowPermissionSchema.optional(),\n\t})\n\t.optional()\n\n/**\n * Non-defaulting variant for pre-merge validation\n */\nexport const WorkflowsSettingsSchemaNoDefaults = z\n\t.object({\n\t\tissue: WorkflowPermissionSchemaNoDefaults.optional(),\n\t\tpr: WorkflowPermissionSchemaNoDefaults.optional(),\n\t\tregular: WorkflowPermissionSchemaNoDefaults.optional(),\n\t})\n\t.optional()\n\n/**\n * Zod schema for capabilities settings\n */\nexport const CapabilitiesSettingsSchema = z\n\t.object({\n\t\tweb: z\n\t\t\t.object({\n\t\t\t\tbasePort: z\n\t\t\t\t\t.number()\n\t\t\t\t\t.min(1, 'Base port must be >= 1')\n\t\t\t\t\t.max(65535, 'Base port must be <= 65535')\n\t\t\t\t\t.optional()\n\t\t\t\t\t.describe('Base port for web workspace port calculations (default: 3000)'),\n\t\t\t})\n\t\t\t.optional(),\n\t\tdatabase: z\n\t\t\t.object({\n\t\t\t\tdatabaseUrlEnvVarName: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.min(1, 'Database URL variable name cannot be empty')\n\t\t\t\t\t.regex(/^[A-Z_][A-Z0-9_]*$/, 'Must be valid env var name (uppercase, underscores)')\n\t\t\t\t\t.optional()\n\t\t\t\t\t.default('DATABASE_URL')\n\t\t\t\t\t.describe('Name of environment variable for database connection URL'),\n\t\t\t})\n\t\t\t.optional(),\n\t})\n\t.optional()\n\n/**\n * Non-defaulting variant for pre-merge validation\n */\nexport const CapabilitiesSettingsSchemaNoDefaults = z\n\t.object({\n\t\tweb: z\n\t\t\t.object({\n\t\t\t\tbasePort: z\n\t\t\t\t\t.number()\n\t\t\t\t\t.min(1, 'Base port must be >= 1')\n\t\t\t\t\t.max(65535, 'Base port must be <= 65535')\n\t\t\t\t\t.optional()\n\t\t\t\t\t.describe('Base port for web workspace port calculations (default: 3000)'),\n\t\t\t})\n\t\t\t.optional(),\n\t\tdatabase: z\n\t\t\t.object({\n\t\t\t\tdatabaseUrlEnvVarName: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.min(1, 'Database URL variable name cannot be empty')\n\t\t\t\t\t.regex(/^[A-Z_][A-Z0-9_]*$/, 'Must be valid env var name (uppercase, underscores)')\n\t\t\t\t\t.optional()\n\t\t\t\t\t.describe('Name of environment variable for database connection URL'),\n\t\t\t})\n\t\t\t.optional(),\n\t})\n\t.optional()\n\n/**\n * Zod schema for Neon database provider settings\n */\nexport const NeonSettingsSchema = z.object({\n\tprojectId: z\n\t\t.string()\n\t\t.min(1)\n\t\t.regex(/^[a-zA-Z0-9-]+$/, 'Neon project ID must contain only letters, numbers, and hyphens')\n\t\t.describe('Neon project ID found in your project URL (e.g., \"fantastic-fox-3566354\")'),\n\tparentBranch: z\n\t\t.string()\n\t\t.min(1)\n\t\t.describe('Branch from which new database branches are created'),\n})\n\n/**\n * Zod schema for database provider settings\n */\nexport const DatabaseProvidersSettingsSchema = z\n\t.object({\n\t\tneon: NeonSettingsSchema.optional().describe(\n\t\t\t'Neon database configuration. Requires Neon CLI installed and authenticated for database branching.',\n\t\t),\n\t})\n\t.optional()\n\n/**\n * Zod schema for iloom settings\n */\nexport const IloomSettingsSchema = z.object({\n\tmainBranch: z\n\t\t.string()\n\t\t.min(1, \"Settings 'mainBranch' cannot be empty\")\n\t\t.optional()\n\t\t.describe('Name of the main/primary branch for the repository'),\n\tsourceEnvOnStart: z\n\t\t.boolean()\n\t\t.default(false)\n\t\t.describe(\n\t\t\t'Source all dotenv-flow files (.env, .env.local, .env.development, .env.development.local) when launching terminal processes (Claude, dev server, terminal). ' +\n\t\t\t\t'Files are sourced in precedence order so later files override earlier ones. ' +\n\t\t\t\t'NOTE TO AI AGENTS: Before making changes to settings files, YOU MUST OFFER to check .env file compatibility. ' +\n\t\t\t\t'WARNING: Unquoted values in .env files may break sourcing in bash/zsh shells. ' +\n\t\t\t\t'Before enabling, verify ALL your .env.* files do not contain unquoted special characters ' +\n\t\t\t\t'(e.g., database URLs with ?, &, or other shell metacharacters). ' +\n\t\t\t\t'Shell compatibility issues may cause processes to fail or behave unexpectedly.',\n\t\t),\n\tworktreePrefix: z\n\t\t.string()\n\t\t.optional()\n\t\t.refine(\n\t\t\t(val) => {\n\t\t\t\tif (val === undefined) return true // undefined = use default calculation\n\t\t\t\tif (val === '') return true // empty string = no prefix mode\n\n\t\t\t\t// Allowlist: only alphanumeric, hyphens, underscores, and forward slashes\n\t\t\t\tconst allowedChars = /^[a-zA-Z0-9\\-_/]+$/\n\t\t\t\tif (!allowedChars.test(val)) return false\n\n\t\t\t\t// Reject if only special characters (no alphanumeric content)\n\t\t\t\tif (/^[-_/]+$/.test(val)) return false\n\n\t\t\t\t// Check each segment (split by /) contains at least one alphanumeric character\n\t\t\t\tconst segments = val.split('/')\n\t\t\t\tfor (const segment of segments) {\n\t\t\t\t\tif (segment && /^[-_]+$/.test(segment)) {\n\t\t\t\t\t\t// Segment exists but contains only hyphens/underscores\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t},\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t\"worktreePrefix contains invalid characters. Only alphanumeric characters, hyphens (-), underscores (_), and forward slashes (/) are allowed. Use forward slashes for nested directories.\",\n\t\t\t},\n\t\t)\n\t\t.describe(\n\t\t\t'Prefix for worktree directories. Empty string disables prefix. Defaults to <repo-name>-looms if not set.',\n\t\t),\n\tprotectedBranches: z\n\t\t.array(z.string().min(1, 'Protected branch name cannot be empty'))\n\t\t.optional()\n\t\t.describe('List of branches that cannot be deleted (defaults to [mainBranch, \"main\", \"master\", \"develop\"])'),\n\tcopyGitIgnoredPatterns: z\n\t\t.array(z.string().min(1, 'Pattern cannot be empty'))\n\t\t.optional()\n\t\t.describe('Glob patterns for gitignored files to copy to looms (e.g., [\"*.db\", \"data/*.sqlite\"]). Great for local dbs and large test data files that are too big to commit to git. Note: .env (dotenv-flow) files, iloom\\'s and claude\\'s local settings are automatically copied and do not need to be specified here.'),\n\tworkflows: WorkflowsSettingsSchema.describe('Per-workflow-type permission configurations'),\n\tagents: z\n\t\t.record(z.string(), AgentSettingsSchema)\n\t\t.optional()\n\t\t.nullable()\n\t\t.describe(\n\t\t\t'Per-agent configuration overrides. Available agents: ' +\n\t\t\t\t'iloom-issue-analyzer (analyzes issues), ' +\n\t\t\t\t'iloom-issue-planner (creates implementation plans), ' +\n\t\t\t\t'iloom-issue-analyze-and-plan (combined analysis and planning), ' +\n\t\t\t\t'iloom-issue-complexity-evaluator (evaluates complexity), ' +\n\t\t\t\t'iloom-issue-enhancer (enhances issue descriptions), ' +\n\t\t\t\t'iloom-issue-implementer (implements code changes), ' +\n\t\t\t\t'iloom-issue-reviewer (reviews code changes against requirements)',\n\t\t),\n\tspin: SpinAgentSettingsSchema.optional().describe(\n\t\t'Spin orchestrator configuration. Model defaults to opus when not configured.',\n\t),\n\tsummary: SummarySettingsSchema.optional().describe(\n\t\t'Session summary generation configuration. Model defaults to sonnet when not configured.',\n\t),\n\tcapabilities: CapabilitiesSettingsSchema.describe('Project capability configurations'),\n\tdatabaseProviders: DatabaseProvidersSettingsSchema.describe('Database provider configurations'),\n\tissueManagement: z\n\t\t.object({\n\t\t\tprovider: z.enum(['github', 'linear']).optional().default('github').describe('Issue tracker provider (github, linear)'),\n\t\t\tgithub: z\n\t\t\t\t.object({\n\t\t\t\t\tremote: z\n\t\t\t\t\t\t.string()\n\t\t\t\t\t\t.min(1, 'Remote name cannot be empty')\n\t\t\t\t\t\t.describe('Git remote name to use for GitHub operations'),\n\t\t\t\t})\n\t\t\t\t.optional(),\n\t\t\tlinear: z\n\t\t\t\t.object({\n\t\t\t\t\tteamId: z\n\t\t\t\t\t\t.string()\n\t\t\t\t\t\t.min(1, 'Team ID cannot be empty')\n\t\t\t\t\t\t.describe('Linear team identifier (e.g., \"ENG\", \"PLAT\")'),\n\t\t\t\t\tbranchFormat: z\n\t\t\t\t\t\t.string()\n\t\t\t\t\t\t.optional()\n\t\t\t\t\t\t.describe('Branch naming template for Linear issues'),\n\t\t\t\t\tapiToken: z\n\t\t\t\t\t\t.string()\n\t\t\t\t\t\t.optional()\n\t\t\t\t\t\t.describe('Linear API token (lin_api_...). SECURITY: Store in settings.local.json only, never commit to source control.'),\n\t\t\t\t})\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional()\n\t\t.describe('Issue management configuration'),\n\tmergeBehavior: z\n\t\t.object({\n\t\t\tmode: z.enum(['local', 'github-pr', 'github-draft-pr']).default('local'),\n\t\t\tremote: z.string().optional(),\n\t\t})\n\t\t.optional()\n\t\t.describe('Merge behavior configuration: local (merge locally), github-pr (create PR), or github-draft-pr (create draft PR at start, mark ready on finish)'),\n\tide: z\n\t\t.object({\n\t\t\ttype: z\n\t\t\t\t.enum(['vscode', 'cursor', 'webstorm', 'sublime', 'intellij', 'windsurf', 'antigravity'])\n\t\t\t\t.default('vscode')\n\t\t\t\t.describe(\n\t\t\t\t\t'IDE to launch when starting a loom. Options: vscode (Visual Studio Code), cursor (Cursor AI editor), ' +\n\t\t\t\t\t\t'webstorm (JetBrains WebStorm), sublime (Sublime Text), intellij (JetBrains IntelliJ IDEA), ' +\n\t\t\t\t\t\t'windsurf (Windsurf editor), antigravity (Antigravity IDE).'\n\t\t\t\t),\n\t\t})\n\t\t.optional()\n\t\t.describe(\n\t\t\t'IDE configuration for workspace launches. Controls which editor opens when you start a loom. ' +\n\t\t\t\t'Supports VSCode, Cursor, WebStorm, Sublime Text, IntelliJ, Windsurf, and Antigravity. ' +\n\t\t\t\t'Note: Color synchronization (title bar colors) only works with VSCode-compatible editors (vscode, cursor, windsurf, antigravity).'\n\t\t),\n\tcolors: z\n\t\t.object({\n\t\t\tterminal: z\n\t\t\t\t.boolean()\n\t\t\t\t.default(true)\n\t\t\t\t.describe('Apply terminal background colors based on branch name (macOS only)'),\n\t\t\tvscode: z\n\t\t\t\t.boolean()\n\t\t\t\t.default(false)\n\t\t\t\t.describe(\n\t\t\t\t\t'Apply VSCode/Cursor title bar colors based on branch name. ' +\n\t\t\t\t\t\t'Note: This modifies .vscode/settings.json which may be in source control. ' +\n\t\t\t\t\t\t'Default is false for safety; enable via init or explicitly if .vscode is gitignored.'\n\t\t\t\t),\n\t\t})\n\t\t.optional()\n\t\t.describe('Color synchronization settings for workspace identification'),\n\tattribution: z\n\t\t.enum(['off', 'upstreamOnly', 'on'])\n\t\t.default('upstreamOnly')\n\t\t.describe(\n\t\t\t'Controls when iloom attribution appears in session summaries. ' +\n\t\t\t\t'\"off\" - never show attribution. ' +\n\t\t\t\t'\"upstreamOnly\" - only show for contributions to external repositories (e.g., open source). ' +\n\t\t\t\t'\"on\" - always show attribution.'\n\t\t),\n})\n\n/**\n * Non-defaulting variant for pre-merge validation\n * This prevents Zod from polluting partial settings with default values before merge\n */\nexport const IloomSettingsSchemaNoDefaults = z.object({\n\tmainBranch: z\n\t\t.string()\n\t\t.min(1, \"Settings 'mainBranch' cannot be empty\")\n\t\t.optional()\n\t\t.describe('Name of the main/primary branch for the repository'),\n\tsourceEnvOnStart: z\n\t\t.boolean()\n\t\t.optional()\n\t\t.describe(\n\t\t\t'Source all dotenv-flow files (.env, .env.local, .env.development, .env.development.local) when launching terminal processes (Claude, dev server, terminal). ' +\n\t\t\t\t'Files are sourced in precedence order so later files override earlier ones. ' +\n\t\t\t\t'NOTE TO AI AGENTS: Before making changes to settings files, YOU MUST OFFER to check .env compatibility. ' +\n\t\t\t\t'WARNING: Unquoted values in .env files may break sourcing in bash/zsh shells. ' +\n\t\t\t\t'Before enabling, verify ALL your .env.* files do not contain unquoted special characters ' +\n\t\t\t\t'(e.g., database URLs with ?, &, or other shell metacharacters). ' +\n\t\t\t\t'Shell compatibility issues may cause processes to fail or behave unexpectedly.',\n\t\t),\n\tworktreePrefix: z\n\t\t.string()\n\t\t.optional()\n\t\t.refine(\n\t\t\t(val) => {\n\t\t\t\tif (val === undefined) return true // undefined = use default calculation\n\t\t\t\tif (val === '') return true // empty string = no prefix mode\n\n\t\t\t\t// Allowlist: only alphanumeric, hyphens, underscores, and forward slashes\n\t\t\t\tconst allowedChars = /^[a-zA-Z0-9\\-_/]+$/\n\t\t\t\tif (!allowedChars.test(val)) return false\n\n\t\t\t\t// Reject if only special characters (no alphanumeric content)\n\t\t\t\tif (/^[-_/]+$/.test(val)) return false\n\n\t\t\t\t// Check each segment (split by /) contains at least one alphanumeric character\n\t\t\t\tconst segments = val.split('/')\n\t\t\t\tfor (const segment of segments) {\n\t\t\t\t\tif (segment && /^[-_]+$/.test(segment)) {\n\t\t\t\t\t\t// Segment exists but contains only hyphens/underscores\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true\n\t\t\t},\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t\"worktreePrefix contains invalid characters. Only alphanumeric characters, hyphens (-), underscores (_), and forward slashes (/) are allowed. Use forward slashes for nested directories.\",\n\t\t\t},\n\t\t)\n\t\t.describe(\n\t\t\t'Prefix for worktree directories. Empty string disables prefix. Defaults to <repo-name>-looms if not set.',\n\t\t),\n\tprotectedBranches: z\n\t\t.array(z.string().min(1, 'Protected branch name cannot be empty'))\n\t\t.optional()\n\t\t.describe('List of branches that cannot be deleted (defaults to [mainBranch, \"main\", \"master\", \"develop\"])'),\n\tcopyGitIgnoredPatterns: z\n\t\t.array(z.string().min(1, 'Pattern cannot be empty'))\n\t\t.optional()\n\t\t.describe('Glob patterns for gitignored files to copy to looms (e.g., [\"*.db\", \"data/*.sqlite\"]). Great for local dbs and large test data files that are too big to commit to git. Note: .env (dotenv-flow) files, iloom\\'s and claude\\'s local settings are automatically copied and do not need to be specified here.'),\n\tworkflows: WorkflowsSettingsSchemaNoDefaults.describe('Per-workflow-type permission configurations'),\n\tagents: z\n\t\t.record(z.string(), AgentSettingsSchema)\n\t\t.optional()\n\t\t.nullable()\n\t\t.describe(\n\t\t\t'Per-agent configuration overrides. Available agents: ' +\n\t\t\t\t'iloom-issue-analyzer (analyzes issues), ' +\n\t\t\t\t'iloom-issue-planner (creates implementation plans), ' +\n\t\t\t\t'iloom-issue-analyze-and-plan (combined analysis and planning), ' +\n\t\t\t\t'iloom-issue-complexity-evaluator (evaluates complexity), ' +\n\t\t\t\t'iloom-issue-enhancer (enhances issue descriptions), ' +\n\t\t\t\t'iloom-issue-implementer (implements code changes), ' +\n\t\t\t\t'iloom-issue-reviewer (reviews code changes against requirements)',\n\t\t),\n\tspin: z\n\t\t.object({\n\t\t\tmodel: z.enum(['sonnet', 'opus', 'haiku']).optional(),\n\t\t})\n\t\t.optional()\n\t\t.describe('Spin orchestrator configuration'),\n\tsummary: z\n\t\t.object({\n\t\t\tmodel: z.enum(['sonnet', 'opus', 'haiku']).optional(),\n\t\t})\n\t\t.optional()\n\t\t.describe('Session summary generation configuration'),\n\tcapabilities: CapabilitiesSettingsSchemaNoDefaults.describe('Project capability configurations'),\n\tdatabaseProviders: DatabaseProvidersSettingsSchema.describe('Database provider configurations'),\n\tissueManagement: z\n\t\t.object({\n\t\t\tprovider: z.enum(['github', 'linear']).optional().describe('Issue tracker provider (github, linear)'),\n\t\t\tgithub: z\n\t\t\t\t.object({\n\t\t\t\t\tremote: z\n\t\t\t\t\t\t.string()\n\t\t\t\t\t\t.min(1, 'Remote name cannot be empty')\n\t\t\t\t\t\t.describe('Git remote name to use for GitHub operations'),\n\t\t\t\t})\n\t\t\t\t.optional(),\n\t\t\tlinear: z\n\t\t\t\t.object({\n\t\t\t\t\tteamId: z\n\t\t\t\t\t\t.string()\n\t\t\t\t\t\t.min(1, 'Team ID cannot be empty')\n\t\t\t\t\t\t.describe('Linear team identifier (e.g., \"ENG\", \"PLAT\")'),\n\t\t\t\t\tbranchFormat: z\n\t\t\t\t\t\t.string()\n\t\t\t\t\t\t.optional()\n\t\t\t\t\t\t.describe('Branch naming template for Linear issues'),\n\t\t\t\t\tapiToken: z\n\t\t\t\t\t\t.string()\n\t\t\t\t\t\t.optional()\n\t\t\t\t\t\t.describe('Linear API token (lin_api_...). SECURITY: Store in settings.local.json only, never commit to source control.'),\n\t\t\t\t})\n\t\t\t\t.optional(),\n\t\t})\n\t\t.optional()\n\t\t.describe('Issue management configuration'),\n\tmergeBehavior: z\n\t\t.object({\n\t\t\tmode: z.enum(['local', 'github-pr', 'github-draft-pr']).optional(),\n\t\t\tremote: z.string().optional(),\n\t\t})\n\t\t.optional()\n\t\t.describe('Merge behavior configuration: local (merge locally), github-pr (create PR), or github-draft-pr (create draft PR at start, mark ready on finish)'),\n\tide: z\n\t\t.object({\n\t\t\ttype: z\n\t\t\t\t.enum(['vscode', 'cursor', 'webstorm', 'sublime', 'intellij', 'windsurf', 'antigravity'])\n\t\t\t\t.optional()\n\t\t\t\t.describe(\n\t\t\t\t\t'IDE to launch when starting a loom. Options: vscode (Visual Studio Code), cursor (Cursor AI editor), ' +\n\t\t\t\t\t\t'webstorm (JetBrains WebStorm), sublime (Sublime Text), intellij (JetBrains IntelliJ IDEA), ' +\n\t\t\t\t\t\t'windsurf (Windsurf editor), antigravity (Antigravity IDE).'\n\t\t\t\t),\n\t\t})\n\t\t.optional()\n\t\t.describe(\n\t\t\t'IDE configuration for workspace launches. Controls which editor opens when you start a loom. ' +\n\t\t\t\t'Supports VSCode, Cursor, WebStorm, Sublime Text, IntelliJ, Windsurf, and Antigravity. ' +\n\t\t\t\t'Note: Color synchronization (title bar colors) only works with VSCode-compatible editors (vscode, cursor, windsurf, antigravity).'\n\t\t),\n\tcolors: z\n\t\t.object({\n\t\t\tterminal: z\n\t\t\t\t.boolean()\n\t\t\t\t.optional()\n\t\t\t\t.describe('Apply terminal background colors based on branch name (macOS only)'),\n\t\t\tvscode: z\n\t\t\t\t.boolean()\n\t\t\t\t.optional()\n\t\t\t\t.describe(\n\t\t\t\t\t'Apply VSCode/Cursor title bar colors based on branch name. ' +\n\t\t\t\t\t\t'Note: This modifies .vscode/settings.json which may be in source control.'\n\t\t\t\t),\n\t\t})\n\t\t.optional()\n\t\t.describe('Color synchronization settings for workspace identification'),\n\tattribution: z\n\t\t.enum(['off', 'upstreamOnly', 'on'])\n\t\t.optional()\n\t\t.describe(\n\t\t\t'Controls when iloom attribution appears in session summaries. ' +\n\t\t\t\t'\"off\" - never show attribution. ' +\n\t\t\t\t'\"upstreamOnly\" - only show for contributions to external repositories (e.g., open source). ' +\n\t\t\t\t'\"on\" - always show attribution.'\n\t\t),\n})\n\n/**\n * TypeScript type for Neon settings derived from Zod schema\n */\nexport type NeonSettings = z.infer<typeof NeonSettingsSchema>\n\n/**\n * TypeScript type for database providers settings derived from Zod schema\n */\nexport type DatabaseProvidersSettings = z.infer<typeof DatabaseProvidersSettingsSchema>\n\n/**\n * TypeScript type for agent settings derived from Zod schema\n */\nexport type AgentSettings = z.infer<typeof AgentSettingsSchema>\n\n/**\n * TypeScript type for spin agent settings derived from Zod schema\n */\nexport type SpinAgentSettings = z.infer<typeof SpinAgentSettingsSchema>\n\n/**\n * TypeScript type for summary settings derived from Zod schema\n */\nexport type SummarySettings = z.infer<typeof SummarySettingsSchema>\n\n/**\n * TypeScript type for workflow permission configuration derived from Zod schema\n */\nexport type WorkflowPermission = z.infer<typeof WorkflowPermissionSchema>\n\n/**\n * TypeScript type for workflows settings derived from Zod schema\n */\nexport type WorkflowsSettings = z.infer<typeof WorkflowsSettingsSchema>\n\n/**\n * TypeScript type for capabilities settings derived from Zod schema\n */\nexport type CapabilitiesSettings = z.infer<typeof CapabilitiesSettingsSchema>\n\n/**\n * TypeScript type for IDE settings derived from Zod schema\n */\nexport type IdeSettings = z.infer<typeof IloomSettingsSchema>['ide']\n\n/**\n * TypeScript type for iloom settings derived from Zod schema\n */\nexport type IloomSettings = z.infer<typeof IloomSettingsSchema>\n\n/**\n * Manages project-level settings from .iloom/settings.json\n */\nexport class SettingsManager {\n\t/**\n\t * Load settings from global, project, and local sources with proper precedence\n\t * Merge hierarchy (lowest to highest priority):\n\t * 1. Global settings (~/.config/iloom-ai/settings.json)\n\t * 2. Project settings (<PROJECT_ROOT>/.iloom/settings.json)\n\t * 3. Local settings (<PROJECT_ROOT>/.iloom/settings.local.json)\n\t * 4. CLI overrides (--set flags)\n\t * Returns empty object if all files don't exist (not an error)\n\t */\n\tasync loadSettings(\n\t\tprojectRoot?: string,\n\t\tcliOverrides?: Partial<IloomSettings>,\n\t): Promise<IloomSettings> {\n\t\tconst root = this.getProjectRoot(projectRoot)\n\n\t\t// Load global settings (lowest priority)\n\t\tconst globalSettings = await this.loadGlobalSettingsFile()\n\t\tconst globalSettingsPath = this.getGlobalSettingsPath()\n\t\tlogger.debug(`🌍 Global settings from ${globalSettingsPath}:`, JSON.stringify(globalSettings, null, 2))\n\n\t\t// Load base settings from settings.json\n\t\tconst baseSettings = await this.loadSettingsFile(root, 'settings.json')\n\t\tconst baseSettingsPath = path.join(root, '.iloom', 'settings.json')\n\t\tlogger.debug(`📄 Base settings from ${baseSettingsPath}:`, JSON.stringify(baseSettings, null, 2))\n\n\t\t// Load local overrides from settings.local.json\n\t\tconst localSettings = await this.loadSettingsFile(root, 'settings.local.json')\n\t\tconst localSettingsPath = path.join(root, '.iloom', 'settings.local.json')\n\t\tlogger.debug(`📄 Local settings from ${localSettingsPath}:`, JSON.stringify(localSettings, null, 2))\n\n\t\t// Deep merge with priority: cliOverrides > localSettings > baseSettings > globalSettings\n\t\tlet merged = this.mergeSettings(this.mergeSettings(globalSettings, baseSettings), localSettings)\n\t\tlogger.debug('🔄 After merging global + base + local settings:', JSON.stringify(merged, null, 2))\n\n\t\tif (cliOverrides && Object.keys(cliOverrides).length > 0) {\n\t\t\tlogger.debug('⚙️ CLI overrides to apply:', JSON.stringify(cliOverrides, null, 2))\n\t\t\tmerged = this.mergeSettings(merged, cliOverrides)\n\t\t\tlogger.debug('🔄 After applying CLI overrides:', JSON.stringify(merged, null, 2))\n\t\t}\n\n\t\t// Validate merged result\n\t\ttry {\n\t\t\tconst finalSettings = IloomSettingsSchema.parse(merged)\n\n\t\t\t// Debug: Log final merged configuration\n\t\t\tthis.logFinalConfiguration(finalSettings)\n\n\t\t\treturn finalSettings\n\t\t} catch (error) {\n\t\t\t// Show all Zod validation errors\n\t\t\tif (error instanceof z.ZodError) {\n\t\t\t\tconst errorMsg = this.formatAllZodErrors(error, '<merged settings>')\n\t\t\t\t// Enhance error message if CLI overrides were applied\n\t\t\t\tif (cliOverrides && Object.keys(cliOverrides).length > 0) {\n\t\t\t\t\tthrow new Error(`${errorMsg.message}\\n\\nNote: CLI overrides were applied. Check your --set arguments.`)\n\t\t\t\t}\n\t\t\t\tthrow errorMsg\n\t\t\t}\n\t\t\tthrow error\n\t\t}\n\t}\n\n\t/**\n\t * Log the final merged configuration for debugging\n\t */\n\tprivate logFinalConfiguration(settings: IloomSettings): void {\n\t\tlogger.debug('📋 Final merged configuration:', JSON.stringify(settings, null, 2))\n\t}\n\n\t/**\n\t * Load and parse a single settings file\n\t * Returns empty object if file doesn't exist (not an error)\n\t * Uses non-defaulting schema to prevent polluting partial settings with defaults before merge\n\t */\n\tprivate async loadSettingsFile(\n\t\tprojectRoot: string,\n\t\tfilename: string,\n\t): Promise<z.infer<typeof IloomSettingsSchemaNoDefaults>> {\n\t\tconst settingsPath = path.join(projectRoot, '.iloom', filename)\n\n\t\ttry {\n\t\t\tconst content = await readFile(settingsPath, 'utf-8')\n\t\t\tlet parsed: unknown\n\n\t\t\ttry {\n\t\t\t\tparsed = JSON.parse(content)\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to parse settings file at ${settingsPath}: ${error instanceof Error ? error.message : 'Invalid JSON'}`,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t// Basic type checking - ensure it's an object, but don't validate schema completeness\n\t\t\t// Individual files may be incomplete (e.g., Linear config split between files)\n\t\t\t// Final validation will happen on the merged result in loadSettings()\n\t\t\tif (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Settings validation failed at ${filename}:\\n - root: Expected object, received ${typeof parsed}`\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn parsed as z.infer<typeof IloomSettingsSchemaNoDefaults>\n\t\t} catch (error) {\n\t\t\t// File not found is not an error - return empty settings\n\t\t\tif ((error as { code?: string }).code === 'ENOENT') {\n\t\t\t\tlogger.debug(`No settings file found at ${settingsPath}, using defaults`)\n\t\t\t\treturn {}\n\t\t\t}\n\n\t\t\t// Re-throw parsing errors\n\t\t\tthrow error\n\t\t}\n\t}\n\n\t/**\n\t * Deep merge two settings objects with priority to override\n\t * Uses deepmerge library with array replacement strategy\n\t */\n\tprivate mergeSettings(\n\t\tbase: Partial<IloomSettings> | z.infer<typeof IloomSettingsSchemaNoDefaults>,\n\t\toverride: Partial<IloomSettings> | z.infer<typeof IloomSettingsSchemaNoDefaults>,\n\t): IloomSettings {\n\t\t// Use deepmerge with array replacement (not concatenation)\n\t\t// Type assertion is safe because the merged result will be validated with IloomSettingsSchema\n\t\t// which applies all the defaults after merging\n\t\treturn deepmerge(base as Record<string, unknown>, override as Record<string, unknown>, {\n\t\t\t// Replace arrays instead of concatenating them\n\t\t\tarrayMerge: (_destinationArray, sourceArray) => sourceArray,\n\t\t}) as IloomSettings\n\t}\n\n\t/**\n\t * Format all Zod validation errors into a single error message\n\t */\n\tprivate formatAllZodErrors(error: z.ZodError, settingsPath: string): Error {\n\t\tconst errorMessages = error.issues.map(issue => {\n\t\t\tconst path = issue.path.length > 0 ? issue.path.join('.') : 'root'\n\t\t\treturn ` - ${path}: ${issue.message}`\n\t\t})\n\n\t\treturn new Error(\n\t\t\t`Settings validation failed at ${settingsPath}:\\n${errorMessages.join('\\n')}`,\n\t\t)\n\t}\n\n\t/**\n\t * Validate settings structure and model names using Zod schema\n\t * This method is kept for testing purposes but uses Zod internally\n\t * @internal - Only used in tests via bracket notation\n\t */\n\t// @ts-expect-error - Used in tests via bracket notation, TypeScript can't detect this usage\n\tprivate validateSettings(settings: IloomSettings): void {\n\t\ttry {\n\t\t\tIloomSettingsSchema.parse(settings)\n\t\t} catch (error) {\n\t\t\tif (error instanceof z.ZodError) {\n\t\t\t\tthrow this.formatAllZodErrors(error, '<validation>')\n\t\t\t}\n\t\t\tthrow error\n\t\t}\n\t}\n\n\t/**\n\t * Get project root (defaults to process.cwd())\n\t */\n\tprivate getProjectRoot(projectRoot?: string): string {\n\t\treturn projectRoot ?? process.cwd()\n\t}\n\n\t/**\n\t * Get global config directory path (~/.config/iloom-ai)\n\t */\n\tprivate getGlobalConfigDir(): string {\n\t\treturn path.join(os.homedir(), '.config', 'iloom-ai')\n\t}\n\n\t/**\n\t * Get global settings file path (~/.config/iloom-ai/settings.json)\n\t */\n\tprivate getGlobalSettingsPath(): string {\n\t\treturn path.join(this.getGlobalConfigDir(), 'settings.json')\n\t}\n\n\t/**\n\t * Load and parse global settings file\n\t * Returns empty object if file doesn't exist (not an error)\n\t * Warns but returns empty object on validation/parse errors (graceful degradation)\n\t */\n\tprivate async loadGlobalSettingsFile(): Promise<z.infer<typeof IloomSettingsSchemaNoDefaults>> {\n\t\tconst settingsPath = this.getGlobalSettingsPath()\n\n\t\ttry {\n\t\t\tconst content = await readFile(settingsPath, 'utf-8')\n\t\t\tlet parsed: unknown\n\n\t\t\ttry {\n\t\t\t\tparsed = JSON.parse(content)\n\t\t\t} catch (error) {\n\t\t\t\tlogger.warn(\n\t\t\t\t\t`Failed to parse global settings file at ${settingsPath}: ${error instanceof Error ? error.message : 'Invalid JSON'}. Ignoring global settings.`,\n\t\t\t\t)\n\t\t\t\treturn {}\n\t\t\t}\n\n\t\t\t// Validate with non-defaulting schema\n\t\t\ttry {\n\t\t\t\tconst validated = IloomSettingsSchemaNoDefaults.strict().parse(parsed)\n\t\t\t\treturn validated\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof z.ZodError) {\n\t\t\t\t\tconst errorMsg = this.formatAllZodErrors(error, 'global settings')\n\t\t\t\t\tlogger.warn(`${errorMsg.message}. Ignoring global settings.`)\n\t\t\t\t} else {\n\t\t\t\t\tlogger.warn(`Validation error in global settings: ${error instanceof Error ? error.message : 'Unknown error'}. Ignoring global settings.`)\n\t\t\t\t}\n\t\t\t\treturn {}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// File not found is not an error - return empty settings\n\t\t\tif ((error as { code?: string }).code === 'ENOENT') {\n\t\t\t\tlogger.debug(`No global settings file found at ${settingsPath}`)\n\t\t\t\treturn {}\n\t\t\t}\n\n\t\t\t// Other file system errors - warn and continue\n\t\t\tlogger.warn(`Error reading global settings file at ${settingsPath}: ${error instanceof Error ? error.message : 'Unknown error'}. Ignoring global settings.`)\n\t\t\treturn {}\n\t\t}\n\t}\n\n\t/**\n\t * Get effective protected branches list with mainBranch always included\n\t *\n\t * This method provides a single source of truth for protected branches logic:\n\t * 1. Use configured protectedBranches if provided\n\t * 2. Otherwise use defaults: [mainBranch, 'main', 'master', 'develop']\n\t * 3. ALWAYS ensure mainBranch is included even if user configured custom list\n\t *\n\t * @param projectRoot - Optional project root directory (defaults to process.cwd())\n\t * @returns Array of protected branch names with mainBranch guaranteed to be included\n\t */\n\tasync getProtectedBranches(projectRoot?: string): Promise<string[]> {\n\t\tconst settings = await this.loadSettings(projectRoot)\n\t\tconst mainBranch = settings.mainBranch ?? 'main'\n\n\t\t// Build protected branches list:\n\t\t// 1. Use configured protectedBranches if provided\n\t\t// 2. Otherwise use defaults: [mainBranch, 'main', 'master', 'develop']\n\t\t// 3. ALWAYS ensure mainBranch is included even if user configured custom list\n\t\tlet protectedBranches: string[]\n\t\tif (settings.protectedBranches) {\n\t\t\t// Use configured list but ensure mainBranch is always included\n\t\t\tprotectedBranches = settings.protectedBranches.includes(mainBranch)\n\t\t\t\t? settings.protectedBranches\n\t\t\t\t: [mainBranch, ...settings.protectedBranches]\n\t\t} else {\n\t\t\t// Use defaults with current mainBranch\n\t\t\tprotectedBranches = [mainBranch, 'main', 'master', 'develop']\n\t\t}\n\n\t\treturn protectedBranches\n\t}\n\n\t/**\n\t * Get the spin orchestrator model with default applied\n\t * Default is defined in SpinAgentSettingsSchema\n\t *\n\t * @param settings - Pre-loaded settings object\n\t * @returns Model shorthand ('opus', 'sonnet', or 'haiku')\n\t */\n\tgetSpinModel(settings?: IloomSettings): 'sonnet' | 'opus' | 'haiku' {\n\t\treturn settings?.spin?.model ?? SpinAgentSettingsSchema.parse({}).model\n\t}\n\n\t/**\n\t * Get the session summary model with default applied\n\t * Default is defined in SummarySettingsSchema\n\t *\n\t * @param settings - Pre-loaded settings object\n\t * @returns Model shorthand ('opus', 'sonnet', or 'haiku')\n\t */\n\tgetSummaryModel(settings?: IloomSettings): 'sonnet' | 'opus' | 'haiku' {\n\t\treturn settings?.summary?.model ?? SummarySettingsSchema.parse({}).model\n\t}\n}\n"],"mappings":";;;;;;AAAA,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,SAAS,SAAS;AAClB,OAAO,eAAe;AAMf,IAAM,sBAAsB,EAAE,OAAO;AAAA,EAC3C,OAAO,EACL,KAAK,CAAC,UAAU,QAAQ,OAAO,CAAC,EAChC,SAAS,EACT,SAAS,gDAAg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;AAAA,IACT;AAAA,EACD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,qBAAqB,aAAyC;AACnE,UAAM,WAAW,MAAM,KAAK,aAAa,WAAW;AACpD,UAAM,aAAa,SAAS,cAAc;AAM1C,QAAI;AACJ,QAAI,SAAS,mBAAmB;AAE/B,0BAAoB,SAAS,kBAAkB,SAAS,UAAU,IAC/D,SAAS,oBACT,CAAC,YAAY,GAAG,SAAS,iBAAiB;AAAA,IAC9C,OAAO;AAEN,0BAAoB,CAAC,YAAY,QAAQ,UAAU,SAAS;AAAA,IAC7D;AAEA,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,aAAa,UAAuD;AA/2BrE;AAg3BE,aAAO,0CAAU,SAAV,mBAAgB,UAAS,wBAAwB,MAAM,CAAC,CAAC,EAAE;AAAA,EACnE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,gBAAgB,UAAuD;AA13BxE;AA23BE,aAAO,0CAAU,YAAV,mBAAmB,UAAS,sBAAsB,MAAM,CAAC,CAAC,EAAE;AAAA,EACpE;AACD;","names":["path"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
SettingsManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-F6WVM437.js";
|
|
5
5
|
import {
|
|
6
6
|
MetadataManager
|
|
7
7
|
} from "./chunk-CFUWQHCJ.js";
|
|
@@ -363,7 +363,7 @@ async function getDefaultBranch(path2 = process.cwd()) {
|
|
|
363
363
|
}
|
|
364
364
|
async function findAllBranchesForIssue(issueNumber, path2 = process.cwd(), settingsManager) {
|
|
365
365
|
if (!settingsManager) {
|
|
366
|
-
const { SettingsManager: SM } = await import("./SettingsManager-
|
|
366
|
+
const { SettingsManager: SM } = await import("./SettingsManager-35F5RUJH.js");
|
|
367
367
|
settingsManager = new SM();
|
|
368
368
|
}
|
|
369
369
|
const protectedBranches = await settingsManager.getProtectedBranches(path2);
|
|
@@ -708,4 +708,4 @@ export {
|
|
|
708
708
|
removePlaceholderCommitFromHead,
|
|
709
709
|
removePlaceholderCommitFromHistory
|
|
710
710
|
};
|
|
711
|
-
//# sourceMappingURL=chunk-
|
|
711
|
+
//# sourceMappingURL=chunk-GEXP5IOF.js.map
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
} from "./chunk-FXDYIV3K.js";
|
|
15
15
|
import {
|
|
16
16
|
PromptTemplateManager
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-W6WVRHJ6.js";
|
|
18
18
|
import {
|
|
19
19
|
SettingsManager
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-F6WVM437.js";
|
|
21
21
|
import {
|
|
22
22
|
MetadataManager
|
|
23
23
|
} from "./chunk-CFUWQHCJ.js";
|
|
@@ -776,4 +776,4 @@ var SessionSummaryService = class {
|
|
|
776
776
|
export {
|
|
777
777
|
SessionSummaryService
|
|
778
778
|
};
|
|
779
|
-
//# sourceMappingURL=chunk-
|
|
779
|
+
//# sourceMappingURL=chunk-K7SEEHKO.js.map
|