@iloom/cli 0.3.0 → 0.3.2
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 +207 -882
- package/dist/{BranchNamingService-3OQPRSWT.js → BranchNamingService-JYO746H7.js} +2 -2
- package/dist/ClaudeContextManager-5WPRJIIW.js +15 -0
- package/dist/ClaudeService-Z4KA7QOW.js +14 -0
- package/dist/{GitHubService-EBOETDIW.js → GitHubService-UAMH7DMF.js} +2 -2
- package/dist/{LoomLauncher-FLEMBCSQ.js → LoomLauncher-FVZECY3C.js} +24 -13
- package/dist/LoomLauncher-FVZECY3C.js.map +1 -0
- package/dist/README.md +207 -882
- package/dist/{SettingsManager-WHHFGSL7.js → SettingsManager-MTVX57WR.js} +2 -2
- package/dist/{chunk-MAVL6PJF.js → chunk-5NTD4MCZ.js} +23 -7
- package/dist/chunk-5NTD4MCZ.js.map +1 -0
- package/dist/{chunk-FIAT22G7.js → chunk-A2P7NZTB.js} +7 -7
- package/dist/{chunk-C5QCTEQK.js → chunk-C7ASXK6J.js} +2 -2
- package/dist/{chunk-G2IEYOLQ.js → chunk-F4ENT6AC.js} +16 -1
- package/dist/chunk-F4ENT6AC.js.map +1 -0
- package/dist/{chunk-AWOFAD5O.js → chunk-FOV7RRQ2.js} +8 -8
- package/dist/{chunk-RO26VS3W.js → chunk-FXMLNKLT.js} +2 -2
- package/dist/{chunk-47KSHUCR.js → chunk-GOG3ZB7O.js} +16 -10
- package/dist/chunk-GOG3ZB7O.js.map +1 -0
- package/dist/{chunk-JQFO7QQN.js → chunk-GVICXJHW.js} +2 -2
- package/dist/{chunk-JQFO7QQN.js.map → chunk-GVICXJHW.js.map} +1 -1
- package/dist/{chunk-5EF7Z346.js → chunk-KG343GSG.js} +93 -48
- package/dist/chunk-KG343GSG.js.map +1 -0
- package/dist/{chunk-4HHRTA7Q.js → chunk-OAP6SASD.js} +3 -3
- package/dist/{chunk-4HHRTA7Q.js.map → chunk-OAP6SASD.js.map} +1 -1
- package/dist/chunk-OXAM2WVC.js +68 -0
- package/dist/chunk-OXAM2WVC.js.map +1 -0
- package/dist/{chunk-VAYCCUXW.js → chunk-PRE7KTM4.js} +2 -2
- package/dist/{chunk-ZE74H5BR.js → chunk-RW54ZMBM.js} +26 -20
- package/dist/chunk-RW54ZMBM.js.map +1 -0
- package/dist/{chunk-ML3NRPNB.js → chunk-UCZ24SUE.js} +5 -5
- package/dist/chunk-UCZ24SUE.js.map +1 -0
- package/dist/{chunk-3KATJIKO.js → chunk-UERERX6M.js} +2 -2
- package/dist/chunk-UERERX6M.js.map +1 -0
- package/dist/{chunk-IP7SMKIF.js → chunk-UJL4HI2R.js} +59 -60
- package/dist/chunk-UJL4HI2R.js.map +1 -0
- package/dist/{chunk-XXV3UFZL.js → chunk-ZLIHIUDQ.js} +8 -6
- package/dist/chunk-ZLIHIUDQ.js.map +1 -0
- package/dist/{claude-GOP6PFC7.js → claude-KIZYXTSG.js} +4 -2
- package/dist/{cleanup-7RWLBSLE.js → cleanup-6WYUD5SN.js} +19 -17
- package/dist/{cleanup-7RWLBSLE.js.map → cleanup-6WYUD5SN.js.map} +1 -1
- package/dist/cli.js +209 -73
- package/dist/cli.js.map +1 -1
- package/dist/{contribute-BS2L4FZR.js → contribute-7YJHZTO7.js} +3 -2
- package/dist/{contribute-BS2L4FZR.js.map → contribute-7YJHZTO7.js.map} +1 -1
- package/dist/{feedback-N4ECWIPF.js → feedback-752MGDPG.js} +10 -8
- package/dist/{feedback-N4ECWIPF.js.map → feedback-752MGDPG.js.map} +1 -1
- package/dist/{git-TDXKRTXM.js → git-TAFVDB3J.js} +5 -2
- package/dist/{ignite-VM64QO3J.js → ignite-OAMDUN27.js} +13 -11
- package/dist/{ignite-VM64QO3J.js.map → ignite-OAMDUN27.js.map} +1 -1
- package/dist/index.d.ts +20 -7
- package/dist/index.js +279 -297
- package/dist/index.js.map +1 -1
- package/dist/{init-G3T64SC4.js → init-7IIM35LQ.js} +12 -9
- package/dist/{init-G3T64SC4.js.map → init-7IIM35LQ.js.map} +1 -1
- package/dist/mcp/issue-management-server.js +8 -1
- package/dist/mcp/issue-management-server.js.map +1 -1
- package/dist/{neon-helpers-WPUACUVC.js → neon-helpers-5HBYO2VP.js} +2 -2
- package/dist/{open-KXDXEKRZ.js → open-FCHKQ77R.js} +27 -14
- package/dist/open-FCHKQ77R.js.map +1 -0
- package/dist/prompts/init-prompt.txt +10 -4
- package/dist/{rebase-Q7GMM7EI.js → rebase-Q7WXK566.js} +10 -8
- package/dist/{rebase-Q7GMM7EI.js.map → rebase-Q7WXK566.js.map} +1 -1
- package/dist/{run-PAWJJCSX.js → run-SJPM6YRI.js} +27 -14
- package/dist/run-SJPM6YRI.js.map +1 -0
- package/dist/schema/settings.schema.json +4 -4
- package/dist/{test-git-3WDLNQCA.js → test-git-DEUE656D.js} +5 -5
- package/dist/{test-prefix-EVGAWAJW.js → test-prefix-Y6Z6ZHSF.js} +5 -5
- package/dist/{test-tabs-RXDBZ6J7.js → test-tabs-PRMRSHKI.js} +3 -2
- package/dist/{test-tabs-RXDBZ6J7.js.map → test-tabs-PRMRSHKI.js.map} +1 -1
- package/package.json +2 -2
- package/dist/ClaudeContextManager-MUQSDY2E.js +0 -13
- package/dist/ClaudeService-HG4VQ7AW.js +0 -12
- package/dist/LoomLauncher-FLEMBCSQ.js.map +0 -1
- package/dist/chunk-3KATJIKO.js.map +0 -1
- package/dist/chunk-47KSHUCR.js.map +0 -1
- package/dist/chunk-5EF7Z346.js.map +0 -1
- package/dist/chunk-G2IEYOLQ.js.map +0 -1
- package/dist/chunk-IP7SMKIF.js.map +0 -1
- package/dist/chunk-MAVL6PJF.js.map +0 -1
- package/dist/chunk-ML3NRPNB.js.map +0 -1
- package/dist/chunk-XXV3UFZL.js.map +0 -1
- package/dist/chunk-ZE74H5BR.js.map +0 -1
- package/dist/open-KXDXEKRZ.js.map +0 -1
- package/dist/run-PAWJJCSX.js.map +0 -1
- package/dist/terminal-BIRBZ4AZ.js +0 -16
- package/dist/terminal-BIRBZ4AZ.js.map +0 -1
- /package/dist/{BranchNamingService-3OQPRSWT.js.map → BranchNamingService-JYO746H7.js.map} +0 -0
- /package/dist/{ClaudeContextManager-MUQSDY2E.js.map → ClaudeContextManager-5WPRJIIW.js.map} +0 -0
- /package/dist/{ClaudeService-HG4VQ7AW.js.map → ClaudeService-Z4KA7QOW.js.map} +0 -0
- /package/dist/{GitHubService-EBOETDIW.js.map → GitHubService-UAMH7DMF.js.map} +0 -0
- /package/dist/{SettingsManager-WHHFGSL7.js.map → SettingsManager-MTVX57WR.js.map} +0 -0
- /package/dist/{chunk-FIAT22G7.js.map → chunk-A2P7NZTB.js.map} +0 -0
- /package/dist/{chunk-C5QCTEQK.js.map → chunk-C7ASXK6J.js.map} +0 -0
- /package/dist/{chunk-AWOFAD5O.js.map → chunk-FOV7RRQ2.js.map} +0 -0
- /package/dist/{chunk-RO26VS3W.js.map → chunk-FXMLNKLT.js.map} +0 -0
- /package/dist/{chunk-VAYCCUXW.js.map → chunk-PRE7KTM4.js.map} +0 -0
- /package/dist/{claude-GOP6PFC7.js.map → claude-KIZYXTSG.js.map} +0 -0
- /package/dist/{git-TDXKRTXM.js.map → git-TAFVDB3J.js.map} +0 -0
- /package/dist/{neon-helpers-WPUACUVC.js.map → neon-helpers-5HBYO2VP.js.map} +0 -0
- /package/dist/{test-git-3WDLNQCA.js.map → test-git-DEUE656D.js.map} +0 -0
- /package/dist/{test-prefix-EVGAWAJW.js.map → test-prefix-Y6Z6ZHSF.js.map} +0 -0
|
@@ -101,7 +101,7 @@ The following JSON Schema defines valid iloom settings:
|
|
|
101
101
|
"sourceEnvOnStart": {
|
|
102
102
|
"type": "boolean",
|
|
103
103
|
"default": false,
|
|
104
|
-
"description": "Source .env
|
|
104
|
+
"description": "Source all dotenv-flow files (.env, .env.local, .env.development, .env.development.local) when launching terminal processes (Claude, dev server, terminal). Files are sourced in precedence order so later files override earlier ones. NOTE TO AI AGENTS: Before making changes to settings files, YOU MUST OFFER to check .env file compatibility. WARNING: Unquoted values in .env files may break sourcing in bash/zsh shells. Before enabling, verify ALL your .env.* files do not contain unquoted special characters (e.g., database URLs with ?, &, or other shell metacharacters). Shell compatibility issues may cause processes to fail or behave unexpectedly."
|
|
105
105
|
},
|
|
106
106
|
"worktreePrefix": {
|
|
107
107
|
"type": "string",
|
|
@@ -148,7 +148,7 @@ The following JSON Schema defines valid iloom settings:
|
|
|
148
148
|
"startAiAgent": {
|
|
149
149
|
"type": "boolean",
|
|
150
150
|
"default": true,
|
|
151
|
-
"description": "Launch Claude
|
|
151
|
+
"description": "Launch Claude Code agent when starting this workflow type"
|
|
152
152
|
},
|
|
153
153
|
"startTerminal": {
|
|
154
154
|
"type": "boolean",
|
|
@@ -188,7 +188,7 @@ The following JSON Schema defines valid iloom settings:
|
|
|
188
188
|
"startAiAgent": {
|
|
189
189
|
"type": "boolean",
|
|
190
190
|
"default": true,
|
|
191
|
-
"description": "Launch Claude
|
|
191
|
+
"description": "Launch Claude Code agent when starting this workflow type"
|
|
192
192
|
},
|
|
193
193
|
"startTerminal": {
|
|
194
194
|
"type": "boolean",
|
|
@@ -228,7 +228,7 @@ The following JSON Schema defines valid iloom settings:
|
|
|
228
228
|
"startAiAgent": {
|
|
229
229
|
"type": "boolean",
|
|
230
230
|
"default": true,
|
|
231
|
-
"description": "Launch Claude
|
|
231
|
+
"description": "Launch Claude Code agent when starting this workflow type"
|
|
232
232
|
},
|
|
233
233
|
"startTerminal": {
|
|
234
234
|
"type": "boolean",
|
|
@@ -684,6 +684,11 @@ Since this repository has multiple git remotes, GitHub Issues is suggested as th
|
|
|
684
684
|
- Validation: Must be one of: github, linear
|
|
685
685
|
- Store answer as: `issueManagement.provider`
|
|
686
686
|
|
|
687
|
+
**Note on Provider + Merge Mode Combinations:**
|
|
688
|
+
- GitHub Issues + local merge or github-pr: Requires authorized GitHub CLI (`gh`)
|
|
689
|
+
- Linear Issues + local merge: Requires Linear API token only
|
|
690
|
+
- Linear Issues + github-pr merge: Requires BOTH Linear API token AND authorized GitHub CLI (`gh`)
|
|
691
|
+
|
|
687
692
|
**Step 2: Provider-Specific Configuration**
|
|
688
693
|
|
|
689
694
|
Based on the answer to Step 1, ask the appropriate follow-up questions:
|
|
@@ -765,6 +770,7 @@ REMOTES_INFO
|
|
|
765
770
|
- Validation: Must be one of: local, github-pr
|
|
766
771
|
- Store answer as: `mergeBehavior.mode`
|
|
767
772
|
- Context: Fork workflows (with upstream remote) should typically use "github-pr" mode
|
|
773
|
+
- **IMPORTANT**: The "github-pr" mode requires GitHub CLI (`gh`) to be installed and authenticated, regardless of your issue tracker provider. If you use Linear for issue tracking but want to create GitHub PRs, ensure `gh` is installed.
|
|
768
774
|
|
|
769
775
|
**Implementation Details:**
|
|
770
776
|
- Ask Step 1 first to determine provider
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
MergeManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FOV7RRQ2.js";
|
|
5
5
|
import {
|
|
6
6
|
GitWorktreeManager
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-XXV3UFZL.js";
|
|
9
|
-
import {
|
|
10
|
-
SettingsManager
|
|
11
|
-
} from "./chunk-ML3NRPNB.js";
|
|
7
|
+
} from "./chunk-OAP6SASD.js";
|
|
12
8
|
import {
|
|
13
9
|
getRepoRoot,
|
|
14
10
|
isValidGitRepo
|
|
15
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5NTD4MCZ.js";
|
|
12
|
+
import {
|
|
13
|
+
SettingsManager
|
|
14
|
+
} from "./chunk-UCZ24SUE.js";
|
|
15
|
+
import "./chunk-ZLIHIUDQ.js";
|
|
16
|
+
import "./chunk-RW54ZMBM.js";
|
|
17
|
+
import "./chunk-UJL4HI2R.js";
|
|
16
18
|
import {
|
|
17
19
|
logger
|
|
18
20
|
} from "./chunk-GEHQXLEI.js";
|
|
@@ -92,4 +94,4 @@ export {
|
|
|
92
94
|
RebaseCommand,
|
|
93
95
|
WorktreeValidationError
|
|
94
96
|
};
|
|
95
|
-
//# sourceMappingURL=rebase-
|
|
97
|
+
//# sourceMappingURL=rebase-Q7WXK566.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/rebase.ts"],"sourcesContent":["import { logger } from '../utils/logger.js'\nimport { MergeManager } from '../lib/MergeManager.js'\nimport { GitWorktreeManager } from '../lib/GitWorktreeManager.js'\nimport { SettingsManager } from '../lib/SettingsManager.js'\nimport { isValidGitRepo, getRepoRoot } from '../utils/git.js'\nimport type { MergeOptions } from '../types/index.js'\n\nexport interface RebaseOptions {\n\tforce?: boolean\n\tdryRun?: boolean\n}\n\n/**\n * Error thrown when the rebase command is run from an invalid location\n */\nexport class WorktreeValidationError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly suggestion: string\n\t) {\n\t\tsuper(message)\n\t\tthis.name = 'WorktreeValidationError'\n\t}\n}\n\n/**\n * RebaseCommand: Rebase current branch on main with Claude-assisted conflict resolution\n *\n * This command:\n * 1. Validates the current directory is an iloom-managed worktree\n * 2. Detects the worktree root (supports running from subdirectories)\n * 3. Delegates to MergeManager.rebaseOnMain() which handles:\n * - Checking main branch exists\n * - Detecting uncommitted changes (throws if found)\n * - Checking if already up-to-date\n * - Executing rebase\n * - Claude-assisted conflict resolution\n * 4. Reports success\n */\nexport class RebaseCommand {\n\tprivate mergeManager: MergeManager\n\tprivate gitWorktreeManager: GitWorktreeManager\n\tprivate settingsManager: SettingsManager\n\n\tconstructor(mergeManager?: MergeManager, gitWorktreeManager?: GitWorktreeManager, settingsManager?: SettingsManager) {\n\t\tthis.mergeManager = mergeManager ?? new MergeManager()\n\t\tthis.gitWorktreeManager = gitWorktreeManager ?? new GitWorktreeManager()\n\t\tthis.settingsManager = settingsManager ?? new SettingsManager()\n\t}\n\n\t/**\n\t * Validate that the current directory is within an iloom-managed worktree\n\t * Returns the worktree root path if valid\n\t * @throws WorktreeValidationError if validation fails\n\t */\n\tprivate async validateWorktreeContext(): Promise<string> {\n\t\tconst currentDir = process.cwd()\n\n\t\t// Step 1: Check if we're in a git repository at all\n\t\tconst isGitRepo = await isValidGitRepo(currentDir)\n\t\tif (!isGitRepo) {\n\t\t\tthrow new WorktreeValidationError(\n\t\t\t\t'Not a git repository.',\n\t\t\t\t\"Run 'il rebase' from within an iloom worktree created by 'il start'.\"\n\t\t\t)\n\t\t}\n\n\t\t// Step 2: Get the repository root (handles subdirectories)\n\t\tconst repoRoot = await getRepoRoot(currentDir)\n\t\tif (!repoRoot) {\n\t\t\tthrow new WorktreeValidationError(\n\t\t\t\t'Could not determine repository root.',\n\t\t\t\t\"Run 'il rebase' from within an iloom worktree created by 'il start'.\"\n\t\t\t)\n\t\t}\n\n\t\t// Step 3: Check if this path is a registered git worktree\n\t\tconst worktrees = await this.gitWorktreeManager.listWorktrees()\n\t\tconst currentWorktree = worktrees.find(wt => wt.path === repoRoot)\n\n\t\tif (!currentWorktree) {\n\t\t\tthrow new WorktreeValidationError(\n\t\t\t\t'This directory is not an iloom worktree.',\n\t\t\t\t\"Run 'il rebase' from within a worktree created by 'il start <issue>'. Use 'il list' to see available worktrees.\"\n\t\t\t)\n\t\t}\n\n\t\t// Step 4: Check if this is the main worktree (we shouldn't rebase from main)\n\t\tconst isMain = await this.gitWorktreeManager.isMainWorktree(currentWorktree, this.settingsManager)\n\t\tif (isMain) {\n\t\t\tthrow new WorktreeValidationError(\n\t\t\t\t'Cannot rebase from the main worktree.',\n\t\t\t\t\"Navigate to a feature worktree created by 'il start <issue>' and run 'il rebase' from there.\"\n\t\t\t)\n\t\t}\n\n\t\treturn repoRoot\n\t}\n\n\tasync execute(options: RebaseOptions = {}): Promise<void> {\n\t\t// Step 1: Validate we're in a valid iloom worktree\n\t\tlet worktreePath: string\n\t\ttry {\n\t\t\tworktreePath = await this.validateWorktreeContext()\n\t\t} catch (error) {\n\t\t\tif (error instanceof WorktreeValidationError) {\n\t\t\t\tlogger.error(error.message)\n\t\t\t\tlogger.info(error.suggestion)\n\t\t\t\tthrow error\n\t\t\t}\n\t\t\tthrow error\n\t\t}\n\n\t\tconst mergeOptions: MergeOptions = {\n\t\t\tdryRun: options.dryRun ?? false,\n\t\t\tforce: options.force ?? false,\n\t\t}\n\n\t\t// MergeManager.rebaseOnMain() handles:\n\t\t// - Checking main branch exists\n\t\t// - Detecting uncommitted changes (throws if found)\n\t\t// - Checking if already up-to-date\n\t\t// - Executing rebase\n\t\t// - Claude-assisted conflict resolution\n\t\tawait this.mergeManager.rebaseOnMain(worktreePath, mergeOptions)\n\t}\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/commands/rebase.ts"],"sourcesContent":["import { logger } from '../utils/logger.js'\nimport { MergeManager } from '../lib/MergeManager.js'\nimport { GitWorktreeManager } from '../lib/GitWorktreeManager.js'\nimport { SettingsManager } from '../lib/SettingsManager.js'\nimport { isValidGitRepo, getRepoRoot } from '../utils/git.js'\nimport type { MergeOptions } from '../types/index.js'\n\nexport interface RebaseOptions {\n\tforce?: boolean\n\tdryRun?: boolean\n}\n\n/**\n * Error thrown when the rebase command is run from an invalid location\n */\nexport class WorktreeValidationError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly suggestion: string\n\t) {\n\t\tsuper(message)\n\t\tthis.name = 'WorktreeValidationError'\n\t}\n}\n\n/**\n * RebaseCommand: Rebase current branch on main with Claude-assisted conflict resolution\n *\n * This command:\n * 1. Validates the current directory is an iloom-managed worktree\n * 2. Detects the worktree root (supports running from subdirectories)\n * 3. Delegates to MergeManager.rebaseOnMain() which handles:\n * - Checking main branch exists\n * - Detecting uncommitted changes (throws if found)\n * - Checking if already up-to-date\n * - Executing rebase\n * - Claude-assisted conflict resolution\n * 4. Reports success\n */\nexport class RebaseCommand {\n\tprivate mergeManager: MergeManager\n\tprivate gitWorktreeManager: GitWorktreeManager\n\tprivate settingsManager: SettingsManager\n\n\tconstructor(mergeManager?: MergeManager, gitWorktreeManager?: GitWorktreeManager, settingsManager?: SettingsManager) {\n\t\tthis.mergeManager = mergeManager ?? new MergeManager()\n\t\tthis.gitWorktreeManager = gitWorktreeManager ?? new GitWorktreeManager()\n\t\tthis.settingsManager = settingsManager ?? new SettingsManager()\n\t}\n\n\t/**\n\t * Validate that the current directory is within an iloom-managed worktree\n\t * Returns the worktree root path if valid\n\t * @throws WorktreeValidationError if validation fails\n\t */\n\tprivate async validateWorktreeContext(): Promise<string> {\n\t\tconst currentDir = process.cwd()\n\n\t\t// Step 1: Check if we're in a git repository at all\n\t\tconst isGitRepo = await isValidGitRepo(currentDir)\n\t\tif (!isGitRepo) {\n\t\t\tthrow new WorktreeValidationError(\n\t\t\t\t'Not a git repository.',\n\t\t\t\t\"Run 'il rebase' from within an iloom worktree created by 'il start'.\"\n\t\t\t)\n\t\t}\n\n\t\t// Step 2: Get the repository root (handles subdirectories)\n\t\tconst repoRoot = await getRepoRoot(currentDir)\n\t\tif (!repoRoot) {\n\t\t\tthrow new WorktreeValidationError(\n\t\t\t\t'Could not determine repository root.',\n\t\t\t\t\"Run 'il rebase' from within an iloom worktree created by 'il start'.\"\n\t\t\t)\n\t\t}\n\n\t\t// Step 3: Check if this path is a registered git worktree\n\t\tconst worktrees = await this.gitWorktreeManager.listWorktrees()\n\t\tconst currentWorktree = worktrees.find(wt => wt.path === repoRoot)\n\n\t\tif (!currentWorktree) {\n\t\t\tthrow new WorktreeValidationError(\n\t\t\t\t'This directory is not an iloom worktree.',\n\t\t\t\t\"Run 'il rebase' from within a worktree created by 'il start <issue>'. Use 'il list' to see available worktrees.\"\n\t\t\t)\n\t\t}\n\n\t\t// Step 4: Check if this is the main worktree (we shouldn't rebase from main)\n\t\tconst isMain = await this.gitWorktreeManager.isMainWorktree(currentWorktree, this.settingsManager)\n\t\tif (isMain) {\n\t\t\tthrow new WorktreeValidationError(\n\t\t\t\t'Cannot rebase from the main worktree.',\n\t\t\t\t\"Navigate to a feature worktree created by 'il start <issue>' and run 'il rebase' from there.\"\n\t\t\t)\n\t\t}\n\n\t\treturn repoRoot\n\t}\n\n\tasync execute(options: RebaseOptions = {}): Promise<void> {\n\t\t// Step 1: Validate we're in a valid iloom worktree\n\t\tlet worktreePath: string\n\t\ttry {\n\t\t\tworktreePath = await this.validateWorktreeContext()\n\t\t} catch (error) {\n\t\t\tif (error instanceof WorktreeValidationError) {\n\t\t\t\tlogger.error(error.message)\n\t\t\t\tlogger.info(error.suggestion)\n\t\t\t\tthrow error\n\t\t\t}\n\t\t\tthrow error\n\t\t}\n\n\t\tconst mergeOptions: MergeOptions = {\n\t\t\tdryRun: options.dryRun ?? false,\n\t\t\tforce: options.force ?? false,\n\t\t}\n\n\t\t// MergeManager.rebaseOnMain() handles:\n\t\t// - Checking main branch exists\n\t\t// - Detecting uncommitted changes (throws if found)\n\t\t// - Checking if already up-to-date\n\t\t// - Executing rebase\n\t\t// - Claude-assisted conflict resolution\n\t\tawait this.mergeManager.rebaseOnMain(worktreePath, mergeOptions)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAeO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EAClD,YACC,SACgB,YACf;AACD,UAAM,OAAO;AAFG;AAGhB,SAAK,OAAO;AAAA,EACb;AACD;AAgBO,IAAM,gBAAN,MAAoB;AAAA,EAK1B,YAAY,cAA6B,oBAAyC,iBAAmC;AACpH,SAAK,eAAe,gBAAgB,IAAI,aAAa;AACrD,SAAK,qBAAqB,sBAAsB,IAAI,mBAAmB;AACvE,SAAK,kBAAkB,mBAAmB,IAAI,gBAAgB;AAAA,EAC/D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAc,0BAA2C;AACxD,UAAM,aAAa,QAAQ,IAAI;AAG/B,UAAM,YAAY,MAAM,eAAe,UAAU;AACjD,QAAI,CAAC,WAAW;AACf,YAAM,IAAI;AAAA,QACT;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAGA,UAAM,WAAW,MAAM,YAAY,UAAU;AAC7C,QAAI,CAAC,UAAU;AACd,YAAM,IAAI;AAAA,QACT;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAGA,UAAM,YAAY,MAAM,KAAK,mBAAmB,cAAc;AAC9D,UAAM,kBAAkB,UAAU,KAAK,QAAM,GAAG,SAAS,QAAQ;AAEjE,QAAI,CAAC,iBAAiB;AACrB,YAAM,IAAI;AAAA,QACT;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAGA,UAAM,SAAS,MAAM,KAAK,mBAAmB,eAAe,iBAAiB,KAAK,eAAe;AACjG,QAAI,QAAQ;AACX,YAAM,IAAI;AAAA,QACT;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AAAA,EAEA,MAAM,QAAQ,UAAyB,CAAC,GAAkB;AAEzD,QAAI;AACJ,QAAI;AACH,qBAAe,MAAM,KAAK,wBAAwB;AAAA,IACnD,SAAS,OAAO;AACf,UAAI,iBAAiB,yBAAyB;AAC7C,eAAO,MAAM,MAAM,OAAO;AAC1B,eAAO,KAAK,MAAM,UAAU;AAC5B,cAAM;AAAA,MACP;AACA,YAAM;AAAA,IACP;AAEA,UAAM,eAA6B;AAAA,MAClC,QAAQ,QAAQ,UAAU;AAAA,MAC1B,OAAO,QAAQ,SAAS;AAAA,IACzB;AAQA,UAAM,KAAK,aAAa,aAAa,cAAc,YAAY;AAAA,EAChE;AACD;","names":[]}
|
|
@@ -4,10 +4,8 @@ import {
|
|
|
4
4
|
} from "./chunk-MKWYLDFK.js";
|
|
5
5
|
import "./chunk-ZM3CFL5L.js";
|
|
6
6
|
import {
|
|
7
|
-
IdentifierParser
|
|
8
|
-
|
|
9
|
-
parseEnvFile
|
|
10
|
-
} from "./chunk-IP7SMKIF.js";
|
|
7
|
+
IdentifierParser
|
|
8
|
+
} from "./chunk-OXAM2WVC.js";
|
|
11
9
|
import {
|
|
12
10
|
calculatePortForBranch
|
|
13
11
|
} from "./chunk-VU3QMIP2.js";
|
|
@@ -16,7 +14,7 @@ import {
|
|
|
16
14
|
} from "./chunk-YETJNRQM.js";
|
|
17
15
|
import {
|
|
18
16
|
GitWorktreeManager
|
|
19
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OAP6SASD.js";
|
|
20
18
|
import "./chunk-ZT3YZB4K.js";
|
|
21
19
|
import {
|
|
22
20
|
ProjectCapabilityDetector
|
|
@@ -25,12 +23,17 @@ import "./chunk-2ZPFJQ3B.js";
|
|
|
25
23
|
import {
|
|
26
24
|
extractSettingsOverrides
|
|
27
25
|
} from "./chunk-GYCR2LOU.js";
|
|
26
|
+
import {
|
|
27
|
+
extractIssueNumber
|
|
28
|
+
} from "./chunk-5NTD4MCZ.js";
|
|
28
29
|
import {
|
|
29
30
|
SettingsManager
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-UCZ24SUE.js";
|
|
31
32
|
import {
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
extractPort,
|
|
34
|
+
findEnvFileContainingVariable,
|
|
35
|
+
parseEnvFile
|
|
36
|
+
} from "./chunk-UJL4HI2R.js";
|
|
34
37
|
import {
|
|
35
38
|
logger
|
|
36
39
|
} from "./chunk-GEHQXLEI.js";
|
|
@@ -227,24 +230,34 @@ Make sure the project is built (run 'il start' first)`
|
|
|
227
230
|
logger.success("Browser opened");
|
|
228
231
|
}
|
|
229
232
|
/**
|
|
230
|
-
* Get port for workspace - reads from
|
|
233
|
+
* Get port for workspace - reads from dotenv-flow files or calculates based on workspace type
|
|
231
234
|
*/
|
|
232
235
|
async getWorkspacePort(worktreePath) {
|
|
233
236
|
var _a, _b;
|
|
234
237
|
const cliOverrides = extractSettingsOverrides();
|
|
235
238
|
const settings = await this.settingsManager.loadSettings(void 0, cliOverrides);
|
|
236
239
|
const basePort = ((_b = (_a = settings.capabilities) == null ? void 0 : _a.web) == null ? void 0 : _b.basePort) ?? 3e3;
|
|
237
|
-
const
|
|
238
|
-
|
|
240
|
+
const envFile = await findEnvFileContainingVariable(
|
|
241
|
+
worktreePath,
|
|
242
|
+
"PORT",
|
|
243
|
+
async (p) => fs.pathExists(p),
|
|
244
|
+
async (p, varName) => {
|
|
245
|
+
const content = await fs.readFile(p, "utf8");
|
|
246
|
+
const envMap = parseEnvFile(content);
|
|
247
|
+
return envMap.get(varName) ?? null;
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
if (envFile) {
|
|
251
|
+
const envPath = path.join(worktreePath, envFile);
|
|
239
252
|
const envContent = await fs.readFile(envPath, "utf8");
|
|
240
253
|
const envMap = parseEnvFile(envContent);
|
|
241
254
|
const port2 = extractPort(envMap);
|
|
242
255
|
if (port2) {
|
|
243
|
-
logger.debug(`Using PORT from
|
|
256
|
+
logger.debug(`Using PORT from ${envFile}: ${port2}`);
|
|
244
257
|
return port2;
|
|
245
258
|
}
|
|
246
259
|
}
|
|
247
|
-
logger.debug("PORT not found in
|
|
260
|
+
logger.debug("PORT not found in any dotenv-flow file, calculating from workspace identifier");
|
|
248
261
|
const worktrees = await this.gitWorktreeManager.listWorktrees();
|
|
249
262
|
const worktree = worktrees.find((wt) => wt.path === worktreePath);
|
|
250
263
|
if (!worktree) {
|
|
@@ -276,4 +289,4 @@ Make sure the project is built (run 'il start' first)`
|
|
|
276
289
|
export {
|
|
277
290
|
RunCommand
|
|
278
291
|
};
|
|
279
|
-
//# sourceMappingURL=run-
|
|
292
|
+
//# sourceMappingURL=run-SJPM6YRI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/run.ts"],"sourcesContent":["import path from 'path'\nimport fs from 'fs-extra'\nimport { execa } from 'execa'\nimport { GitWorktreeManager } from '../lib/GitWorktreeManager.js'\nimport { ProjectCapabilityDetector } from '../lib/ProjectCapabilityDetector.js'\nimport { DevServerManager } from '../lib/DevServerManager.js'\nimport { SettingsManager } from '../lib/SettingsManager.js'\nimport { IdentifierParser } from '../utils/IdentifierParser.js'\nimport { openBrowser } from '../utils/browser.js'\nimport { parseEnvFile, extractPort, findEnvFileContainingVariable } from '../utils/env.js'\nimport { calculatePortForBranch } from '../utils/port.js'\nimport { extractIssueNumber } from '../utils/git.js'\nimport { logger } from '../utils/logger.js'\nimport { extractSettingsOverrides } from '../utils/cli-overrides.js'\nimport type { GitWorktree } from '../types/worktree.js'\n\nexport interface RunCommandInput {\n\tidentifier?: string\n\targs?: string[]\n}\n\ninterface ParsedRunInput {\n\ttype: 'issue' | 'pr' | 'branch'\n\tnumber?: string | number // For issues and PRs\n\tbranchName?: string // For branches\n\toriginalInput: string\n\tautoDetected: boolean\n}\n\n/**\n * RunCommand - Runs CLI tool or opens workspace in browser\n * Priority: CLI first, Web fallback\n */\nexport class RunCommand {\n\tconstructor(\n\t\tprivate gitWorktreeManager = new GitWorktreeManager(),\n\t\tprivate capabilityDetector = new ProjectCapabilityDetector(),\n\t\tprivate identifierParser = new IdentifierParser(new GitWorktreeManager()),\n\t\tprivate devServerManager = new DevServerManager(),\n\t\tprivate settingsManager = new SettingsManager()\n\t) {}\n\n\tasync execute(input: RunCommandInput): Promise<void> {\n\t\t// 1. Parse or auto-detect identifier\n\t\tconst parsed = input.identifier\n\t\t\t? await this.parseExplicitInput(input.identifier)\n\t\t\t: await this.autoDetectFromCurrentDirectory()\n\n\t\tlogger.debug(`Parsed input: ${JSON.stringify(parsed)}`)\n\n\t\t// 2. Find worktree path based on identifier\n\t\tconst worktree = await this.findWorktreeForIdentifier(parsed)\n\n\t\tlogger.info(`Found worktree at: ${worktree.path}`)\n\n\t\t// 3. Detect project capabilities\n\t\tconst { capabilities, binEntries } =\n\t\t\tawait this.capabilityDetector.detectCapabilities(worktree.path)\n\n\t\tlogger.debug(`Detected capabilities: ${capabilities.join(', ')}`)\n\n\t\t// 4. Execute based on capabilities (CLI first, web fallback)\n\t\tif (capabilities.includes('cli')) {\n\t\t\tawait this.runCLITool(worktree.path, binEntries, input.args ?? [])\n\t\t} else if (capabilities.includes('web')) {\n\t\t\tawait this.openWebBrowser(worktree.path)\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t`No CLI or web capabilities detected for workspace at ${worktree.path}`\n\t\t\t)\n\t\t}\n\t}\n\n\t/**\n\t * Parse explicit identifier input\n\t */\n\tprivate async parseExplicitInput(identifier: string): Promise<ParsedRunInput> {\n\t\tconst parsed = await this.identifierParser.parseForPatternDetection(identifier)\n\n\t\t// Description type should never reach run command (converted in start)\n\t\tif (parsed.type === 'description') {\n\t\t\tthrow new Error('Description input type is not supported in run command')\n\t\t}\n\n\t\tconst result: ParsedRunInput = {\n\t\t\ttype: parsed.type,\n\t\t\toriginalInput: parsed.originalInput,\n\t\t\tautoDetected: false,\n\t\t}\n\n\t\tif (parsed.number !== undefined) {\n\t\t\tresult.number = parsed.number\n\t\t}\n\t\tif (parsed.branchName !== undefined) {\n\t\t\tresult.branchName = parsed.branchName\n\t\t}\n\n\t\treturn result\n\t}\n\n\t/**\n\t * Auto-detect identifier from current directory\n\t * Same logic as FinishCommand.autoDetectFromCurrentDirectory()\n\t */\n\tprivate async autoDetectFromCurrentDirectory(): Promise<ParsedRunInput> {\n\t\tconst currentDir = path.basename(process.cwd())\n\n\t\t// Check for PR worktree pattern: _pr_N suffix\n\t\tconst prPattern = /_pr_(\\d+)$/\n\t\tconst prMatch = currentDir.match(prPattern)\n\n\t\tif (prMatch?.[1]) {\n\t\t\tconst prNumber = parseInt(prMatch[1], 10)\n\t\t\tlogger.debug(`Auto-detected PR #${prNumber} from directory: ${currentDir}`)\n\t\t\treturn {\n\t\t\t\ttype: 'pr',\n\t\t\t\tnumber: prNumber,\n\t\t\t\toriginalInput: currentDir,\n\t\t\t\tautoDetected: true,\n\t\t\t}\n\t\t}\n\n\t\t// Check for issue pattern in directory\n\t\tconst issueNumber = extractIssueNumber(currentDir)\n\n\t\tif (issueNumber !== null) {\n\t\t\tlogger.debug(`Auto-detected issue #${issueNumber} from directory: ${currentDir}`)\n\t\t\treturn {\n\t\t\t\ttype: 'issue',\n\t\t\t\tnumber: issueNumber,\n\t\t\t\toriginalInput: currentDir,\n\t\t\t\tautoDetected: true,\n\t\t\t}\n\t\t}\n\n\t\t// Fallback: get current branch name\n\t\tconst repoInfo = await this.gitWorktreeManager.getRepoInfo()\n\t\tconst currentBranch = repoInfo.currentBranch\n\n\t\tif (!currentBranch) {\n\t\t\tthrow new Error(\n\t\t\t\t'Could not auto-detect identifier. Please provide an issue number, PR number, or branch name.\\n' +\n\t\t\t\t\t'Expected directory pattern: feat/issue-XX-description OR worktree with _pr_N suffix'\n\t\t\t)\n\t\t}\n\n\t\t// Try to extract issue from branch name\n\t\tconst branchIssueNumber = extractIssueNumber(currentBranch)\n\t\tif (branchIssueNumber !== null) {\n\t\t\tlogger.debug(`Auto-detected issue #${branchIssueNumber} from branch: ${currentBranch}`)\n\t\t\treturn {\n\t\t\t\ttype: 'issue',\n\t\t\t\tnumber: branchIssueNumber,\n\t\t\t\toriginalInput: currentBranch,\n\t\t\t\tautoDetected: true,\n\t\t\t}\n\t\t}\n\n\t\t// Last resort: use branch name\n\t\treturn {\n\t\t\ttype: 'branch',\n\t\t\tbranchName: currentBranch,\n\t\t\toriginalInput: currentBranch,\n\t\t\tautoDetected: true,\n\t\t}\n\t}\n\n\t/**\n\t * Find worktree for the given identifier\n\t */\n\tprivate async findWorktreeForIdentifier(parsed: ParsedRunInput): Promise<GitWorktree> {\n\t\tlet worktree: GitWorktree | null = null\n\n\t\tif (parsed.type === 'issue' && parsed.number !== undefined) {\n\t\t\tworktree = await this.gitWorktreeManager.findWorktreeForIssue(parsed.number)\n\t\t} else if (parsed.type === 'pr' && parsed.number !== undefined) {\n\t\t\t// For PRs, ensure the number is numeric (PRs are always numeric per GitHub)\n\t\t\tconst prNumber = typeof parsed.number === 'number' ? parsed.number : Number(parsed.number)\n\t\t\tif (isNaN(prNumber) || !isFinite(prNumber)) {\n\t\t\t\tthrow new Error(`Invalid PR number: ${parsed.number}. PR numbers must be numeric.`)\n\t\t\t}\n\t\t\t// Pass empty string for branch name since we don't know it yet\n\t\t\tworktree = await this.gitWorktreeManager.findWorktreeForPR(prNumber, '')\n\t\t} else if (parsed.type === 'branch' && parsed.branchName) {\n\t\t\tworktree = await this.gitWorktreeManager.findWorktreeForBranch(\n\t\t\t\tparsed.branchName\n\t\t\t)\n\t\t}\n\n\t\tif (!worktree) {\n\t\t\tthrow new Error(\n\t\t\t\t`No worktree found for ${this.formatParsedInput(parsed)}. ` +\n\t\t\t\t\t`Run 'il start ${parsed.originalInput}' to create one.`\n\t\t\t)\n\t\t}\n\n\t\treturn worktree\n\t}\n\n\t/**\n\t * Format parsed input for display\n\t */\n\tprivate formatParsedInput(parsed: ParsedRunInput): string {\n\t\tconst autoLabel = parsed.autoDetected ? ' (auto-detected)' : ''\n\n\t\tif (parsed.type === 'issue') {\n\t\t\treturn `issue #${parsed.number}${autoLabel}`\n\t\t}\n\t\tif (parsed.type === 'pr') {\n\t\t\treturn `PR #${parsed.number}${autoLabel}`\n\t\t}\n\t\treturn `branch \"${parsed.branchName}\"${autoLabel}`\n\t}\n\n\t/**\n\t * Run CLI tool directly from worktree bin path (NO SYMLINKS!)\n\t */\n\tprivate async runCLITool(\n\t\tworktreePath: string,\n\t\tbinEntries: Record<string, string>,\n\t\targs: string[]\n\t): Promise<void> {\n\t\t// Validate binEntries exist\n\t\tif (Object.keys(binEntries).length === 0) {\n\t\t\tthrow new Error('No bin entries found in package.json')\n\t\t}\n\n\t\t// Get first bin entry (deterministic)\n\t\tconst firstEntry = Object.entries(binEntries)[0]\n\t\tif (!firstEntry) {\n\t\t\tthrow new Error('No bin entries found in package.json')\n\t\t}\n\t\tconst [binName, binPath] = firstEntry\n\t\tlogger.debug(`Using bin entry: ${binName} -> ${binPath}`)\n\n\t\t// CRITICAL: Construct absolute path (NO SYMLINKS!)\n\t\tconst binFilePath = path.resolve(worktreePath, binPath)\n\t\tlogger.debug(`Resolved bin file path: ${binFilePath}`)\n\n\t\t// Verify file exists\n\t\tif (!(await fs.pathExists(binFilePath))) {\n\t\t\tthrow new Error(\n\t\t\t\t`CLI executable not found: ${binFilePath}\\n` +\n\t\t\t\t\t`Make sure the project is built (run 'il start' first)`\n\t\t\t)\n\t\t}\n\n\t\t// Execute with Node.js\n\t\tlogger.info(`Running CLI: node ${binFilePath} ${args.join(' ')}`)\n\t\tawait execa('node', [binFilePath, ...args], {\n\t\t\tstdio: 'inherit', // Allow interactive CLIs (prompts, colors, etc.)\n\t\t\tcwd: worktreePath, // Execute in worktree context\n\t\t\tenv: process.env, // Inherit environment\n\t\t})\n\t}\n\n\t/**\n\t * Open web browser with workspace URL\n\t * Auto-starts dev server if not already running\n\t */\n\tprivate async openWebBrowser(worktreePath: string): Promise<void> {\n\t\tconst port = await this.getWorkspacePort(worktreePath)\n\n\t\t// Ensure dev server is running on the port\n\t\tconst serverReady = await this.devServerManager.ensureServerRunning(\n\t\t\tworktreePath,\n\t\t\tport\n\t\t)\n\n\t\tif (!serverReady) {\n\t\t\tlogger.warn(\n\t\t\t\t`Dev server failed to start on port ${port}. Opening browser anyway...`\n\t\t\t)\n\t\t}\n\n\t\t// Construct URL and open browser\n\t\tconst url = `http://localhost:${port}`\n\t\tlogger.info(`Opening browser: ${url}`)\n\t\tawait openBrowser(url)\n\t\tlogger.success('Browser opened')\n\t}\n\n\t/**\n\t * Get port for workspace - reads from dotenv-flow files or calculates based on workspace type\n\t */\n\tprivate async getWorkspacePort(worktreePath: string): Promise<number> {\n\t\t// Load base port from settings with CLI overrides\n\t\tconst cliOverrides = extractSettingsOverrides()\n\t\tconst settings = await this.settingsManager.loadSettings(undefined, cliOverrides)\n\t\tconst basePort = settings.capabilities?.web?.basePort ?? 3000\n\n\t\t// Try to read PORT from any dotenv-flow file (as override)\n\t\tconst envFile = await findEnvFileContainingVariable(\n\t\t\tworktreePath,\n\t\t\t'PORT',\n\t\t\tasync (p) => fs.pathExists(p),\n\t\t\tasync (p, varName) => {\n\t\t\t\tconst content = await fs.readFile(p, 'utf8')\n\t\t\t\tconst envMap = parseEnvFile(content)\n\t\t\t\treturn envMap.get(varName) ?? null\n\t\t\t}\n\t\t)\n\n\t\tif (envFile) {\n\t\t\tconst envPath = path.join(worktreePath, envFile)\n\t\t\tconst envContent = await fs.readFile(envPath, 'utf8')\n\t\t\tconst envMap = parseEnvFile(envContent)\n\t\t\tconst port = extractPort(envMap)\n\n\t\t\tif (port) {\n\t\t\t\tlogger.debug(`Using PORT from ${envFile}: ${port}`)\n\t\t\t\treturn port\n\t\t\t}\n\t\t}\n\n\t\t// PORT not in any dotenv-flow file, calculate based on workspace identifier\n\t\tlogger.debug('PORT not found in any dotenv-flow file, calculating from workspace identifier')\n\n\t\t// Get worktree to determine type\n\t\tconst worktrees = await this.gitWorktreeManager.listWorktrees()\n\t\tconst worktree = worktrees.find(wt => wt.path === worktreePath)\n\n\t\tif (!worktree) {\n\t\t\tthrow new Error(`Could not find worktree for path: ${worktreePath}`)\n\t\t}\n\n\t\t// Extract identifier from worktree path/branch\n\t\tconst dirName = path.basename(worktreePath)\n\n\t\t// Check for PR pattern: _pr_N\n\t\tconst prPattern = /_pr_(\\d+)$/\n\t\tconst prMatch = dirName.match(prPattern)\n\t\tif (prMatch?.[1]) {\n\t\t\tconst prNumber = parseInt(prMatch[1], 10)\n\t\t\tconst port = basePort + prNumber\n\t\t\tlogger.debug(`Calculated PORT for PR #${prNumber}: ${port}`)\n\t\t\treturn port\n\t\t}\n\n\t\t// Check for issue pattern: issue-N\n\t\tconst issueId = extractIssueNumber(dirName) ?? extractIssueNumber(worktree.branch)\n\t\tif (issueId !== null) {\n\t\t\tconst issueNumber = parseInt(issueId, 10)\n\t\t\tif (!isNaN(issueNumber)) {\n\t\t\t\tconst port = basePort + issueNumber\n\t\t\t\tlogger.debug(`Calculated PORT for issue #${issueId}: ${port}`)\n\t\t\t\treturn port\n\t\t\t}\n\t\t\t// For alphanumeric IDs, fall through to branch-based hash\n\t\t}\n\n\t\t// Branch-based workspace - use deterministic hash\n\t\tconst port = calcul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O,KAAK,mBAAmB,SAAS,MAAM;AACjF,QAAI,YAAY,MAAM;AACrB,YAAM,cAAc,SAAS,SAAS,EAAE;AACxC,UAAI,CAAC,MAAM,WAAW,GAAG;AACxB,cAAMA,QAAO,WAAW;AACxB,eAAO,MAAM,8BAA8B,OAAO,KAAKA,KAAI,EAAE;AAC7D,eAAOA;AAAA,MACR;AAAA,IAED;AAGA,UAAM,OAAO,uBAAuB,SAAS,QAAQ,QAAQ;AAC7D,WAAO,MAAM,+BAA+B,SAAS,MAAM,MAAM,IAAI,EAAE;AACvE,WAAO;AAAA,EACR;AACD;","names":["port"]}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"sourceEnvOnStart": {
|
|
13
13
|
"type": "boolean",
|
|
14
14
|
"default": false,
|
|
15
|
-
"description": "Source .env
|
|
15
|
+
"description": "Source all dotenv-flow files (.env, .env.local, .env.development, .env.development.local) when launching terminal processes (Claude, dev server, terminal). Files are sourced in precedence order so later files override earlier ones. NOTE TO AI AGENTS: Before making changes to settings files, YOU MUST OFFER to check .env file compatibility. WARNING: Unquoted values in .env files may break sourcing in bash/zsh shells. Before enabling, verify ALL your .env.* files do not contain unquoted special characters (e.g., database URLs with ?, &, or other shell metacharacters). Shell compatibility issues may cause processes to fail or behave unexpectedly."
|
|
16
16
|
},
|
|
17
17
|
"worktreePrefix": {
|
|
18
18
|
"type": "string",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"startAiAgent": {
|
|
60
60
|
"type": "boolean",
|
|
61
61
|
"default": true,
|
|
62
|
-
"description": "Launch Claude
|
|
62
|
+
"description": "Launch Claude Code agent when starting this workflow type"
|
|
63
63
|
},
|
|
64
64
|
"startTerminal": {
|
|
65
65
|
"type": "boolean",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"startAiAgent": {
|
|
100
100
|
"type": "boolean",
|
|
101
101
|
"default": true,
|
|
102
|
-
"description": "Launch Claude
|
|
102
|
+
"description": "Launch Claude Code agent when starting this workflow type"
|
|
103
103
|
},
|
|
104
104
|
"startTerminal": {
|
|
105
105
|
"type": "boolean",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"startAiAgent": {
|
|
140
140
|
"type": "boolean",
|
|
141
141
|
"default": true,
|
|
142
|
-
"description": "Launch Claude
|
|
142
|
+
"description": "Launch Claude Code agent when starting this workflow type"
|
|
143
143
|
},
|
|
144
144
|
"startTerminal": {
|
|
145
145
|
"type": "boolean",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
SettingsManager
|
|
4
|
-
} from "./chunk-ML3NRPNB.js";
|
|
5
2
|
import {
|
|
6
3
|
findMainWorktreePath
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5NTD4MCZ.js";
|
|
5
|
+
import {
|
|
6
|
+
SettingsManager
|
|
7
|
+
} from "./chunk-UCZ24SUE.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
10
|
} from "./chunk-GEHQXLEI.js";
|
|
@@ -49,4 +49,4 @@ var TestGitCommand = class {
|
|
|
49
49
|
export {
|
|
50
50
|
TestGitCommand
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=test-git-
|
|
52
|
+
//# sourceMappingURL=test-git-DEUE656D.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
SettingsManager
|
|
4
|
-
} from "./chunk-ML3NRPNB.js";
|
|
5
2
|
import {
|
|
6
3
|
generateWorktreePath
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5NTD4MCZ.js";
|
|
5
|
+
import {
|
|
6
|
+
SettingsManager
|
|
7
|
+
} from "./chunk-UCZ24SUE.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
10
|
} from "./chunk-GEHQXLEI.js";
|
|
@@ -65,4 +65,4 @@ var TestPrefixCommand = class {
|
|
|
65
65
|
export {
|
|
66
66
|
TestPrefixCommand
|
|
67
67
|
};
|
|
68
|
-
//# sourceMappingURL=test-prefix-
|
|
68
|
+
//# sourceMappingURL=test-prefix-Y6Z6ZHSF.js.map
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
detectITerm2,
|
|
4
4
|
openMultipleTerminalWindows
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RW54ZMBM.js";
|
|
6
|
+
import "./chunk-UJL4HI2R.js";
|
|
6
7
|
import {
|
|
7
8
|
logger
|
|
8
9
|
} from "./chunk-GEHQXLEI.js";
|
|
@@ -66,4 +67,4 @@ var TestTabsCommand = class {
|
|
|
66
67
|
export {
|
|
67
68
|
TestTabsCommand
|
|
68
69
|
};
|
|
69
|
-
//# sourceMappingURL=test-tabs-
|
|
70
|
+
//# sourceMappingURL=test-tabs-PRMRSHKI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/test-tabs.ts"],"sourcesContent":["import { logger } from '../utils/logger.js'\nimport { openMultipleTerminalWindows, detectITerm2 } from '../utils/terminal.js'\n\n/**\n * Input structure for TestTabsCommand.execute()\n */\nexport interface TestTabsCommandInput {\n options: Record<string, never>\n}\n\n/**\n * Test command to verify the iTerm2 multiple tab functionality\n * Opens three tabs with the same background color and runs simple test commands\n */\nexport class TestTabsCommand {\n /**\n * Main entry point for the test-tabs command\n * Opens multiple terminal tabs with test commands\n */\n public async execute(): Promise<void> {\n try {\n logger.info('Testing iTerm2 Multiple Tab Integration\\n')\n\n // Check if iTerm2 is available\n const hasITerm2 = await detectITerm2()\n\n if (!hasITerm2) {\n logger.warn('iTerm2 not detected. This command works best with iTerm2 installed.')\n logger.info('Falling back to Terminal.app with separate windows...\\n')\n } else {\n logger.info('iTerm2 detected. Opening multiple tabs in single window...\\n')\n }\n\n // Define test background color (light blue)\n const backgroundColor = { r: 235, g: 235, b: 250 }\n\n // Open multiple terminal tabs with test commands\n logger.info('Opening tabs with test commands...')\n\n await openMultipleTerminalWindows([\n {\n workspacePath: process.cwd(),\n command: 'echo \"Tab 1 test\" && echo \"Current directory: $(pwd)\"',\n backgroundColor,\n title: 'Test Tab 1'\n },\n {\n workspacePath: process.cwd(),\n command: 'echo \"Tab 2 test\" && echo \"Current directory: $(pwd)\"',\n backgroundColor,\n title: 'Test Tab 2'\n },\n {\n workspacePath: process.cwd(),\n command: 'echo \"Tab 3 test\" && echo \"Current directory: $(pwd)\"',\n backgroundColor,\n title: 'Test Tab 3'\n }\n ])\n\n logger.success('\\nMultiple tabs opened successfully!')\n logger.info('Check the terminal windows/tabs to verify:')\n logger.info(' - Three tabs/windows are open')\n logger.info(' - All have the same light blue background color')\n logger.info(' - Tab 1 shows \"Tab 1 test\"')\n logger.info(' - Tab 2 shows \"Tab 2 test\"')\n logger.info(' - Tab 3 shows \"Tab 3 test\"')\n logger.info(' - All show the current directory')\n\n } catch (error) {\n if (error instanceof Error) {\n logger.error(`Test failed: ${error.message}`)\n } else {\n logger.error('Test failed with unknown error')\n }\n throw error\n }\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/commands/test-tabs.ts"],"sourcesContent":["import { logger } from '../utils/logger.js'\nimport { openMultipleTerminalWindows, detectITerm2 } from '../utils/terminal.js'\n\n/**\n * Input structure for TestTabsCommand.execute()\n */\nexport interface TestTabsCommandInput {\n options: Record<string, never>\n}\n\n/**\n * Test command to verify the iTerm2 multiple tab functionality\n * Opens three tabs with the same background color and runs simple test commands\n */\nexport class TestTabsCommand {\n /**\n * Main entry point for the test-tabs command\n * Opens multiple terminal tabs with test commands\n */\n public async execute(): Promise<void> {\n try {\n logger.info('Testing iTerm2 Multiple Tab Integration\\n')\n\n // Check if iTerm2 is available\n const hasITerm2 = await detectITerm2()\n\n if (!hasITerm2) {\n logger.warn('iTerm2 not detected. This command works best with iTerm2 installed.')\n logger.info('Falling back to Terminal.app with separate windows...\\n')\n } else {\n logger.info('iTerm2 detected. Opening multiple tabs in single window...\\n')\n }\n\n // Define test background color (light blue)\n const backgroundColor = { r: 235, g: 235, b: 250 }\n\n // Open multiple terminal tabs with test commands\n logger.info('Opening tabs with test commands...')\n\n await openMultipleTerminalWindows([\n {\n workspacePath: process.cwd(),\n command: 'echo \"Tab 1 test\" && echo \"Current directory: $(pwd)\"',\n backgroundColor,\n title: 'Test Tab 1'\n },\n {\n workspacePath: process.cwd(),\n command: 'echo \"Tab 2 test\" && echo \"Current directory: $(pwd)\"',\n backgroundColor,\n title: 'Test Tab 2'\n },\n {\n workspacePath: process.cwd(),\n command: 'echo \"Tab 3 test\" && echo \"Current directory: $(pwd)\"',\n backgroundColor,\n title: 'Test Tab 3'\n }\n ])\n\n logger.success('\\nMultiple tabs opened successfully!')\n logger.info('Check the terminal windows/tabs to verify:')\n logger.info(' - Three tabs/windows are open')\n logger.info(' - All have the same light blue background color')\n logger.info(' - Tab 1 shows \"Tab 1 test\"')\n logger.info(' - Tab 2 shows \"Tab 2 test\"')\n logger.info(' - Tab 3 shows \"Tab 3 test\"')\n logger.info(' - All show the current directory')\n\n } catch (error) {\n if (error instanceof Error) {\n logger.error(`Test failed: ${error.message}`)\n } else {\n logger.error('Test failed with unknown error')\n }\n throw error\n }\n }\n}\n"],"mappings":";;;;;;;;;;;AAcO,IAAM,kBAAN,MAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,EAK3B,MAAa,UAAyB;AACpC,QAAI;AACF,aAAO,KAAK,2CAA2C;AAGvD,YAAM,YAAY,MAAM,aAAa;AAErC,UAAI,CAAC,WAAW;AACd,eAAO,KAAK,qEAAqE;AACjF,eAAO,KAAK,yDAAyD;AAAA,MACvE,OAAO;AACL,eAAO,KAAK,8DAA8D;AAAA,MAC5E;AAGA,YAAM,kBAAkB,EAAE,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI;AAGjD,aAAO,KAAK,oCAAoC;AAEhD,YAAM,4BAA4B;AAAA,QAChC;AAAA,UACE,eAAe,QAAQ,IAAI;AAAA,UAC3B,SAAS;AAAA,UACT;AAAA,UACA,OAAO;AAAA,QACT;AAAA,QACA;AAAA,UACE,eAAe,QAAQ,IAAI;AAAA,UAC3B,SAAS;AAAA,UACT;AAAA,UACA,OAAO;AAAA,QACT;AAAA,QACA;AAAA,UACE,eAAe,QAAQ,IAAI;AAAA,UAC3B,SAAS;AAAA,UACT;AAAA,UACA,OAAO;AAAA,QACT;AAAA,MACF,CAAC;AAED,aAAO,QAAQ,sCAAsC;AACrD,aAAO,KAAK,4CAA4C;AACxD,aAAO,KAAK,iCAAiC;AAC7C,aAAO,KAAK,mDAAmD;AAC/D,aAAO,KAAK,8BAA8B;AAC1C,aAAO,KAAK,8BAA8B;AAC1C,aAAO,KAAK,8BAA8B;AAC1C,aAAO,KAAK,oCAAoC;AAAA,IAElD,SAAS,OAAO;AACd,UAAI,iBAAiB,OAAO;AAC1B,eAAO,MAAM,gBAAgB,MAAM,OAAO,EAAE;AAAA,MAC9C,OAAO;AACL,eAAO,MAAM,gCAAgC;AAAA,MAC/C;AACA,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iloom/cli",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Control plane for maintaining alignment between you and Claude
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"description": "Control plane for maintaining alignment between you and Claude Code as you work across multiple issues using isolated environments, visible context, and multi-agent workflows to scale understanding, not just output",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
7
7
|
"claude",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
ClaudeContextManager
|
|
4
|
-
} from "./chunk-C5QCTEQK.js";
|
|
5
|
-
import "./chunk-FIAT22G7.js";
|
|
6
|
-
import "./chunk-XXV3UFZL.js";
|
|
7
|
-
import "./chunk-WEN5C5DM.js";
|
|
8
|
-
import "./chunk-ML3NRPNB.js";
|
|
9
|
-
import "./chunk-GEHQXLEI.js";
|
|
10
|
-
export {
|
|
11
|
-
ClaudeContextManager
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=ClaudeContextManager-MUQSDY2E.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
ClaudeService
|
|
4
|
-
} from "./chunk-FIAT22G7.js";
|
|
5
|
-
import "./chunk-XXV3UFZL.js";
|
|
6
|
-
import "./chunk-WEN5C5DM.js";
|
|
7
|
-
import "./chunk-ML3NRPNB.js";
|
|
8
|
-
import "./chunk-GEHQXLEI.js";
|
|
9
|
-
export {
|
|
10
|
-
ClaudeService
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=ClaudeService-HG4VQ7AW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/LoomLauncher.ts","../src/utils/ide.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { openTerminalWindow, openMultipleTerminalWindows } from '../utils/terminal.js'\nimport type { TerminalWindowOptions } from '../utils/terminal.js'\nimport { openIdeWindow } from '../utils/ide.js'\nimport { getDevServerLaunchCommand } from '../utils/dev-server.js'\nimport { generateColorFromBranchName } from '../utils/color.js'\nimport { logger } from '../utils/logger.js'\nimport { ClaudeContextManager } from './ClaudeContextManager.js'\nimport type { SettingsManager } from './SettingsManager.js'\nimport type { Capability } from '../types/loom.js'\n\nexport interface LaunchLoomOptions {\n\tenableClaude: boolean\n\tenableCode: boolean\n\tenableDevServer: boolean\n\tenableTerminal: boolean\n\tworktreePath: string\n\tbranchName: string\n\tport?: number\n\tcapabilities: Capability[]\n\tworkflowType: 'issue' | 'pr' | 'regular'\n\tidentifier: string | number\n\ttitle?: string\n\toneShot?: import('../types/index.js').OneShotMode\n\tsetArguments?: string[] // Raw --set arguments to forward\n\texecutablePath?: string // Executable path to use for spin command\n\tsourceEnvOnStart?: boolean // defaults to false if undefined\n}\n\n/**\n * LoomLauncher orchestrates opening loom components\n */\nexport class LoomLauncher {\n\tprivate claudeContext: ClaudeContextManager\n\tprivate settings?: SettingsManager\n\n\tconstructor(claudeContext?: ClaudeContextManager, settings?: SettingsManager) {\n\t\tthis.claudeContext = claudeContext ?? new ClaudeContextManager()\n\t\tif (settings !== undefined) {\n\t\t\tthis.settings = settings\n\t\t}\n\t}\n\n\t/**\n\t * Launch loom components based on individual flags\n\t */\n\tasync launchLoom(options: LaunchLoomOptions): Promise<void> {\n\t\tconst { enableClaude, enableCode, enableDevServer, enableTerminal } = options\n\n\t\tlogger.debug(`Launching loom components: Claude=${enableClaude}, Code=${enableCode}, DevServer=${enableDevServer}, Terminal=${enableTerminal}`)\n\n\t\tconst launchPromises: Promise<void>[] = []\n\n\t\t// Launch VSCode if enabled\n\t\tif (enableCode) {\n\t\t\tlogger.debug('Launching VSCode')\n\t\t\tlaunchPromises.push(this.launchVSCode(options))\n\t\t}\n\n\t\t// Build array of terminals to launch\n\t\tconst terminalsToLaunch: Array<{\n\t\t\ttype: 'claude' | 'devServer' | 'terminal'\n\t\t\toptions: TerminalWindowOptions\n\t\t}> = []\n\n\t\tif (enableDevServer) {\n\t\t\tterminalsToLaunch.push({\n\t\t\t\ttype: 'devServer',\n\t\t\t\toptions: await this.buildDevServerTerminalOptions(options),\n\t\t\t})\n\t\t}\n\n\t\tif (enableTerminal) {\n\t\t\tterminalsToLaunch.push({\n\t\t\t\ttype: 'terminal',\n\t\t\t\toptions: this.buildStandaloneTerminalOptions(options),\n\t\t\t})\n\t\t}\n\n\t\tif (enableClaude) {\n\t\t\tterminalsToLaunch.push({\n\t\t\t\ttype: 'claude',\n\t\t\t\toptions: await this.buildClaudeTerminalOptions(options),\n\t\t\t})\n\t\t}\n\n\t\t// Launch terminals based on count\n\t\tif (terminalsToLaunch.length > 1) {\n\t\t\t// Multiple terminals - launch as tabs in single window\n\t\t\tlogger.debug(`Launching ${terminalsToLaunch.length} terminals in single window`)\n\t\t\tlaunchPromises.push(this.launchMultipleTerminals(terminalsToLaunch, options))\n\t\t} else if (terminalsToLaunch.length === 1) {\n\t\t\t// Single terminal - launch standalone\n\t\t\tconst terminal = terminalsToLaunch[0]\n\t\t\tif (!terminal) {\n\t\t\t\tthrow new Error('Terminal configuration is undefined')\n\t\t\t}\n\t\t\tconst terminalType = terminal.type\n\t\t\tlogger.debug(`Launching single ${terminalType} terminal`)\n\n\t\t\tif (terminalType === 'claude') {\n\t\t\t\tlaunchPromises.push(this.launchClaudeTerminal(options))\n\t\t\t} else if (terminalType === 'devServer') {\n\t\t\t\tlaunchPromises.push(this.launchDevServerTerminal(options))\n\t\t\t} else {\n\t\t\t\tlaunchPromises.push(this.launchStandaloneTerminal(options))\n\t\t\t}\n\t\t}\n\n\t\t// Wait for all components to launch\n\t\tawait Promise.all(launchPromises)\n\n\t\tlogger.success('loom launched successfully')\n\t}\n\n\t/**\n\t * Launch IDE (VSCode or configured alternative)\n\t */\n\tprivate async launchVSCode(options: LaunchLoomOptions): Promise<void> {\n\t\tconst ideConfig = await this.settings?.loadSettings().then((s) => s.ide)\n\t\tawait openIdeWindow(options.worktreePath, ideConfig)\n\t\tlogger.info('IDE opened')\n\t}\n\n\t/**\n\t * Launch Claude terminal\n\t */\n\tprivate async launchClaudeTerminal(options: LaunchLoomOptions): Promise<void> {\n\t\tawait this.claudeContext.launchWithContext({\n\t\t\tworkspacePath: options.worktreePath,\n\t\t\ttype: options.workflowType,\n\t\t\tidentifier: options.identifier,\n\t\t\tbranchName: options.branchName,\n\t\t\t...(options.title && { title: options.title }),\n\t\t\t...(options.port !== undefined && { port: options.port }),\n\t\t\toneShot: options.oneShot ?? 'default',\n\t\t\t...(options.setArguments && { setArguments: options.setArguments }),\n\t\t\t...(options.executablePath && { executablePath: options.executablePath }),\n\t\t})\n\t\tlogger.info('Claude terminal opened')\n\t}\n\n\t/**\n\t * Launch dev server terminal\n\t */\n\tprivate async launchDevServerTerminal(options: LaunchLoomOptions): Promise<void> {\n\t\tconst colorData = generateColorFromBranchName(options.branchName)\n\t\tconst devServerCommand = await getDevServerLaunchCommand(\n\t\t\toptions.worktreePath,\n\t\t\toptions.port,\n\t\t\toptions.capabilities\n\t\t)\n\n\t\tawait openTerminalWindow({\n\t\t\tworkspacePath: options.worktreePath,\n\t\t\tcommand: devServerCommand,\n\t\t\tbackgroundColor: colorData.rgb,\n\t\t\tincludeEnvSetup: (options.sourceEnvOnStart ?? false) && existsSync(join(options.worktreePath, '.env')),\n\t\t\tincludePortExport: options.capabilities.includes('web'),\n\t\t\t...(options.port !== undefined && { port: options.port }),\n\t\t})\n\t\tlogger.info('Dev server terminal opened')\n\t}\n\n\t/**\n\t * Launch standalone terminal (no command, just workspace with env vars)\n\t */\n\tprivate async launchStandaloneTerminal(options: LaunchLoomOptions): Promise<void> {\n\t\tconst colorData = generateColorFromBranchName(options.branchName)\n\n\t\tawait openTerminalWindow({\n\t\t\tworkspacePath: options.worktreePath,\n\t\t\tbackgroundColor: colorData.rgb,\n\t\t\tincludeEnvSetup: (options.sourceEnvOnStart ?? false) && existsSync(join(options.worktreePath, '.env')),\n\t\t\tincludePortExport: options.capabilities.includes('web'),\n\t\t\t...(options.port !== undefined && { port: options.port }),\n\t\t})\n\t\tlogger.info('Standalone terminal opened')\n\t}\n\n\t/**\n\t * Build terminal options for Claude\n\t */\n\tprivate async buildClaudeTerminalOptions(\n\t\toptions: LaunchLoomOptions\n\t): Promise<TerminalWindowOptions> {\n\t\tconst colorData = generateColorFromBranchName(options.branchName)\n\t\tconst hasEnvFile = existsSync(join(options.worktreePath, '.env'))\n\t\tconst claudeTitle = `Claude - ${this.formatIdentifier(options.workflowType, options.identifier)}`\n\n\t\tconst executable = options.executablePath ?? 'iloom'\n\t\tlet claudeCommand = `${executable} spin`\n\t\tif (options.oneShot !== undefined && options.oneShot !== 'default') {\n\t\t\tclaudeCommand += ` --one-shot=${options.oneShot}`\n\t\t}\n\t\tif (options.setArguments && options.setArguments.length > 0) {\n\t\t\tfor (const setArg of options.setArguments) {\n\t\t\t\tclaudeCommand += ` --set ${setArg}`\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tworkspacePath: options.worktreePath,\n\t\t\tcommand: claudeCommand,\n\t\t\tbackgroundColor: colorData.rgb,\n\t\t\ttitle: claudeTitle,\n\t\t\tincludeEnvSetup: (options.sourceEnvOnStart ?? false) && hasEnvFile,\n\t\t\t...(options.port !== undefined && { port: options.port, includePortExport: true }),\n\t\t}\n\t}\n\n\t/**\n\t * Build terminal options for dev server\n\t */\n\tprivate async buildDevServerTerminalOptions(\n\t\toptions: LaunchLoomOptions\n\t): Promise<TerminalWindowOptions> {\n\t\tconst colorData = generateColorFromBranchName(options.branchName)\n\t\tconst devServerCommand = await getDevServerLaunchCommand(\n\t\t\toptions.worktreePath,\n\t\t\toptions.port,\n\t\t\toptions.capabilities\n\t\t)\n\t\tconst hasEnvFile = existsSync(join(options.worktreePath, '.env'))\n\t\tconst devServerTitle = `Dev Server - ${this.formatIdentifier(options.workflowType, options.identifier)}`\n\n\t\treturn {\n\t\t\tworkspacePath: options.worktreePath,\n\t\t\tcommand: devServerCommand,\n\t\t\tbackgroundColor: colorData.rgb,\n\t\t\ttitle: devServerTitle,\n\t\t\tincludeEnvSetup: (options.sourceEnvOnStart ?? false) && hasEnvFile,\n\t\t\tincludePortExport: options.capabilities.includes('web'),\n\t\t\t...(options.port !== undefined && { port: options.port }),\n\t\t}\n\t}\n\n\t/**\n\t * Build terminal options for standalone terminal (no command)\n\t */\n\tprivate buildStandaloneTerminalOptions(\n\t\toptions: LaunchLoomOptions\n\t): TerminalWindowOptions {\n\t\tconst colorData = generateColorFromBranchName(options.branchName)\n\t\tconst hasEnvFile = existsSync(join(options.worktreePath, '.env'))\n\t\tconst terminalTitle = `Terminal - ${this.formatIdentifier(options.workflowType, options.identifier)}`\n\n\t\treturn {\n\t\t\tworkspacePath: options.worktreePath,\n\t\t\tbackgroundColor: colorData.rgb,\n\t\t\ttitle: terminalTitle,\n\t\t\tincludeEnvSetup: (options.sourceEnvOnStart ?? false) && hasEnvFile,\n\t\t\tincludePortExport: options.capabilities.includes('web'),\n\t\t\t...(options.port !== undefined && { port: options.port }),\n\t\t}\n\t}\n\n\t/**\n\t * Launch multiple terminals (2+) as tabs in single window\n\t */\n\tprivate async launchMultipleTerminals(\n\t\tterminals: Array<{ type: string; options: TerminalWindowOptions }>,\n\t\t_options: LaunchLoomOptions\n\t): Promise<void> {\n\t\tconst terminalOptions = terminals.map((t) => t.options)\n\n\t\tawait openMultipleTerminalWindows(terminalOptions)\n\n\t\tconst terminalTypes = terminals.map((t) => t.type).join(' + ')\n\t\tlogger.info(`Multiple terminals opened: ${terminalTypes}`)\n\t}\n\n\t/**\n\t * Format identifier for terminal tab titles\n\t */\n\tprivate formatIdentifier(workflowType: 'issue' | 'pr' | 'regular', identifier: string | number): string {\n\t\tif (workflowType === 'issue') {\n\t\t\treturn `Issue #${identifier}`\n\t\t} else if (workflowType === 'pr') {\n\t\t\treturn `PR #${identifier}`\n\t\t} else {\n\t\t\treturn `Branch: ${identifier}`\n\t\t}\n\t}\n}\n","import { execa } from 'execa'\nimport { logger } from './logger.js'\nimport type { IdeSettings } from '../lib/SettingsManager.js'\n\n// IDE preset configuration\nconst IDE_PRESETS = {\n\tvscode: { command: 'code', name: 'Visual Studio Code', args: [] },\n\tcursor: { command: 'cursor', name: 'Cursor', args: [] },\n\twebstorm: { command: 'webstorm', name: 'WebStorm', args: ['--nosplash'] },\n\tsublime: { command: 'subl', name: 'Sublime Text', args: [] },\n\tintellij: { command: 'idea', name: 'IntelliJ IDEA', args: ['--nosplash'] },\n\twindsurf: { command: 'surf', name: 'Windsurf', args: [] },\n} as const\n\ntype IdePreset = keyof typeof IDE_PRESETS\n\n// Resolve IDE configuration to command and args\nexport function getIdeConfig(ideSettings?: IdeSettings): {\n\tcommand: string\n\targs: string[]\n\tname: string\n} {\n\t// Default to vscode if not configured\n\tconst type = ideSettings?.type ?? 'vscode'\n\n\tconst preset = IDE_PRESETS[type as IdePreset]\n\treturn {\n\t\tcommand: preset.command,\n\t\targs: [...preset.args],\n\t\tname: preset.name,\n\t}\n}\n\n// Check if IDE is available\nexport async function isIdeAvailable(command: string): Promise<boolean> {\n\ttry {\n\t\tawait execa('command', ['-v', command], { shell: true, timeout: 5000 })\n\t\treturn true\n\t} catch {\n\t\treturn false\n\t}\n}\n\n// Get installation hint for IDE\nfunction getInstallHint(type: string): string {\n\tconst hints: Record<string, string> = {\n\t\tvscode:\n\t\t\t'Install command-line tools: Open VSCode > Command Palette > \"Shell Command: Install \\'code\\' command in PATH\"',\n\t\tcursor:\n\t\t\t'Install command-line tools: Open Cursor > Command Palette > \"Install \\'cursor\\' command in PATH\"',\n\t\twebstorm: 'Install via JetBrains Toolbox > Settings > Shell Scripts > Enable',\n\t\tsublime:\n\t\t\t'Create symlink: ln -s \"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl\" /usr/local/bin/subl',\n\t\tintellij: 'Install via JetBrains Toolbox > Settings > Shell Scripts > Enable',\n\t\twindsurf:\n\t\t\t'Install command-line tools during Windsurf installation or create symlink manually',\n\t}\n\treturn hints[type] ?? `Ensure the IDE command is available in your PATH`\n}\n\n// Open IDE window for workspace\nexport async function openIdeWindow(\n\tworkspacePath: string,\n\tideSettings?: IdeSettings\n): Promise<void> {\n\tconst config = getIdeConfig(ideSettings)\n\tconst available = await isIdeAvailable(config.command)\n\n\tif (!available) {\n\t\tconst type = ideSettings?.type ?? 'vscode'\n\t\tthrow new Error(\n\t\t\t`${config.name} is not available. The \"${config.command}\" command was not found in PATH.\\n` +\n\t\t\t\tgetInstallHint(type)\n\t\t)\n\t}\n\n\ttry {\n\t\tawait execa(config.command, [...config.args, workspacePath])\n\t\tlogger.debug(`Opened ${config.name} for workspace: ${workspacePath}`)\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Failed to open ${config.name}: ${error instanceof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,MACtD,GAAI,QAAQ,SAAS,UAAa,EAAE,MAAM,QAAQ,KAAK;AAAA,IACxD;AAAA,EACD;AAAA;AAAA;AAAA;AAAA,EAKQ,+BACP,SACwB;AACxB,UAAM,YAAY,4BAA4B,QAAQ,UAAU;AAChE,UAAM,aAAa,WAAW,KAAK,QAAQ,cAAc,MAAM,CAAC;AAChE,UAAM,gBAAgB,cAAc,KAAK,iBAAiB,QAAQ,cAAc,QAAQ,UAAU,CAAC;AAEnG,WAAO;AAAA,MACN,eAAe,QAAQ;AAAA,MACvB,iBAAiB,UAAU;AAAA,MAC3B,OAAO;AAAA,MACP,kBAAkB,QAAQ,oBAAoB,UAAU;AAAA,MACxD,mBAAmB,QAAQ,aAAa,SAAS,KAAK;AAAA,MACtD,GAAI,QAAQ,SAAS,UAAa,EAAE,MAAM,QAAQ,KAAK;AAAA,IACxD;AAAA,EACD;AAAA;AAAA;AAAA;AAAA,EAKA,MAAc,wBACb,WACA,UACgB;AAChB,UAAM,kBAAkB,UAAU,IAAI,CAAC,MAAM,EAAE,OAAO;AAEtD,UAAM,4BAA4B,eAAe;AAEjD,UAAM,gBAAgB,UAAU,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,KAAK;AAC7D,WAAO,KAAK,8BAA8B,aAAa,EAAE;AAAA,EAC1D;AAAA;AAAA;AAAA;AAAA,EAKQ,iBAAiB,cAA0C,YAAqC;AACvG,QAAI,iBAAiB,SAAS;AAC7B,aAAO,UAAU,UAAU;AAAA,IAC5B,WAAW,iBAAiB,MAAM;AACjC,aAAO,OAAO,UAAU;AAAA,IACzB,OAAO;AACN,aAAO,WAAW,UAAU;AAAA,IAC7B;AAAA,EACD;AACD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/BranchNamingService.ts"],"sourcesContent":["import type { BranchNameStrategy, BranchGenerationOptions } from '../types/branch-naming.js'\nimport { logger } from '../utils/logger.js'\n\n// ============================================\n// Strategy Classes\n// ============================================\n\n/**\n * Simple branch naming strategy\n * Format: feat/issue-{number}__{slug}\n */\nexport class SimpleBranchNameStrategy implements BranchNameStrategy {\n\tasync generate(issueNumber: string | number, title: string): Promise<string> {\n\t\t// Create a simple slug from the title\n\t\tconst slug = title\n\t\t\t.toLowerCase()\n\t\t\t.replace(/[^a-z0-9]+/g, '-')\n\t\t\t.replace(/^-|-$/g, '')\n\t\t\t.substring(0, 20) // Keep it short for the simple strategy\n\n\t\treturn `feat/issue-${issueNumber}__${slug}`\n\t}\n}\n\n/**\n * Claude AI-powered branch naming strategy\n * Uses Claude CLI to generate semantic branch names\n */\nexport class ClaudeBranchNameStrategy implements BranchNameStrategy {\n\tconstructor(private claudeModel = 'haiku') {}\n\n\tasync generate(issueNumber: string | number, title: string): Promise<string> {\n\t\t// Dynamic import to allow mocking in tests\n\t\tconst { generateBranchName } = await import('../utils/claude.js')\n\t\treturn generateBranchName(title, issueNumber, this.claudeModel)\n\t}\n}\n\n// ============================================\n// Service Interface and Implementation\n// ============================================\n\n/**\n * Service interface for branch name generation\n * Provides strategy management and generation capabilities\n */\nexport interface BranchNamingService {\n\tgenerateBranchName(options: BranchGenerationOptions): Promise<string>\n\tsetDefaultStrategy(strategy: BranchNameStrategy): void\n\tgetDefaultStrategy(): BranchNameStrategy\n}\n\n/**\n * Default implementation of BranchNamingService\n * Supports multiple naming strategies with configurable defaults\n */\nexport class DefaultBranchNamingService implements BranchNamingService {\n\tprivate defaultStrategy: BranchNameStrategy\n\n\tconstructor(options?: {\n\t\tstrategy?: BranchNameStrategy\n\t\tuseClaude?: boolean\n\t\tclaudeModel?: string\n\t}) {\n\t\t// Set up default strategy based on options\n\t\tif (options?.strategy) {\n\t\t\tthis.defaultStrategy = options.strategy\n\t\t} else if (options?.useClaude !== false) {\n\t\t\tthis.defaultStrategy = new ClaudeBranchNameStrategy(options?.claudeModel)\n\t\t} else {\n\t\t\tthis.defaultStrategy = new SimpleBranchNameStrategy()\n\t\t}\n\t}\n\n\tasync generateBranchName(options: BranchGenerationOptions): Promise<string> {\n\t\tconst { issueNumber, title, strategy } = options\n\n\t\t// Use provided strategy or fall back to default\n\t\tconst nameStrategy = strategy ?? this.defaultStrategy\n\n\t\tlogger.debug('Generating branch name', {\n\t\t\tissueNumber,\n\t\t\ttitle,\n\t\t\tstrategy: nameStrategy.constructor.name,\n\t\t})\n\n\t\treturn nameStrategy.generate(issueNumber, title)\n\t}\n\n\tsetDefaultStrategy(strategy: BranchNameStrategy): void {\n\t\tthis.defaultStrategy = strategy\n\t}\n\n\tgetDefaultStrategy(): BranchNameStrategy {\n\t\treturn this.defaultStrategy\n\t}\n}\n"],"mappings":";;;;;;AAWO,IAAM,2BAAN,MAA6D;AAAA,EACnE,MAAM,SAAS,aAA8B,OAAgC;AAE5E,UAAM,OAAO,MACX,YAAY,EACZ,QAAQ,eAAe,GAAG,EAC1B,QAAQ,UAAU,EAAE,EACpB,UAAU,GAAG,EAAE;AAEjB,WAAO,cAAc,WAAW,KAAK,IAAI;AAAA,EAC1C;AACD;AAMO,IAAM,2BAAN,MAA6D;AAAA,EACnE,YAAoB,cAAc,SAAS;AAAvB;AAAA,EAAwB;AAAA,EAE5C,MAAM,SAAS,aAA8B,OAAgC;AAE5E,UAAM,EAAE,mBAAmB,IAAI,MAAM,OAAO,sBAAoB;AAChE,WAAO,mBAAmB,OAAO,aAAa,KAAK,WAAW;AAAA,EAC/D;AACD;AAoBO,IAAM,6BAAN,MAAgE;AAAA,EAGtE,YAAY,SAIT;AAEF,QAAI,mCAAS,UAAU;AACtB,WAAK,kBAAkB,QAAQ;AAAA,IAChC,YAAW,mCAAS,eAAc,OAAO;AACxC,WAAK,kBAAkB,IAAI,yBAAyB,mCAAS,WAAW;AAAA,IACzE,OAAO;AACN,WAAK,kBAAkB,IAAI,yBAAyB;AAAA,IACrD;AAAA,EACD;AAAA,EAEA,MAAM,mBAAmB,SAAmD;AAC3E,UAAM,EAAE,aAAa,OAAO,SAAS,IAAI;AAGzC,UAAM,eAAe,YAAY,KAAK;AAEtC,WAAO,MAAM,0BAA0B;AAAA,MACtC;AAAA,MACA;AAAA,MACA,UAAU,aAAa,YAAY;AAAA,IACpC,CAAC;AAED,WAAO,aAAa,SAAS,aAAa,KAAK;AAAA,EAChD;AAAA,EAEA,mBAAmB,UAAoC;AACtD,SAAK,kBAAkB;AAAA,EACxB;AAAA,EAEA,qBAAyC;AACxC,WAAO,KAAK;AAAA,EACb;AACD;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/IssueEnhancementService.ts"],"sourcesContent":["import type { IssueTracker } from './IssueTracker.js'\nimport type { AgentManager } from './AgentManager.js'\nimport type { SettingsManager } from './SettingsManager.js'\nimport { launchClaude } from '../utils/claude.js'\nimport { openBrowser } from '../utils/browser.js'\nimport { waitForKeypress } from '../utils/prompt.js'\nimport { logger } from '../utils/logger.js'\n\n/**\n * Service for enhancing and creating GitHub issues with AI assistance.\n * Extracts reusable issue enhancement logic from StartCommand.\n */\nexport class IssueEnhancementService {\n\tconstructor(\n\t\tprivate gitHubService: IssueTracker,\n\t\tprivate agentManager: AgentManager,\n\t\tprivate settingsManager: SettingsManager\n\t) {}\n\n\t/**\n\t * Validates that a description meets minimum requirements.\n\t * Requirements: >30 characters AND >2 spaces\n\t */\n\tpublic validateDescription(description: string): boolean {\n\t\tconst trimmedDescription = description.trim()\n\t\tconst spaceCount = (trimmedDescription.match(/ /g) ?? []).length\n\n\t\treturn trimmedDescription.length > 30 && spaceCount > 2\n\t}\n\n\t/**\n\t * Enhances a description using Claude AI in headless mode.\n\t * Falls back to original description if enhancement fails.\n\t */\n\tpublic async enhanceDescription(description: string): Promise<string> {\n\t\ttry {\n\t\t\tlogger.info('Enhancing description with Claude AI. This may take a moment...')\n\n\t\t\t// Load agent configurations\n\t\t\tconst settings = await this.settingsManager.loadSettings()\n\t\t\tconst loadedAgents = await this.agentManager.loadAgents(settings)\n\t\t\tconst agents = this.agentManager.formatForCli(loadedAgents)\n\n\t\t\t// Call Claude in headless mode with issue enhancer agent\n\t\t\tconst prompt = `@agent-iloom-issue-enhancer\n\nTASK: Enhance the following issue description for GitHub.\n\nINPUT:\n${description}\n\nOUTPUT REQUIREMENTS:\n- Return ONLY the enhanced description markdown text\n- NO meta-commentary (no \"Here is...\", \"The enhanced...\", \"I have...\", etc)\n- NO code block markers (\\`\\`\\`)\n- NO conversational framing or acknowledgments\n- NO explanations of your work\n- Start your response immediately with the enhanced content\n\nYour response should be the raw markdown that will become the GitHub issue body.`\n\n\t\t\tconst enhanced = await launchClaude(prompt, {\n\t\t\t\theadless: true,\n\t\t\t\tmodel: 'sonnet',\n\t\t\t\tagents,\n\t\t\t})\n\n\t\t\tif (enhanced && typeof enhanced === 'string') {\n\t\t\t\tlogger.success('Description enhanced successfully')\n\t\t\t\treturn enhanced\n\t\t\t}\n\n\t\t\t// Fallback to original description\n\t\t\tlogger.warn('Claude enhancement returned empty result, using original description')\n\t\t\treturn description\n\t\t} catch (error) {\n\t\t\tlogger.warn(`Failed to enhance description: ${error instanceof Error ? error.message : 'Unknown error'}`)\n\t\t\treturn description\n\t\t}\n\t}\n\n\t/**\n\t * Creates a GitHub issue with title and enhanced body.\n\t * @param originalDescription - Used as the issue title\n\t * @param enhancedDescription - Used as the issue body\n\t * @param repository - Optional repository override (format: \"owner/repo\")\n\t * @param labels - Optional array of label names to add to the issue\n\t * @returns Issue number and URL\n\t */\n\tpublic async createEnhancedIssue(\n\t\toriginalDescription: string,\n\t\tenhancedDescription: string,\n\t\trepository?: string,\n\t\tlabels?: string[]\n\t): Promise<{ number: string | number; url: string }> {\n\t\tlogger.info('Creating GitHub issue from description...')\n\n\t\tconst result = await this.gitHubService.createIssue(\n\t\t\toriginalDescription, // Use original description as title\n\t\t\tenhancedDescription, // Use enhanced description as body\n\t\t\trepository,\n\t\t\tlabels\n\t\t)\n\n\t\treturn result\n\t}\n\n\t/**\n\t * Waits for user keypress and opens issue in browser for review.\n\t * @param issueNumber - Issue number to open for review\n\t * @param confirm - If true, wait for additional keypress after opening browser before returning\n\t * @param repository - Optional repository to fetch issue from (format: \"owner/repo\")\n\t */\n\tpublic async waitForReviewAndOpen(issueNumber: string | number, confirm = false, repository?: string): Promise<void> {\n\t\t// Check if running in CI environment\n\t\tconst isCI = process.env.CI === 'true'\n\n\t\tif (isCI) {\n\t\t\t// In CI: Skip all interactive operations\n\t\t\tlogger.info(`Running in CI environment - skipping interactive prompts for issue #${issueNumber}`)\n\t\t\treturn\n\t\t}\n\n\t\t// Get issue URL\n\t\tconst issueUrl = await this.gitHubService.getIssueUrl(issueNumber, repository)\n\n\t\t// Display message and wait for first keypress\n\t\tconst message = `Created issue #${issueNumber}.\nReview and edit the issue in your browser if needed.\nPress any key to open issue for editing...`\n\t\tawait waitForKeypress(message)\n\n\t\t// Open issue in browser\n\t\tawait openBrowser(issueUrl)\n\n\t\t// If confirmation required, wait for second keypress\n\t\tif (confirm) {\n\t\t\tawait waitForKeypress('Press any key to continue with loom creation...')\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAYO,IAAM,0BAAN,MAA8B;AAAA,EACpC,YACS,eACA,cACA,iBACP;AAHO;AACA;AACA;AAAA,EACN;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,oBAAoB,aAA8B;AACxD,UAAM,qBAAqB,YAAY,KAAK;AAC5C,UAAM,cAAc,mBAAmB,MAAM,IAAI,KAAK,CAAC,GAAG;AAE1D,WAAO,mBAAmB,SAAS,MAAM,aAAa;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAa,mBAAmB,aAAsC;AACrE,QAAI;AACH,aAAO,KAAK,iEAAiE;AAG7E,YAAM,WAAW,MAAM,KAAK,gBAAgB,aAAa;AACzD,YAAM,eAAe,MAAM,KAAK,aAAa,WAAW,QAAQ;AAChE,YAAM,SAAS,KAAK,aAAa,aAAa,YAAY;AAG1D,YAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhB,W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