@clawos-dev/clawd 0.2.747 → 0.2.749

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 CHANGED
@@ -53626,11 +53626,11 @@ var DashboardDataError = class extends Error {
53626
53626
  code;
53627
53627
  };
53628
53628
  var SUBROUTES = {
53629
- "cloud-persona-metrics": ["personas", "data", "issues"],
53629
+ "cloud-persona-metrics": ["personas", "data", "issues", "overview"],
53630
53630
  "cloud-persona-conversations": ["personas", "threads", "thread"],
53631
53631
  "cloud-persona-schedules": ["personas", "schedules", "runs"]
53632
53632
  };
53633
- var UPSTREAM_DOWN = { personas: "UPSTREAM_UNREACHABLE", data: "GATEWAY_UNREACHABLE", issues: "GATEWAY_UNREACHABLE", threads: "CENTER_UNREACHABLE", thread: "CENTER_UNREACHABLE", schedules: "GATEWAY_UNREACHABLE", runs: "GATEWAY_UNREACHABLE" };
53633
+ var UPSTREAM_DOWN = { personas: "UPSTREAM_UNREACHABLE", data: "GATEWAY_UNREACHABLE", overview: "GATEWAY_UNREACHABLE", issues: "GATEWAY_UNREACHABLE", threads: "CENTER_UNREACHABLE", thread: "CENTER_UNREACHABLE", schedules: "GATEWAY_UNREACHABLE", runs: "GATEWAY_UNREACHABLE" };
53634
53634
  var NO_STORE = { "cache-control": "no-store" };
53635
53635
  function send(res, status, contentType, body) {
53636
53636
  res.writeHead(status, { "content-type": contentType, ...NO_STORE });
@@ -53676,7 +53676,12 @@ function createDashboardRoutes(deps) {
53676
53676
  const q3 = url.searchParams;
53677
53677
  try {
53678
53678
  if (sub === "personas") {
53679
- sendJson(res, 200, { personas: await deps.data.personas() });
53679
+ const [personas, admin] = await Promise.all([deps.data.personas(), page === "cloud-persona-metrics" ? deps.data.isAdmin() : Promise.resolve(false)]);
53680
+ sendJson(res, 200, page === "cloud-persona-metrics" ? { personas, admin } : { personas });
53681
+ return true;
53682
+ }
53683
+ if (sub === "overview") {
53684
+ sendPassthrough(res, await deps.data.overview());
53680
53685
  return true;
53681
53686
  }
53682
53687
  const personaId2 = q3.get("persona") ?? "";
@@ -54111,6 +54116,10 @@ function createDashboardData(deps) {
54111
54116
  const [registered, visible] = await Promise.all([deps.registeredPersonas(), deps.visiblePersonas(lp)]);
54112
54117
  return visiblePersonaIds(registered, visible);
54113
54118
  },
54119
+ async isAdmin() {
54120
+ return (await deps.visiblePersonas(mustLoginPass())).all;
54121
+ },
54122
+ overview: () => deps.overview(),
54114
54123
  metrics: (q3) => deps.metrics(q3),
54115
54124
  issues: (q3) => deps.issues(q3),
54116
54125
  schedules: (q3) => deps.schedules(q3),
@@ -58843,6 +58852,7 @@ var GATEWAY_ROUTES = {
58843
58852
  volume: () => "/me/volume",
58844
58853
  workspace: (personaId2) => `/p/${encodeURIComponent(personaId2)}/workspace`,
58845
58854
  fork: (personaId2) => `/p/${encodeURIComponent(personaId2)}/fork`,
58855
+ overview: () => "/overview",
58846
58856
  metrics: (personaId2) => `/metrics/${encodeURIComponent(personaId2)}`,
58847
58857
  schedules: (personaId2) => `/schedules/${encodeURIComponent(personaId2)}`,
58848
58858
  scheduleRuns: (personaId2, scheduleId) => `/schedules/${encodeURIComponent(personaId2)}/${encodeURIComponent(scheduleId)}/runs`
@@ -59045,6 +59055,20 @@ var CloudGatewayClient = class {
59045
59055
  throw e;
59046
59056
  }
59047
59057
  }
59058
+ /** 全部 persona 的概览(仅管理员,gateway 问中心判):状态码 + body 原样转,鉴权同 fetchMetrics */
59059
+ async fetchOverview() {
59060
+ const { apiKey, gatewayUrl } = await this.credentials();
59061
+ try {
59062
+ const res = await this.fetchImpl(gatewayUrl + GATEWAY_ROUTES.overview(), {
59063
+ headers: { authorization: `Bearer ${apiKey}` },
59064
+ signal: AbortSignal.timeout(METRICS_TIMEOUT_MS)
59065
+ });
59066
+ return { status: res.status, body: await res.text() };
59067
+ } catch (e) {
59068
+ if (e.name === "TimeoutError") throw new Error(`\u4E91\u4E0A\u670D\u52A1 ${METRICS_TIMEOUT_MS / 1e3} \u79D2\u6CA1\u56DE`);
59069
+ throw e;
59070
+ }
59071
+ }
59048
59072
  /**
59049
59073
  * 看板的定时任务页(design 2026-10-27-cloud-schedule):gateway 回什么原样转(状态码 + body),鉴权同 fetchMetrics。
59050
59074
  * 带 scheduleId = 展开一条任务的运行记录一页(limit / before 分页)
@@ -76410,7 +76434,7 @@ function computeMethodAccess(args) {
76410
76434
  }
76411
76435
 
76412
76436
  // src/version.ts
76413
- var version = "0.2.747".length > 0 ? "0.2.747" : "dev";
76437
+ var version = "0.2.749".length > 0 ? "0.2.749" : "dev";
76414
76438
 
76415
76439
  // src/cli-probe/probe.ts
76416
76440
  var fs87 = __toESM(require("fs"), 1);
@@ -80568,6 +80592,7 @@ async function startDaemon(config) {
80568
80592
  loginPass: () => ownerIdentityStore.read()?.loginPass ?? null,
80569
80593
  registeredPersonas: async () => (await cloudGateway.listPersonas()).map((p3) => p3.personaId),
80570
80594
  visiblePersonas: (loginPass) => centralVisiblePersonas({ api: dashboardApi(), loginPass }),
80595
+ overview: () => cloudGateway.fetchOverview(),
80571
80596
  metrics: (q3) => cloudGateway.fetchMetrics(q3),
80572
80597
  issues: (q3) => cloudGateway.fetchThreadIssues(q3),
80573
80598
  schedules: (q3) => cloudGateway.fetchSchedules(q3),