@clawos-dev/clawd 0.2.350 → 0.2.352

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
@@ -6139,7 +6139,13 @@ var init_feishu_auth = __esm({
6139
6139
  * 设备属性,与登录态无关、登录登出不变。UI"我的设备标识"用它拼
6140
6140
  * clawos://device/<deviceId>(替代旧的 unionId——不再向外暴露人的身份标识)。
6141
6141
  */
6142
- deviceId: external_exports.string().min(1)
6142
+ deviceId: external_exports.string().min(1),
6143
+ /**
6144
+ * TTC JWT 过期时间(unix ms)。null = 登录回调未携带 expires_at;字段缺省 = 老 daemon。
6145
+ * 仅时间戳——token 本体永不出 ws(spec §9 不变)。UI 据此派生 过期/临期 提示
6146
+ * (见 spec 2026-08-17-ttc-jwt-expiry-ux-design §2)。
6147
+ */
6148
+ ttcTokenExpiresAt: external_exports.number().nullable().optional()
6143
6149
  });
6144
6150
  AuthLogoutResponseSchema = external_exports.object({
6145
6151
  type: external_exports.literal("auth:logout:ok")
@@ -59836,7 +59842,9 @@ function buildFeishuAuthHandlers(deps) {
59836
59842
  type: "auth:getIdentity:ok",
59837
59843
  identity: record ? record.identity : null,
59838
59844
  // 决策 #15:设备属性,与登录态无关——UI"分享我的 Hub 标识"用
59839
- deviceId: deps.deviceId
59845
+ deviceId: deps.deviceId,
59846
+ // 过期时间戳(仅时间戳,token 本体永不出 ws)——UI 派生 过期/临期 提示
59847
+ ttcTokenExpiresAt: record ? record.ttcTokenExpiresAt : null
59840
59848
  }
59841
59849
  };
59842
59850
  };
@@ -59862,11 +59870,20 @@ function ensureOwner3(ctx) {
59862
59870
  throw new ClawdError(ERROR_CODES.UNAUTHORIZED, "UNAUTHORIZED: device:* requires owner ctx");
59863
59871
  }
59864
59872
  }
59873
+ function rethrowLoginExpired(e) {
59874
+ if (e instanceof CentralClientError && e.code === "UNAUTHORIZED") {
59875
+ throw new ClawdError(
59876
+ ERROR_CODES.VALIDATION_ERROR,
59877
+ "LOGIN_EXPIRED: \u767B\u5F55\u51ED\u8BC1\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u5728\u8054\u7CFB\u4EBA\u9762\u677F\u91CD\u65B0\u767B\u5F55"
59878
+ );
59879
+ }
59880
+ throw e;
59881
+ }
59865
59882
  function buildDeviceHandlers(deps) {
59866
59883
  const now = deps.now ?? Date.now;
59867
59884
  const list = async (_frame, _client, ctx) => {
59868
59885
  ensureOwner3(ctx);
59869
- const devices = await deps.listDevices();
59886
+ const devices = await deps.listDevices().catch(rethrowLoginExpired);
59870
59887
  return {
59871
59888
  response: { type: "device:list:ok", devices }
59872
59889
  };
@@ -59882,7 +59899,7 @@ function buildDeviceHandlers(deps) {
59882
59899
  "TUNNEL_REQUIRED: \u672C\u673A\u672A\u5F00 tunnel\uFF0C\u5F00\u542F\u540E\u91CD\u8BD5"
59883
59900
  );
59884
59901
  }
59885
- const exchanged = await deps.exchange(args.deviceId);
59902
+ const exchanged = await deps.exchange(args.deviceId).catch(rethrowLoginExpired);
59886
59903
  const url = args.url ?? exchanged.deviceUrl;
59887
59904
  if (!url) {
59888
59905
  throw new ClawdError(
@@ -60227,7 +60244,7 @@ function computeMethodAccess(args) {
60227
60244
  }
60228
60245
 
60229
60246
  // src/version.ts
60230
- var version = "0.2.350".length > 0 ? "0.2.350" : "dev";
60247
+ var version = "0.2.352".length > 0 ? "0.2.352" : "dev";
60231
60248
 
60232
60249
  // src/cli-probe/probe.ts
60233
60250
  var fs59 = __toESM(require("fs"), 1);
@@ -21425,7 +21425,13 @@ var AuthGetIdentityResponseSchema = external_exports.object({
21425
21425
  * 设备属性,与登录态无关、登录登出不变。UI"我的设备标识"用它拼
21426
21426
  * clawos://device/<deviceId>(替代旧的 unionId——不再向外暴露人的身份标识)。
21427
21427
  */
21428
- deviceId: external_exports.string().min(1)
21428
+ deviceId: external_exports.string().min(1),
21429
+ /**
21430
+ * TTC JWT 过期时间(unix ms)。null = 登录回调未携带 expires_at;字段缺省 = 老 daemon。
21431
+ * 仅时间戳——token 本体永不出 ws(spec §9 不变)。UI 据此派生 过期/临期 提示
21432
+ * (见 spec 2026-08-17-ttc-jwt-expiry-ux-design §2)。
21433
+ */
21434
+ ttcTokenExpiresAt: external_exports.number().nullable().optional()
21429
21435
  });
21430
21436
  var AuthLogoutResponseSchema = external_exports.object({
21431
21437
  type: external_exports.literal("auth:logout:ok")