infra-kit 0.1.100 → 0.1.101

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/dist/mcp.js CHANGED
@@ -42,7 +42,7 @@ ${r}`:`${e}
42
42
  from: "${p}"
43
43
  to: "${d}"
44
44
  `});o||m.setInteractive(),f||(i.info("Operation cancelled. Exiting..."),gn.exit(0)),m.addOption("--yes",!0),await Je({versionId:c.id,description:d},n);let u=Pt(n,c),g=wn(u,d);await Ge({branch:s,body:g}),i.info(`\u2705 Updated description for ${l}`),i.info(`\u{1F517} Jira Version: ${u}`),i.info(`\u{1F517} PR branch: ${s}
45
- `),m.print();let T={version:a,branch:s,jiraVersionUrl:u,previousDescription:p,newDescription:d,changed:!0};return{content:h(JSON.stringify(T,null,2)),structuredContent:T}},Tr=v({name:"release-desc-edit",description:"Edit a release's description in Jira and in the matching GitHub release PR body. Targets the Jira fix version named `v<version>` and the open PR on branch `release/v<version>`. The PR body is rewritten canonically to `<jiraVersionUrl>\\n\\n<description>` \u2014 any prior manual edits to the body are overwritten. Both `version` and `description` are required for MCP calls (the picker/prompt are unreachable without a TTY). Empty `description` clears the description on both sides. Confirmation is auto-skipped for MCP, so the caller is responsible for gating.",inputSchema:{version:q.string().describe('Release version, e.g. "1.2.5".'),description:q.string().describe("New description. Empty string clears the description.")},outputSchema:{version:q.string().describe("Release version"),branch:q.string().describe('Release branch name (e.g. "release/v1.2.5")'),jiraVersionUrl:q.string().describe("Jira fix version URL"),previousDescription:q.string().describe("The description before the update"),newDescription:q.string().describe("The description after the update"),changed:q.boolean().describe("Whether the description actually changed")},handler:$t});import{z as bn}from"zod/v4";var Et={name:"infra-kit",type:"module",version:"0.1.100",description:"infra-kit",main:"dist/cli.js",module:"dist/cli.js",bin:{"infra-kit":"dist/cli.js",ik:"dist/cli.js"},engines:{node:">=24.x"},scripts:{inspector:"npx @modelcontextprotocol/inspector node ./dist/mcp.js --debug",build:"pnpm run clean-artifacts && node ./scripts/build.js","clean-artifacts":"rm -rf dist","clean-cache":"rm -rf node_modules/.cache .eslintcache tsconfig.tsbuildinfo .turbo .swc","prettier-fix":"pnpm exec prettier **/* --write --no-error-on-unmatched-pattern --log-level silent --ignore-path ../../../.prettierignore","prettier-check":"pnpm exec prettier **/* --check --no-error-on-unmatched-pattern --log-level silent --ignore-path ../../../.prettierignore","eslint-check":"pnpm exec eslint --cache --quiet --report-unused-disable-directives ./src","eslint-fix":"pnpm exec eslint --cache --quiet --report-unused-disable-directives ./src --fix","ts-check":"tsc --noEmit",test:"pnpm exec vitest run --reporter=minimal","test-watch":"pnpm exec vitest --watch --silent passed-only","test-ui":"pnpm exec vitest --ui --silent passed-only","test-report":"pnpm exec vitest run --coverage --silent passed-only",qa:"pnpm run prettier-check && pnpm run eslint-check && pnpm run ts-check && pnpm run test && echo \u2705 Success",fix:"pnpm run prettier-fix && pnpm run eslint-fix && pnpm run qa"},dependencies:{"@inquirer/checkbox":"catalog:","@inquirer/confirm":"catalog:","@inquirer/select":"catalog:","@modelcontextprotocol/sdk":"^1.29.0",commander:"^14.0.3",pino:"^10.3.1","pino-pretty":"^13.1.3",yaml:"catalog:",zod:"^3.25.76",zx:"^8.8.5"},devDependencies:{"@pkg/eslint-config":"workspace:*","@pkg/vitest-config":"workspace:*",esbuild:"^0.28.0",typescript:"catalog:"}};var St=async()=>{let e=Et.version;i.info(e);let r={version:e};return{content:h(JSON.stringify(r,null,2)),structuredContent:r}},Pr=v({name:"version",description:"Print the installed infra-kit CLI version",inputSchema:{},outputSchema:{version:bn.string().describe("Installed infra-kit CLI version (from package.json)")},handler:St});import En from"@inquirer/checkbox";import Sr from"@inquirer/confirm";import Sn from"@inquirer/select";import In from"node:process";import{z as U}from"zod/v4";import{$ as Y}from"zx";import{$ as It}from"zx";var Te=async e=>{try{let r=(await It`cmux list-workspaces`.quiet()).stdout,t=xn(r,e);if(!t)return;await It`cmux close-workspace --workspace ${t}`.quiet()}catch(r){i.debug({error:r,title:e},"cmux: skipped closing workspace")}},xn=(e,r)=>{for(let t of e.split(`
45
+ `),m.print();let T={version:a,branch:s,jiraVersionUrl:u,previousDescription:p,newDescription:d,changed:!0};return{content:h(JSON.stringify(T,null,2)),structuredContent:T}},Tr=v({name:"release-desc-edit",description:"Edit a release's description in Jira and in the matching GitHub release PR body. Targets the Jira fix version named `v<version>` and the open PR on branch `release/v<version>`. The PR body is rewritten canonically to `<jiraVersionUrl>\\n\\n<description>` \u2014 any prior manual edits to the body are overwritten. Both `version` and `description` are required for MCP calls (the picker/prompt are unreachable without a TTY). Empty `description` clears the description on both sides. Confirmation is auto-skipped for MCP, so the caller is responsible for gating.",inputSchema:{version:q.string().describe('Release version, e.g. "1.2.5".'),description:q.string().describe("New description. Empty string clears the description.")},outputSchema:{version:q.string().describe("Release version"),branch:q.string().describe('Release branch name (e.g. "release/v1.2.5")'),jiraVersionUrl:q.string().describe("Jira fix version URL"),previousDescription:q.string().describe("The description before the update"),newDescription:q.string().describe("The description after the update"),changed:q.boolean().describe("Whether the description actually changed")},handler:$t});import{z as bn}from"zod/v4";var Et={name:"infra-kit",type:"module",version:"0.1.101",description:"infra-kit",main:"dist/cli.js",module:"dist/cli.js",bin:{"infra-kit":"dist/cli.js",ik:"dist/cli.js"},engines:{node:">=24.x"},scripts:{inspector:"npx @modelcontextprotocol/inspector node ./dist/mcp.js --debug",build:"pnpm run clean-artifacts && node ./scripts/build.js","clean-artifacts":"rm -rf dist","clean-cache":"rm -rf node_modules/.cache .eslintcache tsconfig.tsbuildinfo .turbo .swc","prettier-fix":"pnpm exec prettier **/* --write --no-error-on-unmatched-pattern --log-level silent --ignore-path ../../../.prettierignore","prettier-check":"pnpm exec prettier **/* --check --no-error-on-unmatched-pattern --log-level silent --ignore-path ../../../.prettierignore","eslint-check":"pnpm exec eslint --cache --quiet --report-unused-disable-directives ./src","eslint-fix":"pnpm exec eslint --cache --quiet --report-unused-disable-directives ./src --fix","ts-check":"tsc --noEmit",test:"pnpm exec vitest run --reporter=minimal","test-watch":"pnpm exec vitest --watch --silent passed-only","test-ui":"pnpm exec vitest --ui --silent passed-only","test-report":"pnpm exec vitest run --coverage --silent passed-only",qa:"pnpm run prettier-check && pnpm run eslint-check && pnpm run ts-check && pnpm run test && echo \u2705 Success",fix:"pnpm run prettier-fix && pnpm run eslint-fix && pnpm run qa"},dependencies:{"@inquirer/checkbox":"^5.1.5","@inquirer/confirm":"^6.0.13","@inquirer/select":"^5.1.5","@modelcontextprotocol/sdk":"^1.29.0",commander:"^14.0.3",pino:"^10.3.1","pino-pretty":"^13.1.3",yaml:"^2.9.0",zod:"^3.25.76",zx:"^8.8.5"},devDependencies:{"@pkg/eslint-config":"workspace:*","@pkg/vitest-config":"workspace:*",esbuild:"^0.28.0",typescript:"^6.0.3"}};var St=async()=>{let e=Et.version;i.info(e);let r={version:e};return{content:h(JSON.stringify(r,null,2)),structuredContent:r}},Pr=v({name:"version",description:"Print the installed infra-kit CLI version",inputSchema:{},outputSchema:{version:bn.string().describe("Installed infra-kit CLI version (from package.json)")},handler:St});import En from"@inquirer/checkbox";import Sr from"@inquirer/confirm";import Sn from"@inquirer/select";import In from"node:process";import{z as U}from"zod/v4";import{$ as Y}from"zx";import{$ as It}from"zx";var Te=async e=>{try{let r=(await It`cmux list-workspaces`.quiet()).stdout,t=xn(r,e);if(!t)return;await It`cmux close-workspace --workspace ${t}`.quiet()}catch(r){i.debug({error:r,title:e},"cmux: skipped closing workspace")}},xn=(e,r)=>{for(let t of e.split(`
46
46
  `)){let o=t.match(/^[* ]\s*(workspace:\d+)\s+(.+?)(?:\s+\[selected\])?\s*$/);if(!o)continue;let n=o[1];if((o[2]?.trim()??"")===r)return n}};import{$ as Cn}from"zx";var $r=async()=>{try{let e=(await Cn`cmux list-workspaces`.quiet()).stdout,r=new Set;for(let t of e.split(`
47
47
  `)){let o=t.match(/^[* ]\s*workspace:\d+\s+(.+?)(?:\s+\[selected\])?\s*$/);if(!o)continue;let n=o[1]?.trim();n&&r.add(n)}return r}catch(e){return i.debug({error:e},"cmux: skipped listing workspace titles"),new Set}};import{$ as Pe}from"zx";var $e=async e=>{let{cwd:r,title:t}=e,o=(await Pe`cmux new-workspace --cwd ${r}`).stdout,n=Pn(o),s=(await Pe`cmux list-pane-surfaces --workspace ${n}`).stdout,a=Tn(s);await Pe`cmux new-split right --workspace ${n} --surface ${a}`,await Pe`cmux new-split down --workspace ${n} --surface ${a}`,t&&await Pe`cmux rename-workspace --workspace ${n} ${t}`},Tn=e=>{let r=e.match(/surface:\d+/);if(!r)throw new Error("cmux: could not locate initial surface in list-pane-surfaces output");return r[0]},Pn=e=>{let r=e.match(/workspace:\d+/);if(!r)throw new Error("cmux: could not locate workspace ref in new-workspace output");return r[0]};var j=e=>{let{repoName:r,branch:t}=e,o=t.replace("release/","");return`${r} ${o}`};import Ot from"node:fs/promises";import ze from"node:path";var Ee=async e=>{let{workspacePath:r,folderPaths:t}=e,o=ze.dirname(r),n;try{n=await Ot.readFile(r,"utf-8")}catch(d){throw new Error(`Cursor workspace file not found at ${r}: ${d.message}`)}let s;try{s=JSON.parse(n)}catch(d){throw new Error(`Failed to parse ${r} as JSON. Comments (JSONC) are not supported. ${d.message}`)}let a=s.folders??[],l=new Set(a.map(d=>ze.resolve(o,d.path))),c=[],p=[];for(let d of t){let f=ze.resolve(d);if(l.has(f)){p.push(d);continue}let u=ze.relative(o,f);a.push({path:u}),l.add(f),c.push(d)}return s.folders=a,await Ot.writeFile(r,`${JSON.stringify(s,null,2)}
48
48
  `,"utf-8"),{added:c,skipped:p}};import $n from"node:fs/promises";import Xe from"node:path";import At from"node:fs/promises";import He from"node:path";var X=async e=>{let{workspacePath:r,folderPaths:t}=e,o=He.dirname(r),n;try{n=await At.readFile(r,"utf-8")}catch(u){throw new Error(`Cursor workspace file not found at ${r}: ${u.message}`)}let s;try{s=JSON.parse(n)}catch(u){throw new Error(`Failed to parse ${r} as JSON. Comments (JSONC) are not supported. ${u.message}`)}let a=s.folders??[],l=new Set(t.map(u=>He.resolve(u))),c=new Set,p=a.filter(u=>{let g=He.resolve(o,u.path);return l.has(g)?(c.add(g),!1):!0});s.folders=p,await At.writeFile(r,`${JSON.stringify(s,null,2)}