@neta-art/neta-search-cli 0.2.61 → 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.
Files changed (2) hide show
  1. package/neta-search.mjs +25 -6
  2. 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 apiBase = process.env["NETASEARCH_API"] ?? // sandbox 内(平台注入 COHUB_*):默认 prod Service——真实用户的事件该写
28120
- // prod 账本;否则 prod sandbox 的事件会全部写进 dev 账本(review #76 抓过的
28121
- // 隐患)。sandbox 外:默认 prod 公网地址(2026-10-09 起;此前是 dev,公网 npm 版发布前改),
28122
- // 本地验收用 NETASEARCH_API 指 dev。
28123
- // 不依赖平台注入 NETASEARCH_API——COHUB_SPACE_ID 就是平台已给的信号。
28124
- (spaceId !== "" ? "http://neta-search-api.recsys.svc.cluster.local" : "https://search.neta.art");
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neta-art/neta-search-cli",
3
- "version": "0.2.61",
3
+ "version": "0.2.64",
4
4
  "description": "neta-search CLI — find, try and install skills from the Cohub / Neta skill registry",
5
5
  "type": "module",
6
6
  "bin": {