cerebrex 0.6.0 → 0.6.1
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.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -682,7 +682,7 @@ Examples:
|
|
|
682
682
|
\uD83D\uDCE6 Publishing to CerebreX Registry
|
|
683
683
|
`));let Z=Z1.resolve(process.cwd(),$.dir),X=Z1.join(Z,"package.json");if(!n.existsSync(X))console.error(D.red(` No package.json found in ${Z}`)),console.error(D.dim(" Run `cerebrex build` first.\n")),process.exit(1);let J=JSON.parse(n.readFileSync(X,"utf-8")),Q=$.name||J.name,Y=$.version||J.version;if(!Q)console.error(D.red(` Could not determine package name. Use --name <name>
|
|
684
684
|
`)),process.exit(1);let q=r9();if(!q)console.error(D.yellow(" Not authenticated.")),console.error(D.dim(` Run: cerebrex auth login
|
|
685
|
-
`)),process.exit(1);let H="",G=$.readme?Z1.resolve(process.cwd(),$.readme):Z1.join(Z,"README.md");if(n.existsSync(G))H=n.readFileSync(G,"utf-8");let K=R1("Creating package tarball...").start();try{let z=`${Q.replace(/\//g,"-")}-${Y}.tgz`,W=Z1.join(zk.tmpdir(),z),{execa:V}=await Promise.resolve().then(() => (c6(),p6));await V("tar",["-czf",W,"-C",Z1.dirname(Z),Z1.basename(Z)]),K.text="Uploading to CerebreX Registry...";let L=n.readFileSync(W),T=new FormData;if(T.append("tarball",new Blob([L],{type:"application/gzip"}),z),T.append("name",Q),T.append("version",Y??""),T.append("description",J.description??""),T.append("tags",$.tag),H)T.append("readme",H);let F=await fetch(`${m$}/v1/
|
|
685
|
+
`)),process.exit(1);let H="",G=$.readme?Z1.resolve(process.cwd(),$.readme):Z1.join(Z,"README.md");if(n.existsSync(G))H=n.readFileSync(G,"utf-8");let K=R1("Creating package tarball...").start();try{let z=`${Q.replace(/\//g,"-")}-${Y}.tgz`,W=Z1.join(zk.tmpdir(),z),{execa:V}=await Promise.resolve().then(() => (c6(),p6));await V("tar",["-czf",W,"-C",Z1.dirname(Z),Z1.basename(Z)]),K.text="Uploading to CerebreX Registry...";let L=n.readFileSync(W),T=new FormData;if(T.append("tarball",new Blob([L],{type:"application/gzip"}),z),T.append("name",Q),T.append("version",Y??""),T.append("description",J.description??""),T.append("tags",$.tag),H)T.append("readme",H);let F=await fetch(`${m$}/v1/packages`,{method:"POST",headers:{Authorization:`Bearer ${q}`},body:T}),R=await F.json();if(n.unlinkSync(W),!F.ok||!R.success)throw Error(R.error||`HTTP ${F.status}`);K.succeed(D.green("Package published!")),console.log(D.cyan(`
|
|
686
686
|
View your package at:`)),console.log(D.bold(` ${R.url??`${m$}/packages/${encodeURIComponent(Q)}`}
|
|
687
687
|
`))}catch(z){K.fail(D.red("Publish failed"));let W=z.message;if(console.error(D.dim(` ${W}`)),/fetch|ECONNREFUSED|ENOTFOUND/.test(W))console.error(D.dim(`
|
|
688
688
|
Registry: ${m$}
|
|
@@ -762,7 +762,7 @@ Examples:
|
|
|
762
762
|
`)),process.exit(1);let X=R1(`Sending task '${$.type}' to agent ${$.agent}...`).start();try{let J=await fetch(`${$.hiveUrl}/tasks`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${$.token}`},body:JSON.stringify({agent_id:$.agent,type:$.type,payload:Z})});if(!J.ok){let Y=await J.json();throw Error(Y.error||`HTTP ${J.status}`)}let{task:Q}=await J.json();X.succeed(D.green("Task queued")),console.log(D.dim(`
|
|
763
763
|
Task ID: ${Q.id}`)),console.log(D.dim(` Status: ${Q.status}
|
|
764
764
|
`))}catch(J){X.fail(D.red("Failed to send task")),console.error(D.dim(` ${J.message}
|
|
765
|
-
`)),process.exit(1)}});var Nk="0.6.
|
|
765
|
+
`)),process.exit(1)}});var Nk="0.6.1",C1=new V1,iq1=`
|
|
766
766
|
${D.cyan(" ██████╗███████╗██████╗ ███████╗██████╗ ██████╗ ███████╗██╗ ██╗")}
|
|
767
767
|
${D.cyan(" ██╔════╝██╔════╝██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝╚██╗██╔╝")}
|
|
768
768
|
${D.cyan(" ██║ █████╗ ██████╔╝█████╗ ██████╔╝██████╔╝█████╗ ╚███╔╝ ")}
|