@clawos-dev/clawd 0.2.435 → 0.2.437

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
@@ -8845,6 +8845,10 @@ var init_methods = __esm({
8845
8845
  summary: "\u7F6E\u9876 / \u53D6\u6D88\u7F6E\u9876\u8054\u7CFB\u4EBA",
8846
8846
  args: ContactPinArgsSchema
8847
8847
  },
8848
+ "org:peers": {
8849
+ summary: "\u540C\u7EC4\u7EC7\u6210\u5458\u5FEB\u7167\uFF08\u542B\u8FD8\u6CA1\u8FDE\u4E0A\u7684\uFF09\u3002owner-only\uFF1B\u6570\u636E\u6765\u81EA\u6700\u8FD1\u4E00\u8F6E org auto-mesh \u62C9\u53D6\uFF0Cdaemon \u5185\u5B58\u7F13\u5B58",
8850
+ args: NO_ARGS
8851
+ },
8848
8852
  "contact:setNote": {
8849
8853
  summary: "\u7ED9\u8054\u7CFB\u4EBA\uFF08\u5BF9\u65B9\u8BBE\u5907\uFF09\u5199\u5907\u6CE8\u3002owner \u672C\u5730\u79C1\u8BB0\uFF0C\u4E0D\u540C\u6B65\u7ED9\u5BF9\u65B9\uFF1B\u4E00\u4EBA\u591A\u8BBE\u5907\u65F6\u7528\u6765\u533A\u5206\u54EA\u53F0\u662F\u54EA\u53F0",
8850
8854
  args: ContactSetNoteArgsSchema
@@ -9153,8 +9157,8 @@ var init_visitor_schemas = __esm({
9153
9157
  function formatLarkSpeakerReminder(speaker) {
9154
9158
  return `<system-reminder>\u6B64\u6D88\u606F\u6765\u81EA\u98DE\u4E66\u7FA4\u6210\u5458 ${speaker}</system-reminder>`;
9155
9159
  }
9156
- function formatSenderAttribution(sender) {
9157
- if (sender.principal === "owner") return "";
9160
+ function formatSenderAttribution(sender, declaredParty) {
9161
+ if (sender.principal === "owner" && declaredParty === "owner") return "";
9158
9162
  if (!sender.displayName) return "";
9159
9163
  return `<system-reminder>\u6B64\u6D88\u606F\u6765\u81EA ${sender.principal}\uFF1A${sender.displayName}</system-reminder>`;
9160
9164
  }
@@ -44930,7 +44934,7 @@ function renderIdentityLines(fields) {
44930
44934
  function buildConnectionPrompt(args) {
44931
44935
  const parts = ["# \u8FDE\u63A5\u4E0A\u4E0B\u6587"];
44932
44936
  if (args.mode === "owner") {
44933
- parts.push("\u5F53\u524D\u8FDE\u63A5\u65B9\uFF08\u5C31\u662F owner \u672C\u4EBA\uFF09\uFF1A");
44937
+ parts.push("\u5F00\u8FD9\u4E2A session \u7684\u8FDE\u63A5\u65B9\uFF08\u5C31\u662F owner \u672C\u4EBA\uFF09\uFF1A");
44934
44938
  parts.push(
44935
44939
  renderIdentityLines({
44936
44940
  label: args.ownerLabel,
@@ -44939,7 +44943,7 @@ function buildConnectionPrompt(args) {
44939
44943
  })
44940
44944
  );
44941
44945
  } else {
44942
- parts.push("\u5F53\u524D\u8FDE\u63A5\u65B9\uFF08\u4E0D\u662F owner \u672C\u4EBA\uFF09\uFF1A");
44946
+ parts.push("\u5F00\u8FD9\u4E2A session \u7684\u8FDE\u63A5\u65B9\uFF08\u4E0D\u662F owner \u672C\u4EBA\uFF09\uFF1A");
44943
44947
  parts.push(
44944
44948
  renderIdentityLines({
44945
44949
  label: args.guestLabel,
@@ -44958,6 +44962,10 @@ function buildConnectionPrompt(args) {
44958
44962
  })
44959
44963
  );
44960
44964
  }
44965
+ parts.push("");
44966
+ parts.push(
44967
+ `\u4E0A\u9762\u5199\u7684\u662F\u5F00\u8FD9\u4E2A session \u7684\u4EBA\uFF0C\u4E4B\u540E\u7684\u6D88\u606F\u4E0D\u4E00\u5B9A\u90FD\u6765\u81EA\u4ED6 \u2014\u2014 \u4E2D\u9014\u53EF\u80FD\u6362\u4EBA\u8BF4\u8BDD\uFF0C\u6BD4\u5982 ${args.mode === "owner" ? "guest \u4ECE\u522B\u7684\u8BBE\u5907\u8FDE\u8FDB\u6765" : "owner \u672C\u4EBA\u8FDB\u6765"}\u63A5\u4E00\u53E5\u3002\u6D88\u606F\u5C3E\u90E8\u5E26 <system-reminder>\u6B64\u6D88\u606F\u6765\u81EA owner\uFF0Fguest\uFF1A\u67D0\u67D0</system-reminder> \u65F6\uFF0C\u4EE5\u5C3E\u6CE8\u91CC\u7684\u4EBA\u4E3A\u51C6\uFF1B\u6CA1\u6709\u5C3E\u6CE8\u5C31\u662F\u4E0A\u9762\u8FD9\u4F4D\u3002`
44968
+ );
44961
44969
  if (args.workDir) {
44962
44970
  parts.push("");
44963
44971
  let line = `\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`;
@@ -44971,7 +44979,7 @@ function buildConnectionPrompt(args) {
44971
44979
  if (args.mode === "guest" && args.guestDeviceId) {
44972
44980
  parts.push("");
44973
44981
  parts.push(
44974
- `\u5BF9\u65B9\u8BF4\u7684\u300C\u6211\u7684\u684C\u9762 / \u6211\u672C\u5730\u7684\u2026\u300D\u662F\u4ED6\u90A3\u53F0\u8BBE\u5907\u3001\u4E0D\u662F\u672C\u673A\uFF1B\u8981\u5728\u90A3\u8FB9\u770B\u6587\u4EF6\u6216\u8DD1\u547D\u4EE4\uFF0C\u7528 peer-ops \u7684 exec\uFF0CpeerDeviceId \u586B ${args.guestDeviceId}\u3002`
44982
+ `${args.guestLabel}\u8BF4\u7684\u300C\u6211\u7684\u684C\u9762 / \u6211\u672C\u5730\u7684\u2026\u300D\u662F\u4ED6\u90A3\u53F0\u8BBE\u5907\u3001\u4E0D\u662F\u672C\u673A\uFF1B\u8981\u5728\u90A3\u8FB9\u770B\u6587\u4EF6\u6216\u8DD1\u547D\u4EE4\uFF0C\u7528 peer-ops \u7684 exec\uFF0CpeerDeviceId \u586B ${args.guestDeviceId}\u3002`
44975
44983
  );
44976
44984
  }
44977
44985
  parts.push("");
@@ -60183,8 +60191,13 @@ async function fetchOrgPeers(opts) {
60183
60191
  const body = await res.json();
60184
60192
  return body.items ?? [];
60185
60193
  }
60194
+ var lastPeers = [];
60195
+ function getCachedOrgPeers() {
60196
+ return lastPeers;
60197
+ }
60186
60198
  async function syncOrgMesh(deps) {
60187
60199
  const peers = await deps.fetchPeers();
60200
+ lastPeers = peers;
60188
60201
  if (peers.length === 0) {
60189
60202
  deps.log("org-mesh: \u4E0D\u5728\u4EFB\u4F55\u7EC4\u7EC7\uFF08\u6216\u7EC4\u91CC\u53EA\u6709\u81EA\u5DF1\uFF09\uFF0C\u8DF3\u8FC7");
60190
60203
  deps.onProgress?.({ total: 0, done: 0, connected: 0, failed: 0, active: false });
@@ -61008,7 +61021,9 @@ function buildSessionHandlers(deps) {
61008
61021
  deps.getOwnerIdentity().feishuUnionId
61009
61022
  )
61010
61023
  );
61011
- const attribution = formatSenderAttribution(sender);
61024
+ const creatorPrincipalId = manager.findOwnedSession(args.sessionId)?.creatorPrincipalId;
61025
+ const declaredParty = creatorPrincipalId && creatorPrincipalId !== ownerPrincipalId ? "guest" : "owner";
61026
+ const attribution = formatSenderAttribution(sender, declaredParty);
61012
61027
  const outbound = attribution ? { ...args, text: `${args.text}
61013
61028
 
61014
61029
  ${attribution}` } : args;
@@ -62131,6 +62146,12 @@ function buildContactHandlers(deps) {
62131
62146
  }
62132
62147
  };
62133
62148
  };
62149
+ const orgPeers = async (_frame, _client, ctx) => {
62150
+ ensureOwner2(ctx);
62151
+ return {
62152
+ response: { type: "org:peers:ok", peers: getCachedOrgPeers() }
62153
+ };
62154
+ };
62134
62155
  const remove = async (frame, _client, ctx) => {
62135
62156
  ensureOwner2(ctx);
62136
62157
  const args = parseArgs2(ContactRemoveArgsSchema, frame, "contact:remove");
@@ -62198,6 +62219,7 @@ function buildContactHandlers(deps) {
62198
62219
  "contact:list": list,
62199
62220
  "contact:pin": pin,
62200
62221
  "contact:setNote": setNote,
62222
+ "org:peers": orgPeers,
62201
62223
  "contact:remove": remove,
62202
62224
  "contact:handshake": handshake
62203
62225
  };
@@ -62383,6 +62405,7 @@ var METHOD_GRANT_MAP = {
62383
62405
  "contact:list": ADMIN_ANY,
62384
62406
  "contact:pin": ADMIN_ANY,
62385
62407
  "contact:setNote": ADMIN_ANY,
62408
+ "org:peers": ADMIN_ANY,
62386
62409
  "contact:remove": ADMIN_ANY,
62387
62410
  // contact:setRemoteAccess (owner UI 配远程访问授权):ADMIN_ANY
62388
62411
  // (对齐 inbox:postMessage 的"能连上=有 auth,业务在 handler 校"模式)
@@ -62634,7 +62657,7 @@ function computeMethodAccess(args) {
62634
62657
  }
62635
62658
 
62636
62659
  // src/version.ts
62637
- var version = "0.2.435".length > 0 ? "0.2.435" : "dev";
62660
+ var version = "0.2.437".length > 0 ? "0.2.437" : "dev";
62638
62661
 
62639
62662
  // src/cli-probe/probe.ts
62640
62663
  var fs65 = __toESM(require("fs"), 1);
@@ -23905,6 +23905,10 @@ var METHOD_DOCS = {
23905
23905
  summary: "\u7F6E\u9876 / \u53D6\u6D88\u7F6E\u9876\u8054\u7CFB\u4EBA",
23906
23906
  args: ContactPinArgsSchema
23907
23907
  },
23908
+ "org:peers": {
23909
+ summary: "\u540C\u7EC4\u7EC7\u6210\u5458\u5FEB\u7167\uFF08\u542B\u8FD8\u6CA1\u8FDE\u4E0A\u7684\uFF09\u3002owner-only\uFF1B\u6570\u636E\u6765\u81EA\u6700\u8FD1\u4E00\u8F6E org auto-mesh \u62C9\u53D6\uFF0Cdaemon \u5185\u5B58\u7F13\u5B58",
23910
+ args: NO_ARGS
23911
+ },
23908
23912
  "contact:setNote": {
23909
23913
  summary: "\u7ED9\u8054\u7CFB\u4EBA\uFF08\u5BF9\u65B9\u8BBE\u5907\uFF09\u5199\u5907\u6CE8\u3002owner \u672C\u5730\u79C1\u8BB0\uFF0C\u4E0D\u540C\u6B65\u7ED9\u5BF9\u65B9\uFF1B\u4E00\u4EBA\u591A\u8BBE\u5907\u65F6\u7528\u6765\u533A\u5206\u54EA\u53F0\u662F\u54EA\u53F0",
23910
23914
  args: ContactSetNoteArgsSchema