@clawos-dev/clawd 0.2.529 → 0.2.530
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/dist/cli.cjs +14 -7
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -62300,20 +62300,27 @@ var CloudGatewayClient = class {
|
|
|
62300
62300
|
}
|
|
62301
62301
|
deps;
|
|
62302
62302
|
fetchImpl;
|
|
62303
|
-
|
|
62303
|
+
/**
|
|
62304
|
+
* gateway 在哪 + 这个人有没有 key。要登录、要中心配了地址;**不要求有 key**——
|
|
62305
|
+
* 登记表是全局的、/healthz 不看票,列表只需要地址。key 到开会话才要(见 credentials)。
|
|
62306
|
+
* 曾把两样绑在一起:没生成 key 的用户连列表都看不到,也就永远不知道要去设置页生成一把(2026-09-16 修)。
|
|
62307
|
+
*/
|
|
62308
|
+
async locate() {
|
|
62304
62309
|
const loginPass = this.deps.getLoginPass();
|
|
62305
62310
|
if (!loginPass) throw new ClawdError(ERROR_CODES.FEISHU_LOGIN_REQUIRED, "\u8FD8\u6CA1\u767B\u5F55\u98DE\u4E66\uFF0C\u4E91\u4E0A persona \u7528\u4E0D\u4E86");
|
|
62306
62311
|
const get = this.deps.getApiKey ?? ((args) => centralGetApiKey({ api: this.deps.centralApi ?? "", fetchImpl: this.fetchImpl, ...args }));
|
|
62307
62312
|
const { apiKey, gatewayUrl } = await get({ loginPass });
|
|
62308
|
-
if (!apiKey) throw new Error("\u8FD8\u6CA1\u751F\u6210\u4E91 persona \u7684\u8C03\u7528 key\uFF0C\u53BB\u300C\u8BBE\u7F6E \u2192 \u4E91\u4E0A persona\u300D\u751F\u6210\u4E00\u628A");
|
|
62309
62313
|
if (!gatewayUrl) throw new Error("\u4E2D\u5FC3\u6CA1\u914D\u4E91 gateway \u5730\u5740\uFF08gatewayUrl \u4E3A\u7A7A\uFF09");
|
|
62310
62314
|
return { apiKey, gatewayUrl: trimSlash(gatewayUrl) };
|
|
62311
62315
|
}
|
|
62316
|
+
async credentials() {
|
|
62317
|
+
const { apiKey, gatewayUrl } = await this.locate();
|
|
62318
|
+
if (!apiKey) throw new Error("\u8FD8\u6CA1\u751F\u6210\u4E91 persona \u7684\u8C03\u7528 key\uFF0C\u53BB\u300C\u8BBE\u7F6E \u2192 \u4E91\u4E0A persona\u300D\u751F\u6210\u4E00\u628A");
|
|
62319
|
+
return { apiKey, gatewayUrl };
|
|
62320
|
+
}
|
|
62312
62321
|
async listPersonas() {
|
|
62313
|
-
const {
|
|
62314
|
-
const res = await this.fetchImpl(gatewayUrl + GATEWAY_ROUTES.healthz()
|
|
62315
|
-
headers: { authorization: `Bearer ${apiKey}` }
|
|
62316
|
-
});
|
|
62322
|
+
const { gatewayUrl } = await this.locate();
|
|
62323
|
+
const res = await this.fetchImpl(gatewayUrl + GATEWAY_ROUTES.healthz());
|
|
62317
62324
|
if (!res.ok) throw new Error(`gateway /healthz \u56DE ${res.status}`);
|
|
62318
62325
|
const body = await res.json();
|
|
62319
62326
|
const rows = Array.isArray(body.deployments) ? body.deployments : [];
|
|
@@ -70328,7 +70335,7 @@ function computeMethodAccess(args) {
|
|
|
70328
70335
|
}
|
|
70329
70336
|
|
|
70330
70337
|
// src/version.ts
|
|
70331
|
-
var version = "0.2.
|
|
70338
|
+
var version = "0.2.530".length > 0 ? "0.2.530" : "dev";
|
|
70332
70339
|
|
|
70333
70340
|
// src/cli-probe/probe.ts
|
|
70334
70341
|
var fs77 = __toESM(require("fs"), 1);
|