@clawos-dev/clawd 0.2.462 → 0.2.463

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
@@ -58673,6 +58673,14 @@ var LocalWsServer = class {
58673
58673
  Promise.resolve(this.frameHandler(client, frame)).catch((err) => {
58674
58674
  const e = err;
58675
58675
  const requestId = typeof frame.requestId === "string" ? frame.requestId : void 0;
58676
+ const meta = {
58677
+ method: typeof frame.type === "string" ? frame.type : "<unknown>",
58678
+ code: e.code ?? "INTERNAL",
58679
+ message: (e.message ?? String(err)).slice(0, 300),
58680
+ ...typeof frame.sessionId === "string" ? { sessionId: frame.sessionId } : {}
58681
+ };
58682
+ if (e.code) this.logger?.warn("rpc failed", meta);
58683
+ else this.logger?.error("rpc failed", meta);
58676
58684
  const record3 = this.clients.get(client.id);
58677
58685
  if (!record3) return;
58678
58686
  this.safeSend(record3.ws, {
@@ -62645,8 +62653,9 @@ function buildSessionHandlers(deps) {
62645
62653
  );
62646
62654
  }
62647
62655
  };
62648
- const assertNotMasterPersona = (personaId2) => {
62656
+ const assertNotMasterPersona = (personaId2, ephemeral) => {
62649
62657
  if (personaId2 !== MASTER_PERSONA_ID) return;
62658
+ if (ephemeral) return;
62650
62659
  throw new ClawdError(
62651
62660
  ERROR_CODES.FORBIDDEN,
62652
62661
  `${MASTER_PERSONA_ID} \u7684\u4F1A\u8BDD\u7531\u8BDD\u9898\u521B\u5EFA\uFF0C\u4E0D\u80FD\u76F4\u63A5\u5EFA\uFF1A\u8BF7\u5728\u9891\u9053\u91CC\u65B0\u5EFA\u8BDD\u9898`
@@ -62654,7 +62663,7 @@ function buildSessionHandlers(deps) {
62654
62663
  };
62655
62664
  const create = async (frame, _client, ctx) => {
62656
62665
  const args = SessionCreateArgs.parse(frame);
62657
- assertNotMasterPersona(args.ownerPersonaId);
62666
+ assertNotMasterPersona(args.ownerPersonaId, args.ephemeral);
62658
62667
  let tool = args.tool;
62659
62668
  let model = args.model;
62660
62669
  let effort = args.effort;
@@ -62777,6 +62786,12 @@ function buildSessionHandlers(deps) {
62777
62786
  const update = async (frame, _client, ctx) => {
62778
62787
  const args = SessionUpdateArgs.parse(frame);
62779
62788
  ensureSessionAccess(ctx, args.sessionId, "send");
62789
+ if (args.patch.ephemeral === false && store.read(args.sessionId)?.ownerPersonaId === MASTER_PERSONA_ID) {
62790
+ throw new ClawdError(
62791
+ ERROR_CODES.FORBIDDEN,
62792
+ `${MASTER_PERSONA_ID} \u7684\u5FEB\u901F\u95EE\u7B54\u4F1A\u8BDD\u4E0D\u80FD\u8F6C\u6B63\uFF1A\u8F6C\u6B63\u540E\u5C31\u662F\u4E00\u6761\u6CA1\u6709\u8BDD\u9898\u5F52\u5C5E\u3001\u4E5F\u56DE\u6536\u4E0D\u6389\u7684\u4F1A\u8BDD`
62793
+ );
62794
+ }
62780
62795
  const { response, broadcast } = manager.update(args);
62781
62796
  return { response: { type: "session:info", ...response }, broadcast };
62782
62797
  };
@@ -64493,7 +64508,7 @@ function computeMethodAccess(args) {
64493
64508
  }
64494
64509
 
64495
64510
  // src/version.ts
64496
- var version = "0.2.462".length > 0 ? "0.2.462" : "dev";
64511
+ var version = "0.2.463".length > 0 ? "0.2.463" : "dev";
64497
64512
 
64498
64513
  // src/cli-probe/probe.ts
64499
64514
  var fs72 = __toESM(require("fs"), 1);