@iloom/cli 0.4.1 → 0.5.1

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.
Files changed (121) hide show
  1. package/README.md +24 -0
  2. package/dist/{ClaudeContextManager-DK77227F.js → ClaudeContextManager-DQFKIMEP.js} +5 -5
  3. package/dist/{ClaudeService-W3SA7HVG.js → ClaudeService-CJS32WG2.js} +4 -4
  4. package/dist/{LoomLauncher-S3YGJRJQ.js → LoomLauncher-JNWBMHES.js} +22 -88
  5. package/dist/LoomLauncher-JNWBMHES.js.map +1 -0
  6. package/dist/MetadataManager-WXUVXKUS.js +10 -0
  7. package/dist/PRManager-7DSIMCAD.js +16 -0
  8. package/dist/{PromptTemplateManager-2TDZAUC6.js → PromptTemplateManager-72FEOGT6.js} +2 -2
  9. package/dist/README.md +24 -0
  10. package/dist/{SettingsManager-FJFU6JJD.js → SettingsManager-XPR4TEQL.js} +2 -2
  11. package/dist/agents/iloom-issue-analyze-and-plan.md +41 -7
  12. package/dist/agents/iloom-issue-analyzer.md +38 -8
  13. package/dist/agents/iloom-issue-complexity-evaluator.md +45 -15
  14. package/dist/agents/iloom-issue-enhancer.md +60 -18
  15. package/dist/agents/iloom-issue-implementer.md +29 -7
  16. package/dist/agents/iloom-issue-planner.md +36 -7
  17. package/dist/agents/iloom-issue-reviewer.md +30 -7
  18. package/dist/{chunk-JC5HXN75.js → chunk-3CMGCRB5.js} +2 -2
  19. package/dist/{chunk-G6CIIJLT.js → chunk-4YTILIIH.js} +7 -8
  20. package/dist/chunk-4YTILIIH.js.map +1 -0
  21. package/dist/{chunk-IARWMDAX.js → chunk-6KB7R22U.js} +98 -16
  22. package/dist/chunk-6KB7R22U.js.map +1 -0
  23. package/dist/{chunk-55TB3FSG.js → chunk-AS2IRKLU.js} +2 -2
  24. package/dist/{chunk-VTXCGKV5.js → chunk-BVIK2P6P.js} +11 -3
  25. package/dist/chunk-BVIK2P6P.js.map +1 -0
  26. package/dist/chunk-CDF7ZX2B.js +72 -0
  27. package/dist/chunk-CDF7ZX2B.js.map +1 -0
  28. package/dist/{chunk-POI7KLBH.js → chunk-CDQEK2WD.js} +5 -5
  29. package/dist/{chunk-74VMN2KC.js → chunk-DKQ4SUII.js} +16 -1
  30. package/dist/chunk-DKQ4SUII.js.map +1 -0
  31. package/dist/{chunk-BIIQHEXJ.js → chunk-GVRO4PWE.js} +12 -8
  32. package/dist/chunk-GVRO4PWE.js.map +1 -0
  33. package/dist/{chunk-TMZAVPGF.js → chunk-HABINPX2.js} +71 -15
  34. package/dist/{chunk-TMZAVPGF.js.map → chunk-HABINPX2.js.map} +1 -1
  35. package/dist/{chunk-2W2FBL5G.js → chunk-LN4H3A6A.js} +66 -7
  36. package/dist/chunk-LN4H3A6A.js.map +1 -0
  37. package/dist/{chunk-VWNS6DH5.js → chunk-OOU3DKNT.js} +13 -7
  38. package/dist/chunk-OOU3DKNT.js.map +1 -0
  39. package/dist/chunk-P2ZQ5LKB.js +347 -0
  40. package/dist/chunk-P2ZQ5LKB.js.map +1 -0
  41. package/dist/{chunk-OF7BNW4D.js → chunk-RJKMF6BC.js} +30 -4
  42. package/dist/chunk-RJKMF6BC.js.map +1 -0
  43. package/dist/{chunk-O7WHXLCB.js → chunk-RNZMHJK7.js} +18 -4
  44. package/dist/chunk-RNZMHJK7.js.map +1 -0
  45. package/dist/{chunk-UPUAQYAW.js → chunk-S65T4O6I.js} +2 -2
  46. package/dist/{chunk-HD5SUKI2.js → chunk-TSLKDFAF.js} +55 -6
  47. package/dist/chunk-TSLKDFAF.js.map +1 -0
  48. package/dist/{chunk-IJ7IGJT3.js → chunk-YZTDGPFB.js} +18 -1
  49. package/dist/chunk-YZTDGPFB.js.map +1 -0
  50. package/dist/{cleanup-KDLVTT7M.js → cleanup-LU6NU2NZ.js} +14 -14
  51. package/dist/cli.js +283 -363
  52. package/dist/cli.js.map +1 -1
  53. package/dist/{contribute-HY372S6F.js → contribute-RS3DO3WP.js} +4 -4
  54. package/dist/{dev-server-JCJGQ3PV.js → dev-server-ASH7HJVI.js} +30 -16
  55. package/dist/dev-server-ASH7HJVI.js.map +1 -0
  56. package/dist/{feedback-7PVBQNLJ.js → feedback-OFVW22UW.js} +11 -6
  57. package/dist/{feedback-7PVBQNLJ.js.map → feedback-OFVW22UW.js.map} +1 -1
  58. package/dist/{git-4BVOOOOV.js → git-OQAPUPLP.js} +16 -6
  59. package/dist/git-OQAPUPLP.js.map +1 -0
  60. package/dist/{ignite-3B264M7K.js → ignite-NREQ3JRM.js} +57 -22
  61. package/dist/ignite-NREQ3JRM.js.map +1 -0
  62. package/dist/index.d.ts +58 -7
  63. package/dist/index.js +110 -7
  64. package/dist/index.js.map +1 -1
  65. package/dist/{init-LBA6NUK2.js → init-F6PFMSU5.js} +7 -7
  66. package/dist/init-F6PFMSU5.js.map +1 -0
  67. package/dist/mcp/recap-server.js +264 -0
  68. package/dist/mcp/recap-server.js.map +1 -0
  69. package/dist/{open-OGCV32Z4.js → open-KW4NTLXH.js} +16 -17
  70. package/dist/{open-OGCV32Z4.js.map → open-KW4NTLXH.js.map} +1 -1
  71. package/dist/{projects-P55273AB.js → projects-QEAEBAT2.js} +2 -2
  72. package/dist/prompts/init-prompt.txt +31 -72
  73. package/dist/prompts/issue-prompt.txt +115 -15
  74. package/dist/prompts/pr-prompt.txt +49 -1
  75. package/dist/prompts/regular-prompt.txt +80 -20
  76. package/dist/{rebase-4T5FQHNH.js → rebase-WZHHE5LU.js} +6 -6
  77. package/dist/recap-33NPZ3ZO.js +117 -0
  78. package/dist/recap-33NPZ3ZO.js.map +1 -0
  79. package/dist/{run-HNOP6WE2.js → run-HRYQ7TR7.js} +16 -17
  80. package/dist/{run-HNOP6WE2.js.map → run-HRYQ7TR7.js.map} +1 -1
  81. package/dist/schema/settings.schema.json +13 -2
  82. package/dist/{shell-DE3HKJSM.js → shell-JMU5XTHW.js} +6 -6
  83. package/dist/{summary-GDT7DTRI.js → summary-4SSGGH7N.js} +17 -9
  84. package/dist/summary-4SSGGH7N.js.map +1 -0
  85. package/dist/{test-git-YMAE57UP.js → test-git-6SAIRBUD.js} +4 -4
  86. package/dist/{test-prefix-YCKL6CMT.js → test-prefix-RLVRK5ZD.js} +4 -4
  87. package/package.json +1 -1
  88. package/dist/LoomLauncher-S3YGJRJQ.js.map +0 -1
  89. package/dist/chunk-2W2FBL5G.js.map +0 -1
  90. package/dist/chunk-74VMN2KC.js.map +0 -1
  91. package/dist/chunk-BIIQHEXJ.js.map +0 -1
  92. package/dist/chunk-G6CIIJLT.js.map +0 -1
  93. package/dist/chunk-HD5SUKI2.js.map +0 -1
  94. package/dist/chunk-IARWMDAX.js.map +0 -1
  95. package/dist/chunk-IJ7IGJT3.js.map +0 -1
  96. package/dist/chunk-O7WHXLCB.js.map +0 -1
  97. package/dist/chunk-OF7BNW4D.js.map +0 -1
  98. package/dist/chunk-QRBOPFAA.js +0 -48
  99. package/dist/chunk-QRBOPFAA.js.map +0 -1
  100. package/dist/chunk-VTXCGKV5.js.map +0 -1
  101. package/dist/chunk-VWNS6DH5.js.map +0 -1
  102. package/dist/dev-server-JCJGQ3PV.js.map +0 -1
  103. package/dist/ignite-3B264M7K.js.map +0 -1
  104. package/dist/summary-GDT7DTRI.js.map +0 -1
  105. /package/dist/{ClaudeContextManager-DK77227F.js.map → ClaudeContextManager-DQFKIMEP.js.map} +0 -0
  106. /package/dist/{ClaudeService-W3SA7HVG.js.map → ClaudeService-CJS32WG2.js.map} +0 -0
  107. /package/dist/{PromptTemplateManager-2TDZAUC6.js.map → MetadataManager-WXUVXKUS.js.map} +0 -0
  108. /package/dist/{SettingsManager-FJFU6JJD.js.map → PRManager-7DSIMCAD.js.map} +0 -0
  109. /package/dist/{git-4BVOOOOV.js.map → PromptTemplateManager-72FEOGT6.js.map} +0 -0
  110. /package/dist/{init-LBA6NUK2.js.map → SettingsManager-XPR4TEQL.js.map} +0 -0
  111. /package/dist/{chunk-JC5HXN75.js.map → chunk-3CMGCRB5.js.map} +0 -0
  112. /package/dist/{chunk-55TB3FSG.js.map → chunk-AS2IRKLU.js.map} +0 -0
  113. /package/dist/{chunk-POI7KLBH.js.map → chunk-CDQEK2WD.js.map} +0 -0
  114. /package/dist/{chunk-UPUAQYAW.js.map → chunk-S65T4O6I.js.map} +0 -0
  115. /package/dist/{cleanup-KDLVTT7M.js.map → cleanup-LU6NU2NZ.js.map} +0 -0
  116. /package/dist/{contribute-HY372S6F.js.map → contribute-RS3DO3WP.js.map} +0 -0
  117. /package/dist/{projects-P55273AB.js.map → projects-QEAEBAT2.js.map} +0 -0
  118. /package/dist/{rebase-4T5FQHNH.js.map → rebase-WZHHE5LU.js.map} +0 -0
  119. /package/dist/{shell-DE3HKJSM.js.map → shell-JMU5XTHW.js.map} +0 -0
  120. /package/dist/{test-git-YMAE57UP.js.map → test-git-6SAIRBUD.js.map} +0 -0
  121. /package/dist/{test-prefix-YCKL6CMT.js.map → test-prefix-RLVRK5ZD.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -381,14 +381,14 @@ declare const IloomSettingsSchema: z.ZodObject<{
381
381
  provider?: "github" | "linear" | undefined;
382
382
  }>>;
383
383
  mergeBehavior: z.ZodOptional<z.ZodObject<{
384
- mode: z.ZodDefault<z.ZodEnum<["local", "github-pr"]>>;
384
+ mode: z.ZodDefault<z.ZodEnum<["local", "github-pr", "github-draft-pr"]>>;
385
385
  remote: z.ZodOptional<z.ZodString>;
386
386
  }, "strip", z.ZodTypeAny, {
387
- mode: "local" | "github-pr";
387
+ mode: "local" | "github-pr" | "github-draft-pr";
388
388
  remote?: string | undefined;
389
389
  }, {
390
390
  remote?: string | undefined;
391
- mode?: "local" | "github-pr" | undefined;
391
+ mode?: "local" | "github-pr" | "github-draft-pr" | undefined;
392
392
  }>>;
393
393
  ide: z.ZodOptional<z.ZodObject<{
394
394
  type: z.ZodDefault<z.ZodEnum<["vscode", "cursor", "webstorm", "sublime", "intellij", "windsurf", "antigravity"]>>;
@@ -407,8 +407,10 @@ declare const IloomSettingsSchema: z.ZodObject<{
407
407
  vscode?: boolean | undefined;
408
408
  terminal?: boolean | undefined;
409
409
  }>>;
410
+ attribution: z.ZodDefault<z.ZodEnum<["off", "upstreamOnly", "on"]>>;
410
411
  }, "strip", z.ZodTypeAny, {
411
412
  sourceEnvOnStart: boolean;
413
+ attribution: "off" | "upstreamOnly" | "on";
412
414
  mainBranch?: string | undefined;
413
415
  worktreePrefix?: string | undefined;
414
416
  protectedBranches?: string[] | undefined;
@@ -476,7 +478,7 @@ declare const IloomSettingsSchema: z.ZodObject<{
476
478
  } | undefined;
477
479
  } | undefined;
478
480
  mergeBehavior?: {
479
- mode: "local" | "github-pr";
481
+ mode: "local" | "github-pr" | "github-draft-pr";
480
482
  remote?: string | undefined;
481
483
  } | undefined;
482
484
  ide?: {
@@ -556,7 +558,7 @@ declare const IloomSettingsSchema: z.ZodObject<{
556
558
  } | undefined;
557
559
  mergeBehavior?: {
558
560
  remote?: string | undefined;
559
- mode?: "local" | "github-pr" | undefined;
561
+ mode?: "local" | "github-pr" | "github-draft-pr" | undefined;
560
562
  } | undefined;
561
563
  ide?: {
562
564
  type?: "vscode" | "cursor" | "webstorm" | "sublime" | "intellij" | "windsurf" | "antigravity" | undefined;
@@ -565,6 +567,7 @@ declare const IloomSettingsSchema: z.ZodObject<{
565
567
  vscode?: boolean | undefined;
566
568
  terminal?: boolean | undefined;
567
569
  } | undefined;
570
+ attribution?: "off" | "upstreamOnly" | "on" | undefined;
568
571
  }>;
569
572
  /**
570
573
  * TypeScript type for iloom settings derived from Zod schema
@@ -1223,7 +1226,7 @@ interface FinishResult {
1223
1226
  /** Whether this was a dry-run operation */
1224
1227
  dryRun?: boolean;
1225
1228
  operations: Array<{
1226
- type: 'validation' | 'commit' | 'rebase' | 'merge' | 'cleanup' | 'pr-creation' | 'build';
1229
+ type: 'validation' | 'commit' | 'rebase' | 'merge' | 'cleanup' | 'pr-creation' | 'pr-ready' | 'build';
1227
1230
  message: string;
1228
1231
  success: boolean;
1229
1232
  error?: string;
@@ -1540,6 +1543,9 @@ interface TemplateVariables {
1540
1543
  BRANCH_NAME?: string;
1541
1544
  LOOM_TYPE?: string;
1542
1545
  COMPACT_SUMMARIES?: string;
1546
+ DRAFT_PR_NUMBER?: number;
1547
+ DRAFT_PR_MODE?: boolean;
1548
+ STANDARD_ISSUE_MODE?: boolean;
1543
1549
  }
1544
1550
  declare class PromptTemplateManager {
1545
1551
  private templateDir;
@@ -1638,6 +1644,9 @@ interface WriteMetadataInput {
1638
1644
  colorHex: string;
1639
1645
  sessionId: string;
1640
1646
  projectPath: string;
1647
+ issueUrls: Record<string, string>;
1648
+ prUrls: Record<string, string>;
1649
+ draftPrNumber?: number;
1641
1650
  parentLoom?: {
1642
1651
  type: 'issue' | 'pr' | 'branch';
1643
1652
  identifier: string | number;
@@ -1661,6 +1670,9 @@ interface LoomMetadata {
1661
1670
  colorHex: string | null;
1662
1671
  sessionId: string | null;
1663
1672
  projectPath: string | null;
1673
+ issueUrls: Record<string, string>;
1674
+ prUrls: Record<string, string>;
1675
+ draftPrNumber: number | null;
1664
1676
  parentLoom: {
1665
1677
  type: 'issue' | 'pr' | 'branch';
1666
1678
  identifier: string | number;
@@ -1701,6 +1713,12 @@ declare class MetadataManager {
1701
1713
  * Get the full path to the metadata file for a worktree
1702
1714
  */
1703
1715
  private getFilePath;
1716
+ /**
1717
+ * Get the full path to the metadata file for a worktree (public API)
1718
+ * Used by other services that need to reference the metadata file location
1719
+ * (e.g., MCP servers that need to read loom context)
1720
+ */
1721
+ getMetadataFilePath(worktreePath: string): string;
1704
1722
  /**
1705
1723
  * Write metadata for a worktree (spec section 3.1)
1706
1724
  *
@@ -1972,6 +1990,39 @@ declare function getMergeTargetBranch(worktreePath?: string, options?: {
1972
1990
  settingsManager?: SettingsManager;
1973
1991
  metadataManager?: MetadataManager;
1974
1992
  }): Promise<string>;
1993
+ /**
1994
+ * Placeholder commit prefix used by github-draft-pr mode.
1995
+ * Created during il start to enable draft PR creation (GitHub requires at least one commit ahead of base).
1996
+ * Removed during il finish before the final push to maintain clean commit history.
1997
+ */
1998
+ declare const PLACEHOLDER_COMMIT_PREFIX = "[iloom-temp]";
1999
+ /**
2000
+ * Check if HEAD commit is a placeholder commit
2001
+ * @param cwd - Working directory (defaults to process.cwd())
2002
+ * @returns true if HEAD is a placeholder commit
2003
+ */
2004
+ declare function isPlaceholderCommit(cwd?: string): Promise<boolean>;
2005
+ /**
2006
+ * Find placeholder commit SHA in history using git log --grep
2007
+ * @param worktreePath - Working directory
2008
+ * @returns SHA of placeholder commit if found, null otherwise
2009
+ */
2010
+ declare function findPlaceholderCommitSha(worktreePath: string): Promise<string | null>;
2011
+ /**
2012
+ * Remove placeholder commit when it's HEAD
2013
+ * Uses soft reset to preserve any staged changes
2014
+ * @param worktreePath - Working directory
2015
+ * @returns true if placeholder was removed
2016
+ */
2017
+ declare function removePlaceholderCommitFromHead(worktreePath: string): Promise<boolean>;
2018
+ /**
2019
+ * Remove placeholder commit from history using rebase
2020
+ * Used when user has made commits on top of placeholder
2021
+ * @param worktreePath - Working directory
2022
+ * @param placeholderSha - SHA of the placeholder commit to remove
2023
+ * @throws Error if rebase fails
2024
+ */
2025
+ declare function removePlaceholderCommitFromHistory(worktreePath: string, placeholderSha: string): Promise<void>;
1975
2026
 
1976
2027
  interface LoggerOptions {
1977
2028
  prefix?: string;
@@ -2148,4 +2199,4 @@ declare class TableFormatter {
2148
2199
  static previewFormatting(headers: string[], options?: TableFormatterOptions): string;
2149
2200
  }
2150
2201
 
2151
- export { type AddIssueOptions, type AddIssueResult, type BatchCleanupResult, type BranchCleanupTarget, type BranchDeleteOptions, type BranchGenerationOptions, type BranchNameStrategy, type Capability, type ClaudeContext, ClaudeContextManager, type CleanupOptions, type CleanupResult, type ColorData, type CommitOptions, type Config, type CreateLoomInput, type DatabaseDeletionResult, DatabaseManager, type DatabaseProvider, type EnhanceOptions, type EnhanceResult, type EnvFileOptions, type EnvOperationResult, type EnvVariable, EnvironmentManager, type FeedbackOptions, type FinishOptions, type FinishResult, GitHubService, type GitStatus, type GitWorktree, GitWorktreeManager, type InstallationMethod, type Issue, type IssueTracker, IssueTrackerFactory, type IssueTrackerInputDetection, type IssueTrackerProviderType, type LaunchMode, LinearMarkupConverter, type ListOptions, type Logger, type LoggerOptions, type Loom, type LoomSummary, type MergeOptions, type MergeResult, type MockOptions, type OneShotMode, type OperationResult, type PRWorktreePattern, type Platform, type PortAssignmentOptions, type ProcessInfo, type ProjectCapability, type PullRequest, type RemoteBranchStatus, type ResourceCleanupOptions, type RgbColor, type SafetyCheck, type StartOptions, type StartResult, type SummaryResult, TableFormatter, type TableFormatterOptions, type TableGenerationOptions, type UpdateCheckCache, type UpdateCheckResult, UserAbortedCommitError, type ValidationOptions, type ValidationResult, type ValidationStepResult, type Workspace, type WorkspaceInput, WorkspaceManager, type WorkspaceSummary, type Worktree, type WorktreeCleanupOptions, type WorktreeCreateOptions, type WorktreeListOptions, type WorktreeOperationResult, type WorktreeStatus, type WorktreeValidation, branchExists, checkRemoteBranchStatus, createLogger, createStderrLogger, ensureRepositoryHasCommits, executeGitCommand, extractIssueNumber, extractPRNumber, findAllBranchesForIssue, findMainWorktreePath, findMainWorktreePathWithSettings, findWorktreeForBranch, generateWorktreePath, getCurrentBranch, getDefaultBranch, getMergeTargetBranch, getRepoRoot, getWorktreeRoot, hasUncommittedChanges, isBranchMergedIntoMain, isEmptyRepository, isFileGitignored, isFileTrackedByGit, isPRBranch, isRemoteBranchUpToDate, isValidGitRepo, isWorktreePath, logger, parseWorktreeList, pushBranchToRemote };
2202
+ export { type AddIssueOptions, type AddIssueResult, type BatchCleanupResult, type BranchCleanupTarget, type BranchDeleteOptions, type BranchGenerationOptions, type BranchNameStrategy, type Capability, type ClaudeContext, ClaudeContextManager, type CleanupOptions, type CleanupResult, type ColorData, type CommitOptions, type Config, type CreateLoomInput, type DatabaseDeletionResult, DatabaseManager, type DatabaseProvider, type EnhanceOptions, type EnhanceResult, type EnvFileOptions, type EnvOperationResult, type EnvVariable, EnvironmentManager, type FeedbackOptions, type FinishOptions, type FinishResult, GitHubService, type GitStatus, type GitWorktree, GitWorktreeManager, type InstallationMethod, type Issue, type IssueTracker, IssueTrackerFactory, type IssueTrackerInputDetection, type IssueTrackerProviderType, type LaunchMode, LinearMarkupConverter, type ListOptions, type Logger, type LoggerOptions, type Loom, type LoomSummary, type MergeOptions, type MergeResult, type MockOptions, type OneShotMode, type OperationResult, PLACEHOLDER_COMMIT_PREFIX, type PRWorktreePattern, type Platform, type PortAssignmentOptions, type ProcessInfo, type ProjectCapability, type PullRequest, type RemoteBranchStatus, type ResourceCleanupOptions, type RgbColor, type SafetyCheck, type StartOptions, type StartResult, type SummaryResult, TableFormatter, type TableFormatterOptions, type TableGenerationOptions, type UpdateCheckCache, type UpdateCheckResult, UserAbortedCommitError, type ValidationOptions, type ValidationResult, type ValidationStepResult, type Workspace, type WorkspaceInput, WorkspaceManager, type WorkspaceSummary, type Worktree, type WorktreeCleanupOptions, type WorktreeCreateOptions, type WorktreeListOptions, type WorktreeOperationResult, type WorktreeStatus, type WorktreeValidation, branchExists, checkRemoteBranchStatus, createLogger, createStderrLogger, ensureRepositoryHasCommits, executeGitCommand, extractIssueNumber, extractPRNumber, findAllBranchesForIssue, findMainWorktreePath, findMainWorktreePathWithSettings, findPlaceholderCommitSha, findWorktreeForBranch, generateWorktreePath, getCurrentBranch, getDefaultBranch, getMergeTargetBranch, getRepoRoot, getWorktreeRoot, hasUncommittedChanges, isBranchMergedIntoMain, isEmptyRepository, isFileGitignored, isFileTrackedByGit, isPRBranch, isPlaceholderCommit, isRemoteBranchUpToDate, isValidGitRepo, isWorktreePath, logger, parseWorktreeList, pushBranchToRemote, removePlaceholderCommitFromHead, removePlaceholderCommitFromHistory };
package/dist/index.js CHANGED
@@ -330,9 +330,9 @@ var init_SettingsManager = __esm({
330
330
  }).optional()
331
331
  }).optional().describe("Issue management configuration"),
332
332
  mergeBehavior: z.object({
333
- mode: z.enum(["local", "github-pr"]).default("local"),
333
+ mode: z.enum(["local", "github-pr", "github-draft-pr"]).default("local"),
334
334
  remote: z.string().optional()
335
- }).optional().describe("Merge behavior configuration: local (merge locally) or github-pr (create PR)"),
335
+ }).optional().describe("Merge behavior configuration: local (merge locally), github-pr (create PR), or github-draft-pr (create draft PR at start, mark ready on finish)"),
336
336
  ide: z.object({
337
337
  type: z.enum(["vscode", "cursor", "webstorm", "sublime", "intellij", "windsurf", "antigravity"]).default("vscode").describe(
338
338
  "IDE to launch when starting a loom. Options: vscode (Visual Studio Code), cursor (Cursor AI editor), webstorm (JetBrains WebStorm), sublime (Sublime Text), intellij (JetBrains IntelliJ IDEA), windsurf (Windsurf editor), antigravity (Antigravity IDE)."
@@ -345,7 +345,10 @@ var init_SettingsManager = __esm({
345
345
  vscode: z.boolean().default(false).describe(
346
346
  "Apply VSCode/Cursor title bar colors based on branch name. Note: This modifies .vscode/settings.json which may be in source control. Default is false for safety; enable via init or explicitly if .vscode is gitignored."
347
347
  )
348
- }).optional().describe("Color synchronization settings for workspace identification")
348
+ }).optional().describe("Color synchronization settings for workspace identification"),
349
+ attribution: z.enum(["off", "upstreamOnly", "on"]).default("upstreamOnly").describe(
350
+ 'Controls when iloom attribution appears in session summaries. "off" - never show attribution. "upstreamOnly" - only show for contributions to external repositories (e.g., open source). "on" - always show attribution.'
351
+ )
349
352
  });
350
353
  IloomSettingsSchemaNoDefaults = z.object({
351
354
  mainBranch: z.string().min(1, "Settings 'mainBranch' cannot be empty").optional().describe("Name of the main/primary branch for the repository"),
@@ -398,9 +401,9 @@ var init_SettingsManager = __esm({
398
401
  }).optional()
399
402
  }).optional().describe("Issue management configuration"),
400
403
  mergeBehavior: z.object({
401
- mode: z.enum(["local", "github-pr"]).optional(),
404
+ mode: z.enum(["local", "github-pr", "github-draft-pr"]).optional(),
402
405
  remote: z.string().optional()
403
- }).optional().describe("Merge behavior configuration: local (merge locally) or github-pr (create PR)"),
406
+ }).optional().describe("Merge behavior configuration: local (merge locally), github-pr (create PR), or github-draft-pr (create draft PR at start, mark ready on finish)"),
404
407
  ide: z.object({
405
408
  type: z.enum(["vscode", "cursor", "webstorm", "sublime", "intellij", "windsurf", "antigravity"]).optional().describe(
406
409
  "IDE to launch when starting a loom. Options: vscode (Visual Studio Code), cursor (Cursor AI editor), webstorm (JetBrains WebStorm), sublime (Sublime Text), intellij (JetBrains IntelliJ IDEA), windsurf (Windsurf editor), antigravity (Antigravity IDE)."
@@ -413,7 +416,10 @@ var init_SettingsManager = __esm({
413
416
  vscode: z.boolean().optional().describe(
414
417
  "Apply VSCode/Cursor title bar colors based on branch name. Note: This modifies .vscode/settings.json which may be in source control."
415
418
  )
416
- }).optional().describe("Color synchronization settings for workspace identification")
419
+ }).optional().describe("Color synchronization settings for workspace identification"),
420
+ attribution: z.enum(["off", "upstreamOnly", "on"]).optional().describe(
421
+ 'Controls when iloom attribution appears in session summaries. "off" - never show attribution. "upstreamOnly" - only show for contributions to external repositories (e.g., open source). "on" - always show attribution.'
422
+ )
417
423
  });
418
424
  SettingsManager = class {
419
425
  /**
@@ -870,6 +876,14 @@ var MetadataManager = class {
870
876
  const filename = this.slugifyPath(worktreePath);
871
877
  return path2.join(this.loomsDir, filename);
872
878
  }
879
+ /**
880
+ * Get the full path to the metadata file for a worktree (public API)
881
+ * Used by other services that need to reference the metadata file location
882
+ * (e.g., MCP servers that need to read loom context)
883
+ */
884
+ getMetadataFilePath(worktreePath) {
885
+ return this.getFilePath(worktreePath);
886
+ }
873
887
  /**
874
888
  * Write metadata for a worktree (spec section 3.1)
875
889
  *
@@ -892,6 +906,9 @@ var MetadataManager = class {
892
906
  colorHex: input.colorHex,
893
907
  sessionId: input.sessionId,
894
908
  projectPath: input.projectPath,
909
+ issueUrls: input.issueUrls,
910
+ prUrls: input.prUrls,
911
+ ...input.draftPrNumber && { draftPrNumber: input.draftPrNumber },
895
912
  ...input.parentLoom && { parentLoom: input.parentLoom }
896
913
  };
897
914
  const filePath = this.getFilePath(worktreePath);
@@ -932,6 +949,9 @@ var MetadataManager = class {
932
949
  colorHex: data.colorHex ?? null,
933
950
  sessionId: data.sessionId ?? null,
934
951
  projectPath: data.projectPath ?? null,
952
+ issueUrls: data.issueUrls ?? {},
953
+ prUrls: data.prUrls ?? {},
954
+ draftPrNumber: data.draftPrNumber ?? null,
935
955
  parentLoom: data.parentLoom ?? null
936
956
  };
937
957
  } catch (error) {
@@ -979,6 +999,9 @@ var MetadataManager = class {
979
999
  colorHex: data.colorHex ?? null,
980
1000
  sessionId: data.sessionId ?? null,
981
1001
  projectPath: data.projectPath ?? null,
1002
+ issueUrls: data.issueUrls ?? {},
1003
+ prUrls: data.prUrls ?? {},
1004
+ draftPrNumber: data.draftPrNumber ?? null,
982
1005
  parentLoom: data.parentLoom ?? null
983
1006
  });
984
1007
  } catch (error) {
@@ -1458,6 +1481,8 @@ async function pushBranchToRemote(branchName, worktreePath, options) {
1458
1481
  throw new Error(
1459
1482
  `Failed to push changes to origin/${branchName}
1460
1483
 
1484
+ Git error: ${errorMessage}
1485
+
1461
1486
  Possible causes:
1462
1487
  \u2022 Remote branch was deleted
1463
1488
  \u2022 Push was rejected (non-fast-forward)
@@ -1471,6 +1496,8 @@ async function pushBranchToRemote(branchName, worktreePath, options) {
1471
1496
  throw new Error(
1472
1497
  `Failed to push changes to origin/${branchName}: Network connectivity issues
1473
1498
 
1499
+ Git error: ${errorMessage}
1500
+
1474
1501
  Check your internet connection and try again.`
1475
1502
  );
1476
1503
  }
@@ -1478,6 +1505,8 @@ async function pushBranchToRemote(branchName, worktreePath, options) {
1478
1505
  throw new Error(
1479
1506
  `Failed to push changes: Remote 'origin' not found
1480
1507
 
1508
+ Git error: ${errorMessage}
1509
+
1481
1510
  Configure remote: git remote add origin <url>`
1482
1511
  );
1483
1512
  }
@@ -1623,6 +1652,54 @@ async function getMergeTargetBranch(worktreePath = process.cwd(), options) {
1623
1652
  logger.debug(`Using configured main branch as merge target: ${mainBranch}`);
1624
1653
  return mainBranch;
1625
1654
  }
1655
+ var PLACEHOLDER_COMMIT_PREFIX = "[iloom-temp]";
1656
+ async function isPlaceholderCommit(cwd = process.cwd()) {
1657
+ try {
1658
+ const subject = await executeGitCommand(["log", "-1", "--format=%s", "HEAD"], { cwd });
1659
+ return subject.trim().startsWith(PLACEHOLDER_COMMIT_PREFIX);
1660
+ } catch {
1661
+ return false;
1662
+ }
1663
+ }
1664
+ async function findPlaceholderCommitSha(worktreePath) {
1665
+ try {
1666
+ const log = await executeGitCommand(
1667
+ ["log", "--format=%H", "--fixed-strings", "--grep", PLACEHOLDER_COMMIT_PREFIX, "-n", "1"],
1668
+ { cwd: worktreePath }
1669
+ );
1670
+ const sha = log.trim();
1671
+ if (sha.length === 0) {
1672
+ return null;
1673
+ }
1674
+ const subject = await executeGitCommand(
1675
+ ["log", "-1", "--format=%s", sha],
1676
+ { cwd: worktreePath }
1677
+ );
1678
+ if (!subject.trim().startsWith(PLACEHOLDER_COMMIT_PREFIX)) {
1679
+ return null;
1680
+ }
1681
+ return sha;
1682
+ } catch {
1683
+ return null;
1684
+ }
1685
+ }
1686
+ async function removePlaceholderCommitFromHead(worktreePath) {
1687
+ if (!await isPlaceholderCommit(worktreePath)) {
1688
+ return false;
1689
+ }
1690
+ await executeGitCommand(["reset", "--soft", "HEAD~1"], { cwd: worktreePath });
1691
+ return true;
1692
+ }
1693
+ async function removePlaceholderCommitFromHistory(worktreePath, placeholderSha) {
1694
+ const parentSha = await executeGitCommand(
1695
+ ["rev-parse", `${placeholderSha}^`],
1696
+ { cwd: worktreePath }
1697
+ );
1698
+ await executeGitCommand(
1699
+ ["rebase", "--onto", parentSha.trim(), placeholderSha],
1700
+ { cwd: worktreePath }
1701
+ );
1702
+ }
1626
1703
 
1627
1704
  // src/lib/GitWorktreeManager.ts
1628
1705
  var GitWorktreeManager = class {
@@ -2662,6 +2739,9 @@ var LinearService = class {
2662
2739
  this.supportsPullRequests = false;
2663
2740
  this.config = config ?? {};
2664
2741
  this.prompter = (options == null ? void 0 : options.prompter) ?? promptConfirmation;
2742
+ if (this.config.apiToken) {
2743
+ process.env.LINEAR_API_TOKEN = this.config.apiToken;
2744
+ }
2665
2745
  }
2666
2746
  /**
2667
2747
  * Detect if input matches Linear identifier format (TEAM-NUMBER)
@@ -2831,6 +2911,9 @@ var IssueTrackerFactory = class {
2831
2911
  if (linearSettings == null ? void 0 : linearSettings.branchFormat) {
2832
2912
  linearConfig.branchFormat = linearSettings.branchFormat;
2833
2913
  }
2914
+ if (linearSettings == null ? void 0 : linearSettings.apiToken) {
2915
+ linearConfig.apiToken = linearSettings.apiToken;
2916
+ }
2834
2917
  getLogger().debug(`IssueTrackerFactory: Creating LinearService with config:`, JSON.stringify(linearConfig, null, 2));
2835
2918
  return new LinearService(linearConfig);
2836
2919
  }
@@ -3948,6 +4031,9 @@ var PromptTemplateManager = class {
3948
4031
  if (variables.COMPACT_SUMMARIES !== void 0) {
3949
4032
  result = result.replace(/COMPACT_SUMMARIES/g, variables.COMPACT_SUMMARIES);
3950
4033
  }
4034
+ if (variables.DRAFT_PR_NUMBER !== void 0) {
4035
+ result = result.replace(/DRAFT_PR_NUMBER/g, String(variables.DRAFT_PR_NUMBER));
4036
+ }
3951
4037
  return result;
3952
4038
  }
3953
4039
  /**
@@ -4018,6 +4104,18 @@ var PromptTemplateManager = class {
4018
4104
  } else {
4019
4105
  result = result.replace(compactSummariesRegex, "");
4020
4106
  }
4107
+ const draftPrModeRegex = /\{\{#IF DRAFT_PR_MODE\}\}(.*?)\{\{\/IF DRAFT_PR_MODE\}\}/gs;
4108
+ if (variables.DRAFT_PR_MODE === true) {
4109
+ result = result.replace(draftPrModeRegex, "$1");
4110
+ } else {
4111
+ result = result.replace(draftPrModeRegex, "");
4112
+ }
4113
+ const standardIssueModeRegex = /\{\{#IF STANDARD_ISSUE_MODE\}\}(.*?)\{\{\/IF STANDARD_ISSUE_MODE\}\}/gs;
4114
+ if (variables.STANDARD_ISSUE_MODE === true) {
4115
+ result = result.replace(standardIssueModeRegex, "$1");
4116
+ } else {
4117
+ result = result.replace(standardIssueModeRegex, "");
4118
+ }
4021
4119
  return result;
4022
4120
  }
4023
4121
  /**
@@ -4510,6 +4608,7 @@ export {
4510
4608
  GitWorktreeManager,
4511
4609
  IssueTrackerFactory,
4512
4610
  LinearMarkupConverter,
4611
+ PLACEHOLDER_COMMIT_PREFIX,
4513
4612
  TableFormatter,
4514
4613
  UserAbortedCommitError,
4515
4614
  WorkspaceManager,
@@ -4524,6 +4623,7 @@ export {
4524
4623
  findAllBranchesForIssue,
4525
4624
  findMainWorktreePath,
4526
4625
  findMainWorktreePathWithSettings,
4626
+ findPlaceholderCommitSha,
4527
4627
  findWorktreeForBranch,
4528
4628
  generateWorktreePath,
4529
4629
  getCurrentBranch,
@@ -4537,11 +4637,14 @@ export {
4537
4637
  isFileGitignored,
4538
4638
  isFileTrackedByGit,
4539
4639
  isPRBranch,
4640
+ isPlaceholderCommit,
4540
4641
  isRemoteBranchUpToDate,
4541
4642
  isValidGitRepo,
4542
4643
  isWorktreePath,
4543
4644
  logger,
4544
4645
  parseWorktreeList,
4545
- pushBranchToRemote
4646
+ pushBranchToRemote,
4647
+ removePlaceholderCommitFromHead,
4648
+ removePlaceholderCommitFromHistory
4546
4649
  };
4547
4650
  //# sourceMappingURL=index.js.map