prjct-cli 1.45.0 → 1.45.2
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/CHANGELOG.md +27 -1
- package/dist/bin/prjct-core.mjs +89 -89
- package/dist/cli/jira.mjs +1 -1
- package/dist/cli/linear.mjs +1 -1
- package/dist/daemon/entry.mjs +72 -72
- package/dist/templates.json +1 -1
- package/package.json +1 -1
package/dist/cli/jira.mjs
CHANGED
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
var require = __createRequire(import.meta.url);
|
|
6
6
|
var __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
var __dirname = __pathDirname(__filename);
|
|
8
|
-
var
|
|
8
|
+
var j=Object.defineProperty;var t=(e,r)=>j(e,"name",{value:r,configurable:!0});function c(e){return e instanceof Error?e.message:typeof e=="string"?e:"Unknown error"}t(c,"getErrorMessage");import l from"node:fs/promises";import h from"node:os";import f from"node:path";var M={linear:{command:"npx",args:["-y","mcp-remote","https://mcp.linear.app/mcp"],description:"Linear MCP server (OAuth)"},jira:{command:"npx",args:["-y","mcp-remote","https://mcp.atlassian.com/v1/mcp"],description:"Atlassian MCP server for Jira (OAuth)"}};function i(){return process.env.PRJCT_TEST_MODE==="1"?f.join(h.tmpdir(),"prjct-context7-test","mcp.json"):f.join(h.homedir(),".claude","mcp.json")}t(i,"getClaudeMcpConfigPath");async function v(e=i()){try{let r=await l.readFile(e,"utf-8");return JSON.parse(r)}catch(r){let n=c(r).toLowerCase();if(n.includes("no such file")||n.includes("enoent"))return{};throw new Error(`Failed to read MCP config at ${e}: ${c(r)}`)}}t(v,"readMcpConfig");async function k(e,r=i()){await l.mkdir(f.dirname(r),{recursive:!0}),await l.writeFile(r,JSON.stringify(e,null,2),"utf-8")}t(k,"writeMcpConfig");async function E(e,r,n=i()){let s=await v(n),g={...s.mcpServers||{}},a=g[e];g[e]=r,s.mcpServers=g;let S=JSON.stringify(a)!==JSON.stringify(r);return await k(s,n),{path:n,changed:S}}t(E,"upsertMcpServer");async function u(e,r=i()){return!!(await v(r)).mcpServers?.[e]}t(u,"hasMcpServer");var d=process.argv.slice(2),w=d.indexOf("--json"),P=w!==-1;P&&d.splice(w,1);var y=d.indexOf("--md");y!==-1&&d.splice(y,1);var[m,...C]=d;function o(e){if(P){console.log(JSON.stringify(e,null,2));return}if(typeof e=="string"){console.log(e);return}console.log(JSON.stringify(e,null,2))}t(o,"output");function p(e,r=1){console.error(P?JSON.stringify({error:e}):`Error: ${e}`),process.exit(r)}t(p,"error");async function b(){let e=await E("jira",M.jira);o({success:!0,provider:"jira",mode:"mcp",path:e.path,updated:e.changed,nextSteps:["STEP 1 (done): MCP config written to mcp.json.","STEP 2: Open a NEW terminal and run: npx -y mcp-remote https://mcp.atlassian.com/v1/mcp","STEP 2: A browser will open for OAuth \u2014 complete the authorization.","STEP 3: Close and reopen Claude Code. Jira MCP tools will be ready."],authCommand:"npx -y mcp-remote https://mcp.atlassian.com/v1/mcp"})}t(b,"setup");async function x(){let e=i(),r=await u("jira",e);o({provider:"jira",mode:"mcp",configured:r,path:e,hint:r?"Jira MCP is configured. OAuth happens inside your AI client.":"Run `prjct jira setup` to configure Jira MCP."})}t(x,"status");async function J(e,r,n){let s=i();await u("jira",s)||p("Jira MCP is not configured. Run `prjct jira setup` first.");let a={success:!0,provider:"jira",mode:"mcp",delegated:!0,command:e,args:r,hint:n?.hint??"Run this operation using Jira MCP tools in your current AI client session.",nextSteps:["Open your MCP-enabled AI client/session.",`Execute the Jira MCP operation for "${e}".`]};n?.jql&&(a.jql=n.jql),n?.scope&&(a.scope=n.scope),o(a)}t(J,"runMcpOperation");async function O(e){let r=i();await u("jira",r)||p("Jira MCP is not configured. Run `prjct jira setup` first."),o({success:!0,provider:"jira",mode:"mcp",delegated:!0,command:"sprint",scope:"active_sprint",args:e,jql:"sprint = currentSprint() AND assignee = currentUser() ORDER BY priority DESC",hint:"Fetch your issues in the active sprint via Jira MCP tools.",nextSteps:["Use the Jira MCP search tool with the JQL above to list your active sprint issues.","Issues returned include sprint metadata (sprint name, start/end dates)."]})}t(O,"sprintOperation");async function R(e){let r=i();await u("jira",r)||p("Jira MCP is not configured. Run `prjct jira setup` first."),o({success:!0,provider:"jira",mode:"mcp",delegated:!0,command:"backlog",scope:"backlog",args:e,jql:"sprint is EMPTY AND assignee = currentUser() AND statusCategory != Done ORDER BY priority DESC",hint:"Fetch your backlog issues (not in any sprint) via Jira MCP tools.",nextSteps:["Use the Jira MCP search tool with the JQL above to list your backlog issues.","Backlog issues have no sprint assigned \u2014 differentiate from sprint issues by the sprint field being empty."]})}t(R,"backlogOperation");async function D(){try{switch(m){case"setup":await b();break;case"status":await x();break;case"help":case"--help":case"-h":case void 0:o({usage:"prjct jira <command>",commands:{setup:"Configure Jira MCP server",status:"Check Jira MCP configuration",sprint:"List your issues in the active sprint (MCP)",backlog:"List your backlog issues not in any sprint (MCP)",sync:"Delegate issue sync via MCP tools",list:"Delegate issue listing via MCP tools",get:"Delegate issue retrieval via MCP tools",create:"Delegate issue creation via MCP tools",update:"Delegate issue update via MCP tools",start:"Delegate status transition to in-progress via MCP tools",done:"Delegate status transition to done via MCP tools",transition:"Delegate workflow transition via MCP tools"},note:"Jira is MCP-only. sprint/backlog provide JQL for your AI client MCP session."});break;case"sprint":await O(C);break;case"backlog":await R(C);break;case"sync":case"start":case"done":case"list":case"get":case"create":case"update":case"transition":case"comment":case"projects":case"boards":await J(m,C);break;default:p(`Unknown command: ${m}. Use --help to see available commands.`)}}catch(e){p(c(e))}}t(D,"main");D();
|
package/dist/cli/linear.mjs
CHANGED
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
var require = __createRequire(import.meta.url);
|
|
6
6
|
var __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
var __dirname = __pathDirname(__filename);
|
|
8
|
-
var
|
|
8
|
+
var y=Object.defineProperty;var r=(e,n)=>y(e,"name",{value:n,configurable:!0});function i(e){return e instanceof Error?e.message:typeof e=="string"?e:"Unknown error"}r(i,"getErrorMessage");import u from"node:fs/promises";import C from"node:os";import l from"node:path";var P={linear:{command:"npx",args:["-y","mcp-remote","https://mcp.linear.app/mcp"],description:"Linear MCP server (OAuth)"},jira:{command:"npx",args:["-y","mcp-remote","https://mcp.atlassian.com/v1/mcp"],description:"Atlassian MCP server for Jira (OAuth)"}};function o(){return process.env.PRJCT_TEST_MODE==="1"?l.join(C.tmpdir(),"prjct-context7-test","mcp.json"):l.join(C.homedir(),".claude","mcp.json")}r(o,"getClaudeMcpConfigPath");async function M(e=o()){try{let n=await u.readFile(e,"utf-8");return JSON.parse(n)}catch(n){let t=i(n).toLowerCase();if(t.includes("no such file")||t.includes("enoent"))return{};throw new Error(`Failed to read MCP config at ${e}: ${i(n)}`)}}r(M,"readMcpConfig");async function x(e,n=o()){await u.mkdir(l.dirname(n),{recursive:!0}),await u.writeFile(n,JSON.stringify(e,null,2),"utf-8")}r(x,"writeMcpConfig");async function E(e,n,t=o()){let a=await M(t),p={...a.mcpServers||{}},S=p[e];p[e]=n,a.mcpServers=p;let w=JSON.stringify(S)!==JSON.stringify(n);return await x(a,t),{path:t,changed:w}}r(E,"upsertMcpServer");async function d(e,n=o()){return!!(await M(n)).mcpServers?.[e]}r(d,"hasMcpServer");var s=process.argv.slice(2),h=s.indexOf("--json"),f=h!==-1;f&&s.splice(h,1);var v=s.indexOf("--md");v!==-1&&s.splice(v,1);var[m,...k]=s;function c(e){if(f){console.log(JSON.stringify(e,null,2));return}if(typeof e=="string"){console.log(e);return}console.log(JSON.stringify(e,null,2))}r(c,"output");function g(e,n=1){console.error(f?JSON.stringify({error:e}):`Error: ${e}`),process.exit(n)}r(g,"error");async function O(){let e=await E("linear",P.linear);c({success:!0,provider:"linear",mode:"mcp",path:e.path,updated:e.changed,nextSteps:["STEP 1 (done): MCP config written to mcp.json.","STEP 2: Open a NEW terminal and run: npx -y mcp-remote https://mcp.linear.app/mcp","STEP 2: A browser will open for OAuth \u2014 complete the authorization.","STEP 3: Close and reopen Claude Code. Linear MCP tools will be ready."],authCommand:"npx -y mcp-remote https://mcp.linear.app/mcp"})}r(O,"setup");async function b(){let e=o(),n=await d("linear",e);c({provider:"linear",mode:"mcp",configured:n,path:e,hint:n?"Linear MCP is configured. OAuth happens inside your AI client.":"Run `prjct linear setup` to configure Linear MCP."})}r(b,"status");async function j(e,n){let t=o();await d("linear",t)||g("Linear MCP is not configured. Run `prjct linear setup` first."),c({success:!0,provider:"linear",mode:"mcp",delegated:!0,command:e,args:n,hint:"Run this operation using Linear MCP tools in your current AI client session.",nextSteps:["Open your MCP-enabled AI client/session.",`Execute the Linear MCP operation for "${e}".`]})}r(j,"runMcpOperation");async function N(){try{switch(m){case"setup":await O();break;case"status":await b();break;case"help":case"--help":case"-h":case void 0:c({usage:"prjct linear <command>",commands:{setup:"Configure Linear MCP server",status:"Check Linear MCP configuration",sync:"Delegate issue sync via MCP tools",list:"Delegate issue listing via MCP tools",get:"Delegate issue retrieval via MCP tools",create:"Delegate issue creation via MCP tools",update:"Delegate issue update via MCP tools",start:"Delegate status transition to in-progress via MCP tools",done:"Delegate status transition to done via MCP tools",comment:"Delegate comment creation via MCP tools"},note:"Linear is MCP-only."});break;case"sync":case"list":case"get":case"create":case"update":case"start":case"done":case"comment":case"teams":case"projects":await j(m,k);break;default:g(`Unknown command: ${m}. Use --help to see available commands.`)}}catch(e){g(i(e))}}r(N,"main");N();
|