Lines 1-25javascript
2"use strict";var Ee=Object.create;var W=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var be=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var we=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ve(t))!Te.call(e,n)&&n!==o&&W(e,n,{get:()=>t[n],enumerable:!(i=Re(t,n))||i.enumerable});return e};var l=(e,t,o)=>(o=e!=null?Ee(be(e)):{},we(t||!e||!e.__esModule?W(o,"default",{value:e,enumerable:!0}):o,e));var me=require("commander"),he=l(require("fs")),Se=l(require("path"));var I=require("child_process"),w=l(require("pa ...
3 ${s instanceof Error?s.message:String(s)}
HighChild Process
Package source references child process execution.
dist/index.jsView on unpkg · L1 HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/index.jsView on unpkg · L1 4 You can also use --tarball <path> to install from a local file.`)}finally{try{d.rmSync(c,{recursive:!0,force:!0})}catch{}}}var H=require("child_process"),_=l(require("fs")),T=l(require("path"));function Z(e=process.platform){return e==="win32"?"npm.cmd":"npm"}function Pe(e){return _.default.existsSync(T.default.join(e,"node_modules",".prisma","client","default.js"))}function ee(e){let t={...process.env},o=T.default.join(e,".env");if(!_.default.existsSync(o))return t;for(let i of _.default.readFileSync(o,"utf8").split(/\r?\n/)){let n=i.trim();if(!n||n.startsWith("#"))continue;let c=n.indexOf( ...
5`),{padding:{top:1,bottom:1,left:2,right:2},borderColor:"cyan",borderStyle:"round"})}function g(e,t){return e==="running"?u.default.green(` \u25CF ${t}`):e==="error"?u.default.red(` \u2716 ${t}`):
6`))),o){try{B(t,g)}catch(m){console.log(g("error",`Production setup failed: ${m instanceof Error?m.message:String(m)}`)),process.exit(1)}console.log(""),console.log(g("pending","Starting all services..."));let r=(0,I.spawn)("node",["start.js"],{cwd:t,stdio:"inherit",env:{...process.env,PORT:e.port,NODE_ENV:"production"}});r.on("error",m=>{console.log(""),console.log(g("error",`Failed to start server: ${m.message}`)),process.exit(1)}),r.on("close",m=>{console.log(""),console.log(g(m===0?"running":"error",`Server stopped with code ${m}`)),process.exit(m||0)});let a=()=>{console.log(""),console.l ...
7`):e==="error"?f.default.red(`\r \u2716 ${t}
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/index.jsView on unpkg · L1 HighRuntime Package Install
Package source invokes a package manager install command at runtime.
dist/index.jsView on unpkg · L5 8`):f.default.yellow(`\r \u25D0 ${t}`)}function Ue(){let e=P(),t=O.join(e,".env");if(b.existsSync(t)){let i=b.readFileSync(t,"utf8").match(/^PORT=(.*)$/
9`),{padding:{top:1,bottom:1,left:2,right:2},borderColor:"cyan",borderStyle:"round"}))}async function le(e){try{await N((r,a)=>{process.stdout.write(j(r,a))},e?.tarball),process.stdout.write(`
10`)}catch(r){console.error(j("error","Failed to fetch server source: "+(r instanceof Error?r.message:String(r)))),process.exit(1)}let t=P(),o=O.join(t,".env"),i=Ue(),n="SQLite (local)",c=t;console.clear(),Fe("1.0.1",i,n,c),console.log("");let p={};b.existsSync(o)&&(console.log(f.default.gray(` Existing configuration found. Loading values...
11`)),b.readFileSync(o,"utf8").split(`
12`).forEach(a=>{if(a.startsWith("#")||!a.includes("="))return;let m=a.indexOf("=");if(m===-1)return;let $=a.substring(0,m).trim(),ye=a.substring(m+1).trim().replace(/^["']|["']$/g,"");p[$]=ye}));let s=await ie.default.prompt([{type:"input",name:"GITHUB_CLIENT_ID",message:"GitHub OAuth Client ID:",default:p.GITHUB_CLIENT_ID||"",validate:r=>r.length>0||"Required"},{type:"password",name:"GITHUB_CLIENT_SECRET",message:"GitHub OAuth Client Secret:",default:p.GITHUB_CLIENT_SECRET||"",mask:"*",validate:r=>r.length>0||"Required"},{type:"input",name:"DATABASE_URL",message:"SQLite Database Path:",default ...
13`);if(b.writeFileSync(o,S,"utf8"),b.existsSync(O.join(t,"start.js")))try{console.log(j("pending","Preparing Prisma and database...")),B(t,(r,a)=>{process.stdout.write(j(r,a))}),process.stdout.write(`
14`)}catch(r){console.error(j("error",`Setup validation failed: ${r instanceof Error?r.message:String(r)}`)),process.exit(1)}console.log(""),console.log(f.default.green(f.default.bold(" Configuration saved!"))),console.log(f.default.gray(" Path: "+
15Triggering deployment for project: ${i}...`));try{let n=await fetch(`${o}/api/projects/${i}/deploy`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({branch:e.branch})});if(!n.ok){let p=await n.json().catch(()=>null);throw new Error(p?.error||`Server responded with ${n.status}`)}let c=await n.json();console.log(R.default.green(`
16\u2714 Deployment triggered successfully!`)),console.log(`Deployment ID: ${R.default.bold(c.deployment.id)}`),console.log(`Status: ${R.default.yellow(c.deployment.status)}`),c.warning&&console.log(R.default.yellow(`
17\u26A0 Warning: ${c.warning}`)),console.log(R.default.gray(`
18To view logs in real-time, run:`)),console.log(`starbridge logs ${c.deployment.id}`)}catch(n){console.error(R.default.red(`
19\u2716 Deployment failed: ${n.message}`)),process.exit(1)}}var D=l(require("picocolors"));async function fe(e){let t=U(),o=G();t||(console.error(D.default.red("\u2716 You are not logged in. Run `starbridge login` first.")),process.exit(1)),console.log(D.default.cyan(`
20Connecting to deployment log stream for ${e}...`));try{let i=await fetch(`${o}/api/deployments/${e}/logs`,{method:"GET",headers:{Authorization:`Bearer ${t}`,Accept:"text/event-stream"}});if(!i.ok){let s=await i.json().catch(()=>null);throw new Error(s?.error||`Server responded with ${i.status}`)}if(!i.body)throw new Error("No response body returned from server.");console.log(D.default.green(`\u2714 Connected. Streaming logs:
21`));let n=i.body.getReader(),c=new TextDecoder("utf-8"),p="";for(;;){let{done:s,value:E}=await n.read();if(s)break;p+=c.decode(E,{stream:!0});let S=p.split(`
22`);p=S.pop()||"";for(let r of S){let a=r.trim();if(!(!a||a.startsWith(":"))&&a.startsWith("data:"))try{let m=JSON.parse(a.substring(5).trim());console.log(m.message)}catch{console.log(a.substring(5).trim())}}}console.log(D.default.cyan(`
23\u2714 Log stream closed.`))}catch(i){console.error(D.default.red(`
24\u2716 Failed to stream logs: ${i.message}`)),process.exit(1)}}function He(){try{return JSON.parse(he.readFileSync(Se.join(__dirname,"..","package.json"),"utf8")).version||"1.0.0"}catch{return"1.0.0"}}var C=new me.Command;C.name("starbridge").description("StarBridge \u2014 Autonomous Deployment Platform for Solo Devs & Startups").version(He());C.command("start").description("Start StarBridge server and open dashboard").option("-p, --port <number>","Port number","3000").option("--no-open","Do not open browser automatically").option("-t, --tarball <path>","Path to local server tarball (skip down ...
Long lines were clipped for display.