@limecloud/agent-app-studio
Advanced tools
+1
-1
@@ -5,3 +5,3 @@ --- | ||
| displayName: Lime Agent App Studio | ||
| version: 0.1.2 | ||
| version: 0.1.3 | ||
| status: preview | ||
@@ -8,0 +8,0 @@ appType: developer-tool |
+1
-1
| { | ||
| "name": "@limecloud/agent-app-studio", | ||
| "version": "0.1.2", | ||
| "version": "0.1.3", | ||
| "description": "Lime Agent App Studio CLI and visual publisher for Agent App packages.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+8
-2
@@ -22,3 +22,9 @@ // input: lime-agent-app-studio 命令 | ||
| case "package": | ||
| return printJson(await packageProject({ appDir: options.appDir || ".", outDir: options.outDir })); | ||
| return printJson( | ||
| await packageProject({ | ||
| appDir: options.appDir || ".", | ||
| outDir: options.outDir, | ||
| includeNodeModules: Boolean(options.includeNodeModules), | ||
| }) | ||
| ); | ||
| case "publish": { | ||
@@ -87,3 +93,3 @@ const auth = await resolveAuthContext(options); | ||
| lime-agent-app-studio project inspect --app-dir <path> | ||
| lime-agent-app-studio package --app-dir <path> [--out-dir <path>] | ||
| lime-agent-app-studio package --app-dir <path> [--out-dir <path>] [--include-node-modules] | ||
| lime-agent-app-studio publish --app-dir <path> --app-id <id> --tenant-id <id> --channel beta --dry-run | ||
@@ -90,0 +96,0 @@ lime-agent-app-studio publish --app-dir <path> --app-id <id> --tenant-id <id> --channel stable --publish |
@@ -30,3 +30,5 @@ // input: 本地 Agent App 目录与输出目录 | ||
| const packagePath = join(outDir, packageName); | ||
| const files = await collectPackageFiles(appDir); | ||
| const files = await collectPackageFiles(appDir, { | ||
| includeNodeModules: Boolean(options.includeNodeModules), | ||
| }); | ||
| await writeZip(appDir, files, packagePath); | ||
@@ -48,6 +50,10 @@ | ||
| export async function collectPackageFiles(appDir) { | ||
| export async function collectPackageFiles(appDir, options = {}) { | ||
| const root = resolve(appDir); | ||
| const result = []; | ||
| await walk(root, root, result); | ||
| const excludes = new Set(defaultExcludes); | ||
| if (options.includeNodeModules) { | ||
| excludes.delete("node_modules"); | ||
| } | ||
| await walk(root, root, result, excludes); | ||
| result.sort((a, b) => a.localeCompare(b)); | ||
@@ -57,6 +63,6 @@ return result; | ||
| async function walk(root, current, result) { | ||
| async function walk(root, current, result, excludes) { | ||
| const entries = await readdir(current, { withFileTypes: true }); | ||
| for (const entry of entries) { | ||
| if (defaultExcludes.has(entry.name)) continue; | ||
| if (excludes.has(entry.name)) continue; | ||
| if (entry.name === "dist-package") continue; | ||
@@ -66,3 +72,3 @@ const fullPath = join(current, entry.name); | ||
| if (entry.isDirectory()) { | ||
| await walk(root, fullPath, result); | ||
| await walk(root, fullPath, result, excludes); | ||
| continue; | ||
@@ -69,0 +75,0 @@ } |
@@ -45,3 +45,7 @@ // input: 本地项目、认证上下文与发布参数 | ||
| } | ||
| const packaged = await packageProject({ appDir: options.appDir, outDir: options.outDir }); | ||
| const packaged = await packageProject({ | ||
| appDir: options.appDir, | ||
| outDir: options.outDir, | ||
| includeNodeModules: Boolean(options.includeNodeModules), | ||
| }); | ||
| const upload = await uploadDeveloperAgentAppPackage({ ...options, appId: plan.appId, packagePath: packaged.packagePath }); | ||
@@ -48,0 +52,0 @@ const releasePayload = { |
+2
-2
@@ -8,4 +8,2 @@ // input: 本地 HTTP 请求 | ||
| import { fileURLToPath } from "node:url"; | ||
| import { inspectProject } from "./core/project.mjs"; | ||
| import { publishProject } from "./core/publisher.mjs"; | ||
| import { resolveAuthContext } from "./core/config.mjs"; | ||
@@ -29,2 +27,3 @@ | ||
| const body = await readJson(req); | ||
| const { inspectProject } = await import("./core/project.mjs"); | ||
| return sendJson(res, await inspectProject(body.appDir || ".")); | ||
@@ -35,2 +34,3 @@ } | ||
| const auth = await resolveAuthContext(body); | ||
| const { publishProject } = await import("./core/publisher.mjs"); | ||
| return sendJson(res, await publishProject({ ...body, ...auth })); | ||
@@ -37,0 +37,0 @@ } |
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.
71179
0.67%938
1.74%