@let.com/cli 0.2.0 → 0.2.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/bin.js +1 -1
- package/package.json +2 -3
- package/dist/create.js +0 -3
package/dist/bin.js
CHANGED
|
@@ -224,7 +224,7 @@ ${(e.tail??[]).join(`
|
|
|
224
224
|
`)}var turnOk=t=>t.state==="done"||t.state==="stopped"&&t.stopReason==="done";async function runStudio(sub,args,d){let b=studioBackend(d.backend),model=typeof d.flags.model=="string"?d.flags.model:void 0;if(!sub||sub==="list"){let projects=await b.listStudioProjects(typeof d.flags.account=="string"?d.flags.account:void 0),human=projects.length?projects.map(p2=>`${p2.name} ${p2.id} ${p2.head?`v${p2.head.number}`:"-"} ${p2.kitId}${p2.activeTurnId?" (working)":""}`).join(`
|
|
225
225
|
`):'No Build projects yet. Start one: letcom build new "a booking site for my studio"';return d.print(human,{projects}),0}if(sub==="new"){let prompt=args.join(" ").trim();if(!prompt)throw new StudioCliError("usage","letcom build new needs what to build",'Run letcom build new "a landing page for my bakery".');let who=await d.backend.whoami(),accountId=typeof d.flags.account=="string"?d.flags.account:who.grant?.accountId??who.accounts[0]?.accountId;if(!accountId)throw new StudioCliError("account_required","Which account?","Pass --account <id>.");let name=typeof d.flags.name=="string"?d.flags.name:prompt.replace(/\s+/g," ").slice(0,60),project=await b.createStudioProject({accountId,name,...model?{model}:{},...typeof d.flags.kit=="string"?{kit:d.flags.kit}:{}});d.say(`Started ${project.name} (${project.id}).`);let{turn}=await b.sendStudioMessage(project.id,{text:prompt,...model?{model}:{}});if(d.flags["no-wait"]===!0)return d.print(`Let.com Build is working on it (turn ${turn.id}). Follow: letcom build open ${project.id}`,{project,turn}),0;let r2=await follow(d,project,turn);return d.print(turnSummary(project,r2),{project,turn:r2.turn,answer:r2.answer}),turnOk(r2.turn)?0:1}if(sub==="prompt"){let[first,...more]=args,linked=more.length===0?readStudioLink(resolve3(d.cwd,String(d.flags.dir??"."))):null,project=linked?await b.getStudioProject(linked.projectId):await resolveProject(d,first),text=(linked?[first??"",...more]:more).join(" ").trim();if(!text)throw new StudioCliError("usage","letcom build prompt needs a message",'Run letcom build prompt <project> "make the header blue".');let{turn}=await b.sendStudioMessage(project.id,{text,...model?{model}:{}});if(d.flags["no-wait"]===!0)return d.print(`Let.com Build is working on it (turn ${turn.id}).`,{project,turn}),0;let r2=await follow(d,project,turn);return d.print(turnSummary(project,r2),{project,turn:r2.turn,answer:r2.answer}),turnOk(r2.turn)?0:1}if(sub==="pull"){let project=await resolveProject(d,args[0]),version2=await resolveVersion(d,project),dir=resolve3(d.cwd,String(d.flags.dir??(args[0]?project.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"studio-project":"."))),link=existsSync4(dir)?readStudioLink(dir):null;if(existsSync4(dir)&&readdirSync2(dir).some(f=>f!==".create")&&link?.projectId!==project.id&&d.flags.force!==!0)throw new StudioCliError("folder_not_empty",`${dir} already holds files that are not this Build project`,"Pull into an empty folder (--dir <path>), or pass --force to write over them.");let{bytes}=await b.getStudioExport(project.id,version2.id),{written,skipped}=writeFiles(dir,readExportZip(bytes));return mkdirSync3(join4(dir,".create"),{recursive:!0}),refuseLinked(join4(dir,".create")),writeAtomicNoFollow(join4(dir,".create","studio.json"),Buffer.from(`${JSON.stringify({projectId:project.id,projectName:project.name,versionId:version2.id,versionNumber:version2.number},null,2)}
|
|
226
226
|
`)),d.print(`Pulled ${project.name} v${version2.number} into ${dir} (${written} files${skipped.length?`, ${skipped.length} skipped`:""}). Run npm install && npm run dev.`,{project,version:version2,dir,files:written,skipped}),0}if(sub==="deploy"){let project=await resolveProject(d,args[0]),version2=d.flags.at===void 0?void 0:await resolveVersion(d,project),r2=await b.getStudioDeployReview(project.id,version2?.id),page=studioPageUrl(d.apiUrl,d.env,project.id),lines=[`Deploying ${project.name} v${r2.versionNumber}: ${r2.added.length} added, ${r2.changed.length} changed, ${r2.removed.length} removed.`,...r2.blocked.length?["Cannot be deployed as it is:",...r2.blocked.map(x=>` ${x.path}: ${x.detail}`)]:[],...r2.risks.length?["You will be asked to confirm:",...r2.risks.map(x=>` [${x.kind}] ${x.path}: ${x.detail}`)]:[],`Build apps are deployed by you in Let.com Build: ${page??`open project ${project.id} in the dashboard`} \u2192 Publish.`];return page&&d.interactive&&d.openBrowser&&d.flags["no-browser"]!==!0&&d.openBrowser(page),d.print(lines.join(`
|
|
227
|
-
`),{project,review:r2,url:page}),r2.blocked.length?1:0}if(sub==="open"){let project=await resolveProject(d,args[0]),page=studioPageUrl(d.apiUrl,d.env,project.id);return page&&d.openBrowser&&d.interactive&&d.openBrowser(page),d.print(page??`Open project ${project.id} in Let.com Build.`,{project,url:page}),0}throw new StudioCliError("usage",`Unknown build command: ${sub}`,"Run letcom build list | new | prompt | pull | deploy | open.")}var VERSION="0.2.
|
|
227
|
+
`),{project,review:r2,url:page}),r2.blocked.length?1:0}if(sub==="open"){let project=await resolveProject(d,args[0]),page=studioPageUrl(d.apiUrl,d.env,project.id);return page&&d.openBrowser&&d.interactive&&d.openBrowser(page),d.print(page??`Open project ${project.id} in Let.com Build.`,{project,url:page}),0}throw new StudioCliError("usage",`Unknown build command: ${sub}`,"Run letcom build list | new | prompt | pull | deploy | open.")}var VERSION="0.2.1",HELP=`letcom \u2014 deploy apps to Let.com
|
|
228
228
|
|
|
229
229
|
Usage: letcom <command> [options]
|
|
230
230
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@let.com/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Deploy apps to Let.com from the terminal or an AI agent (letcom deploy), or give your agent Let.com's tools with a local MCP server (letcom mcp).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://www.let.com",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
23
|
"bin": {
|
|
24
|
-
"letcom": "dist/bin.js"
|
|
25
|
-
"create": "dist/create.js"
|
|
24
|
+
"letcom": "dist/bin.js"
|
|
26
25
|
},
|
|
27
26
|
"exports": {
|
|
28
27
|
"./package.json": "./package.json"
|
package/dist/create.js
DELETED