@clawos-dev/clawd 0.2.187-beta.373.fba4299 → 0.2.187-beta.374.81ea8db

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
@@ -157,8 +157,7 @@ var init_methods = __esm({
157
157
  // 写入路径:device:connect 落 store + 自动反向(决策 #11);list / remove 作联系人列表读删。
158
158
  "contact:list",
159
159
  "contact:remove",
160
- "contact:set-note",
161
- // ---- visitor:*(web 访客 · persona web 分享,spec 2026-06-24-persona-web-share-design) ----
160
+ // ---- visitor:* (web 访客 · persona web 分享,spec 2026-06-24-persona-web-share-design) ----
162
161
  // owner-only:列出登录访问过本机 public persona 的 web 访客(零安装、飞书登录、daemon 自签
163
162
  // visitor token)。存储 ~/.clawd/visitors.json(VisitorStore),登录(exchange)即 upsert;
164
163
  // 访客身份用 TTC unique_id,会话按 creatorPrincipalId='visitor-<id>' 进现有会话用户分组。
@@ -5631,7 +5630,7 @@ var init_inbox = __esm({
5631
5630
  });
5632
5631
 
5633
5632
  // ../protocol/src/contact.ts
5634
- var ContactSchema, ContactWireSchema, ContactRemoveArgsSchema, ContactRemoveOkSchema, ContactListOkSchema, ContactAddedFrameSchema, ContactRemovedFrameSchema, ContactSetNoteArgsSchema, ContactSetNoteOkSchema;
5633
+ var ContactSchema, ContactWireSchema, ContactRemoveArgsSchema, ContactRemoveOkSchema, ContactListOkSchema, ContactAddedFrameSchema, ContactRemovedFrameSchema;
5635
5634
  var init_contact = __esm({
5636
5635
  "../protocol/src/contact.ts"() {
5637
5636
  "use strict";
@@ -5660,12 +5659,7 @@ var init_contact = __esm({
5660
5659
  // 不用 .min(1):自动反向路径合法地存空串,禁止填假 token 占位(不造假数据)。
5661
5660
  connectToken: external_exports.string(),
5662
5661
  grants: external_exports.array(GrantSchema),
5663
- addedAt: external_exports.number().int().nonnegative(),
5664
- /**
5665
- * 本机私有备注(≤20 字):owner 给该联系人加的标注,只存本机、不分享给对方。
5666
- * optional——老 contacts.json 记录无此字段,禁止必填(否则 strict parse 失败 orphan 全部联系人)。
5667
- */
5668
- note: external_exports.string().max(20).optional()
5662
+ addedAt: external_exports.number().int().nonnegative()
5669
5663
  }).strict();
5670
5664
  ContactWireSchema = ContactSchema;
5671
5665
  ContactRemoveArgsSchema = external_exports.object({
@@ -5687,15 +5681,6 @@ var init_contact = __esm({
5687
5681
  type: external_exports.literal("contact:removed"),
5688
5682
  deviceId: external_exports.string().min(1)
5689
5683
  }).strict();
5690
- ContactSetNoteArgsSchema = external_exports.object({
5691
- deviceId: external_exports.string().min(1),
5692
- note: external_exports.string().max(20)
5693
- }).strict();
5694
- ContactSetNoteOkSchema = external_exports.object({
5695
- type: external_exports.literal("contact:set-note:ok"),
5696
- deviceId: external_exports.string().min(1),
5697
- note: external_exports.string().max(20)
5698
- }).strict();
5699
5684
  }
5700
5685
  });
5701
5686
 
@@ -41387,7 +41372,10 @@ function buildConnectionPrompt(args) {
41387
41372
  }
41388
41373
  if (args.workDir) {
41389
41374
  result += `
41390
- \u4F60\u7684\u6587\u4EF6\u5DE5\u4F5C\u76EE\u5F55\u662F ${args.workDir}\uFF0C\u8FD9\u4E2A\u76EE\u5F55\u5BF9\u4F60\u53EF\u8BFB\u53EF\u5199\uFF0C\u6587\u4EF6\u7684\u8BFB\u53D6/\u521B\u5EFA/\u4FEE\u6539\u90FD\u5728\u8FD9\u91CC\u8FDB\u884C\u3002persona \u76EE\u5F55\u5BF9\u4F60\u53EA\u8BFB\uFF0C\u4E0D\u8981\u5F80\u91CC\u5199\u3002`;
41375
+ \u4F60\u7684\u6587\u4EF6\u5DE5\u4F5C\u76EE\u5F55\u662F ${args.workDir}\uFF0C\u8FD9\u4E2A\u76EE\u5F55\u5BF9\u4F60\u53EF\u8BFB\u53EF\u5199\uFF0C\u6587\u4EF6\u7684\u8BFB\u53D6/\u521B\u5EFA/\u4FEE\u6539\u90FD\u5728\u8FD9\u91CC\u8FDB\u884C\u3002`;
41376
+ if (args.mode === "guest") {
41377
+ result += "persona \u76EE\u5F55\u5BF9\u4F60\u53EA\u8BFB\uFF0C\u4E0D\u8981\u5F80\u91CC\u5199\u3002";
41378
+ }
41391
41379
  }
41392
41380
  return result;
41393
41381
  }
@@ -50189,21 +50177,6 @@ var ContactStore = class {
50189
50177
  this.contacts.set(contact.deviceId, contact);
50190
50178
  this.flush();
50191
50179
  }
50192
- /**
50193
- * 设/改/清空单台设备的本机私有备注(决策:本机私有标注,只存本机不分享)。
50194
- * 命中返回更新后的 contact 并 flush;note 空串则删除 note 字段(保持 contacts.json 干净);
50195
- * 未命中返回 null(不写盘)。
50196
- */
50197
- setNote(deviceId, note) {
50198
- const existing = this.contacts.get(deviceId);
50199
- if (!existing) return null;
50200
- const next = { ...existing };
50201
- if (note) next.note = note;
50202
- else delete next.note;
50203
- this.contacts.set(deviceId, next);
50204
- this.flush();
50205
- return next;
50206
- }
50207
50180
  /** 删单台设备(contact:remove 语义,决策 #16):删该 deviceId 一条,返回是否删到 */
50208
50181
  removeByDeviceId(deviceId) {
50209
50182
  const existed = this.contacts.delete(deviceId);
@@ -53790,30 +53763,9 @@ function buildContactHandlers(deps) {
53790
53763
  }
53791
53764
  };
53792
53765
  };
53793
- const setNote = async (frame, _client, ctx) => {
53794
- ensureOwner(ctx);
53795
- const { type: _t, requestId: _r, ...rest } = frame;
53796
- const args = ContactSetNoteArgsSchema.parse(rest);
53797
- const updated = deps.store.setNote(args.deviceId, args.note);
53798
- if (!updated) {
53799
- throw new ClawdError(
53800
- ERROR_CODES.INVALID_PARAM,
53801
- `INVALID_PARAM: contact ${args.deviceId} \u4E0D\u5B58\u5728`
53802
- );
53803
- }
53804
- deps.broadcast({ type: "contact:added", contact: updated });
53805
- return {
53806
- response: {
53807
- type: "contact:set-note:ok",
53808
- deviceId: args.deviceId,
53809
- note: args.note
53810
- }
53811
- };
53812
- };
53813
53766
  return {
53814
53767
  "contact:list": list,
53815
- "contact:remove": remove,
53816
- "contact:set-note": setNote
53768
+ "contact:remove": remove
53817
53769
  };
53818
53770
  }
53819
53771
 
@@ -56604,7 +56556,6 @@ var METHOD_GRANT_MAP = {
56604
56556
  // 写入路径在 device:connect / 自动反向;list / remove 作联系人读 / 删,owner-only。
56605
56557
  "contact:list": ADMIN_ANY,
56606
56558
  "contact:remove": ADMIN_ANY,
56607
- "contact:set-note": ADMIN_ANY,
56608
56559
  // ---- visitor:* (访客名单,owner-only) ----
56609
56560
  // owner 看完整访客名单(含没开会话的);guest 不可调(handler 内再 assertOwner 兜底)。
56610
56561
  "visitor:list": ADMIN_ANY,