@limecloud/agent-app-studio
Advanced tools
+1
-1
@@ -5,3 +5,3 @@ --- | ||
| displayName: Lime Agent App Studio | ||
| version: 0.1.1 | ||
| version: 0.1.2 | ||
| status: preview | ||
@@ -8,0 +8,0 @@ appType: developer-tool |
+3
-2
| { | ||
| "name": "@limecloud/agent-app-studio", | ||
| "version": "0.1.1", | ||
| "version": "0.1.2", | ||
| "description": "Lime Agent App Studio CLI and visual publisher for Agent App packages.", | ||
@@ -30,3 +30,4 @@ "type": "module", | ||
| "publish:dry-run": "npm publish --access public --dry-run", | ||
| "publish:npm": "npm publish --access public" | ||
| "publish:npm": "npm publish --access public", | ||
| "dev": "node src/server.mjs" | ||
| }, | ||
@@ -33,0 +34,0 @@ "engines": { |
+33
-0
@@ -19,2 +19,9 @@ // input: 本地 HTTP 请求 | ||
| try { | ||
| if (req.method === "GET" && req.url === "/api/bootstrap") { | ||
| return sendJson(res, { | ||
| appId: "lime-agent-app-studio", | ||
| status: "ok", | ||
| entry: "dashboard", | ||
| }); | ||
| } | ||
| if (req.method === "POST" && req.url === "/api/inspect") { | ||
@@ -50,2 +57,5 @@ const body = await readJson(req); | ||
| if (error?.code === "ENOENT" || error?.code === "EISDIR") { | ||
| if (acceptsHtml(req)) { | ||
| return sendFile(res, join(appRoot, "index.html")); | ||
| } | ||
| return sendNotFound(res); | ||
@@ -55,2 +65,11 @@ } | ||
| } | ||
| return sendBuffer(res, filePath, content); | ||
| } | ||
| async function sendFile(res, filePath) { | ||
| const content = await readFile(filePath); | ||
| return sendBuffer(res, filePath, content); | ||
| } | ||
| function sendBuffer(res, filePath, content) { | ||
| const type = contentType(filePath); | ||
@@ -95,1 +114,15 @@ res.writeHead(200, { "Content-Type": type }); | ||
| } | ||
| function acceptsHtml(req) { | ||
| const accept = req.headers.accept || ""; | ||
| return accept.includes("text/html"); | ||
| } | ||
| function isMainModule() { | ||
| return process.argv[1] && import.meta.url === new URL(process.argv[1], "file:").href; | ||
| } | ||
| if (isMainModule()) { | ||
| const { url } = await startStudioServer({ port: process.env.PORT }); | ||
| console.log(`Lime Agent App Studio runtime 已启动:${url}`); | ||
| } |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
70707
1.38%922
3.13%13
8.33%