infra-kit 0.1.91 → 0.1.93

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "infra-kit",
3
3
  "type": "module",
4
- "version": "0.1.91",
4
+ "version": "0.1.93",
5
5
  "description": "infra-kit",
6
6
  "main": "dist/cli.js",
7
7
  "module": "dist/cli.js",
@@ -14,9 +14,9 @@ interface OpenCmuxWorkspaceArgs {
14
14
  export const openCmuxWorkspaceWithLayout = async (args: OpenCmuxWorkspaceArgs): Promise<void> => {
15
15
  const { cwd, title } = args
16
16
 
17
- await $`cmux new-workspace --cwd ${cwd}`
17
+ const newWorkspaceOutput = (await $`cmux new-workspace --cwd ${cwd}`).stdout
18
18
 
19
- const workspaceRef = (await $`cmux current-workspace`).stdout.trim()
19
+ const workspaceRef = parseWorkspaceRef(newWorkspaceOutput)
20
20
 
21
21
  const surfacesOutput = (await $`cmux list-pane-surfaces --workspace ${workspaceRef}`).stdout
22
22
 
@@ -30,6 +30,15 @@ export const openCmuxWorkspaceWithLayout = async (args: OpenCmuxWorkspaceArgs):
30
30
  }
31
31
  }
32
32
 
33
+ /**
34
+ * Extracts the first `surface:<id>` reference from the output of
35
+ * `cmux list-pane-surfaces`. Used to locate the initial (primary) pane
36
+ * surface so subsequent splits can be anchored relative to it.
37
+ *
38
+ * @example
39
+ * const output = 'surface:12 (active)\nsurface:13\n'
40
+ * parseFirstSurfaceRef(output) // => 'surface:12'
41
+ */
33
42
  const parseFirstSurfaceRef = (output: string): string => {
34
43
  const match = output.match(/surface:\d+/)
35
44
 
@@ -39,3 +48,22 @@ const parseFirstSurfaceRef = (output: string): string => {
39
48
 
40
49
  return match[0]
41
50
  }
51
+
52
+ /**
53
+ * Extracts the `workspace:<id>` reference from the output of
54
+ * `cmux new-workspace`. The returned ref is used to target the newly
55
+ * created workspace in follow-up `cmux` commands (splits, rename, etc.).
56
+ *
57
+ * @example
58
+ * const output = 'created workspace:7\n'
59
+ * parseWorkspaceRef(output) // => 'workspace:7'
60
+ */
61
+ const parseWorkspaceRef = (output: string): string => {
62
+ const match = output.match(/workspace:\d+/)
63
+
64
+ if (!match) {
65
+ throw new Error('cmux: could not locate workspace ref in new-workspace output')
66
+ }
67
+
68
+ return match[0]
69
+ }
@@ -113,18 +113,21 @@ interface CreateReleaseBranchArgs {
113
113
  version: string
114
114
  jiraVersionUrl: string
115
115
  type: ReleaseType
116
+ description?: string
116
117
  }
117
118
 
118
119
  // Function to create a release branch
119
120
  export const createReleaseBranch = async (
120
121
  args: CreateReleaseBranchArgs,
121
122
  ): Promise<{ branchName: string; prUrl: string }> => {
122
- const { version, jiraVersionUrl, type } = args
123
+ const { version, jiraVersionUrl, type, description } = args
123
124
  const titlePrefix = type === 'hotfix' ? 'Hotfix' : 'Release'
124
125
  const baseBranch = getBaseBranch(type)
125
126
 
126
127
  const branchName = `release/v${version}`
127
128
 
129
+ const body = description && description.trim() !== '' ? `${jiraVersionUrl}\n\n${description}` : `${jiraVersionUrl} \n`
130
+
128
131
  try {
129
132
  $.quiet = true
130
133
 
@@ -137,7 +140,7 @@ export const createReleaseBranch = async (
137
140
 
138
141
  // Create PR and capture URL
139
142
  const prResult =
140
- await $`gh pr create --title "${titlePrefix} v${version}" --body "${jiraVersionUrl} \n" --base ${baseBranch} --head ${branchName}`
143
+ await $`gh pr create --title "${titlePrefix} v${version}" --body ${body} --base ${baseBranch} --head ${branchName}`
141
144
 
142
145
  const prLink = prResult.stdout.trim()
143
146
 
@@ -68,7 +68,7 @@ export const createSingleRelease = async (args: CreateSingleReleaseArgs): Promis
68
68
  const jiraVersionUrl = `${jiraConfig.baseUrl}/projects/${result.version!.projectId}/versions/${result.version!.id}/tab/release-report-all-issues`
69
69
 
70
70
  // 2. Create GitHub release branch
71
- const releaseInfo = await createReleaseBranch({ version, jiraVersionUrl, type })
71
+ const releaseInfo = await createReleaseBranch({ version, jiraVersionUrl, type, description })
72
72
 
73
73
  return {
74
74
  version,
@@ -11,6 +11,7 @@ import { ghReleaseDeploySelectedMcpTool } from 'src/commands/gh-release-deploy-s
11
11
  import { ghReleaseListMcpTool } from 'src/commands/gh-release-list'
12
12
  import { releaseCreateMcpTool } from 'src/commands/release-create'
13
13
  import { releaseCreateBatchMcpTool } from 'src/commands/release-create-batch'
14
+ import { versionMcpTool } from 'src/commands/version'
14
15
  import { worktreesAddMcpTool } from 'src/commands/worktrees-add'
15
16
  import { worktreesListMcpTool } from 'src/commands/worktrees-list'
16
17
  import { worktreesRemoveMcpTool } from 'src/commands/worktrees-remove'