infra-kit 0.1.81 → 0.1.85

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/.eslintcache ADDED
@@ -0,0 +1 @@
1
+ [{"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/doctor/doctor.ts":"1","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/doctor/index.ts":"2","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-clear/env-clear.ts":"3","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-clear/index.ts":"4","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-list/env-list.ts":"5","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-list/index.ts":"6","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-load/env-load.ts":"7","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-load/index.ts":"8","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-status/env-status.ts":"9","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-status/index.ts":"10","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-merge-dev/gh-merge-dev.ts":"11","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-merge-dev/index.ts":"12","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deliver/gh-release-deliver.ts":"13","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deliver/index.ts":"14","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts":"15","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-all/index.ts":"16","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts":"17","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-selected/index.ts":"18","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-service/gh-release-deploy-service.ts":"19","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-service/index.ts":"20","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-list/gh-release-list.ts":"21","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-list/index.ts":"22","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/init/index.ts":"23","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/init/init.ts":"24","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create/index.ts":"25","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create/release-create.ts":"26","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create-batch/index.ts":"27","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create-batch/release-create-batch.ts":"28","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-add/index.ts":"29","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-add/worktrees-add.ts":"30","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-list/index.ts":"31","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-list/worktrees-list.ts":"32","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-remove/index.ts":"33","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-remove/worktrees-remove.ts":"34","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-sync/index.ts":"35","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-sync/worktrees-sync.ts":"36","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/entry/cli.ts":"37","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/entry/mcp.ts":"38","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/doppler-cli-auth.ts":"39","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/doppler-project.ts":"40","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/index.ts":"41","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-cli-auth/gh-cli-auth.ts":"42","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-cli-auth/index.ts":"43","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-release-prs/gh-release-prs.ts":"44","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-release-prs/index.ts":"45","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/index.ts":"46","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/api.ts":"47","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/index.ts":"48","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/types.ts":"49","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/command-echo/command-echo.ts":"50","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/command-echo/index.ts":"51","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/constants.ts":"52","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/error-handlers/index.ts":"53","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/git-utils/git-utils.ts":"54","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/git-utils/index.ts":"55","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/logger/index.ts":"56","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/release-utils/index.ts":"57","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/release-utils/release-utils.ts":"58","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/tool-handler/index.ts":"59","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/tool-handler/tool-handler.ts":"60","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/version-utils/index.ts":"61","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/version-utils/version-utils.ts":"62","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/prompts/index.ts":"63","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/resources/index.ts":"64","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/server.ts":"65","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/tools/index.ts":"66","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/sanity.test.tsx":"67","/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/types.ts":"68"},{"size":2678,"mtime":1775813835763,"results":"69","hashOfConfig":"70"},{"size":49,"mtime":1775813835764,"results":"71","hashOfConfig":"70"},{"size":2486,"mtime":1775813835764,"results":"72","hashOfConfig":"70"},{"size":56,"mtime":1775813835764,"results":"73","hashOfConfig":"70"},{"size":1256,"mtime":1775813835765,"results":"74","hashOfConfig":"70"},{"size":53,"mtime":1775813835765,"results":"75","hashOfConfig":"70"},{"size":3419,"mtime":1775813835766,"results":"76","hashOfConfig":"70"},{"size":53,"mtime":1775813835766,"results":"77","hashOfConfig":"70"},{"size":2934,"mtime":1775813835767,"results":"78","hashOfConfig":"70"},{"size":59,"mtime":1775813835767,"results":"79","hashOfConfig":"70"},{"size":5617,"mtime":1775813835768,"results":"80","hashOfConfig":"70"},{"size":63,"mtime":1775813835771,"results":"81","hashOfConfig":"70"},{"size":5391,"mtime":1775813835772,"results":"82","hashOfConfig":"70"},{"size":81,"mtime":1775813835772,"results":"83","hashOfConfig":"70"},{"size":4316,"mtime":1775813835773,"results":"84","hashOfConfig":"70"},{"size":88,"mtime":1775813835773,"results":"85","hashOfConfig":"70"},{"size":7131,"mtime":1775813835774,"results":"86","hashOfConfig":"70"},{"size":103,"mtime":1775813835774,"results":"87","hashOfConfig":"70"},{"size":5951,"mtime":1775813835775,"results":"88","hashOfConfig":"70"},{"size":100,"mtime":1775813835775,"results":"89","hashOfConfig":"70"},{"size":2189,"mtime":1775813835775,"results":"90","hashOfConfig":"70"},{"size":72,"mtime":1775813835776,"results":"91","hashOfConfig":"70"},{"size":30,"mtime":1775813835776,"results":"92","hashOfConfig":"70"},{"size":3283,"mtime":1775813835777,"results":"93","hashOfConfig":"70"},{"size":71,"mtime":1775813835778,"results":"94","hashOfConfig":"70"},{"size":5247,"mtime":1775813835778,"results":"95","hashOfConfig":"70"},{"size":87,"mtime":1775813835779,"results":"96","hashOfConfig":"70"},{"size":6101,"mtime":1775813835779,"results":"97","hashOfConfig":"70"},{"size":68,"mtime":1775813835780,"results":"98","hashOfConfig":"70"},{"size":8142,"mtime":1775813835780,"results":"99","hashOfConfig":"70"},{"size":71,"mtime":1775813835780,"results":"100","hashOfConfig":"70"},{"size":2870,"mtime":1775813835781,"results":"101","hashOfConfig":"70"},{"size":77,"mtime":1775813835781,"results":"102","hashOfConfig":"70"},{"size":5740,"mtime":1775813835781,"results":"103","hashOfConfig":"70"},{"size":71,"mtime":1775813835782,"results":"104","hashOfConfig":"70"},{"size":4117,"mtime":1775813835782,"results":"105","hashOfConfig":"70"},{"size":9452,"mtime":1775813835783,"results":"106","hashOfConfig":"107"},{"size":1044,"mtime":1775813835783,"results":"108","hashOfConfig":"70"},{"size":730,"mtime":1775813835783,"results":"109","hashOfConfig":"70"},{"size":656,"mtime":1775813835784,"results":"110","hashOfConfig":"70"},{"size":117,"mtime":1775813835784,"results":"111","hashOfConfig":"70"},{"size":768,"mtime":1775813835787,"results":"112","hashOfConfig":"70"},{"size":57,"mtime":1775813835788,"results":"113","hashOfConfig":"70"},{"size":4149,"mtime":1775813835788,"results":"114","hashOfConfig":"70"},{"size":147,"mtime":1775813835788,"results":"115","hashOfConfig":"70"},{"size":204,"mtime":1775813835788,"results":"116","hashOfConfig":"70"},{"size":9253,"mtime":1775813835789,"results":"117","hashOfConfig":"70"},{"size":363,"mtime":1775813835789,"results":"118","hashOfConfig":"70"},{"size":2111,"mtime":1775813835789,"results":"119","hashOfConfig":"70"},{"size":1811,"mtime":1775813835790,"results":"120","hashOfConfig":"70"},{"size":45,"mtime":1775813835790,"results":"121","hashOfConfig":"70"},{"size":1568,"mtime":1775813835790,"results":"122","hashOfConfig":"70"},{"size":1015,"mtime":1775813835791,"results":"123","hashOfConfig":"70"},{"size":1344,"mtime":1775813835791,"results":"124","hashOfConfig":"70"},{"size":66,"mtime":1775813835791,"results":"125","hashOfConfig":"70"},{"size":1003,"mtime":1775813835791,"results":"126","hashOfConfig":"70"},{"size":237,"mtime":1775813835792,"results":"127","hashOfConfig":"70"},{"size":4683,"mtime":1775813835792,"results":"128","hashOfConfig":"70"},{"size":51,"mtime":1775813835792,"results":"129","hashOfConfig":"70"},{"size":774,"mtime":1775813835793,"results":"130","hashOfConfig":"70"},{"size":61,"mtime":1775813835793,"results":"131","hashOfConfig":"70"},{"size":733,"mtime":1775813835793,"results":"132","hashOfConfig":"70"},{"size":140,"mtime":1775813835794,"results":"133","hashOfConfig":"70"},{"size":142,"mtime":1775813835794,"results":"134","hashOfConfig":"70"},{"size":577,"mtime":1775813835794,"results":"135","hashOfConfig":"70"},{"size":1999,"mtime":1775813835795,"results":"136","hashOfConfig":"70"},{"size":149,"mtime":1775813835795,"results":"137","hashOfConfig":"138"},{"size":242,"mtime":1775813835795,"results":"139","hashOfConfig":"70"},{"filePath":"140","messages":"141","suppressedMessages":"142","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"jgfgyi",{"filePath":"143","messages":"144","suppressedMessages":"145","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","suppressedMessages":"148","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"149","messages":"150","suppressedMessages":"151","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","suppressedMessages":"154","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"155","messages":"156","suppressedMessages":"157","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","suppressedMessages":"160","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"161","messages":"162","suppressedMessages":"163","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","suppressedMessages":"166","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"167","messages":"168","suppressedMessages":"169","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","suppressedMessages":"172","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"173","messages":"174","suppressedMessages":"175","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"176","messages":"177","suppressedMessages":"178","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"179","messages":"180","suppressedMessages":"181","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"182","messages":"183","suppressedMessages":"184","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"185","messages":"186","suppressedMessages":"187","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"188","messages":"189","suppressedMessages":"190","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"191","messages":"192","suppressedMessages":"193","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"194","messages":"195","suppressedMessages":"196","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"197","messages":"198","suppressedMessages":"199","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"200","messages":"201","suppressedMessages":"202","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"203","messages":"204","suppressedMessages":"205","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"206","messages":"207","suppressedMessages":"208","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"209","messages":"210","suppressedMessages":"211","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"212","messages":"213","suppressedMessages":"214","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"215","messages":"216","suppressedMessages":"217","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"218","messages":"219","suppressedMessages":"220","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"221","messages":"222","suppressedMessages":"223","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"224","messages":"225","suppressedMessages":"226","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"227","messages":"228","suppressedMessages":"229","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"230","messages":"231","suppressedMessages":"232","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"233","messages":"234","suppressedMessages":"235","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"236","messages":"237","suppressedMessages":"238","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"239","messages":"240","suppressedMessages":"241","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"242","messages":"243","suppressedMessages":"244","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"245","messages":"246","suppressedMessages":"247","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"248","messages":"249","suppressedMessages":"250","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1pn6f",{"filePath":"251","messages":"252","suppressedMessages":"253","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"254","messages":"255","suppressedMessages":"256","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"257","messages":"258","suppressedMessages":"259","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"260","messages":"261","suppressedMessages":"262","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"263","messages":"264","suppressedMessages":"265","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"266","messages":"267","suppressedMessages":"268","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"269","messages":"270","suppressedMessages":"271","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"272","messages":"273","suppressedMessages":"274","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"275","messages":"276","suppressedMessages":"277","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"278","messages":"279","suppressedMessages":"280","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"281","messages":"282","suppressedMessages":"283","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"284","messages":"285","suppressedMessages":"286","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"287","messages":"288","suppressedMessages":"289","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"290","messages":"291","suppressedMessages":"292","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"293","messages":"294","suppressedMessages":"295","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"296","messages":"297","suppressedMessages":"298","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"299","messages":"300","suppressedMessages":"301","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"302","messages":"303","suppressedMessages":"304","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"305","messages":"306","suppressedMessages":"307","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"308","messages":"309","suppressedMessages":"310","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"311","messages":"312","suppressedMessages":"313","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"314","messages":"315","suppressedMessages":"316","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"317","messages":"318","suppressedMessages":"319","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"320","messages":"321","suppressedMessages":"322","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"323","messages":"324","suppressedMessages":"325","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"326","messages":"327","suppressedMessages":"328","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"329","messages":"330","suppressedMessages":"331","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"332","messages":"333","suppressedMessages":"334","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"335","messages":"336","suppressedMessages":"337","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"338","messages":"339","suppressedMessages":"340","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"193rhvy",{"filePath":"341","messages":"342","suppressedMessages":"343","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/doctor/doctor.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/doctor/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-clear/env-clear.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-clear/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-list/env-list.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-list/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-load/env-load.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-load/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-status/env-status.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/env-status/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-merge-dev/gh-merge-dev.ts",[],["344"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-merge-dev/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deliver/gh-release-deliver.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deliver/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-all/gh-release-deploy-all.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-all/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-selected/gh-release-deploy-selected.ts",[],["345"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-selected/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-service/gh-release-deploy-service.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-deploy-service/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-list/gh-release-list.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/gh-release-list/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/init/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/init/init.ts",[],["346","347","348"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create/release-create.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create-batch/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/release-create-batch/release-create-batch.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-add/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-add/worktrees-add.ts",[],["349"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-list/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-list/worktrees-list.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-remove/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-remove/worktrees-remove.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-sync/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/commands/worktrees-sync/worktrees-sync.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/entry/cli.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/entry/mcp.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/doppler-cli-auth.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/doppler-project.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/doppler/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-cli-auth/gh-cli-auth.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-cli-auth/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-release-prs/gh-release-prs.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/gh-release-prs/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/gh/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/api.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/integrations/jira/types.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/command-echo/command-echo.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/command-echo/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/constants.ts",[],["350"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/error-handlers/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/git-utils/git-utils.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/git-utils/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/logger/index.ts",[],["351"],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/release-utils/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/release-utils/release-utils.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/tool-handler/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/tool-handler/tool-handler.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/version-utils/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/lib/version-utils/version-utils.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/prompts/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/resources/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/server.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/mcp/tools/index.ts",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/sanity.test.tsx",[],[],"/Users/arthur/projects/infra-kit/apps/infra-kit/cli/src/types.ts",[],[],{"ruleId":"352","severity":2,"message":"353","line":21,"column":87,"messageId":"354","endLine":21,"endColumn":89,"suppressions":"355"},{"ruleId":"352","severity":2,"message":"356","line":30,"column":113,"messageId":"354","endLine":30,"endColumn":115,"suppressions":"357"},{"ruleId":"358","severity":2,"message":"359","line":52,"column":53,"endLine":52,"endColumn":59,"suppressions":"360"},{"ruleId":"358","severity":2,"message":"359","line":77,"column":54,"endLine":77,"endColumn":60,"suppressions":"361"},{"ruleId":"362","severity":2,"message":"363","line":97,"column":5,"messageId":"364","endLine":97,"endColumn":47,"suppressions":"365"},{"ruleId":"352","severity":2,"message":"366","line":33,"column":100,"messageId":"354","endLine":33,"endColumn":102,"suppressions":"367"},{"ruleId":"368","severity":2,"message":"369","line":51,"column":30,"messageId":"370","endLine":51,"endColumn":54,"suppressions":"371"},{"ruleId":"368","severity":2,"message":"369","line":6,"column":30,"messageId":"370","endLine":6,"endColumn":54,"suppressions":"372"},"sonarjs/cognitive-complexity","Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.","refactorFunction",["373"],"Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.",["374"],"sonarjs/slow-regex","Make sure the regex used here, which is vulnerable to super-linear runtime due to backtracking, cannot lead to denial of service.",["375"],["376"],"no-template-curly-in-string","Unexpected template string expression.","unexpectedTemplateExpression",["377"],"Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.",["378"],"sonarjs/publicly-writable-directories","Make sure publicly writable directories are used safely here.","safeDirectory",["379"],["380"],{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},{"kind":"381","justification":"382"},"directive",""]
@@ -0,0 +1,11 @@
1
+
2
+ 
3
+ > infra-kit@0.1.85 build /Users/arthur/projects/infra-kit/apps/infra-kit/cli
4
+ > pnpm run clean-artifacts && node ./scripts/build.js
5
+
6
+
7
+ > infra-kit@0.1.85 clean-artifacts /Users/arthur/projects/infra-kit/apps/infra-kit/cli
8
+ > rm -rf dist
9
+
10
+ ✅ Build was completed successfully: cli.js - 0.0494 MB
11
+ ✅ Build was completed successfully: mcp.js - 0.0424 MB
@@ -0,0 +1,5 @@
1
+
2
+ 
3
+ > infra-kit@0.1.85 eslint-check /Users/arthur/projects/infra-kit/apps/infra-kit/cli
4
+ > pnpm exec eslint --cache --quiet --report-unused-disable-directives ./src
5
+
@@ -0,0 +1,5 @@
1
+
2
+ 
3
+ > infra-kit@0.1.85 prettier-check /Users/arthur/projects/infra-kit/apps/infra-kit/cli
4
+ > pnpm exec prettier **/* --check --no-error-on-unmatched-pattern --log-level warn --ignore-path ../../.prettierignore
5
+
@@ -0,0 +1,17 @@
1
+
2
+ 
3
+ > infra-kit@0.1.85 test /Users/arthur/projects/infra-kit/apps/infra-kit/cli
4
+ > pnpm exec vitest run --reporter=dot
5
+
6
+ [?25l
7
+  RUN  v4.1.4 /Users/arthur/projects/infra-kit/apps/infra-kit/cli
8
+
9
+ [?2026h*
10
+ [?2026l·
11
+
12
+  Test Files  1 passed (1)
13
+  Tests  1 passed (1)
14
+  Start at  12:59:00
15
+  Duration  102ms (transform 16ms, setup 14ms, import 9ms, tests 1ms, environment 0ms)
16
+
17
+ [?25h
@@ -0,0 +1,5 @@
1
+
2
+ 
3
+ > infra-kit@0.1.85 ts-check /Users/arthur/projects/infra-kit/apps/infra-kit/cli
4
+ > tsc --noEmit
5
+
package/dist/cli.js CHANGED
@@ -1,37 +1,41 @@
1
- import{Command as Xt,Option as Rr}from"commander";import{z as L}from"zod";import{$ as $r}from"zx";import xr from"node:process";import Tr from"pino";import Cr from"pino-pretty";var Sr=()=>{let e=xr.argv.includes("--debug")?"debug":"info",r=["time","pid","hostname"];return e==="debug"&&r.push("level"),Tr({level:e},Cr({destination:2,ignore:r.join(","),colorize:!0}))},o=Sr();var ce=async(e,r,t,n)=>{try{return await $r`${r}`,{name:e,status:"pass",message:t}}catch{return{name:e,status:"fail",message:n}}},le=async()=>{let e=await Promise.all([ce("gh installed",["gh","--version"],"GitHub CLI is installed","GitHub CLI is not installed. Install from: https://cli.github.com/"),ce("gh authenticated",["gh","auth","status"],"GitHub CLI is authenticated","GitHub CLI is not authenticated. Run: gh auth login"),ce("doppler installed",["doppler","--version"],"Doppler CLI is installed","Doppler CLI is not installed. Install from: https://docs.doppler.com/docs/install-cli"),ce("doppler authenticated",["doppler","me"],"Doppler CLI is authenticated","Doppler CLI is not authenticated. Run: doppler login")]);o.info(`Doctor check results:
2
- `);for(let t of e){let n=t.status==="pass"?"[PASS]":"[FAIL]";o.info(` ${n} ${t.name}: ${t.message}`)}let r={checks:e.map(t=>({name:t.name,status:t.status,message:t.message})),allPassed:e.every(t=>t.status==="pass")};return{content:[{type:"text",text:JSON.stringify(r,null,2)}],structuredContent:r}},Er={name:"doctor",description:"Check installation and authentication status of gh and doppler CLIs",inputSchema:{},outputSchema:{checks:L.array(L.object({name:L.string().describe("Name of the check"),status:L.enum(["pass","fail"]).describe("Check result"),message:L.string().describe("Details about the check result")})).describe("List of all check results"),allPassed:L.boolean().describe("Whether all checks passed")},handler:le};import me from"node:fs";import nr from"node:path";import Nr from"node:process";import{z as de}from"zod";import or from"node:fs";import Ir from"node:path";import Ar from"node:process";var C=["dev","arthur","renana","roman","eliran","oriana"],je={"hulyo-monorepo":"hulyo","travelist-monorepo":"travelist"},Pr="./node_modules/.cache/infra-kit",j="env-load.sh",sr="env-clear.sh",Ve="INFRA_KIT_SESSION",V="INFRA_KIT_ENV_CONFIG",B="INFRA_KIT_ENV_PROJECT",F="INFRA_KIT_ENV_LOADED_AT",pe=e=>or.existsSync(e)?or.readFileSync(e,"utf-8").split(`
3
- `).filter(t=>t.includes("=")&&!t.startsWith("set ")).map(t=>t.split("=")[0]):[],M=()=>{let e=Ar.env[Ve];if(!e)throw new Error("INFRA_KIT_SESSION is not set. Run `source ~/.zshrc` or `infra-kit env-init` first.");return Ir.join(Pr,e)},W="-worktrees";var ue=async()=>{let e=M(),r=nr.join(e,j);if(!me.existsSync(r))return o.error("No loaded environment found. Run `env-load` first."),{content:[{type:"text",text:"No loaded environment found. Run `env-load` first."}]};let t=pe(r),n=[...t.map(a=>`unset ${a}`),`unset ${V}`,`unset ${B}`,`unset ${F}`],s=nr.resolve(e,sr);me.mkdirSync(e,{recursive:!0}),me.writeFileSync(s,`${n.join(`
1
+ import to,{Separator as Y}from"@inquirer/select";import{Command as oo,Option as Cr}from"commander";import Tr from"node:process";import{z as L}from"zod";import{$ as Pr}from"zx";import $r from"node:process";import Er from"pino";import Ir from"pino-pretty";var Ar=()=>{let e=$r.argv.includes("--debug")?"debug":"info",r=["time","pid","hostname"];return e==="debug"&&r.push("level"),Er({level:e},Ir({destination:2,ignore:r.join(","),colorize:!0}))},s=Ar();var le=async(e,r,t,n)=>{try{return await Pr`${r}`,{name:e,status:"pass",message:t}}catch{return{name:e,status:"fail",message:n}}},pe=async()=>{let e=await Promise.all([le("gh installed",["gh","--version"],"GitHub CLI is installed","GitHub CLI is not installed. Install from: https://cli.github.com/"),le("gh authenticated",["gh","auth","status"],"GitHub CLI is authenticated","GitHub CLI is not authenticated. Run: gh auth login"),le("doppler installed",["doppler","--version"],"Doppler CLI is installed","Doppler CLI is not installed. Install from: https://docs.doppler.com/docs/install-cli"),le("doppler authenticated",["doppler","me"],"Doppler CLI is authenticated","Doppler CLI is not authenticated. Run: doppler login")]);s.info(`Doctor check results:
2
+ `);for(let t of e){let n=t.status==="pass"?"[PASS]":"[FAIL]";s.info(` ${n} ${t.name}: ${t.message}`)}let r={checks:e.map(t=>({name:t.name,status:t.status,message:t.message})),allPassed:e.every(t=>t.status==="pass")};return{content:[{type:"text",text:JSON.stringify(r,null,2)}],structuredContent:r}},Nr={name:"doctor",description:"Check installation and authentication status of gh and doppler CLIs",inputSchema:{},outputSchema:{checks:L.array(L.object({name:L.string().describe("Name of the check"),status:L.enum(["pass","fail"]).describe("Check result"),message:L.string().describe("Details about the check result")})).describe("List of all check results"),allPassed:L.boolean().describe("Whether all checks passed")},handler:pe};import de from"node:fs";import ir from"node:path";import Jr from"node:process";import{z as ue}from"zod";import sr from"node:fs";import Dr from"node:path";import Or from"node:process";var C=["dev","arthur","renana","roman","eliran","oriana"],Ve={"hulyo-monorepo":"hulyo","travelist-monorepo":"travelist"},_r="./node_modules/.cache/infra-kit",j="env-load.sh",nr="env-clear.sh",Be="INFRA_KIT_SESSION",V="INFRA_KIT_ENV_CONFIG",B="INFRA_KIT_ENV_PROJECT",F="INFRA_KIT_ENV_LOADED_AT",me=e=>sr.existsSync(e)?sr.readFileSync(e,"utf-8").split(`
3
+ `).filter(t=>t.includes("=")&&!t.startsWith("set ")).map(t=>t.split("=")[0]):[],M=()=>{let e=Or.env[Be];if(!e)throw new Error("INFRA_KIT_SESSION is not set. Run `source ~/.zshrc` or `infra-kit init` first.");return Dr.join(_r,e)},W="-worktrees";var fe=async()=>{let e=M(),r=ir.join(e,j);if(!de.existsSync(r))return s.error("No loaded environment found. Run `env-load` first."),{content:[{type:"text",text:"No loaded environment found. Run `env-load` first."}]};let t=me(r),n=[...t.map(a=>`unset ${a}`),`unset ${V}`,`unset ${B}`,`unset ${F}`],o=ir.resolve(e,nr);de.mkdirSync(e,{recursive:!0}),de.writeFileSync(o,`${n.join(`
4
4
  `)}
5
- `),Nr.stdout.write(`${s}
6
- `),me.unlinkSync(r);let i={variableCount:t.length,unsetStatements:n};return{content:[{type:"text",text:JSON.stringify(i,null,2)}],structuredContent:i}},Dr={name:"env-clear",description:"Clear loaded env vars. Returns a file path that must be sourced (source <path>) to apply. The env-clear shell alias does this automatically.",inputSchema:{},outputSchema:{filePath:de.string().describe("Path to the file that must be sourced to apply"),variableCount:de.number().describe("Number of variables cleared"),unsetStatements:de.array(de.string()).describe("Unset statements generated")},handler:ue};import fe from"node:fs";import Or from"node:os";import _r from"node:path";var ir="# infra-kit shell functions",Be=async()=>{let e=_r.join(Or.homedir(),".zshrc"),r=jr();if(fe.existsSync(e)){let t=fe.readFileSync(e,"utf-8"),n=Lr(t);fe.writeFileSync(e,n)}fe.appendFileSync(e,`
7
- ${r}
8
- `),o.info(`Added infra-kit shell functions to ${e}`),o.info("Run `source ~/.zshrc` or open a new terminal to activate.")},Jr=e=>e.startsWith("#")||e.startsWith("env-load")||e.startsWith("env-clear")||e.startsWith("env-status")||e.startsWith("if ")||e.startsWith(" export INFRA_KIT_SESSION")||e.startsWith("fi"),Lr=e=>{let r=e.indexOf(ir);if(r===-1)return e;let t=e.slice(0,r).replace(/\n+$/,""),n=e.slice(r).split(`
9
- `),s=0;for(;s<n.length&&Jr(n[s]);)s++;let i=n.slice(s).join(`
10
- `);return t+(i?`
11
- ${i}`:"")},jr=()=>{let e="pnpm exec infra-kit";return[ir,'if [[ -z "${INFRA_KIT_SESSION}" ]]; then'," export INFRA_KIT_SESSION=$(head -c 4 /dev/urandom | xxd -p)","fi",`env-load() { local f; f=$(${e} env-load "$@") && source "$f" && ${e} env-status; }`,`env-clear() { local f; f=$(${e} env-clear) && source "$f" && ${e} env-status; }`,`env-status() { ${e} env-status; }`].join(`
12
- `)};import{z as Fe}from"zod";import ar from"node:process";import{$ as cr}from"zx";var _=async()=>{try{await cr`doppler --version`}catch(e){o.error({error:e},"Error: Doppler CLI is not installed."),o.error("Please install it from: https://docs.doppler.com/docs/install-cli"),ar.exit(1)}try{await cr`doppler me`}catch(e){o.error({error:e},"Error: Doppler CLI is not authenticated."),o.error("Please authenticate by running: doppler login"),ar.exit(1)}};import Fr from"node:path";import{$ as lr}from"zx";var D=async e=>{let t=(await lr`git worktree list`).stdout.split(`
13
- `).filter(Boolean),n={release:Vr,feature:Br};return t.map(n[e]).filter(s=>s!==null)},Vr=e=>{let r=e.split(" ").filter(Boolean);return r.length<3||!r[0]?.includes("release/v")?null:`release/${r[0]?.split("/").pop()||""}`},Br=e=>{let r=e.split(" ").filter(Boolean);return r.length<3||!r[0]?.includes("feature/")?null:`feature/${r[0]?.split("/").pop()||""}`},$=async()=>(await lr`git rev-parse --show-toplevel`).stdout.trim();var Y=async()=>{let e=await $(),r=Fr.basename(e),t=je[r];if(!t)throw new Error(`Could not determine Doppler project for directory "${r}". Expected one of: ${Object.keys(je).join(", ")}`);return t};var ge=async()=>{await _();let e=await Y();o.info(`Doppler Project: ${e}
14
- `),o.info("Available Configs:");for(let t of C)o.info(` - ${t}`);let r={project:e,configs:C};return{content:[{type:"text",text:JSON.stringify(r,null,2)}],structuredContent:r}},Mr={name:"env-list",description:"List available Doppler configs for the detected project",inputSchema:{},outputSchema:{project:Fe.string().describe("Detected Doppler project name"),configs:Fe.array(Fe.string()).describe("Available environment configs")},handler:ge};import qr from"@inquirer/select";import pr from"node:fs";import Ur from"node:path";import mr from"node:process";import{z as Z}from"zod";import{$ as Me}from"zx";var Wr=()=>{let e="",r=[],t=!1;return{start(n){e=n,r=[],t=!1},setInteractive(){t=!0},addOption(n,s){r.push({flag:n,value:s})},print(){if(!t||r.length===0)return;let n=r.map(s=>typeof s.value=="boolean"?s.value?s.flag:"":Array.isArray(s.value)?`${s.flag} "${s.value.join(", ")}"`:`${s.flag} ${s.value}`).filter(Boolean).join(" ");o.info(`\u{1F4DF} Equivalent command:
15
- pnpm exec infra-kit ${e} ${n}`),o.info("")},reset(){e="",r=[],t=!1}}},c=Wr();var he=async e=>{await _();let{config:r}=e;c.start("env-load");let t="";r?t=r:(c.setInteractive(),t=await qr({message:"Select environment config",choices:C.map(f=>({name:f,value:f}))},{output:mr.stderr})),c.addOption("--config",t);let n=await Y();Me.quiet=!0;let s=await Me`doppler secrets download --no-file --format env --project ${n} --config ${t}`;Me.quiet=!1;let i=s.stdout.trim(),a=new Date().toISOString(),p=["set -a",i,`${V}=${t}`,`${B}=${n}`,`${F}=${a}`,"set +a"],l=M(),m=Ur.resolve(l,j);pr.mkdirSync(l,{recursive:!0}),pr.writeFileSync(m,`${p.join(`
5
+ `),Jr.stdout.write(`${o}
6
+ `),de.unlinkSync(r);let i={variableCount:t.length,unsetStatements:n};return{content:[{type:"text",text:JSON.stringify(i,null,2)}],structuredContent:i}},Lr={name:"env-clear",description:"Clear loaded env vars. Returns a file path that must be sourced (source <path>) to apply. The env-clear shell alias does this automatically.",inputSchema:{},outputSchema:{filePath:ue.string().describe("Path to the file that must be sourced to apply"),variableCount:ue.number().describe("Number of variables cleared"),unsetStatements:ue.array(ue.string()).describe("Unset statements generated")},handler:fe};import{z as Fe}from"zod";import ar from"node:process";import{$ as cr}from"zx";var _=async()=>{try{await cr`doppler --version`}catch(e){s.error({error:e},"Error: Doppler CLI is not installed."),s.error("Please install it from: https://docs.doppler.com/docs/install-cli"),ar.exit(1)}try{await cr`doppler me`}catch(e){s.error({error:e},"Error: Doppler CLI is not authenticated."),s.error("Please authenticate by running: doppler login"),ar.exit(1)}};import Br from"node:path";import{$ as lr}from"zx";var D=async e=>{let t=(await lr`git worktree list`).stdout.split(`
7
+ `).filter(Boolean),n={release:jr,feature:Vr};return t.map(n[e]).filter(o=>o!==null)},jr=e=>{let r=e.split(" ").filter(Boolean);return r.length<3||!r[0]?.includes("release/v")?null:`release/${r[0]?.split("/").pop()||""}`},Vr=e=>{let r=e.split(" ").filter(Boolean);return r.length<3||!r[0]?.includes("feature/")?null:`feature/${r[0]?.split("/").pop()||""}`},$=async()=>(await lr`git rev-parse --show-toplevel`).stdout.trim();var Z=async()=>{let e=await $(),r=Br.basename(e),t=Ve[r];if(!t)throw new Error(`Could not determine Doppler project for directory "${r}". Expected one of: ${Object.keys(Ve).join(", ")}`);return t};var ge=async()=>{await _();let e=await Z();s.info(`Doppler project: ${e}
8
+ `),s.info("Available configs:");for(let t of C)s.info(` - ${t}`);let r={project:e,configs:C};return{content:[{type:"text",text:JSON.stringify(r,null,2)}],structuredContent:r}},Fr={name:"env-list",description:"List available Doppler configs for the detected project",inputSchema:{},outputSchema:{project:Fe.string().describe("Detected Doppler project name"),configs:Fe.array(Fe.string()).describe("Available environment configs")},handler:ge};import Wr from"@inquirer/select";import pr from"node:fs";import qr from"node:path";import mr from"node:process";import{z as Q}from"zod";import{$ as Me}from"zx";var Mr=()=>{let e="",r=[],t=!1;return{start(n){e=n,r=[],t=!1},setInteractive(){t=!0},addOption(n,o){r.push({flag:n,value:o})},print(){if(!t||r.length===0)return;let n=r.map(o=>typeof o.value=="boolean"?o.value?o.flag:"":Array.isArray(o.value)?`${o.flag} "${o.value.join(", ")}"`:`${o.flag} "${o.value}"`).filter(Boolean).join(" ");s.info(`\u{1F4DF} Equivalent command:
9
+ pnpm exec infra-kit ${e} ${n}
10
+ `)},reset(){e="",r=[],t=!1}}},l=Mr();var he=async e=>{await _();let{config:r}=e;l.start("env-load");let t="";r?t=r:(l.setInteractive(),t=await Wr({message:"Select environment config",choices:C.map(f=>({name:f,value:f}))},{output:mr.stderr})),l.addOption("--config",t);let n=await Z();Me.quiet=!0;let o=await Me`doppler secrets download --no-file --format env --project ${n} --config ${t}`;Me.quiet=!1;let i=o.stdout.trim(),a=new Date().toISOString(),p=["set -a",i,`${V}=${t}`,`${B}=${n}`,`${F}=${a}`,"set +a"],c=M(),m=qr.resolve(c,j);pr.mkdirSync(c,{recursive:!0}),pr.writeFileSync(m,`${p.join(`
16
11
  `)}
17
12
  `),mr.stdout.write(`${m}
18
13
  `);let d={variableCount:i.split(`
19
- `).filter(f=>f.includes("=")).length,project:n,config:t};return{content:[{type:"text",text:JSON.stringify(d,null,2)}],structuredContent:d}},Gr={name:"env-load",description:"Load Doppler env vars for a config. Returns a file path that must be sourced (source <path>) to apply variables. The env-load shell alias does this automatically.",inputSchema:{config:Z.string().describe("Environment config name to load (e.g. dev, arthur, renana)")},outputSchema:{filePath:Z.string().describe("Path to the file that must be sourced to apply variables"),variableCount:Z.number().describe("Number of variables loaded"),project:Z.string().describe("Doppler project name"),config:Z.string().describe("Doppler config name")},handler:he};import zr from"node:path";import Q from"node:process";import{z as q}from"zod";var ve=async()=>{await _(),o.info("Environment session status:");let e=M(),r=Q.env[Ve],t=zr.join(e,j),n=0,s=0,i=Q.env[V]??null,a=Q.env[B]??null,p=Q.env[F]??null;if(i){let m=pe(t);m.length>0&&(s=m.length,n=m.filter(d=>d in Q.env).length);let u=p?.replace(/\.\d{3}Z$/,"")??null;o.info(` ${i}: ${n} of ${s} vars loaded (project: ${a}, loadedAt: ${u}, session: ${r})
20
- `)}else o.info(` Session ${r}: no env loaded
21
- `);let l={sessionId:r,sessionLoadedCount:n,sessionTotalCount:s,sessionConfig:i,sessionProject:a,sessionLoadedAt:p};return{content:[{type:"text",text:JSON.stringify(l,null,2)}],structuredContent:l}},Kr={name:"env-status",description:"Show Doppler authentication status and detected project info",inputSchema:{},outputSchema:{sessionId:q.string().describe("Current terminal session ID"),sessionLoadedCount:q.number().describe("Number of cached vars active in the current session"),sessionTotalCount:q.number().describe("Total number of cached var names"),sessionConfig:q.string().nullable().describe("Doppler config name of the loaded session (environment name)"),sessionProject:q.string().nullable().describe("Doppler project name of the loaded session"),sessionLoadedAt:q.string().nullable().describe("ISO 8601 timestamp of when the env was loaded")},handler:ve};import Zr from"@inquirer/checkbox";import Qr from"@inquirer/confirm";import et from"node:process";import{z}from"zod";import{$ as A}from"zx";import{$ as Ts}from"zx";import ke from"node:process";import{$ as E}from"zx";import{$ as te}from"zx";import ee from"node:process";var We=async(e,r)=>{try{let{baseUrl:t,token:n,email:s,projectId:i}=r,a={name:e.name,projectId:e.projectId||i,description:e.description||"",released:e.released||!1,archived:e.archived||!1},p=`${t}/rest/api/3/version`,l=btoa(`${s}:${n}`),m=await fetch(p,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Basic ${l}`},body:JSON.stringify(a)});if(!m.ok){let d=await m.text();throw o.error({status:m.status,statusText:m.statusText,error:d},"Failed to create Jira version"),new Error(`HTTP ${m.status}: ${m.statusText}`)}return{success:!0,version:await m.json()}}catch(t){throw o.error({error:t},"Error creating Jira version"),t}},ye=async e=>{try{let{baseUrl:r,token:t,email:n,projectId:s}=e,i=`${r}/rest/api/3/project/${s}/versions`,a=btoa(`${n}:${t}`),p=await fetch(i,{method:"GET",headers:{Accept:"application/json",Authorization:`Basic ${a}`}});if(!p.ok){let m=await p.text();throw o.error({status:p.status,statusText:p.statusText,error:m},"Failed to get Jira project versions"),new Error(`HTTP ${p.status}: ${p.statusText}`)}return await p.json()}catch(r){throw o.error({error:r},"Error getting Jira project versions"),r}},Xr=async(e,r)=>{try{return(await ye(r)).find(s=>s.name===e)||null}catch(t){throw o.error({error:t,versionName:e},"Error finding Jira version by name"),t}},Yr=async(e,r)=>{try{let{baseUrl:t,token:n,email:s}=r,i={released:e.released??!0,archived:e.archived??!1};e.releaseDate?i.releaseDate=e.releaseDate:e.released!==!1&&(i.releaseDate=new Date().toISOString().split("T")[0]),e.description!==void 0&&(i.description=e.description);let a=`${t}/rest/api/3/version/${e.versionId}`,p=btoa(`${s}:${n}`),l=await fetch(a,{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Basic ${p}`},body:JSON.stringify(i)});if(!l.ok){let u=await l.text();throw o.error({status:l.status,statusText:l.statusText,error:u},"Failed to update Jira version"),new Error(`HTTP ${l.status}: ${l.statusText}`)}return{success:!0,version:await l.json()}}catch(t){throw o.error({error:t},"Error updating Jira version"),t}},qe=async(e,r)=>{try{let{versionName:t}=e,n=await Xr(t,r);if(!n)throw o.error({versionName:t},"Jira version not found"),new Error(`Version "${t}" not found in Jira project`);return await Yr({versionId:n.id,released:!0,releaseDate:new Date().toISOString().split("T")[0]},r)}catch(t){throw o.error({error:t},"Error delivering Jira release"),t}},U=async()=>{let e=ee.env.JIRA_BASE_URL,r=ee.env.JIRA_TOKEN||ee.env.JIRA_API_TOKEN,t=ee.env.JIRA_PROJECT_ID,n=ee.env.JIRA_EMAIL,s=[];if(e||s.push("JIRA_BASE_URL (e.g., https://your-domain.atlassian.net)"),r||s.push("JIRA_TOKEN or JIRA_API_TOKEN (your Jira API token)"),t||s.push("JIRA_PROJECT_ID (numeric project ID)"),n||s.push("JIRA_EMAIL (your Jira email address)"),s.length>0){let a=["Jira configuration is required but incomplete.","Please configure the following environment variables:",...s.map(p=>` - ${p}`),"","You can set these in your .env file or as environment variables."].join(`
22
- `);throw new Error(a)}let i=Number.parseInt(t,10);if(Number.isNaN(i))throw new TypeError(`Invalid JIRA_PROJECT_ID: "${t}" must be a numeric value (e.g., 10001)`);return{baseUrl:e.replace(/\/$/,""),token:r,projectId:i,email:n}},re=async()=>{try{return await U()}catch(e){return o.warn({error:e},"Jira configuration not available, skipping Jira integration"),null}};var we=e=>e==="hotfix"?"main":"dev",oe=async(e="regular")=>{let r=we(e);te.quiet=!0,await te`git fetch origin`,await te`git switch ${r}`,await te`git pull origin ${r}`,te.quiet=!1},se=async e=>{let{version:r,jiraConfig:t,description:n,type:s="regular"}=e,i=`v${r}`,a=await We({name:i,projectId:t.projectId,description:n||"",released:!1,archived:!1},t),p=`${t.baseUrl}/projects/${a.version.projectId}/versions/${a.version.id}/tab/release-report-all-issues`,l=await be({version:r,jiraVersionUrl:p,type:s});return{version:r,type:s,branchName:l.branchName,prUrl:l.prUrl,jiraVersionUrl:p}},y=async()=>{let e=new Map,r=await re();if(!r)return e;try{let t=await ye(r);for(let n of t)n.description&&e.set(n.name,n.description)}catch{}return e},G=(e,r,t)=>{let n=t?" ".repeat(t-e.length+3):" ";return`${e}${n}[${r}]`},h=e=>e.toLowerCase().startsWith("hotfix")?"hotfix":"regular",x=e=>{let{branches:r,descriptions:t,types:n}=e,s=r.map(a=>a.replace("release/v","")),i=Math.max(...s.map(a=>a.length));return r.map((a,p)=>{let l=s[p],m=n?n.get(a)||"regular":void 0,u=t.get(`v${l}`),d=" ".repeat(i-l.length+3),f=m?G(l,m,i):l;return u&&(f=m?`${f} ${u}`:`${l}${d}${u}`),{name:f,value:a}})};var Ue=e=>e.replace("release/","").slice(1).split(".").map(Number),Re=e=>[...e].sort((r,t)=>{let[n,s,i]=Ue(r),[a,p,l]=Ue(t);return n!==a?(n??0)-(a??0):s!==p?(s??0)-(p??0):(i??0)-(l??0)});var dr=async()=>{let e=await E`gh pr list --search "Release in:title" --base dev --json number,title,headRefName,state,baseRefName`,r=await E`gh pr list --search "Hotfix in:title" --base main --json number,title,headRefName,state,baseRefName`,t=[...JSON.parse(e.stdout),...JSON.parse(r.stdout)],n=new Set;return t.filter(s=>n.has(s.headRefName)?!1:(n.add(s.headRefName),!0))},xe=async()=>{try{let e=await dr();return e.length===0&&(o.error("\u274C No release PRs found. Check the project folder for the script. Exiting..."),ke.exit(1)),Re(e.map(r=>r.headRefName))}catch(e){o.error({error:e},"\u274C Error fetching release PRs"),ke.exit(1)}},v=async()=>{try{let e=await dr();e.length===0&&(o.error("\u274C No release PRs found. Check the project folder for the script. Exiting..."),ke.exit(1));let r=Re(e.map(n=>n.headRefName)),t=new Map(e.map(n=>[n.headRefName,n]));return r.map(n=>({branch:n,title:t.get(n).title}))}catch(e){o.error({error:e},"\u274C Error fetching release PRs"),ke.exit(1)}},be=async e=>{let{version:r,jiraVersionUrl:t,type:n}=e,s=n==="hotfix"?"Hotfix":"Release",i=we(n),a=`release/v${r}`;try{E.quiet=!0,await E`git switch ${i}`,await E`git pull origin ${i}`,await E`git checkout -b ${a}`,await E`git push -u origin ${a}`,await E`git commit --allow-empty-message --allow-empty --message ''`,await E`git push origin ${a}`;let l=(await E`gh pr create --title "${s} v${r}" --body "${t} \n" --base ${i} --head ${a}`).stdout.trim();return await E`git switch ${i}`,E.quiet=!1,{branchName:a,prUrl:l}}catch(p){throw o.error({error:p,branchName:a},`Error creating release branch ${a}`),p}};var Te=async e=>{let{all:r,confirmedCommand:t}=e;c.start("merge-dev");let s=(await v()).filter(u=>h(u.title)==="regular").map(u=>u.branch);if(s.length===0)return o.info("\u2139\uFE0F No open release branches found"),c.print(),{content:[{type:"text",text:JSON.stringify({successfulMerges:0,failedMerges:0,failedBranches:[],totalBranches:0},null,2)}],structuredContent:{successfulMerges:0,failedMerges:0,failedBranches:[],totalBranches:0}};let i=[];if(r)i=s;else{c.setInteractive();let u=await y();i=await Zr({required:!0,message:"\u{1F33F} Select release branches",choices:x({branches:s,descriptions:u})})}i.length===s.length?c.addOption("--all",!0):c.addOption("--versions",i.map(u=>u.replace("release/v","")));let p=t?!0:await Qr({message:`Are you sure you want to merge dev into these branches: ${i.join(", ")}?`});t||c.setInteractive(),p||(o.info("Operation cancelled. Exiting..."),et.exit(0)),t||c.addOption("--yes",!0),A.quiet=!0,await A`git fetch origin`,await A`git switch dev`,await A`git pull origin dev`;let l=[];for(let u of i)await rt(u)||l.push(u);if(A.quiet=!1,l.length>0){o.info(`
23
- \u26A0\uFE0F ${l.length} branch(es) failed to merge automatically.
24
- `),o.info("\u{1F4CB} Manual merge script for failed branches:");for(let u of l)o.info(`# Merge dev into ${u} and resolve conflicts if any
14
+ `).filter(f=>f.includes("=")).length,project:n,config:t};return{content:[{type:"text",text:JSON.stringify(d,null,2)}],structuredContent:d}},Ur={name:"env-load",description:"Load Doppler env vars for a config. Returns a file path that must be sourced (source <path>) to apply variables. The env-load shell alias does this automatically.",inputSchema:{config:Q.string().describe("Environment config name to load (e.g. dev, arthur, renana)")},outputSchema:{filePath:Q.string().describe("Path to the file that must be sourced to apply variables"),variableCount:Q.number().describe("Number of variables loaded"),project:Q.string().describe("Doppler project name"),config:Q.string().describe("Doppler config name")},handler:he};import Gr from"node:path";import ee from"node:process";import{z as q}from"zod";var ve=async()=>{await _(),s.info("Environment session status:");let e=M(),r=ee.env[Be],t=Gr.join(e,j),n=0,o=0,i=ee.env[V]??null,a=ee.env[B]??null,p=ee.env[F]??null;if(i){let m=me(t);m.length>0&&(o=m.length,n=m.filter(d=>d in ee.env).length);let u=p?.replace(/\.\d{3}Z$/,"")??null;s.info(` ${i}: ${n} of ${o} vars loaded (project: ${a}, loadedAt: ${u}, session: ${r})
15
+ `)}else s.info(` Session ${r}: no env loaded
16
+ `);let c={sessionId:r,sessionLoadedCount:n,sessionTotalCount:o,sessionConfig:i,sessionProject:a,sessionLoadedAt:p};return{content:[{type:"text",text:JSON.stringify(c,null,2)}],structuredContent:c}},zr={name:"env-status",description:"Show Doppler authentication status and detected project info",inputSchema:{},outputSchema:{sessionId:q.string().describe("Current terminal session ID"),sessionLoadedCount:q.number().describe("Number of cached vars active in the current session"),sessionTotalCount:q.number().describe("Total number of cached var names"),sessionConfig:q.string().nullable().describe("Doppler config name of the loaded session (environment name)"),sessionProject:q.string().nullable().describe("Doppler project name of the loaded session"),sessionLoadedAt:q.string().nullable().describe("ISO 8601 timestamp of when the env was loaded")},handler:ve};import Yr from"@inquirer/checkbox";import Zr from"@inquirer/confirm";import Qr from"node:process";import{z}from"zod";import{$ as A}from"zx";import{$ as Ts}from"zx";import ke from"node:process";import{$ as E}from"zx";import{$ as oe}from"zx";import re from"node:process";var We=async(e,r)=>{try{let{baseUrl:t,token:n,email:o,projectId:i}=r,a={name:e.name,projectId:e.projectId||i,description:e.description||"",released:e.released||!1,archived:e.archived||!1},p=`${t}/rest/api/3/version`,c=btoa(`${o}:${n}`),m=await fetch(p,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(a)});if(!m.ok){let d=await m.text();throw s.error({status:m.status,statusText:m.statusText,error:d},"Failed to create Jira version"),new Error(`HTTP ${m.status}: ${m.statusText}`)}return{success:!0,version:await m.json()}}catch(t){throw s.error({error:t},"Error creating Jira version"),t}},ye=async e=>{try{let{baseUrl:r,token:t,email:n,projectId:o}=e,i=`${r}/rest/api/3/project/${o}/versions`,a=btoa(`${n}:${t}`),p=await fetch(i,{method:"GET",headers:{Accept:"application/json",Authorization:`Basic ${a}`}});if(!p.ok){let m=await p.text();throw s.error({status:p.status,statusText:p.statusText,error:m},"Failed to get Jira project versions"),new Error(`HTTP ${p.status}: ${p.statusText}`)}return await p.json()}catch(r){throw s.error({error:r},"Error getting Jira project versions"),r}},Hr=async(e,r)=>{try{return(await ye(r)).find(o=>o.name===e)||null}catch(t){throw s.error({error:t,versionName:e},"Error finding Jira version by name"),t}},Xr=async(e,r)=>{try{let{baseUrl:t,token:n,email:o}=r,i={released:e.released??!0,archived:e.archived??!1};e.releaseDate?i.releaseDate=e.releaseDate:e.released!==!1&&(i.releaseDate=new Date().toISOString().split("T")[0]),e.description!==void 0&&(i.description=e.description);let a=`${t}/rest/api/3/version/${e.versionId}`,p=btoa(`${o}:${n}`),c=await fetch(a,{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Basic ${p}`},body:JSON.stringify(i)});if(!c.ok){let u=await c.text();throw s.error({status:c.status,statusText:c.statusText,error:u},"Failed to update Jira version"),new Error(`HTTP ${c.status}: ${c.statusText}`)}return{success:!0,version:await c.json()}}catch(t){throw s.error({error:t},"Error updating Jira version"),t}},qe=async(e,r)=>{try{let{versionName:t}=e,n=await Hr(t,r);if(!n)throw s.error({versionName:t},"Jira version not found"),new Error(`Version "${t}" not found in Jira project`);return await Xr({versionId:n.id,released:!0,releaseDate:new Date().toISOString().split("T")[0]},r)}catch(t){throw s.error({error:t},"Error delivering Jira release"),t}},U=async()=>{let e=re.env.JIRA_BASE_URL,r=re.env.JIRA_TOKEN||re.env.JIRA_API_TOKEN,t=re.env.JIRA_PROJECT_ID,n=re.env.JIRA_EMAIL,o=[];if(e||o.push("JIRA_BASE_URL (e.g., https://your-domain.atlassian.net)"),r||o.push("JIRA_TOKEN or JIRA_API_TOKEN (your Jira API token)"),t||o.push("JIRA_PROJECT_ID (numeric project ID)"),n||o.push("JIRA_EMAIL (your Jira email address)"),o.length>0){let a=["Jira configuration is required but incomplete.","Please configure the following environment variables:",...o.map(p=>` - ${p}`),"","You can set these in your .env file or as environment variables."].join(`
17
+ `);throw new Error(a)}let i=Number.parseInt(t,10);if(Number.isNaN(i))throw new TypeError(`Invalid JIRA_PROJECT_ID: "${t}" must be a numeric value (e.g., 10001)`);return{baseUrl:e.replace(/\/$/,""),token:r,projectId:i,email:n}},te=async()=>{try{return await U()}catch(e){return s.warn({error:e},"Jira configuration not available, skipping Jira integration"),null}};var we=e=>e==="hotfix"?"main":"dev",se=async(e="regular")=>{let r=we(e);oe.quiet=!0,await oe`git fetch origin`,await oe`git switch ${r}`,await oe`git pull origin ${r}`,oe.quiet=!1},ne=async e=>{let{version:r,jiraConfig:t,description:n,type:o="regular"}=e,i=`v${r}`,a=await We({name:i,projectId:t.projectId,description:n||"",released:!1,archived:!1},t),p=`${t.baseUrl}/projects/${a.version.projectId}/versions/${a.version.id}/tab/release-report-all-issues`,c=await Re({version:r,jiraVersionUrl:p,type:o});return{version:r,type:o,branchName:c.branchName,prUrl:c.prUrl,jiraVersionUrl:p}},w=async()=>{let e=new Map,r=await te();if(!r)return e;try{let t=await ye(r);for(let n of t)n.description&&e.set(n.name,n.description)}catch{}return e},G=(e,r,t)=>{let n=t?" ".repeat(t-e.length+3):" ",o=`[${r}]`.padEnd(11);return`${e}${n}${o}`},v=e=>e.toLowerCase().startsWith("hotfix")?"hotfix":"regular",x=e=>{let{branches:r,descriptions:t,types:n}=e,o=r.map(a=>a.replace("release/v","")),i=Math.max(...o.map(a=>a.length));return r.map((a,p)=>{let c=o[p],m=n?n.get(a)||"regular":void 0,u=t.get(`v${c}`),d=" ".repeat(i-c.length+3),f=m?G(c,m,i):c;return u&&(f=m?`${f} ${u}`:`${c}${d}${u}`),{name:f,value:a}})};var Ue=e=>e.replace("release/","").slice(1).split(".").map(Number),be=e=>[...e].sort((r,t)=>{let[n,o,i]=Ue(r),[a,p,c]=Ue(t);return n!==a?(n??0)-(a??0):o!==p?(o??0)-(p??0):(i??0)-(c??0)});var dr=async()=>{let e=await E`gh pr list --search "Release in:title" --base dev --json number,title,headRefName,state,baseRefName`,r=await E`gh pr list --search "Hotfix in:title" --base main --json number,title,headRefName,state,baseRefName`,t=[...JSON.parse(e.stdout),...JSON.parse(r.stdout)],n=new Set;return t.filter(o=>n.has(o.headRefName)?!1:(n.add(o.headRefName),!0))},xe=async()=>{try{let e=await dr();return e.length===0&&(s.error("\u274C No release PRs found. Check the project folder for the script. Exiting..."),ke.exit(1)),be(e.map(r=>r.headRefName))}catch(e){s.error({error:e},"\u274C Error fetching release PRs"),ke.exit(1)}},y=async()=>{try{let e=await dr();e.length===0&&(s.error("\u274C No release PRs found. Check the project folder for the script. Exiting..."),ke.exit(1));let r=be(e.map(n=>n.headRefName)),t=new Map(e.map(n=>[n.headRefName,n]));return r.map(n=>({branch:n,title:t.get(n).title}))}catch(e){s.error({error:e},"\u274C Error fetching release PRs"),ke.exit(1)}},Re=async e=>{let{version:r,jiraVersionUrl:t,type:n}=e,o=n==="hotfix"?"Hotfix":"Release",i=we(n),a=`release/v${r}`;try{E.quiet=!0,await E`git switch ${i}`,await E`git pull origin ${i}`,await E`git checkout -b ${a}`,await E`git push -u origin ${a}`,await E`git commit --allow-empty-message --allow-empty --message ''`,await E`git push origin ${a}`;let c=(await E`gh pr create --title "${o} v${r}" --body "${t} \n" --base ${i} --head ${a}`).stdout.trim();return await E`git switch ${i}`,E.quiet=!1,{branchName:a,prUrl:c}}catch(p){throw s.error({error:p,branchName:a},`Error creating release branch ${a}`),p}};var Te=async e=>{let{all:r,confirmedCommand:t}=e;l.start("merge-dev");let o=(await y()).filter(u=>v(u.title)==="regular").map(u=>u.branch);if(o.length===0)return s.info("\u2139\uFE0F No open release branches found"),l.print(),{content:[{type:"text",text:JSON.stringify({successfulMerges:0,failedMerges:0,failedBranches:[],totalBranches:0},null,2)}],structuredContent:{successfulMerges:0,failedMerges:0,failedBranches:[],totalBranches:0}};let i=[];if(r)i=o;else{l.setInteractive();let u=await w();i=await Yr({required:!0,message:"\u{1F33F} Select release branches",choices:x({branches:o,descriptions:u})})}i.length===o.length?l.addOption("--all",!0):l.addOption("--versions",i.map(u=>u.replace("release/v","")));let p=t?!0:await Zr({message:`Are you sure you want to merge dev into these branches: ${i.join(", ")}?`});t||l.setInteractive(),p||(s.info("Operation cancelled. Exiting..."),Qr.exit(0)),t||l.addOption("--yes",!0),A.quiet=!0,await A`git fetch origin`,await A`git switch dev`,await A`git pull origin dev`;let c=[];for(let u of i)await et(u)||c.push(u);if(A.quiet=!1,c.length>0){s.info(`
18
+ \u26A0\uFE0F ${c.length} branch(es) failed to merge automatically.
19
+ `),s.info("\u{1F4CB} Manual merge script for failed branches:");for(let u of c)s.info(`# Merge dev into ${u} and resolve conflicts if any
20
+
25
21
  git switch ${u} && git pull origin ${u} && git merge origin/dev
26
22
  git push origin ${u} && git switch dev
27
- `);o.info(`\u2705 ${i.length-l.length}/${i.length} merges completed successfully.`)}else o.info("\u2705 All merges completed successfully!");c.print();let m={successfulMerges:i.length-l.length,failedMerges:l.length,failedBranches:l,totalBranches:i.length};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}},rt=async e=>{try{return await A`git switch ${e}`,await A`git pull origin ${e}`,await A`git merge origin/dev --no-edit`,await A`git push origin ${e}`,await A`git switch dev`,o.info(`Successfully merged dev into ${e}`),!0}catch(r){return o.error({error:r,branch:e},`Error merging dev into ${e}`),await A`git reset --merge HEAD~1`,!1}},tt={name:"gh-merge-dev",description:"Merge dev branch into selected release branches",inputSchema:{all:z.boolean().describe("Merge dev into all release branches without prompting")},outputSchema:{successfulMerges:z.number().describe("Number of successful merges"),failedMerges:z.number().describe("Number of failed merges"),failedBranches:z.array(z.string()).describe("List of branches that failed to merge"),totalBranches:z.number().describe("Total number of branches processed")},handler:Te};import ot from"@inquirer/confirm";import st from"@inquirer/select";import Ge from"node:process";import{z as ne}from"zod";import{$ as S}from"zx";var Ce=async e=>{let{version:r,confirmedCommand:t}=e;c.start("release-deliver");let n=await v(),s=n.map(d=>d.branch),i=new Map(n.map(d=>[d.branch,h(d.title)])),a="";if(r)a=`release/v${r}`;else{c.setInteractive();let d=await y();a=await st({message:"\u{1F33F} Select release branch",choices:x({branches:s,descriptions:d,types:i})})}let p=a.replace("release/v","");c.addOption("--version",p);let l=n.find(d=>d.branch===a);l||(o.error(`\u274C Release branch ${a} not found in open PRs. Exiting...`),Ge.exit(1));let m=h(l.title),u=t?!0:await ot({message:`Are you sure you want to deliver version ${a} to production?`});t||c.setInteractive(),u||(o.info("Operation cancelled. Exiting..."),Ge.exit(0)),c.addOption("--yes",!0);try{S.quiet=!0,m==="hotfix"?(await S`gh pr merge ${a} --squash --admin --delete-branch`,S.quiet=!1,await S`gh workflow run deploy-all.yml --ref main -f environment=prod`,S.quiet=!0,await S`git switch main && git pull && git switch dev && git pull && git merge main --no-edit && git push`):(await S`gh pr merge ${a} --squash --admin --delete-branch`,await S`gh pr create --base main --head dev --title "Release v${p} (RC)" --body ""`,await S`gh pr merge dev --squash --admin`,S.quiet=!1,await S`gh workflow run deploy-all.yml --ref main -f environment=prod`,S.quiet=!0,await S`git switch main && git pull && git switch dev && git pull && git merge main --no-edit && git push`),S.quiet=!1;let d=await re();if(d)try{let g=a.replace("release/","");await qe({versionName:g},d)}catch(g){o.error({error:g},"Failed to deliver Jira release (non-blocking)")}else o.info("\u{1F514} Jira is not configured, skipping Jira release delivery");o.info(`Successfully delivered ${a} to production!`),c.print();let f={releaseBranch:a,version:a.replace("release/v",""),type:m,success:!0};return{content:[{type:"text",text:JSON.stringify(f,null,2)}],structuredContent:f}}catch(d){o.error({error:d},"\u274C Error merging release branch into dev"),Ge.exit(1)}},nt={name:"gh-release-deliver",description:"Deliver a release branch to production",inputSchema:{version:ne.string().describe('Version to deliver to production (e.g., "1.2.5")')},outputSchema:{releaseBranch:ne.string().describe("The release branch that was delivered"),version:ne.string().describe("The version that was delivered"),type:ne.enum(["regular","hotfix"]).describe("Release type"),success:ne.boolean().describe("Whether the delivery was successful")},handler:Ce};import ur from"@inquirer/select";import fr from"node:process";import{z as O}from"zod";import{$ as ze}from"zx";var Se=async e=>{let{version:r,env:t,skipTerraform:n}=e;c.start("release-deploy-all");let s="";if(r)s=r==="dev"?"dev":`release/v${r}`;else{c.setInteractive();let l=await v(),m=l.map(f=>f.branch),u=new Map(l.map(f=>[f.branch,h(f.title)])),d=await y();s=await ur({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:m,descriptions:d,types:u})]})}let i=s==="dev"?"dev":s.replace("release/v","");c.addOption("--version",i);let a="";t?a=t:(c.setInteractive(),a=await ur({message:"\u{1F9EA} Select environment",choices:C.map(l=>({name:l,value:l}))})),c.addOption("--env",a),C.includes(a)||(o.error(`\u274C Invalid environment: ${a}. Exiting...`),fr.exit(1));let p=n??!1;p&&c.addOption("--skip-terraform",!0);try{ze.quiet=!0,await ze`gh workflow run deploy-all.yml --ref ${s} -f environment=${a} ${p?["-f","skip_terraform_deploy=true"]:[]}`,ze.quiet=!1,o.info(`Successfully launched deploy-all workflow_dispatch for release branch: ${s} and environment: ${a}`),c.print();let m={releaseBranch:s,version:s.replace("release/v",""),environment:a,skipTerraformDeploy:p,success:!0};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}}catch(l){o.error({error:l},"\u274C Error launching workflow"),fr.exit(1)}},it={name:"gh-release-deploy-all",description:"Deploy a release branch to a specified environment",inputSchema:{version:O.string().describe('Version to deploy (e.g., "1.2.5")'),env:O.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),skipTerraform:O.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:O.string().describe("The release branch that was deployed"),version:O.string().describe("The version that was deployed"),environment:O.string().describe("The environment deployed to"),skipTerraformDeploy:O.boolean().describe("Whether terraform deployment was skipped"),success:O.boolean().describe("Whether the deployment was successful")},handler:Se};import at from"@inquirer/checkbox";import gr from"@inquirer/select";import ct from"node:fs/promises";import{resolve as lt}from"node:path";import ie from"node:process";import pt from"yaml";import{z as I}from"zod";import{$ as Ke}from"zx";var $e=async e=>{let{version:r,env:t,services:n,skipTerraform:s}=e;c.start("release-deploy-selected");let i="";if(r)i=r==="dev"?"dev":`release/v${r}`;else{c.setInteractive();let f=await v(),g=f.map(k=>k.branch),b=new Map(f.map(k=>[k.branch,h(k.title)])),T=await y();i=await gr({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:g,descriptions:T,types:b})]})}let a=i==="dev"?"dev":i.replace("release/v","");c.addOption("--version",a);let p="";t?p=t:(c.setInteractive(),p=await gr({message:"\u{1F9EA} Select environment",choices:C.map(f=>({name:f,value:f}))})),c.addOption("--env",p),C.includes(p)||(o.error(`\u274C Invalid environment: ${p}. Exiting...`),ie.exit(1));let l=await mt();l.length===0&&(o.error("\u274C No services found in workflow file. Exiting..."),ie.exit(1));let m=[];n&&n.length>0?m=n:(c.setInteractive(),m=await at({message:"\u{1F680} Select services to deploy (space to select, enter to confirm)",choices:l.map(f=>({name:f,value:f}))})),c.addOption("--services",m),m.length===0&&(o.error("\u274C No services selected. Exiting..."),ie.exit(1));let u=m.filter(f=>!l.includes(f));u.length>0&&(o.error(`\u274C Invalid services: ${u.join(", ")}. Available services: ${l.join(", ")}`),ie.exit(1));let d=s??!1;d&&c.addOption("--skip-terraform",!0);try{Ke.quiet=!0;let f=m.flatMap(T=>["-f",`${T}=true`]);await Ke`gh workflow run deploy-selected-services.yml --ref ${i} -f environment=${p} ${f} ${d?["-f","skip_terraform_deploy=true"]:[]}`,Ke.quiet=!1,o.info(`Successfully launched deploy-selected-services workflow_dispatch for release branch: ${i}, environment: ${p}, services: ${m.join(", ")}`),c.print();let b={releaseBranch:i,version:i.replace("release/v",""),environment:p,services:m,skipTerraformDeploy:d,success:!0};return{content:[{type:"text",text:JSON.stringify(b,null,2)}],structuredContent:b}}catch(f){o.error({error:f},"\u274C Error launching workflow"),ie.exit(1)}},mt=async()=>{let e=await $(),r=lt(e,".github/workflows/deploy-selected-services.yml"),t=await ct.readFile(r,"utf-8"),s=pt.parse(t).on.workflow_dispatch.inputs,i=[];for(let[a,p]of Object.entries(s))p.type==="boolean"&&a!=="skip_terraform_deploy"&&i.push(a);return i},dt={name:"gh-release-deploy-selected",description:"Deploy selected services from a release branch to a specified environment",inputSchema:{version:I.string().describe('Version to deploy (e.g., "1.2.5")'),env:I.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),services:I.array(I.string()).describe('List of services to deploy (e.g., ["client-be", "client-fe"])'),skipTerraform:I.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:I.string().describe("The release branch that was deployed"),version:I.string().describe("The version that was deployed"),environment:I.string().describe("The environment deployed to"),services:I.array(I.string()).describe("The services that were deployed"),skipTerraformDeploy:I.boolean().describe("Whether terraform deployment was skipped"),success:I.boolean().describe("Whether the deployment was successful")},handler:$e};import He from"@inquirer/select";import ut from"node:fs/promises";import{resolve as ft}from"node:path";import Xe from"node:process";import gt from"yaml";import{z as P}from"zod";import{$ as Ye}from"zx";var Ee=async e=>{let{version:r,env:t,service:n,skipTerraform:s}=e;c.start("release-deploy-service");let i="";if(r)i=r==="dev"?"dev":`release/v${r}`;else{c.setInteractive();let d=await v(),f=d.map(T=>T.branch),g=new Map(d.map(T=>[T.branch,h(T.title)])),b=await y();i=await He({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:f,descriptions:b,types:g})]})}let a=i==="dev"?"dev":i.replace("release/v","");c.addOption("--version",a);let p="";t?p=t:(c.setInteractive(),p=await He({message:"\u{1F9EA} Select environment",choices:C.map(d=>({name:d,value:d}))})),c.addOption("--env",p),C.includes(p)||(o.error(`\u274C Invalid environment: ${p}. Exiting...`),Xe.exit(1));let l=await ht(),m="";n?m=n:(c.setInteractive(),m=await He({message:"\u{1F680} Select service to deploy",choices:l.map(d=>({name:d,value:d}))})),c.addOption("--service",m),l.includes(m)||(o.error(`\u274C Invalid service: ${m}. Available services: ${l.join(", ")}`),Xe.exit(1));let u=s??!1;u&&c.addOption("--skip-terraform",!0);try{Ye.quiet=!0,await Ye`gh workflow run deploy-single-service.yml --ref ${i} -f environment=${p} -f service=${m} ${u?["-f","skip_terraform_deploy=true"]:[]}`,Ye.quiet=!1,o.info(`Successfully launched deploy-single-service workflow_dispatch for release branch: ${i}, environment: ${p}, service: ${m}`),c.print();let f={releaseBranch:i,version:i.replace("release/v",""),environment:p,service:m,skipTerraformDeploy:u,success:!0};return{content:[{type:"text",text:JSON.stringify(f,null,2)}],structuredContent:f}}catch(d){o.error({error:d},"\u274C Error launching workflow"),Xe.exit(1)}},ht=async()=>{let e=await $(),r=ft(e,".github/workflows/deploy-single-service.yml"),t=await ut.readFile(r,"utf-8");return gt.parse(t).on.workflow_dispatch.inputs.service.options},vt={name:"gh-release-deploy-service",description:"Deploy a specific service in a release branch to a specified environment",inputSchema:{version:P.string().describe('Version to deploy (e.g., "1.2.5")'),env:P.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),service:P.string().describe('Service to deploy (e.g., "client-be", "client-fe")'),skipTerraform:P.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:P.string().describe("The release branch that was deployed"),version:P.string().describe("The version that was deployed"),environment:P.string().describe("The environment deployed to"),service:P.string().describe("The service that was deployed"),skipTerraformDeploy:P.boolean().describe("Whether terraform deployment was skipped"),success:P.boolean().describe("Whether the deployment was successful")},handler:Ee};import{z as K}from"zod";var Ie=async()=>{let r=(await v()).map(a=>({version:a.branch.replace("release/",""),type:h(a.title)})),t=await y(),n=Math.max(...r.map(a=>a.version.length)),s=r.map(a=>{let p=G(a.version,a.type,n),l=t.get(a.version);return l?`${p} ${l}`:p});o.info(`All release branches:
28
- `),o.info(`
29
- ${s.join(`
23
+ `);s.info(`\u2705 ${i.length-c.length}/${i.length} merges completed successfully.`)}else s.info(`\u2705 All merges completed successfully!
24
+ `);l.print();let m={successfulMerges:i.length-c.length,failedMerges:c.length,failedBranches:c,totalBranches:i.length};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}},et=async e=>{try{return await A`git switch ${e}`,await A`git pull origin ${e}`,await A`git merge origin/dev --no-edit`,await A`git push origin ${e}`,await A`git switch dev`,s.info(`Successfully merged dev into ${e}`),!0}catch(r){return s.error({error:r,branch:e},`Error merging dev into ${e}`),await A`git reset --merge HEAD~1`,!1}},rt={name:"gh-merge-dev",description:"Merge dev branch into selected release branches",inputSchema:{all:z.boolean().describe("Merge dev into all release branches without prompting")},outputSchema:{successfulMerges:z.number().describe("Number of successful merges"),failedMerges:z.number().describe("Number of failed merges"),failedBranches:z.array(z.string()).describe("List of branches that failed to merge"),totalBranches:z.number().describe("Total number of branches processed")},handler:Te};import tt from"@inquirer/confirm";import ot from"@inquirer/select";import Ge from"node:process";import{z as ie}from"zod";import{$ as S}from"zx";var Ce=async e=>{let{version:r,confirmedCommand:t}=e;l.start("release-deliver");let n=await y(),o=n.map(d=>d.branch),i=new Map(n.map(d=>[d.branch,v(d.title)])),a="";if(r)a=`release/v${r}`;else{l.setInteractive();let d=await w();a=await ot({message:"\u{1F33F} Select release branch",choices:x({branches:o,descriptions:d,types:i})})}let p=a.replace("release/v","");l.addOption("--version",p);let c=n.find(d=>d.branch===a);c||(s.error(`\u274C Release branch ${a} not found in open PRs. Exiting...`),Ge.exit(1));let m=v(c.title),u=t?!0:await tt({message:`Are you sure you want to deliver version ${a} to production?`});t||l.setInteractive(),u||(s.info("Operation cancelled. Exiting..."),Ge.exit(0)),l.addOption("--yes",!0);try{S.quiet=!0,m==="hotfix"?(await S`gh pr merge ${a} --squash --admin --delete-branch`,S.quiet=!1,await S`gh workflow run deploy-all.yml --ref main -f environment=prod`,S.quiet=!0,await S`git switch main && git pull && git switch dev && git pull && git merge main --no-edit && git push`):(await S`gh pr merge ${a} --squash --admin --delete-branch`,await S`gh pr create --base main --head dev --title "Release v${p} (RC)" --body ""`,await S`gh pr merge dev --squash --admin`,S.quiet=!1,await S`gh workflow run deploy-all.yml --ref main -f environment=prod`,S.quiet=!0,await S`git switch main && git pull && git switch dev && git pull && git merge main --no-edit && git push`),S.quiet=!1;let d=await te();if(d)try{let g=a.replace("release/","");await qe({versionName:g},d)}catch(g){s.error({error:g},"Failed to deliver Jira release (non-blocking)")}else s.info("\u{1F514} Jira is not configured, skipping Jira release delivery");s.info(`Successfully delivered ${a} to production!`),l.print();let f={releaseBranch:a,version:a.replace("release/v",""),type:m,success:!0};return{content:[{type:"text",text:JSON.stringify(f,null,2)}],structuredContent:f}}catch(d){s.error({error:d},"\u274C Error merging release branch into dev"),Ge.exit(1)}},st={name:"gh-release-deliver",description:"Deliver a release branch to production",inputSchema:{version:ie.string().describe('Version to deliver to production (e.g., "1.2.5")')},outputSchema:{releaseBranch:ie.string().describe("The release branch that was delivered"),version:ie.string().describe("The version that was delivered"),type:ie.enum(["regular","hotfix"]).describe("Release type"),success:ie.boolean().describe("Whether the delivery was successful")},handler:Ce};import ur from"@inquirer/select";import fr from"node:process";import{z as O}from"zod";import{$ as ze}from"zx";var Se=async e=>{let{version:r,env:t,skipTerraform:n}=e;l.start("release-deploy-all");let o="";if(r)o=r==="dev"?"dev":`release/v${r}`;else{l.setInteractive();let c=await y(),m=c.map(f=>f.branch),u=new Map(c.map(f=>[f.branch,v(f.title)])),d=await w();o=await ur({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:m,descriptions:d,types:u})]})}let i=o==="dev"?"dev":o.replace("release/v","");l.addOption("--version",i);let a="";t?a=t:(l.setInteractive(),a=await ur({message:"\u{1F9EA} Select environment",choices:C.map(c=>({name:c,value:c}))})),l.addOption("--env",a),C.includes(a)||(s.error(`\u274C Invalid environment: ${a}. Exiting...`),fr.exit(1));let p=n??!1;p&&l.addOption("--skip-terraform",!0);try{ze.quiet=!0,await ze`gh workflow run deploy-all.yml --ref ${o} -f environment=${a} ${p?["-f","skip_terraform_deploy=true"]:[]}`,ze.quiet=!1,s.info(`Successfully launched deploy-all workflow_dispatch for release branch: ${o} and environment: ${a}`),l.print();let m={releaseBranch:o,version:o.replace("release/v",""),environment:a,skipTerraformDeploy:p,success:!0};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}}catch(c){s.error({error:c},"\u274C Error launching workflow"),fr.exit(1)}},nt={name:"gh-release-deploy-all",description:"Deploy a release branch to a specified environment",inputSchema:{version:O.string().describe('Version to deploy (e.g., "1.2.5")'),env:O.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),skipTerraform:O.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:O.string().describe("The release branch that was deployed"),version:O.string().describe("The version that was deployed"),environment:O.string().describe("The environment deployed to"),skipTerraformDeploy:O.boolean().describe("Whether terraform deployment was skipped"),success:O.boolean().describe("Whether the deployment was successful")},handler:Se};import it from"@inquirer/checkbox";import gr from"@inquirer/select";import at from"node:fs/promises";import{resolve as ct}from"node:path";import ae from"node:process";import lt from"yaml";import{z as I}from"zod";import{$ as Ke}from"zx";var $e=async e=>{let{version:r,env:t,services:n,skipTerraform:o}=e;l.start("release-deploy-selected");let i="";if(r)i=r==="dev"?"dev":`release/v${r}`;else{l.setInteractive();let f=await y(),g=f.map(k=>k.branch),R=new Map(f.map(k=>[k.branch,v(k.title)])),T=await w();i=await gr({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:g,descriptions:T,types:R})]})}let a=i==="dev"?"dev":i.replace("release/v","");l.addOption("--version",a);let p="";t?p=t:(l.setInteractive(),p=await gr({message:"\u{1F9EA} Select environment",choices:C.map(f=>({name:f,value:f}))})),l.addOption("--env",p),C.includes(p)||(s.error(`\u274C Invalid environment: ${p}. Exiting...`),ae.exit(1));let c=await pt();c.length===0&&(s.error("\u274C No services found in workflow file. Exiting..."),ae.exit(1));let m=[];n&&n.length>0?m=n:(l.setInteractive(),m=await it({message:"\u{1F680} Select services to deploy (space to select, enter to confirm)",choices:c.map(f=>({name:f,value:f}))})),l.addOption("--services",m),m.length===0&&(s.error("\u274C No services selected. Exiting..."),ae.exit(1));let u=m.filter(f=>!c.includes(f));u.length>0&&(s.error(`\u274C Invalid services: ${u.join(", ")}. Available services: ${c.join(", ")}`),ae.exit(1));let d=o??!1;d&&l.addOption("--skip-terraform",!0);try{Ke.quiet=!0;let f=m.flatMap(T=>["-f",`${T}=true`]);await Ke`gh workflow run deploy-selected-services.yml --ref ${i} -f environment=${p} ${f} ${d?["-f","skip_terraform_deploy=true"]:[]}`,Ke.quiet=!1,s.info(`Successfully launched deploy-selected-services workflow_dispatch for release branch: ${i}, environment: ${p}, services: ${m.join(", ")}`),l.print();let R={releaseBranch:i,version:i.replace("release/v",""),environment:p,services:m,skipTerraformDeploy:d,success:!0};return{content:[{type:"text",text:JSON.stringify(R,null,2)}],structuredContent:R}}catch(f){s.error({error:f},"\u274C Error launching workflow"),ae.exit(1)}},pt=async()=>{let e=await $(),r=ct(e,".github/workflows/deploy-selected-services.yml"),t=await at.readFile(r,"utf-8"),o=lt.parse(t).on.workflow_dispatch.inputs,i=[];for(let[a,p]of Object.entries(o))p.type==="boolean"&&a!=="skip_terraform_deploy"&&i.push(a);return i},mt={name:"gh-release-deploy-selected",description:"Deploy selected services from a release branch to a specified environment",inputSchema:{version:I.string().describe('Version to deploy (e.g., "1.2.5")'),env:I.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),services:I.array(I.string()).describe('List of services to deploy (e.g., ["client-be", "client-fe"])'),skipTerraform:I.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:I.string().describe("The release branch that was deployed"),version:I.string().describe("The version that was deployed"),environment:I.string().describe("The environment deployed to"),services:I.array(I.string()).describe("The services that were deployed"),skipTerraformDeploy:I.boolean().describe("Whether terraform deployment was skipped"),success:I.boolean().describe("Whether the deployment was successful")},handler:$e};import He from"@inquirer/select";import dt from"node:fs/promises";import{resolve as ut}from"node:path";import Xe from"node:process";import ft from"yaml";import{z as P}from"zod";import{$ as Ye}from"zx";var Ee=async e=>{let{version:r,env:t,service:n,skipTerraform:o}=e;l.start("release-deploy-service");let i="";if(r)i=r==="dev"?"dev":`release/v${r}`;else{l.setInteractive();let d=await y(),f=d.map(T=>T.branch),g=new Map(d.map(T=>[T.branch,v(T.title)])),R=await w();i=await He({message:"\u{1F33F} Select release branch",choices:[{name:"dev",value:"dev"},...x({branches:f,descriptions:R,types:g})]})}let a=i==="dev"?"dev":i.replace("release/v","");l.addOption("--version",a);let p="";t?p=t:(l.setInteractive(),p=await He({message:"\u{1F9EA} Select environment",choices:C.map(d=>({name:d,value:d}))})),l.addOption("--env",p),C.includes(p)||(s.error(`\u274C Invalid environment: ${p}. Exiting...`),Xe.exit(1));let c=await gt(),m="";n?m=n:(l.setInteractive(),m=await He({message:"\u{1F680} Select service to deploy",choices:c.map(d=>({name:d,value:d}))})),l.addOption("--service",m),c.includes(m)||(s.error(`\u274C Invalid service: ${m}. Available services: ${c.join(", ")}`),Xe.exit(1));let u=o??!1;u&&l.addOption("--skip-terraform",!0);try{Ye.quiet=!0,await Ye`gh workflow run deploy-single-service.yml --ref ${i} -f environment=${p} -f service=${m} ${u?["-f","skip_terraform_deploy=true"]:[]}`,Ye.quiet=!1,s.info(`Successfully launched deploy-single-service workflow_dispatch for release branch: ${i}, environment: ${p}, service: ${m}`),l.print();let f={releaseBranch:i,version:i.replace("release/v",""),environment:p,service:m,skipTerraformDeploy:u,success:!0};return{content:[{type:"text",text:JSON.stringify(f,null,2)}],structuredContent:f}}catch(d){s.error({error:d},"\u274C Error launching workflow"),Xe.exit(1)}},gt=async()=>{let e=await $(),r=ut(e,".github/workflows/deploy-single-service.yml"),t=await dt.readFile(r,"utf-8");return ft.parse(t).on.workflow_dispatch.inputs.service.options},ht={name:"gh-release-deploy-service",description:"Deploy a specific service in a release branch to a specified environment",inputSchema:{version:P.string().describe('Version to deploy (e.g., "1.2.5")'),env:P.string().describe('Environment to deploy to (e.g., "dev", "renana", "oriana")'),service:P.string().describe('Service to deploy (e.g., "client-be", "client-fe")'),skipTerraform:P.boolean().optional().describe("Skip terraform deployment step")},outputSchema:{releaseBranch:P.string().describe("The release branch that was deployed"),version:P.string().describe("The version that was deployed"),environment:P.string().describe("The environment deployed to"),service:P.string().describe("The service that was deployed"),skipTerraformDeploy:P.boolean().describe("Whether terraform deployment was skipped"),success:P.boolean().describe("Whether the deployment was successful")},handler:Ee};import{z as K}from"zod";var Ie=async()=>{let r=(await y()).map(a=>({version:a.branch.replace("release/",""),type:v(a.title)})),t=await w(),n=Math.max(...r.map(a=>a.version.length)),o=r.map(a=>{let p=G(a.version,a.type,n),c=t.get(a.version);return c?`${p} ${c}`:p});s.info(`All release branches:
25
+ `),s.info(`
26
+ ${o.join(`
30
27
  `)}
31
- `);let i={releases:r.map(a=>({version:a.version,type:a.type,description:t.get(a.version)||null})),count:r.length};return{content:[{type:"text",text:JSON.stringify(i,null,2)}],structuredContent:i}},yt={name:"gh-release-list",description:"List all open release branches",inputSchema:{},outputSchema:{releases:K.array(K.object({version:K.string().describe("Release version"),type:K.enum(["regular","hotfix"]).describe("Release type"),description:K.string().nullable().describe("Jira version description")})).describe("List of all release branches"),count:K.number().describe("Number of release branches")},handler:Ie};import hr from"@inquirer/confirm";import wt from"@inquirer/select";import vr from"node:process";import{z as N}from"zod";import{$ as Ze,question as yr}from"zx";var Ae=async e=>{let{version:r,description:t,type:n,confirmedCommand:s,checkout:i}=e;c.start("release-create");let a=r,p=t,l=n||"regular",m=i,u=await U();a||(c.setInteractive(),a=await yr("Enter version (e.g. 1.2.5): ")),(!a||a.trim()==="")&&(o.error("No version provided. Exiting..."),vr.exit(1));let d=a.trim();c.addOption("--version",d),n||(c.setInteractive(),l=await wt({message:"Select release type:",choices:[{name:"regular",value:"regular"},{name:"hotfix",value:"hotfix"}],default:"regular"})),c.addOption("--type",l),p===void 0&&(c.setInteractive(),p=await yr("Enter description (optional, press Enter to skip): "),p.trim()===""&&(p="")),p&&c.addOption("--description",p);let f=s?!0:await hr({message:`Are you sure you want to create release branch for version ${d}?`});s||c.setInteractive(),f||(o.info("Operation cancelled. Exiting..."),vr.exit(0)),c.addOption("--yes",!0),await oe(l);let g=await se({version:d,jiraConfig:u,description:p,type:l});o.info(`\u2705 Successfully created release: v${d}`),o.info(`\u{1F517} GitHub PR: ${g.prUrl}`),o.info(`\u{1F517} Jira Version: ${g.jiraVersionUrl}`),m===void 0&&(c.setInteractive(),m=await hr({message:`Do you want to checkout to the created branch ${g.branchName}?`,default:!0})),m||c.addOption("--no-checkout",!0),m&&(Ze.quiet=!0,await Ze`git switch ${g.branchName}`,Ze.quiet=!1,o.info(`\u{1F504} Switched to branch ${g.branchName}`)),c.print();let b={version:d,type:l,branchName:g.branchName,prUrl:g.prUrl,jiraVersionUrl:g.jiraVersionUrl,isCheckedOut:m};return{content:[{type:"text",text:JSON.stringify(b,null,2)}],structuredContent:b}},bt={name:"release-create",description:"Create a single release branch for specified version with Jira version creation",inputSchema:{version:N.string().describe('Version to create (e.g., "1.2.5")'),description:N.string().optional().describe("Optional description for the Jira version"),type:N.enum(["regular","hotfix"]).optional().default("regular").describe('Release type: "regular" or "hotfix" (default: "regular")'),checkout:N.boolean().optional().default(!0).describe("Checkout to the created branch (default: true)")},outputSchema:{version:N.string().describe("Version number"),type:N.enum(["regular","hotfix"]).describe("Release type"),branchName:N.string().describe("Release branch name"),prUrl:N.string().describe("GitHub PR URL"),jiraVersionUrl:N.string().describe("Jira version URL"),isCheckedOut:N.boolean().describe("Whether the branch was checked out")},handler:Ae};import Rt from"@inquirer/confirm";import kt from"@inquirer/select";import wr from"node:process";import{z as R}from"zod";import{question as xt}from"zx";var Tt=async e=>{let{versions:r,type:t,confirmedCommand:n}=e,s=r,i=t||"regular";s||(c.setInteractive(),s=await xt("Enter versions by comma (e.g. 1.2.5, 1.2.6): "));let a=s.split(",").map(l=>l.trim()).filter(Boolean);c.addOption("--versions",a.join(", ")),a.length===0&&(o.error("No versions provided. Exiting..."),wr.exit(1)),t||(c.setInteractive(),i=await kt({message:"Select release type:",choices:[{name:"regular",value:"regular"},{name:"hotfix",value:"hotfix"}],default:"regular"})),c.addOption("--type",i),a.length===1&&o.warn('\u{1F4A1} You are creating only one release. Consider using "create-release" command for single releases.');let p=n?!0:await Rt({message:`Are you sure you want to create release branches for these versions: ${a.join(", ")}?`});return n||c.setInteractive(),p||(o.info("Operation cancelled. Exiting..."),wr.exit(0)),c.addOption("--yes",!0),{versionsList:a,type:i}},Pe=async e=>{c.start("release-create-batch");let r=await U(),{versionsList:t,type:n}=await Tt(e);await oe(n);let s=[],i=[];for(let m of t)try{let u=await se({version:m,jiraConfig:r,type:n});s.push(u),o.info(`\u2705 Successfully created release: v${m}`),o.info(`\u{1F517} GitHub PR: ${u.prUrl}`),o.info(`\u{1F517} Jira Version: ${u.jiraVersionUrl}
32
- `)}catch(u){let d=u instanceof Error?u.message:String(u);i.push({version:m,error:d}),o.error(`\u274C Failed to create release: v${m}`),o.error(` Error: ${d}
33
- `)}let a=s.length,p=i.length;a===t.length?o.info(`\u2705 All ${t.length} release branches were created successfully.`):a>0?(o.warn(`\u26A0\uFE0F ${a} of ${t.length} release branches were created successfully.`),o.warn(`\u274C ${p} release(s) failed.`)):o.error(`\u274C All ${t.length} release branches failed to create.`),c.print();let l={createdBranches:s.map(m=>m.branchName),successCount:a,failureCount:p,releases:s,failedReleases:i};return{content:[{type:"text",text:JSON.stringify(l,null,2)}],structuredContent:l}},Ct={name:"release-create-batch",description:"Create multiple release branches for specified versions with Jira version creation (batch operation)",inputSchema:{versions:R.string().describe('Comma-separated list of versions to create (e.g., "1.2.5, 1.2.6")'),type:R.enum(["regular","hotfix"]).optional().default("regular").describe('Release type: "regular" or "hotfix" (default: "regular")')},outputSchema:{createdBranches:R.array(R.string()).describe("List of created release branches"),successCount:R.number().describe("Number of releases created successfully"),failureCount:R.number().describe("Number of releases that failed"),releases:R.array(R.object({version:R.string().describe("Version number"),type:R.enum(["regular","hotfix"]).describe("Release type"),branchName:R.string().describe("Release branch name"),prUrl:R.string().describe("GitHub PR URL"),jiraVersionUrl:R.string().describe("Jira version URL")})).describe("Detailed information for each created release with URLs"),failedReleases:R.array(R.object({version:R.string().describe("Version number that failed"),error:R.string().describe("Error message")})).describe("List of releases that failed with error messages")},handler:Pe};import St from"@inquirer/checkbox";import Qe from"@inquirer/confirm";import $t from"node:process";import{z as J}from"zod";import{$ as H}from"zx";var Et="feature",It="release",At="release/v",Ne=async e=>{let{confirmedCommand:r,all:t,versions:n,cursor:s,githubDesktop:i}=e;c.start("worktrees-add");try{let a=await D("release"),l=`${await $()}${W}`;await br(`${l}/${It}`),await br(`${l}/${Et}`);let m=[];if(n)m=n.split(",").map(k=>`release/v${k.trim()}`);else{let k=await v(),Je=k.map(Le=>Le.branch);if(Je.length===0)return o.info("\u2139\uFE0F No open release branches found"),c.print(),{content:[{type:"text",text:JSON.stringify({createdWorktrees:[],count:0},null,2)}],structuredContent:{createdWorktrees:[],count:0}};if(t)m=Je;else{c.setInteractive();let Le=new Map(k.map(tr=>[tr.branch,h(tr.title)])),kr=await y();m=await St({required:!0,message:"\u{1F33F} Select release branches",choices:x({branches:Je,descriptions:kr,types:Le})})}}t?c.addOption("--all",!0):c.addOption("--versions",m.map(k=>k.replace("release/v","")));let u=r?!0:await Qe({message:"Are you sure you want to proceed with these worktree changes?"});r||c.setInteractive(),u||(o.info("Operation cancelled. Exiting..."),$t.exit(0)),r||c.addOption("--yes",!0);let d=s??await Qe({message:"Open created worktrees in Cursor?"});typeof s>"u"&&c.setInteractive(),d?c.addOption("--cursor",!0):c.addOption("--no-cursor",!0);let f=i??await Qe({message:"Open created worktrees in GitHub Desktop?"});typeof i>"u"&&c.setInteractive(),f?c.addOption("--github-desktop",!0):c.addOption("--no-github-desktop",!0);let{branchesToCreate:g}=Pt({selectedReleaseBranches:m,currentWorktrees:a}),b=await Nt(g,l);if(Dt(b),d)for(let k of b)await H`cursor ${l}/${k}`;if(f)for(let k of b)await H`github ${l}/${k}`,await H`sleep 5`;c.print();let T={createdWorktrees:b,count:b.length};return{content:[{type:"text",text:JSON.stringify(T,null,2)}],structuredContent:T}}catch(a){throw o.error({error:a},"\u274C Error managing worktrees"),a}},br=async e=>{await H`mkdir -p ${e}`},Pt=e=>{let{selectedReleaseBranches:r,currentWorktrees:t}=e,n=t.filter(i=>i.startsWith(At));return{branchesToCreate:r.filter(i=>!n.includes(i))}},Nt=async(e,r)=>{let t=await Promise.allSettled(e.map(async s=>{let i=`${r}/${s}`;return await H`git worktree add ${i} ${s}`,await H({cwd:i})`pnpm install`,s})),n=[];for(let[s,i]of t.entries())if(i.status==="fulfilled")n.push(i.value);else{let a=e[s];o.error({error:i.reason},`\u274C Failed to create worktree for ${a}`)}return n},Dt=e=>{if(e.length>0){o.info("\u2705 Created git worktrees:");for(let r of e)o.info(r);o.info("")}else o.info("\u2139\uFE0F No new git worktrees to create")},Ot={name:"worktrees-add",description:"Create git worktrees for selected release branches",inputSchema:{all:J.boolean().describe("Add git worktrees for all release branches without prompting"),versions:J.string().optional().describe("Specify versions by comma, e.g. 1.2.5, 1.2.6"),cursor:J.boolean().optional().describe("Open created git worktrees in Cursor"),githubDesktop:J.boolean().optional().describe("Open created git worktrees in GitHub Desktop")},outputSchema:{createdWorktrees:J.array(J.string()).describe("List of created git worktree branches"),count:J.number().describe("Number of git worktrees created")},handler:Ne};import{z as X}from"zod";var De=async()=>{let e=await D("release");if(e.length===0)return o.info("\u2139\uFE0F No active worktrees found"),{content:[{type:"text",text:JSON.stringify({worktrees:[],count:0},null,2)}],structuredContent:{worktrees:[],count:0}};let[r,t]=await Promise.all([v(),y()]),n=new Map(r.map(l=>[l.branch,h(l.title)])),s=e.map(l=>{let m=l.replace("release/",""),u=n.get(l)||"regular",d=t.get(m)||null;return{version:m,type:u,description:d}}),i=Math.max(...s.map(l=>l.version.length)),a=s.map(l=>{let m=G(l.version,l.type,i);return l.description?`${m} ${l.description}`:m});o.info("\u{1F33F} Active worktrees:"),o.info(`
28
+ `);let i={releases:r.map(a=>({version:a.version,type:a.type,description:t.get(a.version)||null})),count:r.length};return{content:[{type:"text",text:JSON.stringify(i,null,2)}],structuredContent:i}},vt={name:"gh-release-list",description:"List all open release branches",inputSchema:{},outputSchema:{releases:K.array(K.object({version:K.string().describe("Release version"),type:K.enum(["regular","hotfix"]).describe("Release type"),description:K.string().nullable().describe("Jira version description")})).describe("List of all release branches"),count:K.number().describe("Number of release branches")},handler:Ie};import Ae from"node:fs";import yt from"node:os";import wt from"node:path";var vr="# -- infra-kit:begin --",yr="# -- infra-kit:end --",Rt=[["# region infra-kit","# endregion infra-kit"]],bt="# infra-kit shell functions",Ze=async()=>{let e=wt.join(yt.homedir(),".zshrc"),r=Tt();if(Ae.existsSync(e)){let t=Ae.readFileSync(e,"utf-8"),n=xt(t);Ae.writeFileSync(e,n)}Ae.appendFileSync(e,`
29
+ ${r}
30
+ `),s.info(`Added infra-kit shell functions to ${e}`),s.info("Run `source ~/.zshrc` or open a new terminal to activate.")},kt=e=>e.startsWith("#")||e.startsWith("alias ")||e.startsWith("env-load")||e.startsWith("env-clear")||e.startsWith("env-status")||e.startsWith("if ")||e.startsWith(" export INFRA_KIT_SESSION")||e.startsWith("fi"),hr=(e,r,t)=>{let n=e.indexOf(r),o=e.indexOf(t);if(n===-1||o===-1)return null;let i=e.slice(0,n).replace(/\n+$/,""),a=e.slice(o+t.length).replace(/^\n+/,"");return i+(a?`
31
+ ${a}`:"")},xt=e=>{let r=hr(e,vr,yr);if(r!==null)return r;for(let[p,c]of Rt){let m=hr(e,p,c);if(m!==null)return m}let t=e.indexOf(bt);if(t===-1)return e;let n=e.slice(0,t).replace(/\n+$/,""),o=e.slice(t).split(`
32
+ `),i=0;for(;i<o.length&&kt(o[i]);)i++;let a=o.slice(i).join(`
33
+ `);return n+(a?`
34
+ ${a}`:"")},Tt=()=>{let e="pnpm exec infra-kit";return[vr,'if [[ -z "${INFRA_KIT_SESSION}" ]]; then'," export INFRA_KIT_SESSION=$(head -c 4 /dev/urandom | xxd -p)","fi",`env-load() { local f; f=$(${e} env-load "$@") && source "$f" && ${e} env-status; }`,`env-clear() { local f; f=$(${e} env-clear) && source "$f" && ${e} env-status; }`,`env-status() { ${e} env-status; }`,`alias ik='${e}'`,yr].join(`
35
+ `)};import wr from"@inquirer/confirm";import Ct from"@inquirer/select";import Rr from"node:process";import{z as N}from"zod";import{$ as Qe,question as br}from"zx";var Pe=async e=>{let{version:r,description:t,type:n,confirmedCommand:o,checkout:i}=e;l.start("release-create");let a=r,p=t,c=n||"regular",m=i,u=await U();a||(l.setInteractive(),a=await br("Enter version (e.g. 1.2.5): ")),(!a||a.trim()==="")&&(s.error("No version provided. Exiting..."),Rr.exit(1));let d=a.trim();l.addOption("--version",d),n||(l.setInteractive(),c=await Ct({message:"Select release type:",choices:[{name:"regular",value:"regular"},{name:"hotfix",value:"hotfix"}],default:"regular"})),l.addOption("--type",c),p===void 0&&(l.setInteractive(),p=await br("Enter description (optional, press Enter to skip): "),p.trim()===""&&(p="")),p&&l.addOption("--description",p);let f=o?!0:await wr({message:`Are you sure you want to create release branch for version ${d}?`});o||l.setInteractive(),f||(s.info("Operation cancelled. Exiting..."),Rr.exit(0)),l.addOption("--yes",!0),await se(c);let g=await ne({version:d,jiraConfig:u,description:p,type:c});s.info(`\u2705 Successfully created release: v${d}`),s.info(`\u{1F517} GitHub PR: ${g.prUrl}`),s.info(`\u{1F517} Jira Version: ${g.jiraVersionUrl}`),m===void 0&&(l.setInteractive(),m=await wr({message:`Do you want to checkout to the created branch ${g.branchName}?`,default:!0})),m||l.addOption("--no-checkout",!0),m&&(Qe.quiet=!0,await Qe`git switch ${g.branchName}`,Qe.quiet=!1,s.info(`\u{1F504} Switched to branch ${g.branchName}`)),l.print();let R={version:d,type:c,branchName:g.branchName,prUrl:g.prUrl,jiraVersionUrl:g.jiraVersionUrl,isCheckedOut:m};return{content:[{type:"text",text:JSON.stringify(R,null,2)}],structuredContent:R}},St={name:"release-create",description:"Create a single release branch for specified version with Jira version creation",inputSchema:{version:N.string().describe('Version to create (e.g., "1.2.5")'),description:N.string().optional().describe("Optional description for the Jira version"),type:N.enum(["regular","hotfix"]).optional().default("regular").describe('Release type: "regular" or "hotfix" (default: "regular")'),checkout:N.boolean().optional().default(!0).describe("Checkout to the created branch (default: true)")},outputSchema:{version:N.string().describe("Version number"),type:N.enum(["regular","hotfix"]).describe("Release type"),branchName:N.string().describe("Release branch name"),prUrl:N.string().describe("GitHub PR URL"),jiraVersionUrl:N.string().describe("Jira version URL"),isCheckedOut:N.boolean().describe("Whether the branch was checked out")},handler:Pe};import $t from"@inquirer/confirm";import Et from"@inquirer/select";import kr from"node:process";import{z as b}from"zod";import{question as It}from"zx";var At=async e=>{let{versions:r,type:t,confirmedCommand:n}=e,o=r,i=t||"regular";o||(l.setInteractive(),o=await It("Enter versions by comma (e.g. 1.2.5, 1.2.6): "));let a=o.split(",").map(c=>c.trim()).filter(Boolean);l.addOption("--versions",a.join(", ")),a.length===0&&(s.error("No versions provided. Exiting..."),kr.exit(1)),t||(l.setInteractive(),i=await Et({message:"Select release type:",choices:[{name:"regular",value:"regular"},{name:"hotfix",value:"hotfix"}],default:"regular"})),l.addOption("--type",i),a.length===1&&s.warn('\u{1F4A1} You are creating only one release. Consider using "create-release" command for single releases.');let p=n?!0:await $t({message:`Are you sure you want to create release branches for these versions: ${a.join(", ")}?`});return n||l.setInteractive(),p||(s.info("Operation cancelled. Exiting..."),kr.exit(0)),l.addOption("--yes",!0),{versionsList:a,type:i}},Ne=async e=>{l.start("release-create-batch");let r=await U(),{versionsList:t,type:n}=await At(e);await se(n);let o=[],i=[];for(let m of t)try{let u=await ne({version:m,jiraConfig:r,type:n});o.push(u),s.info(`\u2705 Successfully created release: v${m}`),s.info(`\u{1F517} GitHub PR: ${u.prUrl}`),s.info(`\u{1F517} Jira Version: ${u.jiraVersionUrl}
36
+ `)}catch(u){let d=u instanceof Error?u.message:String(u);i.push({version:m,error:d}),s.error(`\u274C Failed to create release: v${m}`),s.error(` Error: ${d}
37
+ `)}let a=o.length,p=i.length;a===t.length?s.info(`\u2705 All ${t.length} release branches were created successfully.`):a>0?(s.warn(`\u26A0\uFE0F ${a} of ${t.length} release branches were created successfully.`),s.warn(`\u274C ${p} release(s) failed.`)):s.error(`\u274C All ${t.length} release branches failed to create.`),l.print();let c={createdBranches:o.map(m=>m.branchName),successCount:a,failureCount:p,releases:o,failedReleases:i};return{content:[{type:"text",text:JSON.stringify(c,null,2)}],structuredContent:c}},Pt={name:"release-create-batch",description:"Create multiple release branches for specified versions with Jira version creation (batch operation)",inputSchema:{versions:b.string().describe('Comma-separated list of versions to create (e.g., "1.2.5, 1.2.6")'),type:b.enum(["regular","hotfix"]).optional().default("regular").describe('Release type: "regular" or "hotfix" (default: "regular")')},outputSchema:{createdBranches:b.array(b.string()).describe("List of created release branches"),successCount:b.number().describe("Number of releases created successfully"),failureCount:b.number().describe("Number of releases that failed"),releases:b.array(b.object({version:b.string().describe("Version number"),type:b.enum(["regular","hotfix"]).describe("Release type"),branchName:b.string().describe("Release branch name"),prUrl:b.string().describe("GitHub PR URL"),jiraVersionUrl:b.string().describe("Jira version URL")})).describe("Detailed information for each created release with URLs"),failedReleases:b.array(b.object({version:b.string().describe("Version number that failed"),error:b.string().describe("Error message")})).describe("List of releases that failed with error messages")},handler:Ne};import Nt from"@inquirer/checkbox";import er from"@inquirer/confirm";import Dt from"node:process";import{z as J}from"zod";import{$ as H}from"zx";var Ot="feature",_t="release",Jt="release/v",De=async e=>{let{confirmedCommand:r,all:t,versions:n,cursor:o,githubDesktop:i}=e;l.start("worktrees-add");try{let a=await D("release"),c=`${await $()}${W}`;await xr(`${c}/${_t}`),await xr(`${c}/${Ot}`);let m=[];if(n)m=n.split(",").map(k=>`release/v${k.trim()}`);else{let k=await y(),Le=k.map(je=>je.branch);if(Le.length===0)return s.info("\u2139\uFE0F No open release branches found"),l.print(),{content:[{type:"text",text:JSON.stringify({createdWorktrees:[],count:0},null,2)}],structuredContent:{createdWorktrees:[],count:0}};if(t)m=Le;else{l.setInteractive();let je=new Map(k.map(or=>[or.branch,v(or.title)])),Sr=await w();m=await Nt({required:!0,message:"\u{1F33F} Select release branches",choices:x({branches:Le,descriptions:Sr,types:je})})}}t?l.addOption("--all",!0):l.addOption("--versions",m.map(k=>k.replace("release/v","")));let u=r?!0:await er({message:"Are you sure you want to proceed with these worktree changes?"});r||l.setInteractive(),u||(s.info("Operation cancelled. Exiting..."),Dt.exit(0)),r||l.addOption("--yes",!0);let d=o??await er({message:"Open created worktrees in Cursor?"});typeof o>"u"&&l.setInteractive(),d?l.addOption("--cursor",!0):l.addOption("--no-cursor",!0);let f=i??await er({message:"Open created worktrees in GitHub Desktop?"});typeof i>"u"&&l.setInteractive(),f?l.addOption("--github-desktop",!0):l.addOption("--no-github-desktop",!0);let{branchesToCreate:g}=Lt({selectedReleaseBranches:m,currentWorktrees:a}),R=await jt(g,c);if(Vt(R),d)for(let k of R)await H`cursor ${c}/${k}`;if(f)for(let k of R)await H`github ${c}/${k}`,await H`sleep 5`;l.print();let T={createdWorktrees:R,count:R.length};return{content:[{type:"text",text:JSON.stringify(T,null,2)}],structuredContent:T}}catch(a){throw s.error({error:a},"\u274C Error managing worktrees"),a}},xr=async e=>{await H`mkdir -p ${e}`},Lt=e=>{let{selectedReleaseBranches:r,currentWorktrees:t}=e,n=t.filter(i=>i.startsWith(Jt));return{branchesToCreate:r.filter(i=>!n.includes(i))}},jt=async(e,r)=>{let t=await Promise.allSettled(e.map(async o=>{let i=`${r}/${o}`;return await H`git worktree add ${i} ${o}`,await H({cwd:i})`pnpm install`,o})),n=[];for(let[o,i]of t.entries())if(i.status==="fulfilled")n.push(i.value);else{let a=e[o];s.error({error:i.reason},`\u274C Failed to create worktree for ${a}`)}return n},Vt=e=>{if(e.length>0){s.info("\u2705 Created git worktrees:");for(let r of e)s.info(r);s.info("")}else s.info("\u2139\uFE0F No new git worktrees to create")},Bt={name:"worktrees-add",description:"Create git worktrees for selected release branches",inputSchema:{all:J.boolean().describe("Add git worktrees for all release branches without prompting"),versions:J.string().optional().describe("Specify versions by comma, e.g. 1.2.5, 1.2.6"),cursor:J.boolean().optional().describe("Open created git worktrees in Cursor"),githubDesktop:J.boolean().optional().describe("Open created git worktrees in GitHub Desktop")},outputSchema:{createdWorktrees:J.array(J.string()).describe("List of created git worktree branches"),count:J.number().describe("Number of git worktrees created")},handler:De};import{z as X}from"zod";var Oe=async()=>{let e=await D("release");if(e.length===0)return s.info("\u2139\uFE0F No active worktrees found"),{content:[{type:"text",text:JSON.stringify({worktrees:[],count:0},null,2)}],structuredContent:{worktrees:[],count:0}};let[r,t]=await Promise.all([y(),w()]),n=new Map(r.map(c=>[c.branch,v(c.title)])),o=e.map(c=>{let m=c.replace("release/",""),u=n.get(c)||"regular",d=t.get(m)||null;return{version:m,type:u,description:d}}),i=Math.max(...o.map(c=>c.version.length)),a=o.map(c=>{let m=G(c.version,c.type,i);return c.description?`${m} ${c.description}`:m});s.info("\u{1F33F} Active worktrees:"),s.info(`
34
38
  ${a.join(`
35
39
  `)}
36
- `);let p={worktrees:s,count:s.length};return{content:[{type:"text",text:JSON.stringify(p,null,2)}],structuredContent:p}},_t={name:"worktrees-list",description:"List all git worktrees with detailed information",inputSchema:{},outputSchema:{worktrees:X.array(X.object({version:X.string().describe("Release version"),type:X.enum(["regular","hotfix"]).describe("Release type"),description:X.string().nullable().describe("Jira version description")})).describe("List of all worktrees with details"),count:X.number().describe("Number of worktrees")},handler:De};import Jt from"@inquirer/checkbox";import Lt from"@inquirer/confirm";import jt from"node:process";import{z as ae}from"zod";import{$ as er}from"zx";var Oe=async e=>{let{confirmedCommand:r,all:t,versions:n}=e;c.start("worktrees-remove");try{let s=await D("release");if(s.length===0)return o.info("\u2139\uFE0F No active worktrees to remove"),c.print(),{content:[{type:"text",text:JSON.stringify({removedWorktrees:[],count:0},null,2)}],structuredContent:{removedWorktrees:[],count:0}};let a=`${await $()}${W}`,p=[];if(t)p=s;else if(n)p=n.split(",").map(f=>`release/v${f.trim()}`);else{c.setInteractive();let[f,g]=await Promise.all([y(),v()]),b=new Map(g.map(T=>[T.branch,h(T.title)]));p=await Jt({required:!0,message:"\u{1F33F} Select release branches",choices:x({branches:s,descriptions:f,types:b})})}p.length===s.length?c.addOption("--all",!0):c.addOption("--versions",p.map(f=>f.replace("release/v","")));let m=r?!0:await Lt({message:"Are you sure you want to proceed with these worktree changes?"});r||c.setInteractive(),m||(o.info("Operation cancelled. Exiting..."),jt.exit(0)),r||c.addOption("--yes",!0);let u=await Vt(p,a);Bt(u),c.print();let d={removedWorktrees:u,count:u.length};return{content:[{type:"text",text:JSON.stringify(d,null,2)}],structuredContent:d}}catch(s){throw o.error({error:s},"\u274C Error managing worktrees"),s}},Vt=async(e,r)=>{let t=await Promise.allSettled(e.map(async s=>{let i=`${r}/${s}`;return await er`git worktree remove ${i}`,s})),n=[];for(let[s,i]of t.entries())if(i.status==="fulfilled")n.push(i.value);else{let a=e[s];o.error({error:i.reason},`\u274C Failed to remove worktree for ${a}`)}return n.length===e.length&&(await er`git worktree prune`,await er`rm -rf ${r}`,o.info(`\u{1F5D1}\uFE0F Removed worktree folder: ${r}`),o.info("")),n},Bt=e=>{if(e.length>0){o.info("\u274C Removed worktrees:");for(let r of e)o.info(r);o.info("")}else o.info("\u2139\uFE0F No unused worktrees to remove")},Ft={name:"worktrees-remove",description:"Remove selected worktrees",inputSchema:{all:ae.boolean().describe("Remove all git worktrees without prompting"),versions:ae.string().optional().describe("Specify versions by comma, e.g. 1.2.5, 1.2.6")},outputSchema:{removedWorktrees:ae.array(ae.string()).describe("List of removed git worktree branches"),count:ae.number().describe("Number of git worktrees removed")},handler:Oe};import Mt from"@inquirer/confirm";import Wt from"node:process";import{z as rr}from"zod";import{$ as qt}from"zx";var Ut="release/v",_e=async e=>{let{confirmedCommand:r}=e;c.start("worktrees-sync");try{let t=await D("release"),s=`${await $()}${W}`,i=await xe(),a=r?!0:await Mt({message:"Are you sure you want to proceed with these worktree changes?"});r||c.setInteractive(),a||(o.info("Operation cancelled. Exiting..."),Wt.exit(0)),r||c.addOption("--yes",!0);let{branchesToRemove:p}=Gt({releasePRsList:i,currentWorktrees:t}),l=await zt(p,s);Kt(l),c.print();let m={removedWorktrees:l,count:l.length};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}}catch(t){throw o.error({error:t},"\u274C Error managing worktrees"),t}},Gt=e=>{let{releasePRsList:r,currentWorktrees:t}=e;return{branchesToRemove:t.filter(i=>i.startsWith(Ut)).filter(i=>!r.includes(i))}},zt=async(e,r)=>{let t=[];for(let n of e)try{let s=`${r}/${n}`;await qt`git worktree remove ${s}`,t.push(n)}catch(s){o.error({error:s,branch:n},`\u274C Failed to remove worktree for ${n}`)}return t},Kt=e=>{if(e.length>0){o.info("\u274C Removed worktrees:");for(let r of e)o.info(r);o.info("")}else o.info("\u2139\uFE0F No unused worktrees to remove")},Ht={name:"worktrees-sync",description:"Synchronize worktrees with active release branches",inputSchema:{},outputSchema:{removedWorktrees:rr.array(rr.string()).describe("List of removed worktree branches"),count:rr.number().describe("Number of worktrees removed during sync")},handler:_e};var w=new Xt;w.command("merge-dev").description("Merge dev branch into every release branch").option("-a, --all","Select all active release branches").option("-y, --yes","Skip confirmation prompt").action(async e=>{await Te({all:e.all,confirmedCommand:e.yes})});w.command("release-list").description("List all release branches").action(async()=>{await Ie()});w.command("release-create").description("Create a single release branch").option("-v, --version <version>","Specify the version to create, e.g. 1.2.5").option("-d, --description <description>","Optional description for the Jira version").addOption(new Rr("-t, --type <type>","Release type (default: regular)").choices(["regular","hotfix"])).option("-y, --yes","Skip confirmation prompt").option("--no-checkout","Do not checkout the created branch after creation (checkout is default)").action(async e=>{await Ae({version:e.version,description:e.description,type:e.type,confirmedCommand:e.yes,checkout:e.checkout})});w.command("release-create-batch").description("Create multiple release branches (batch operation)").option("-v, --versions <versions>","Specify the versions to create by comma, e.g. 1.2.5, 1.2.6").addOption(new Rr("-t, --type <type>","Release type (default: regular)").choices(["regular","hotfix"])).option("-y, --yes","Skip confirmation prompt").action(async e=>{await Pe({versions:e.versions,type:e.type,confirmedCommand:e.yes})});w.command("release-deploy-all").description("Deploy any release branch to any environment").option("-v, --version <version>","Specify the version to deploy, e.g. 1.2.5").option("-e, --env <env>","Specify the environment to deploy to, e.g. dev").option("--skip-terraform","Skip terraform deployment step").action(async e=>{await Se({version:e.version,env:e.env,skipTerraform:e.skipTerraform})});w.command("release-deploy-service").description("Deploy specific service in release branch to any environment").option("-v, --version <version>","Specify the version to deploy, e.g. 1.2.5").option("-e, --env <env>","Specify the environment to deploy to, e.g. dev").option("-s, --service <service>","Specify the service to deploy, e.g. client-be").option("--skip-terraform","Skip terraform deployment step").action(async e=>{await Ee({version:e.version,env:e.env,service:e.service,skipTerraform:e.skipTerraform})});w.command("release-deploy-selected").description("Deploy selected services from release branch to any environment").option("-v, --version <version>","Specify the version to deploy, e.g. 1.2.5").option("-e, --env <env>","Specify the environment to deploy to, e.g. dev").option("-s, --services <services...>","Specify services to deploy, e.g. client-be client-fe").option("--skip-terraform","Skip terraform deployment step").action(async e=>{await $e({version:e.version,env:e.env,services:e.services,skipTerraform:e.skipTerraform})});w.command("release-deliver").description("Release a new version to production").option("-v, --version <version>","Specify the version to release, e.g. 1.2.5").option("-y, --yes","Skip confirmation prompt").action(async e=>{await Ce({version:e.version,confirmedCommand:e.yes})});w.command("worktrees-sync").description("Remove release worktrees whose PRs are no longer open").option("-y, --yes","Skip confirmation prompt").action(async e=>{await _e({confirmedCommand:e.yes})});w.command("worktrees-add").description("Add git worktrees for release branches").option("-y, --yes","Skip confirmation prompt").option("-a, --all","Select all active release branches").option("-v, --versions <versions>","Specify versions by comma, e.g. 1.2.5, 1.2.6").option("-c, --cursor","Open created worktrees in Cursor").option("--no-cursor","Skip Cursor prompt").option("-g, --github-desktop","Open created worktrees in GitHub Desktop").option("--no-github-desktop","Skip GitHub Desktop prompt").action(async e=>{await Ne({confirmedCommand:e.yes,all:e.all,versions:e.versions,cursor:e.cursor,githubDesktop:e.githubDesktop})});w.command("worktrees-list").description("List all git worktrees with detailed information").action(async()=>{await De()});w.command("worktrees-remove").description("Remove git worktrees for release branches").option("-y, --yes","Skip confirmation prompt").option("-a, --all","Select all active release branches").option("-v, --versions <versions>","Specify versions by comma, e.g. 1.2.5, 1.2.6").action(async e=>{await Oe({confirmedCommand:e.yes,all:e.all,versions:e.versions})});w.command("doctor").description("Check installation and authentication status of gh and doppler CLIs").action(async()=>{await le()});w.command("env-status").description("Show Doppler authentication status and detected project info").action(async()=>{await ve()});w.command("env-list").description("List available Doppler configs for the detected project").action(async()=>{await ge()});w.command("env-init").description("Set up shell functions for env-load/env-clear in .zshrc").action(async()=>{await Be()});w.command("env-load").description("Load Doppler env vars for a config. Source the returned file path to apply.").option("-c, --config <config>","Environment config name to load (e.g. dev, arthur)").action(async e=>{await he({config:e.config})});w.command("env-clear").description("Clear loaded env vars. Source the returned file path to apply.").action(async()=>{await ue()});w.parse();
40
+ `);let p={worktrees:o,count:o.length};return{content:[{type:"text",text:JSON.stringify(p,null,2)}],structuredContent:p}},Ft={name:"worktrees-list",description:"List all git worktrees with detailed information",inputSchema:{},outputSchema:{worktrees:X.array(X.object({version:X.string().describe("Release version"),type:X.enum(["regular","hotfix"]).describe("Release type"),description:X.string().nullable().describe("Jira version description")})).describe("List of all worktrees with details"),count:X.number().describe("Number of worktrees")},handler:Oe};import Mt from"@inquirer/checkbox";import Wt from"@inquirer/confirm";import qt from"node:process";import{z as ce}from"zod";import{$ as rr}from"zx";var _e=async e=>{let{confirmedCommand:r,all:t,versions:n}=e;l.start("worktrees-remove");try{let o=await D("release");if(o.length===0)return s.info("\u2139\uFE0F No active worktrees to remove"),l.print(),{content:[{type:"text",text:JSON.stringify({removedWorktrees:[],count:0},null,2)}],structuredContent:{removedWorktrees:[],count:0}};let a=`${await $()}${W}`,p=[];if(t)p=o;else if(n)p=n.split(",").map(f=>`release/v${f.trim()}`);else{l.setInteractive();let[f,g]=await Promise.all([w(),y()]),R=new Map(g.map(T=>[T.branch,v(T.title)]));p=await Mt({required:!0,message:"\u{1F33F} Select release branches",choices:x({branches:o,descriptions:f,types:R})})}p.length===o.length?l.addOption("--all",!0):l.addOption("--versions",p.map(f=>f.replace("release/v","")));let m=r?!0:await Wt({message:"Are you sure you want to proceed with these worktree changes?"});r||l.setInteractive(),m||(s.info("Operation cancelled. Exiting..."),qt.exit(0)),r||l.addOption("--yes",!0);let u=await Ut(p,a);Gt(u),l.print();let d={removedWorktrees:u,count:u.length};return{content:[{type:"text",text:JSON.stringify(d,null,2)}],structuredContent:d}}catch(o){throw s.error({error:o},"\u274C Error managing worktrees"),o}},Ut=async(e,r)=>{let t=await Promise.allSettled(e.map(async o=>{let i=`${r}/${o}`;return await rr`git worktree remove ${i}`,o})),n=[];for(let[o,i]of t.entries())if(i.status==="fulfilled")n.push(i.value);else{let a=e[o];s.error({error:i.reason},`\u274C Failed to remove worktree for ${a}`)}return n.length===e.length&&(await rr`git worktree prune`,await rr`rm -rf ${r}`,s.info(`\u{1F5D1}\uFE0F Removed worktree folder: ${r}`),s.info("")),n},Gt=e=>{if(e.length>0){s.info("\u274C Removed worktrees:");for(let r of e)s.info(r);s.info("")}else s.info("\u2139\uFE0F No unused worktrees to remove")},zt={name:"worktrees-remove",description:"Remove selected worktrees",inputSchema:{all:ce.boolean().describe("Remove all git worktrees without prompting"),versions:ce.string().optional().describe("Specify versions by comma, e.g. 1.2.5, 1.2.6")},outputSchema:{removedWorktrees:ce.array(ce.string()).describe("List of removed git worktree branches"),count:ce.number().describe("Number of git worktrees removed")},handler:_e};import Kt from"@inquirer/confirm";import Ht from"node:process";import{z as tr}from"zod";import{$ as Xt}from"zx";var Yt="release/v",Je=async e=>{let{confirmedCommand:r}=e;l.start("worktrees-sync");try{let t=await D("release"),o=`${await $()}${W}`,i=await xe(),a=r?!0:await Kt({message:"Are you sure you want to proceed with these worktree changes?"});r||l.setInteractive(),a||(s.info("Operation cancelled. Exiting..."),Ht.exit(0)),r||l.addOption("--yes",!0);let{branchesToRemove:p}=Zt({releasePRsList:i,currentWorktrees:t}),c=await Qt(p,o);eo(c),l.print();let m={removedWorktrees:c,count:c.length};return{content:[{type:"text",text:JSON.stringify(m,null,2)}],structuredContent:m}}catch(t){throw s.error({error:t},"\u274C Error managing worktrees"),t}},Zt=e=>{let{releasePRsList:r,currentWorktrees:t}=e;return{branchesToRemove:t.filter(i=>i.startsWith(Yt)).filter(i=>!r.includes(i))}},Qt=async(e,r)=>{let t=[];for(let n of e)try{let o=`${r}/${n}`;await Xt`git worktree remove ${o}`,t.push(n)}catch(o){s.error({error:o,branch:n},`\u274C Failed to remove worktree for ${n}`)}return t},eo=e=>{if(e.length>0){s.info("\u274C Removed worktrees:");for(let r of e)s.info(r);s.info("")}else s.info("\u2139\uFE0F No unused worktrees to remove")},ro={name:"worktrees-sync",description:"Synchronize worktrees with active release branches",inputSchema:{},outputSchema:{removedWorktrees:tr.array(tr.string()).describe("List of removed worktree branches"),count:tr.number().describe("Number of worktrees removed during sync")},handler:Je};var h=new oo;h.command("merge-dev").description("Merge dev branch into every release branch").option("-a, --all","Select all active release branches").option("-y, --yes","Skip confirmation prompt").action(async e=>{await Te({all:e.all,confirmedCommand:e.yes})});h.command("release-list").description("List all release branches").action(async()=>{await Ie()});h.command("release-create").description("Create a single release branch").option("-v, --version <version>","Specify the version to create, e.g. 1.2.5").option("-d, --description <description>","Optional description for the Jira version").addOption(new Cr("-t, --type <type>","Release type (default: regular)").choices(["regular","hotfix"])).option("-y, --yes","Skip confirmation prompt").option("--no-checkout","Do not checkout the created branch after creation (checkout is default)").action(async e=>{await Pe({version:e.version,description:e.description,type:e.type,confirmedCommand:e.yes,checkout:e.checkout})});h.command("release-create-batch").description("Create multiple release branches (batch operation)").option("-v, --versions <versions>","Specify the versions to create by comma, e.g. 1.2.5, 1.2.6").addOption(new Cr("-t, --type <type>","Release type (default: regular)").choices(["regular","hotfix"])).option("-y, --yes","Skip confirmation prompt").action(async e=>{await Ne({versions:e.versions,type:e.type,confirmedCommand:e.yes})});h.command("release-deploy-all").description("Deploy any release branch to any environment").option("-v, --version <version>","Specify the version to deploy, e.g. 1.2.5").option("-e, --env <env>","Specify the environment to deploy to, e.g. dev").option("--skip-terraform","Skip terraform deployment step").action(async e=>{await Se({version:e.version,env:e.env,skipTerraform:e.skipTerraform})});h.command("release-deploy-service").description("Deploy specific service in release branch to any environment").option("-v, --version <version>","Specify the version to deploy, e.g. 1.2.5").option("-e, --env <env>","Specify the environment to deploy to, e.g. dev").option("-s, --service <service>","Specify the service to deploy, e.g. client-be").option("--skip-terraform","Skip terraform deployment step").action(async e=>{await Ee({version:e.version,env:e.env,service:e.service,skipTerraform:e.skipTerraform})});h.command("release-deploy-selected").description("Deploy selected services from release branch to any environment").option("-v, --version <version>","Specify the version to deploy, e.g. 1.2.5").option("-e, --env <env>","Specify the environment to deploy to, e.g. dev").option("-s, --services <services...>","Specify services to deploy, e.g. client-be client-fe").option("--skip-terraform","Skip terraform deployment step").action(async e=>{await $e({version:e.version,env:e.env,services:e.services,skipTerraform:e.skipTerraform})});h.command("release-deliver").description("Release a new version to production").option("-v, --version <version>","Specify the version to release, e.g. 1.2.5").option("-y, --yes","Skip confirmation prompt").action(async e=>{await Ce({version:e.version,confirmedCommand:e.yes})});h.command("worktrees-sync").description("Remove release worktrees whose PRs are no longer open").option("-y, --yes","Skip confirmation prompt").action(async e=>{await Je({confirmedCommand:e.yes})});h.command("worktrees-add").description("Add git worktrees for release branches").option("-y, --yes","Skip confirmation prompt").option("-a, --all","Select all active release branches").option("-v, --versions <versions>","Specify versions by comma, e.g. 1.2.5, 1.2.6").option("-c, --cursor","Open created worktrees in Cursor").option("--no-cursor","Skip Cursor prompt").option("-g, --github-desktop","Open created worktrees in GitHub Desktop").option("--no-github-desktop","Skip GitHub Desktop prompt").action(async e=>{await De({confirmedCommand:e.yes,all:e.all,versions:e.versions,cursor:e.cursor,githubDesktop:e.githubDesktop})});h.command("worktrees-list").description("List all git worktrees with detailed information").action(async()=>{await Oe()});h.command("worktrees-remove").description("Remove git worktrees for release branches").option("-y, --yes","Skip confirmation prompt").option("-a, --all","Select all active release branches").option("-v, --versions <versions>","Specify versions by comma, e.g. 1.2.5, 1.2.6").action(async e=>{await _e({confirmedCommand:e.yes,all:e.all,versions:e.versions})});h.command("doctor").description("Check installation and authentication status of gh and doppler CLIs").action(async()=>{await pe()});h.command("env-status").description("Show Doppler authentication status and detected project info").action(async()=>{await ve()});h.command("env-list").description("List available Doppler configs for the detected project").action(async()=>{await ge()});h.command("init").description("Inject shell integration into your profile .zshrc").action(async()=>{await Ze()});h.command("env-load").description("Load Doppler env vars for a config. Source the returned file path to apply.").option("-c, --config <config>","Environment config name to load (e.g. dev, arthur)").action(async e=>{await he({config:e.config})});h.command("env-clear").description("Clear loaded env vars. Source the returned file path to apply.").action(async()=>{await fe()});if(Tr.argv.length<=2){let e=["merge-dev","release-list","release-create","release-create-batch","release-deploy-all","release-deploy-service","release-deploy-selected","release-deliver"],r=["worktrees-add","worktrees-list","worktrees-remove","worktrees-sync"],t=["doctor","init","env-status","env-list","env-load","env-clear"],n=new Map(h.commands.map(c=>[c.name(),c])),o=[...e,...r,...t],i=Math.max(...o.map(c=>c.length)),a=c=>c.filter(m=>n.has(m)).map(m=>({name:`${m.padEnd(i)} ${n.get(m).description()}`,value:m})),p=await to({message:"Select a command to run",choices:[new Y(" "),new Y("\u2014 Release Management \u2014"),...a(e),new Y(" "),new Y("\u2014 Worktrees \u2014"),...a(r),new Y(" "),new Y("\u2014 Environment \u2014"),...a(t)]},{output:Tr.stderr});h.parse(["node","infra-kit",p])}else h.parse();
37
41
  //# sourceMappingURL=cli.js.map