@neta-art/neta-search-cli 0.2.58 → 0.2.64
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/neta-search.mjs +28 -6
- package/package.json +1 -1
package/neta-search.mjs
CHANGED
|
@@ -28113,16 +28113,35 @@ function cliVersion() {
|
|
|
28113
28113
|
}
|
|
28114
28114
|
|
|
28115
28115
|
// cli/src/env.ts
|
|
28116
|
+
var PROD_SERVICE = "http://neta-search-api.recsys.svc.cluster.local";
|
|
28117
|
+
var DEV_SERVICE = "http://neta-search-api-dev.recsys.svc.cluster.local";
|
|
28118
|
+
var PROD_PUBLIC = "https://search.neta.art";
|
|
28119
|
+
var DEV_PUBLIC = "https://dev-search.neta.art";
|
|
28120
|
+
function isDevEnv(env) {
|
|
28121
|
+
return (env ?? "").trim() === "dev";
|
|
28122
|
+
}
|
|
28116
28123
|
function detectEnv() {
|
|
28117
28124
|
const actorId = process.env["COHUB_USER_UUID"] ?? "";
|
|
28118
28125
|
const spaceId = process.env["COHUB_SPACE_ID"] ?? "";
|
|
28119
|
-
const
|
|
28120
|
-
|
|
28121
|
-
|
|
28122
|
-
|
|
28123
|
-
|
|
28124
|
-
|
|
28126
|
+
const explicit = process.env["NETASEARCH_API"];
|
|
28127
|
+
const inSandbox = spaceId !== "";
|
|
28128
|
+
let apiBase;
|
|
28129
|
+
let source;
|
|
28130
|
+
if (explicit !== void 0) {
|
|
28131
|
+
apiBase = explicit;
|
|
28132
|
+
source = "NETASEARCH_API";
|
|
28133
|
+
} else if (isDevEnv(process.env["ENV"])) {
|
|
28134
|
+
apiBase = inSandbox ? DEV_SERVICE : DEV_PUBLIC;
|
|
28135
|
+
source = "env:dev";
|
|
28136
|
+
} else if (inSandbox) {
|
|
28137
|
+
apiBase = PROD_SERVICE;
|
|
28138
|
+
source = "default:prod";
|
|
28139
|
+
} else {
|
|
28140
|
+
apiBase = PROD_PUBLIC;
|
|
28141
|
+
source = "public";
|
|
28142
|
+
}
|
|
28125
28143
|
return {
|
|
28144
|
+
source,
|
|
28126
28145
|
apiBase,
|
|
28127
28146
|
actorId,
|
|
28128
28147
|
spaceId,
|
|
@@ -31111,6 +31130,7 @@ async function cmdRemove(names, opts) {
|
|
|
31111
31130
|
const env = detectEnv();
|
|
31112
31131
|
const local = scanLocal(opts.dir);
|
|
31113
31132
|
const results = [];
|
|
31133
|
+
const reports = [];
|
|
31114
31134
|
for (const n of names) {
|
|
31115
31135
|
const found = (await findLocal(env, local, n)).filter((s) => existsSync7(s.path));
|
|
31116
31136
|
if (found.length === 0) results.push({ name: n, result: "not_found" });
|
|
@@ -31122,9 +31142,11 @@ async function cmdRemove(names, opts) {
|
|
|
31122
31142
|
} else {
|
|
31123
31143
|
rmSync2(s.path, { recursive: true, force: true });
|
|
31124
31144
|
results.push({ name: s.name, result: "removed" });
|
|
31145
|
+
if (s.kind === "installed" && s.id) reports.push(reportSkillEvent(env, "uninstall", s.id, s.digest ?? "", s.name));
|
|
31125
31146
|
}
|
|
31126
31147
|
}
|
|
31127
31148
|
}
|
|
31149
|
+
await Promise.allSettled(reports);
|
|
31128
31150
|
const failed = results.filter((r) => r.result !== "removed").length;
|
|
31129
31151
|
if (opts.json) console.log(JSON.stringify({ results }));
|
|
31130
31152
|
else
|