@fieldwangai/agentflow 0.1.38 → 0.1.39
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/bin/lib/marketplace.mjs +18 -0
- package/bin/lib/ui-server.mjs +17 -0
- package/builtin/web-ui/dist/assets/{index-Dzo7k7P-.css → index-B7-hwwU7.css} +1 -1
- package/builtin/web-ui/dist/assets/index-Cchb13X1.js +218 -0
- package/builtin/web-ui/dist/index.html +2 -2
- package/package.json +1 -1
- package/builtin/web-ui/dist/assets/index-BftRvss5.js +0 -218
package/bin/lib/marketplace.mjs
CHANGED
|
@@ -449,6 +449,24 @@ export function deleteMarketplaceNodePackage(workspaceRoot, id, version, opts =
|
|
|
449
449
|
return { ok: true, id, version, packageDir };
|
|
450
450
|
}
|
|
451
451
|
|
|
452
|
+
export function deleteMarketplaceFlowSnippetPackage(workspaceRoot, id, version) {
|
|
453
|
+
const packageDir = resolveWorkspaceFlowSnippetPackageDir(workspaceRoot, id, version);
|
|
454
|
+
if (!packageDir) return { ok: false, error: "Invalid flow snippet id or version" };
|
|
455
|
+
if (!fs.existsSync(path.join(packageDir, FLOW_SNIPPET_MANIFEST))) {
|
|
456
|
+
return { ok: false, error: `Flow snippet package not found: ${id}@${version}` };
|
|
457
|
+
}
|
|
458
|
+
fs.rmSync(packageDir, { recursive: true, force: true });
|
|
459
|
+
const versionRoot = path.dirname(packageDir);
|
|
460
|
+
try {
|
|
461
|
+
if (fs.existsSync(versionRoot) && fs.readdirSync(versionRoot).length === 0) {
|
|
462
|
+
fs.rmdirSync(versionRoot);
|
|
463
|
+
}
|
|
464
|
+
} catch {
|
|
465
|
+
/* keep non-empty or unreadable parent */
|
|
466
|
+
}
|
|
467
|
+
return { ok: true, id, version, packageDir };
|
|
468
|
+
}
|
|
469
|
+
|
|
452
470
|
export function writeFlowMarketplaceLock(workspaceRoot, flowDir, flowData) {
|
|
453
471
|
if (!flowData || !flowData.instances || typeof flowData.instances !== "object") return null;
|
|
454
472
|
const nodes = {};
|
package/bin/lib/ui-server.mjs
CHANGED
|
@@ -77,6 +77,7 @@ import { runNodeScript } from "./pipeline-scripts.mjs";
|
|
|
77
77
|
import { readFlowSchedule, writeFlowSchedule } from "./schedule-config.mjs";
|
|
78
78
|
import { listScheduleStatuses } from "./scheduler.mjs";
|
|
79
79
|
import {
|
|
80
|
+
deleteMarketplaceFlowSnippetPackage,
|
|
80
81
|
deleteMarketplaceNodePackage,
|
|
81
82
|
installFlowDependency,
|
|
82
83
|
listMarketplaceFlowSnippets,
|
|
@@ -3849,6 +3850,22 @@ export function startUiServer({
|
|
|
3849
3850
|
return;
|
|
3850
3851
|
}
|
|
3851
3852
|
|
|
3853
|
+
if (req.method === "DELETE" && url.pathname === "/api/marketplace/flow-snippet") {
|
|
3854
|
+
const id = url.searchParams.get("id") || "";
|
|
3855
|
+
const version = url.searchParams.get("version") || "";
|
|
3856
|
+
if (!id || !version) {
|
|
3857
|
+
json(res, 400, { ok: false, error: "Missing flow snippet id or version" });
|
|
3858
|
+
return;
|
|
3859
|
+
}
|
|
3860
|
+
try {
|
|
3861
|
+
const result = deleteMarketplaceFlowSnippetPackage(root, id, version);
|
|
3862
|
+
json(res, result.ok ? 200 : 400, result);
|
|
3863
|
+
} catch (e) {
|
|
3864
|
+
json(res, 500, { ok: false, error: (e && e.message) || String(e) });
|
|
3865
|
+
}
|
|
3866
|
+
return;
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3852
3869
|
if (req.method === "POST" && url.pathname === "/api/marketplace/install-node") {
|
|
3853
3870
|
let payload;
|
|
3854
3871
|
try {
|