oh-my-pr 3.2.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +186 -181
- package/dist/mcp.cjs +1 -1
- package/dist/public/assets/index-B1s2T06A.js +48 -0
- package/dist/public/index.html +1 -1
- package/package.json +1 -1
- package/dist/public/assets/index-CTng6NQK.js +0 -48
package/dist/mcp.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var d=require("@modelcontextprotocol/sdk/server/index.js"),l=require("@modelcontextprotocol/sdk/server/stdio.js"),a=require("@modelcontextprotocol/sdk/types.js"),y=process.env.OH_MY_PR_PORT??process.env.CODEFACTORY_PORT??"5001",u=`http://127.0.0.1:${y}`;async function t(r,e,i){let n=`${u}${e}`,s=await fetch(n,{method:r,headers:{"Content-Type":"application/json"},body:i!==void 0?JSON.stringify(i):void 0}),p=await s.text(),o;try{o=JSON.parse(p)}catch{o=p}if(!s.ok){let m=typeof o=="object"&&o!==null&&"error"in o?o.error:p;throw new Error(`HTTP ${s.status}: ${m}`)}return o}var g=[{name:"list_repos",description:"List all repositories currently being watched by oh-my-pr. Returns an array of 'owner/repo' strings.",inputSchema:{type:"object",properties:{},required:[]}},{name:"add_repo",description:"Add a GitHub repository to the oh-my-pr watch list. Accepts 'owner/repo' slugs or full GitHub URLs.",inputSchema:{type:"object",properties:{repo:{type:"string",description:"Repository identifier, e.g. 'owner/repo' or 'https://github.com/owner/repo'."}},required:["repo"]}},{name:"sync_repos",description:"Force an immediate sync cycle across all watched repositories. Fetches the latest PR feedback from GitHub and runs the babysitter logic.",inputSchema:{type:"object",properties:{},required:[]}},{name:"list_prs",description:"List all actively tracked pull requests with their current status and feedback summaries.",inputSchema:{type:"object",properties:{},required:[]}},{name:"list_archived_prs",description:"List pull requests that have been archived (closed / merged).",inputSchema:{type:"object",properties:{},required:[]}},{name:"get_pr",description:"Get full details for a single PR, including all feedback items, triage decisions, and run history.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"add_pr",description:"Register a GitHub pull request with oh-my-pr by URL. oh-my-pr will start watching the PR and run the babysitter.",inputSchema:{type:"object",properties:{url:{type:"string",description:"Full GitHub PR URL, e.g. 'https://github.com/owner/repo/pull/42'."}},required:["url"]}},{name:"remove_pr",description:"Remove a PR from oh-my-pr's tracking list.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"fetch_pr_feedback",description:"Force a fresh fetch of comments and reviews from GitHub for a specific PR.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"triage_pr",description:"Run automatic triage on all un-triaged feedback items for a PR. Items are classified as accept, reject, or flag.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"apply_pr_fixes",description:"Dispatch the configured AI agent to apply all accepted feedback for a PR. Runs in an isolated git worktree and pushes the result.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"babysit_pr",description:"Run a full babysit cycle on a PR: sync feedback \u2192 triage \u2192 apply fixes \u2192 report. This is the highest-level operation for a single PR.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"set_feedback_decision",description:"Manually override the triage decision for a single feedback item on a PR. Valid decisions: 'accept' | 'reject' | 'flag'.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Internal oh-my-pr PR ID."},feedback_id:{type:"string",description:"Feedback item ID."},decision:{type:"string",enum:["accept","reject","flag"],description:"New triage decision."}},required:["pr_id","feedback_id","decision"]}},{name:"retry_feedback_item",description:"Retry a previously failed or warned feedback item for a PR.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Internal oh-my-pr PR ID."},feedback_id:{type:"string",description:"Feedback item ID."}},required:["pr_id","feedback_id"]}},{name:"list_pr_questions",description:"List all questions and answers previously asked about a PR.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["pr_id"]}},{name:"ask_pr_question",description:"Ask the configured AI agent a natural-language question about a PR's state, feedback, or code. Returns the question entry; the answer is filled in asynchronously.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Internal oh-my-pr PR ID."},question:{type:"string",description:"Natural-language question (max 2000 chars).",maxLength:2e3}},required:["pr_id","question"]}},{name:"get_logs",description:"Retrieve activity logs. Optionally filter by PR ID to see only that PR's history.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Optional PR ID to filter logs."}},required:[]}},{name:"get_config",description:"Read the current oh-my-pr configuration. GitHub tokens are redacted.",inputSchema:{type:"object",properties:{},required:[]}},{name:"update_config",description:"Partially update oh-my-pr configuration. All fields are optional; only provided fields are changed. Available fields: githubTokens, githubToken (legacy), codingAgent, maxTurns, fallbackToNextCodingAgent, batchWindowMs, pollIntervalMs, maxChangesPerRun, autoResolveMergeConflicts, autoUpdateDocs, includeRepositoryLinksInGitHubComments, watchedRepos, trustedReviewers, ignoredBots.",inputSchema:{type:"object",properties:{githubTokens:{type:"array",items:{type:"string"}},githubToken:{type:"string"},codingAgent:{type:"string",enum:["claude","codex"]},fallbackToNextCodingAgent:{type:"boolean"},maxTurns:{type:"number"},batchWindowMs:{type:"number"},pollIntervalMs:{type:"number"},maxChangesPerRun:{type:"number"},autoResolveMergeConflicts:{type:"boolean"},autoUpdateDocs:{type:"boolean"},includeRepositoryLinksInGitHubComments:{type:"boolean"},watchedRepos:{type:"array",items:{type:"string"}},trustedReviewers:{type:"array",items:{type:"string"}},ignoredBots:{type:"array",items:{type:"string"}}},required:[]}},{name:"get_runtime",description:"Get oh-my-pr runtime state: drain mode status, active run count, and timestamps.",inputSchema:{type:"object",properties:{},required:[]}},{name:"set_drain_mode",description:"Enable or disable drain mode. When drain mode is on, no new agent runs are started. Use this for graceful shutdown or maintenance.",inputSchema:{type:"object",properties:{enabled:{type:"boolean",description:"True to enable, false to disable."},reason:{type:"string",description:"Optional human-readable reason."},wait_for_idle:{type:"boolean",description:"If true, block until all active runs finish (or timeout)."},timeout_ms:{type:"number",description:"Max milliseconds to wait when wait_for_idle is true (default 120000)."}},required:["enabled"]}},{name:"list_changelogs",description:"List all generated social-media changelogs.",inputSchema:{type:"object",properties:{},required:[]}},{name:"get_changelog",description:"Get the full content of a single social-media changelog.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Changelog ID."}},required:["id"]}},{name:"get_onboarding_status",description:"Check onboarding status for all watched repositories (GitHub workflow installation, etc.).",inputSchema:{type:"object",properties:{},required:[]}},{name:"install_review_workflow",description:"Install the oh-my-pr code-review GitHub Actions workflow on a repository.",inputSchema:{type:"object",properties:{repo:{type:"string",description:"Repository slug 'owner/repo'."},tool:{type:"string",enum:["claude","codex"],description:"Agent tool to use for reviews."}},required:["repo","tool"]}},{name:"list_deployment_healing_sessions",description:"List deployment healing sessions, optionally filtered by repository.",inputSchema:{type:"object",properties:{repo:{type:"string",description:"Optional repository slug 'owner/repo' to filter by."}},required:[]}},{name:"get_deployment_healing_session",description:"Get details of a single deployment healing session by ID.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Deployment healing session ID."}},required:["id"]}}];async function h(r,e){switch(r){case"list_repos":return t("GET","/api/repos");case"add_repo":return t("POST","/api/repos",{repo:e.repo});case"sync_repos":return t("POST","/api/repos/sync");case"list_prs":return t("GET","/api/prs");case"list_archived_prs":return t("GET","/api/prs/archived");case"get_pr":return t("GET",`/api/prs/${e.id}`);case"add_pr":return t("POST","/api/prs",{url:e.url});case"remove_pr":return t("DELETE",`/api/prs/${e.id}`);case"fetch_pr_feedback":return t("POST",`/api/prs/${e.id}/fetch`);case"triage_pr":return t("POST",`/api/prs/${e.id}/triage`);case"apply_pr_fixes":return t("POST",`/api/prs/${e.id}/apply`);case"babysit_pr":return t("POST",`/api/prs/${e.id}/babysit`);case"set_feedback_decision":return t("PATCH",`/api/prs/${e.pr_id}/feedback/${e.feedback_id}`,{decision:e.decision});case"retry_feedback_item":return t("POST",`/api/prs/${e.pr_id}/feedback/${e.feedback_id}/retry`);case"list_pr_questions":return t("GET",`/api/prs/${e.pr_id}/questions`);case"ask_pr_question":return t("POST",`/api/prs/${e.pr_id}/questions`,{question:e.question});case"get_logs":{let i=e.pr_id?`?prId=${encodeURIComponent(String(e.pr_id))}`:"";return t("GET",`/api/logs${i}`)}case"get_config":return t("GET","/api/config");case"update_config":return t("PATCH","/api/config",e);case"get_runtime":return t("GET","/api/runtime");case"set_drain_mode":return t("POST","/api/runtime/drain",{enabled:e.enabled,reason:e.reason,waitForIdle:e.wait_for_idle,timeoutMs:e.timeout_ms});case"list_changelogs":return t("GET","/api/changelogs");case"get_changelog":return t("GET",`/api/changelogs/${e.id}`);case"get_onboarding_status":return t("GET","/api/onboarding/status");case"install_review_workflow":return t("POST","/api/onboarding/install-review",{repo:e.repo,tool:e.tool});case"list_deployment_healing_sessions":{let i=e.repo?`?repo=${encodeURIComponent(String(e.repo))}`:"";return t("GET",`/api/deployment-healing-sessions${i}`)}case"get_deployment_healing_session":return t("GET",`/api/deployment-healing-sessions/${e.id}`);default:throw new Error(`Unknown tool: ${r}`)}}var c=new d.Server({name:"oh-my-pr",version:"1.0.0"},{capabilities:{tools:{}}});c.setRequestHandler(a.ListToolsRequestSchema,async()=>({tools:g}));c.setRequestHandler(a.CallToolRequestSchema,async r=>{let{name:e,arguments:i={}}=r.params;try{let n=await h(e,i);return{content:[{type:"text",text:JSON.stringify(n,null,2)}]}}catch(n){return{content:[{type:"text",text:`Error: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}});async function b(){let r=new l.StdioServerTransport;await c.connect(r),process.stderr.write(`[oh-my-pr-mcp] MCP server started \u2014 targeting ${u}
|
|
2
|
+
"use strict";var d=require("@modelcontextprotocol/sdk/server/index.js"),l=require("@modelcontextprotocol/sdk/server/stdio.js"),a=require("@modelcontextprotocol/sdk/types.js"),y=process.env.OH_MY_PR_PORT??process.env.CODEFACTORY_PORT??"5001",u=`http://127.0.0.1:${y}`;async function t(r,e,i){let n=`${u}${e}`,s=await fetch(n,{method:r,headers:{"Content-Type":"application/json"},body:i!==void 0?JSON.stringify(i):void 0}),p=await s.text(),o;try{o=JSON.parse(p)}catch{o=p}if(!s.ok){let m=typeof o=="object"&&o!==null&&"error"in o?o.error:p;throw new Error(`HTTP ${s.status}: ${m}`)}return o}var g=[{name:"list_repos",description:"List all repositories currently being watched by oh-my-pr. Returns an array of 'owner/repo' strings.",inputSchema:{type:"object",properties:{},required:[]}},{name:"add_repo",description:"Add a GitHub repository to the oh-my-pr watch list. Accepts 'owner/repo' slugs or full GitHub URLs.",inputSchema:{type:"object",properties:{repo:{type:"string",description:"Repository identifier, e.g. 'owner/repo' or 'https://github.com/owner/repo'."}},required:["repo"]}},{name:"sync_repos",description:"Force an immediate sync cycle across all watched repositories. Fetches the latest PR feedback from GitHub and runs the babysitter logic.",inputSchema:{type:"object",properties:{},required:[]}},{name:"list_prs",description:"List all actively tracked pull requests with their current status and feedback summaries.",inputSchema:{type:"object",properties:{},required:[]}},{name:"list_archived_prs",description:"List pull requests that have been archived (closed / merged).",inputSchema:{type:"object",properties:{},required:[]}},{name:"get_pr",description:"Get full details for a single PR, including all feedback items, triage decisions, and run history.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"add_pr",description:"Register a GitHub pull request with oh-my-pr by URL. oh-my-pr will start watching the PR and run the babysitter.",inputSchema:{type:"object",properties:{url:{type:"string",description:"Full GitHub PR URL, e.g. 'https://github.com/owner/repo/pull/42'."}},required:["url"]}},{name:"remove_pr",description:"Remove a PR from oh-my-pr's tracking list.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"fetch_pr_feedback",description:"Force a fresh fetch of comments and reviews from GitHub for a specific PR.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"triage_pr",description:"Run automatic triage on all un-triaged feedback items for a PR. Items are classified as accept, reject, or flag.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"apply_pr_fixes",description:"Dispatch the configured AI agent to apply all accepted feedback for a PR. Runs in an isolated git worktree and pushes the result.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"babysit_pr",description:"Run a full babysit cycle on a PR: sync feedback \u2192 triage \u2192 apply fixes \u2192 report. This is the highest-level operation for a single PR.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["id"]}},{name:"set_feedback_decision",description:"Manually override the triage decision for a single feedback item on a PR. Valid decisions: 'accept' | 'reject' | 'flag'.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Internal oh-my-pr PR ID."},feedback_id:{type:"string",description:"Feedback item ID."},decision:{type:"string",enum:["accept","reject","flag"],description:"New triage decision."}},required:["pr_id","feedback_id","decision"]}},{name:"retry_feedback_item",description:"Retry a previously failed or warned feedback item for a PR.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Internal oh-my-pr PR ID."},feedback_id:{type:"string",description:"Feedback item ID."}},required:["pr_id","feedback_id"]}},{name:"list_pr_questions",description:"List all questions and answers previously asked about a PR.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Internal oh-my-pr PR ID."}},required:["pr_id"]}},{name:"ask_pr_question",description:"Ask the configured AI agent a natural-language question about a PR's state, feedback, or code. Returns the question entry; the answer is filled in asynchronously.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Internal oh-my-pr PR ID."},question:{type:"string",description:"Natural-language question (max 2000 chars).",maxLength:2e3}},required:["pr_id","question"]}},{name:"get_logs",description:"Retrieve activity logs. Optionally filter by PR ID to see only that PR's history.",inputSchema:{type:"object",properties:{pr_id:{type:"string",description:"Optional PR ID to filter logs."}},required:[]}},{name:"get_config",description:"Read the current oh-my-pr configuration. GitHub tokens are redacted.",inputSchema:{type:"object",properties:{},required:[]}},{name:"update_config",description:"Partially update oh-my-pr configuration. All fields are optional; only provided fields are changed. Available fields: githubTokens, githubToken (legacy), codingAgent, maxTurns, fallbackToNextCodingAgent, batchWindowMs, pollIntervalMs, maxChangesPerRun, autoResolveMergeConflicts, autoUpdateDocs, includeRepositoryLinksInGitHubComments, postGitHubProgressReplies, watchedRepos, trustedReviewers, ignoredBots.",inputSchema:{type:"object",properties:{githubTokens:{type:"array",items:{type:"string"}},githubToken:{type:"string"},codingAgent:{type:"string",enum:["claude","codex"]},fallbackToNextCodingAgent:{type:"boolean"},maxTurns:{type:"number"},batchWindowMs:{type:"number"},pollIntervalMs:{type:"number"},maxChangesPerRun:{type:"number"},autoResolveMergeConflicts:{type:"boolean"},autoUpdateDocs:{type:"boolean"},includeRepositoryLinksInGitHubComments:{type:"boolean"},postGitHubProgressReplies:{type:"boolean"},watchedRepos:{type:"array",items:{type:"string"}},trustedReviewers:{type:"array",items:{type:"string"}},ignoredBots:{type:"array",items:{type:"string"}}},required:[]}},{name:"get_runtime",description:"Get oh-my-pr runtime state: drain mode status, active run count, and timestamps.",inputSchema:{type:"object",properties:{},required:[]}},{name:"set_drain_mode",description:"Enable or disable drain mode. When drain mode is on, no new agent runs are started. Use this for graceful shutdown or maintenance.",inputSchema:{type:"object",properties:{enabled:{type:"boolean",description:"True to enable, false to disable."},reason:{type:"string",description:"Optional human-readable reason."},wait_for_idle:{type:"boolean",description:"If true, block until all active runs finish (or timeout)."},timeout_ms:{type:"number",description:"Max milliseconds to wait when wait_for_idle is true (default 120000)."}},required:["enabled"]}},{name:"list_changelogs",description:"List all generated social-media changelogs.",inputSchema:{type:"object",properties:{},required:[]}},{name:"get_changelog",description:"Get the full content of a single social-media changelog.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Changelog ID."}},required:["id"]}},{name:"get_onboarding_status",description:"Check onboarding status for all watched repositories (GitHub workflow installation, etc.).",inputSchema:{type:"object",properties:{},required:[]}},{name:"install_review_workflow",description:"Install the oh-my-pr code-review GitHub Actions workflow on a repository.",inputSchema:{type:"object",properties:{repo:{type:"string",description:"Repository slug 'owner/repo'."},tool:{type:"string",enum:["claude","codex"],description:"Agent tool to use for reviews."}},required:["repo","tool"]}},{name:"list_deployment_healing_sessions",description:"List deployment healing sessions, optionally filtered by repository.",inputSchema:{type:"object",properties:{repo:{type:"string",description:"Optional repository slug 'owner/repo' to filter by."}},required:[]}},{name:"get_deployment_healing_session",description:"Get details of a single deployment healing session by ID.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Deployment healing session ID."}},required:["id"]}}];async function h(r,e){switch(r){case"list_repos":return t("GET","/api/repos");case"add_repo":return t("POST","/api/repos",{repo:e.repo});case"sync_repos":return t("POST","/api/repos/sync");case"list_prs":return t("GET","/api/prs");case"list_archived_prs":return t("GET","/api/prs/archived");case"get_pr":return t("GET",`/api/prs/${e.id}`);case"add_pr":return t("POST","/api/prs",{url:e.url});case"remove_pr":return t("DELETE",`/api/prs/${e.id}`);case"fetch_pr_feedback":return t("POST",`/api/prs/${e.id}/fetch`);case"triage_pr":return t("POST",`/api/prs/${e.id}/triage`);case"apply_pr_fixes":return t("POST",`/api/prs/${e.id}/apply`);case"babysit_pr":return t("POST",`/api/prs/${e.id}/babysit`);case"set_feedback_decision":return t("PATCH",`/api/prs/${e.pr_id}/feedback/${e.feedback_id}`,{decision:e.decision});case"retry_feedback_item":return t("POST",`/api/prs/${e.pr_id}/feedback/${e.feedback_id}/retry`);case"list_pr_questions":return t("GET",`/api/prs/${e.pr_id}/questions`);case"ask_pr_question":return t("POST",`/api/prs/${e.pr_id}/questions`,{question:e.question});case"get_logs":{let i=e.pr_id?`?prId=${encodeURIComponent(String(e.pr_id))}`:"";return t("GET",`/api/logs${i}`)}case"get_config":return t("GET","/api/config");case"update_config":return t("PATCH","/api/config",e);case"get_runtime":return t("GET","/api/runtime");case"set_drain_mode":return t("POST","/api/runtime/drain",{enabled:e.enabled,reason:e.reason,waitForIdle:e.wait_for_idle,timeoutMs:e.timeout_ms});case"list_changelogs":return t("GET","/api/changelogs");case"get_changelog":return t("GET",`/api/changelogs/${e.id}`);case"get_onboarding_status":return t("GET","/api/onboarding/status");case"install_review_workflow":return t("POST","/api/onboarding/install-review",{repo:e.repo,tool:e.tool});case"list_deployment_healing_sessions":{let i=e.repo?`?repo=${encodeURIComponent(String(e.repo))}`:"";return t("GET",`/api/deployment-healing-sessions${i}`)}case"get_deployment_healing_session":return t("GET",`/api/deployment-healing-sessions/${e.id}`);default:throw new Error(`Unknown tool: ${r}`)}}var c=new d.Server({name:"oh-my-pr",version:"1.0.0"},{capabilities:{tools:{}}});c.setRequestHandler(a.ListToolsRequestSchema,async()=>({tools:g}));c.setRequestHandler(a.CallToolRequestSchema,async r=>{let{name:e,arguments:i={}}=r.params;try{let n=await h(e,i);return{content:[{type:"text",text:JSON.stringify(n,null,2)}]}}catch(n){return{content:[{type:"text",text:`Error: ${n instanceof Error?n.message:String(n)}`}],isError:!0}}});async function b(){let r=new l.StdioServerTransport;await c.connect(r),process.stderr.write(`[oh-my-pr-mcp] MCP server started \u2014 targeting ${u}
|
|
3
3
|
`)}b().catch(r=>{process.stderr.write(`[oh-my-pr-mcp] Fatal: ${r}
|
|
4
4
|
`),process.exit(1)});
|