@clawos-dev/clawd 0.2.82 → 0.2.83-beta.155.84907e5
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 +29 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -4594,6 +4594,23 @@ var init_schemas = __esm({
|
|
|
4594
4594
|
* optional:兼容 2026-05-21 之前的老 session 数据,新建一定有值。
|
|
4595
4595
|
*/
|
|
4596
4596
|
creatorPrincipalId: external_exports.string().min(1).optional(),
|
|
4597
|
+
/**
|
|
4598
|
+
* 创建该 session 的接入者 owner identity(auth 帧 selfPrincipalId)。global personal token
|
|
4599
|
+
* (#735) 后 creatorPrincipalId 在 guest ctx 永远是同一张 personal cap.id,UI 端无法区分
|
|
4600
|
+
* 接入者;这个字段把"是哪个人"的信息固定下来。
|
|
4601
|
+
*
|
|
4602
|
+
* 派生规则:
|
|
4603
|
+
* - owner ctx 创建:= 本机 ownerPrincipalId
|
|
4604
|
+
* - guest ctx + auth 帧带 selfPrincipalId:= ctx.peerOwnerPrincipalId
|
|
4605
|
+
* - 旧 per-peer cap 路径 / 老 session:undefined(UI 视作 self 兼容)
|
|
4606
|
+
*
|
|
4607
|
+
* UI 用法:
|
|
4608
|
+
* - Recents/Active/Pinned 过滤:`!creatorOwnerPrincipalId || === ownerPrincipalId` 才显示
|
|
4609
|
+
* - MyPersonas 二级分组:non-self → 按 contacts 反查 displayName 分桶
|
|
4610
|
+
*
|
|
4611
|
+
* 当前为 caller 自报,daemon 不密码学验证真伪;强身份验签是独立工作(B 方案)。
|
|
4612
|
+
*/
|
|
4613
|
+
creatorOwnerPrincipalId: external_exports.string().min(1).optional(),
|
|
4597
4614
|
createdAt: external_exports.string().min(1),
|
|
4598
4615
|
updatedAt: external_exports.string().min(1)
|
|
4599
4616
|
});
|
|
@@ -22734,7 +22751,7 @@ var SessionManager = class {
|
|
|
22734
22751
|
}
|
|
22735
22752
|
}
|
|
22736
22753
|
// ---- 命令方法:均返回 { response, broadcast[] },由 dispatcher 聚合 ----
|
|
22737
|
-
create(args, creatorPrincipalId) {
|
|
22754
|
+
create(args, creatorPrincipalId, creatorOwnerPrincipalId) {
|
|
22738
22755
|
let cwd;
|
|
22739
22756
|
if (args.ownerPersonaId) {
|
|
22740
22757
|
cwd = derivePersonaSpawnCwd(
|
|
@@ -22776,6 +22793,7 @@ var SessionManager = class {
|
|
|
22776
22793
|
forkedFromSessionId: args.forkedFromSessionId,
|
|
22777
22794
|
ownerPersonaId: args.ownerPersonaId,
|
|
22778
22795
|
creatorPrincipalId,
|
|
22796
|
+
...creatorOwnerPrincipalId ? { creatorOwnerPrincipalId } : {},
|
|
22779
22797
|
createdAt: iso,
|
|
22780
22798
|
updatedAt: iso
|
|
22781
22799
|
};
|
|
@@ -28300,15 +28318,23 @@ function buildSessionHandlers(deps) {
|
|
|
28300
28318
|
}
|
|
28301
28319
|
ensurePersonaAccess(ctx, args.ownerPersonaId, "send");
|
|
28302
28320
|
const creatorPrincipalId = ctx?.principal.id ?? ownerPrincipalId;
|
|
28303
|
-
const
|
|
28321
|
+
const creatorOwnerPrincipalId = ctx?.principal.kind === "guest" ? ctx.peerOwnerPrincipalId : ownerPrincipalId;
|
|
28322
|
+
const { response, broadcast } = manager.create(
|
|
28323
|
+
args,
|
|
28324
|
+
creatorPrincipalId,
|
|
28325
|
+
creatorOwnerPrincipalId
|
|
28326
|
+
);
|
|
28304
28327
|
return { response: { type: "session:info", ...response }, broadcast };
|
|
28305
28328
|
};
|
|
28306
28329
|
const list = async (_frame, _client, ctx) => {
|
|
28307
28330
|
const { response } = manager.list();
|
|
28308
28331
|
if (ctx && ctx.principal.kind === "guest") {
|
|
28309
28332
|
const sessions = response.sessions ?? [];
|
|
28333
|
+
const peerOwnerId = ctx.peerOwnerPrincipalId;
|
|
28310
28334
|
const capId = ctx.capabilityId;
|
|
28311
|
-
const filtered = sessions.filter((s) => canAccessPersona(ctx.grants, s.ownerPersonaId, "read")).filter(
|
|
28335
|
+
const filtered = sessions.filter((s) => canAccessPersona(ctx.grants, s.ownerPersonaId, "read")).filter(
|
|
28336
|
+
(s) => peerOwnerId ? s.creatorOwnerPrincipalId === peerOwnerId : s.creatorPrincipalId === capId
|
|
28337
|
+
);
|
|
28312
28338
|
return { response: { type: "session:list", sessions: filtered } };
|
|
28313
28339
|
}
|
|
28314
28340
|
return { response: { type: "session:list", ...response } };
|
package/package.json
CHANGED