@clawos-dev/clawd 0.2.750 → 0.2.752
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
|
@@ -53995,8 +53995,15 @@ async function centralPersonaAccess(opts) {
|
|
|
53995
53995
|
}
|
|
53996
53996
|
return body;
|
|
53997
53997
|
}
|
|
53998
|
+
async function centralResolveDeviceIdentity(opts) {
|
|
53999
|
+
const body = await centralRequest(opts, `/api/persona-cloud/personas/device-identity?deviceId=${encodeURIComponent(opts.deviceId)}`, { method: "GET", bearer: opts.loginPass });
|
|
54000
|
+
if (typeof body.unionId !== "string" || !body.unionId || typeof body.displayName !== "string" || !body.displayName) {
|
|
54001
|
+
throw new CentralClientError("BAD_RESPONSE", "device-identity: missing unionId/displayName");
|
|
54002
|
+
}
|
|
54003
|
+
return { unionId: body.unionId, displayName: body.displayName };
|
|
54004
|
+
}
|
|
53998
54005
|
async function centralAddCollaborator(opts) {
|
|
53999
|
-
await centralRequest(opts, `${personaPath(opts.personaId)}/collaborators`, { method: "PUT", bearer: opts.loginPass, body: { deviceId: opts.deviceId } });
|
|
54006
|
+
await centralRequest(opts, `${personaPath(opts.personaId)}/collaborators`, { method: "PUT", bearer: opts.loginPass, body: { deviceId: opts.deviceId, ...opts.identity } });
|
|
54000
54007
|
}
|
|
54001
54008
|
async function centralRemoveCollaborator(opts) {
|
|
54002
54009
|
await centralRequest(opts, `${personaPath(opts.personaId)}/collaborators/${encodeURIComponent(opts.unionId)}`, { method: "DELETE", bearer: opts.loginPass });
|
|
@@ -65719,13 +65726,19 @@ function buildDeployHandlers(deps) {
|
|
|
65719
65726
|
throw centralInvalid(err);
|
|
65720
65727
|
}
|
|
65721
65728
|
if (before.role !== "owner") throw invalid("\u53EA\u6709\u8FD9\u4E2A persona \u7684\u53D1\u5E03\u8005\u80FD\u6DFB\u52A0\u534F\u4F5C\u8005");
|
|
65729
|
+
let identity;
|
|
65730
|
+
try {
|
|
65731
|
+
identity = await collaboration.resolveDevice(deviceId);
|
|
65732
|
+
} catch (err) {
|
|
65733
|
+
throw centralInvalid(err);
|
|
65734
|
+
}
|
|
65722
65735
|
try {
|
|
65723
|
-
await collaboration.add("integration", cloudId, deviceId);
|
|
65736
|
+
await collaboration.add("integration", cloudId, deviceId, identity);
|
|
65724
65737
|
} catch (err) {
|
|
65725
65738
|
throw centralInvalid(err);
|
|
65726
65739
|
}
|
|
65727
65740
|
try {
|
|
65728
|
-
await collaboration.add("production", cloudId, deviceId);
|
|
65741
|
+
await collaboration.add("production", cloudId, deviceId, identity);
|
|
65729
65742
|
} catch (err) {
|
|
65730
65743
|
const known = new Set(before.collaborators.map((c2) => c2.unionId));
|
|
65731
65744
|
let undone = true;
|
|
@@ -76464,7 +76477,7 @@ function computeMethodAccess(args) {
|
|
|
76464
76477
|
}
|
|
76465
76478
|
|
|
76466
76479
|
// src/version.ts
|
|
76467
|
-
var version = "0.2.
|
|
76480
|
+
var version = "0.2.752".length > 0 ? "0.2.752" : "dev";
|
|
76468
76481
|
|
|
76469
76482
|
// src/cli-probe/probe.ts
|
|
76470
76483
|
var fs87 = __toESM(require("fs"), 1);
|
|
@@ -80408,7 +80421,8 @@ async function startDaemon(config) {
|
|
|
80408
80421
|
};
|
|
80409
80422
|
return {
|
|
80410
80423
|
access: async (environment, personaId2) => centralPersonaAccess({ ...base(environment), personaId: personaId2 }),
|
|
80411
|
-
|
|
80424
|
+
resolveDevice: async (deviceId) => centralResolveDeviceIdentity({ ...base("production"), deviceId }),
|
|
80425
|
+
add: async (environment, personaId2, deviceId, identity) => centralAddCollaborator({ ...base(environment), personaId: personaId2, deviceId, identity }),
|
|
80412
80426
|
remove: async (environment, personaId2, unionId) => centralRemoveCollaborator({ ...base(environment), personaId: personaId2, unionId }),
|
|
80413
80427
|
editLock: async (environment, personaId2, action) => centralEditLock({ ...base(environment), personaId: personaId2, action })
|
|
80414
80428
|
};
|