siluzan-cso-cli 1.1.33-beta.1 → 1.1.40-beta.3
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/README.md +1 -1
- package/dist/index.js +65 -4
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/scripts/install.ps1 +1 -1
- package/dist/skill/scripts/install.sh +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ siluzan-cso init -d /path/to/skills # 写入自定义目录
|
|
|
54
54
|
siluzan-cso init --force # 强制覆盖已存在文件
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
> **注意**:当前为测试版(1.1.
|
|
57
|
+
> **注意**:当前为测试版(1.1.40-beta.3),供内部测试使用。正式发布后安装命令将改为 `npm install -g siluzan-cso-cli`。
|
|
58
58
|
|
|
59
59
|
| 助手 | 建议 `--ai` |
|
|
60
60
|
| ----------------------- | ------------------------------------ |
|
package/dist/index.js
CHANGED
|
@@ -2243,6 +2243,62 @@ function buildSiluzanAuthHeaders(config) {
|
|
|
2243
2243
|
const auth = resolveRequestAuth(config);
|
|
2244
2244
|
return auth.apiKey ? { "x-api-key": auth.apiKey } : { Authorization: `Bearer ${auth.authToken}` };
|
|
2245
2245
|
}
|
|
2246
|
+
var _clientProduct = "siluzan-cli";
|
|
2247
|
+
var _resolveVersion;
|
|
2248
|
+
function configureSiluzanClientIdentity(opts) {
|
|
2249
|
+
_clientProduct = opts.client;
|
|
2250
|
+
_resolveVersion = opts.resolveVersion;
|
|
2251
|
+
}
|
|
2252
|
+
function getSiluzanClientProduct() {
|
|
2253
|
+
return _clientProduct;
|
|
2254
|
+
}
|
|
2255
|
+
function runtimeOverrideFromEnv() {
|
|
2256
|
+
const raw = process.env.SILUZAN_CLIENT_RUNTIME?.trim().toLowerCase();
|
|
2257
|
+
if (raw === "siluzan_agent" || raw === "agent" || raw === "cli") return raw;
|
|
2258
|
+
return void 0;
|
|
2259
|
+
}
|
|
2260
|
+
function envTruthy(name) {
|
|
2261
|
+
const v = process.env[name]?.trim().toLowerCase();
|
|
2262
|
+
return v !== void 0 && v !== "" && v !== "0" && v !== "false" && v !== "no" && v !== "off";
|
|
2263
|
+
}
|
|
2264
|
+
function looksLikeThirdPartyAgentEnv() {
|
|
2265
|
+
if (envTruthy("IS_AGENT_ENV") || envTruthy("AI_AGENT")) return true;
|
|
2266
|
+
if (envTruthy("CURSOR_AGENT")) return true;
|
|
2267
|
+
if (process.env.CURSOR_EXTENSION_HOST_ROLE?.trim() === "agent-exec") return true;
|
|
2268
|
+
if (envTruthy("CLAUDECODE") || envTruthy("CLAUDE_CODE")) return true;
|
|
2269
|
+
if (envTruthy("CODEX_SANDBOX") || envTruthy("CODEX_CI") || envTruthy("CODEX_THREAD_ID")) {
|
|
2270
|
+
return true;
|
|
2271
|
+
}
|
|
2272
|
+
if (envTruthy("GEMINI_CLI") || envTruthy("ANTIGRAVITY_AGENT") || envTruthy("AUGMENT_AGENT")) {
|
|
2273
|
+
return true;
|
|
2274
|
+
}
|
|
2275
|
+
if (envTruthy("CLINE_ACTIVE") || envTruthy("GOOSE_TERMINAL") || envTruthy("OPENCLAW")) {
|
|
2276
|
+
return true;
|
|
2277
|
+
}
|
|
2278
|
+
if (envTruthy("COPILOT_ALLOW_ALL") || envTruthy("COPILOT_MODEL")) return true;
|
|
2279
|
+
return false;
|
|
2280
|
+
}
|
|
2281
|
+
function resolveSiluzanClientRuntime() {
|
|
2282
|
+
if (isSiluzanAgentEnv()) return "siluzan_agent";
|
|
2283
|
+
const override = runtimeOverrideFromEnv();
|
|
2284
|
+
if (override) return override;
|
|
2285
|
+
if (looksLikeThirdPartyAgentEnv()) return "agent";
|
|
2286
|
+
return "cli";
|
|
2287
|
+
}
|
|
2288
|
+
function getSiluzanSkillVersion() {
|
|
2289
|
+
return (_resolveVersion?.() ?? "0.0.0").trim() || "0.0.0";
|
|
2290
|
+
}
|
|
2291
|
+
function buildSiluzanClientIdentityHeaders() {
|
|
2292
|
+
const client = getSiluzanClientProduct();
|
|
2293
|
+
const runtime = resolveSiluzanClientRuntime();
|
|
2294
|
+
const version = getSiluzanSkillVersion();
|
|
2295
|
+
return {
|
|
2296
|
+
"X-Siluzan-Client": client,
|
|
2297
|
+
"X-Siluzan-Runtime": runtime,
|
|
2298
|
+
"X-Siluzan-Skill-Version": version,
|
|
2299
|
+
"User-Agent": `${client}/${version}`
|
|
2300
|
+
};
|
|
2301
|
+
}
|
|
2246
2302
|
var DEFAULT_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
2247
2303
|
var MAX_RESPONSE_BYTES = 50 * 1024 * 1024;
|
|
2248
2304
|
var httpsAgent = new https.Agent({
|
|
@@ -2281,12 +2337,16 @@ function rawRequest(url, options) {
|
|
|
2281
2337
|
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
2282
2338
|
const maxBytes = options.maxResponseBytes ?? MAX_RESPONSE_BYTES;
|
|
2283
2339
|
const isHttps = parsed.protocol === "https:";
|
|
2340
|
+
const headers = {
|
|
2341
|
+
...buildSiluzanClientIdentityHeaders(),
|
|
2342
|
+
...options.headers
|
|
2343
|
+
};
|
|
2284
2344
|
const reqOpts = {
|
|
2285
2345
|
hostname: parsed.hostname,
|
|
2286
2346
|
port: parsed.port || (isHttps ? 443 : 80),
|
|
2287
2347
|
path: parsed.pathname + parsed.search,
|
|
2288
2348
|
method,
|
|
2289
|
-
headers
|
|
2349
|
+
headers,
|
|
2290
2350
|
timeout: timeoutMs || void 0,
|
|
2291
2351
|
agent: isHttps ? httpsAgent : httpAgent
|
|
2292
2352
|
};
|
|
@@ -2343,10 +2403,10 @@ function rawRequest(url, options) {
|
|
|
2343
2403
|
data += chunk;
|
|
2344
2404
|
});
|
|
2345
2405
|
stream.on("end", () => {
|
|
2346
|
-
const
|
|
2406
|
+
const headers2 = {};
|
|
2347
2407
|
for (const [key, val] of Object.entries(res.headers)) {
|
|
2348
2408
|
if (val !== void 0) {
|
|
2349
|
-
|
|
2409
|
+
headers2[key.toLowerCase()] = Array.isArray(val) ? val[0] : val;
|
|
2350
2410
|
}
|
|
2351
2411
|
}
|
|
2352
2412
|
const status = res.statusCode ?? 0;
|
|
@@ -2360,7 +2420,7 @@ function rawRequest(url, options) {
|
|
|
2360
2420
|
ok: status >= 200 && status < 300
|
|
2361
2421
|
});
|
|
2362
2422
|
}
|
|
2363
|
-
resolve52({ status, text: data, headers });
|
|
2423
|
+
resolve52({ status, text: data, headers: headers2 });
|
|
2364
2424
|
});
|
|
2365
2425
|
});
|
|
2366
2426
|
req.on("timeout", () => {
|
|
@@ -9199,6 +9259,7 @@ configureCliJsonSnapshot({
|
|
|
9199
9259
|
resolveVersion: getCurrentVersion2,
|
|
9200
9260
|
fieldGuideRefs: ["references/core/tips.md", "references/list-accounts.md", "references/rag.md"]
|
|
9201
9261
|
});
|
|
9262
|
+
configureSiluzanClientIdentity({ client: "cso-cli", resolveVersion: getCurrentVersion2 });
|
|
9202
9263
|
var program = new Command();
|
|
9203
9264
|
program.name("siluzan-cso").description("Siluzan \u5E73\u53F0 Skill \u5DE5\u5177\uFF1A\u521D\u59CB\u5316\u3001\u8D26\u53F7\u67E5\u8BE2\u3001\u4E0A\u4F20\u3001\u56FE\u6587/\u89C6\u9891\u53D1\u5E03").version(getCurrentVersion2());
|
|
9204
9265
|
program.hook("preAction", async () => {
|
package/dist/skill/_meta.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"slug": "siluzan-cso",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"publishedAt":
|
|
3
|
+
"version": "1.1.40-beta.3",
|
|
4
|
+
"publishedAt": 1785313542007,
|
|
5
5
|
"homepage": "https://www.siluzan.com",
|
|
6
6
|
"source": "https://dev.azure.com/jack4it/Sammamish/_git/siluzan-skill",
|
|
7
7
|
"requiredBinaries": [
|
|
@@ -9,7 +9,7 @@ $ErrorActionPreference = 'Stop'
|
|
|
9
9
|
# -- Package info (injected at build time) ------------------------------------
|
|
10
10
|
$PKG_NAME = 'siluzan-cso-cli'
|
|
11
11
|
# PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
|
|
12
|
-
$PKG_VERSION = '1.1.
|
|
12
|
+
$PKG_VERSION = '1.1.40-beta.3'
|
|
13
13
|
$CLI_BIN = 'siluzan-cso'
|
|
14
14
|
$SKILL_LABEL = 'Siluzan CSO'
|
|
15
15
|
$INSTALL_CMD = 'npm install -g siluzan-cso-cli@beta'
|
|
@@ -9,7 +9,7 @@ set -euo pipefail
|
|
|
9
9
|
# -- Package info (injected at build time) ------------------------------------
|
|
10
10
|
readonly PKG_NAME="siluzan-cso-cli"
|
|
11
11
|
# PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
|
|
12
|
-
readonly PKG_VERSION="1.1.
|
|
12
|
+
readonly PKG_VERSION="1.1.40-beta.3"
|
|
13
13
|
readonly CLI_BIN="siluzan-cso"
|
|
14
14
|
readonly SKILL_LABEL="Siluzan CSO"
|
|
15
15
|
readonly INSTALL_CMD="npm install -g siluzan-cso-cli@beta"
|
package/package.json
CHANGED