@peer2peer/cli 0.1.1 → 0.1.2
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/README.md +13 -11
- package/dist/app.d.ts +78 -0
- package/dist/app.js +150 -39
- package/dist/cli.d.ts +24 -3
- package/dist/cli.js +244 -29
- package/dist/config.d.ts +5 -0
- package/dist/doctor.d.ts +71 -2
- package/dist/doctor.js +95 -16
- package/dist/ext-host.js +5 -1
- package/dist/extensions.js +2 -2
- package/dist/identity.d.ts +29 -3
- package/dist/identity.js +74 -12
- package/dist/ix-local.d.ts +63 -11
- package/dist/ix-local.js +81 -24
- package/dist/pretty.d.ts +3 -1
- package/dist/pretty.js +9 -2
- package/dist/projects.d.ts +70 -3
- package/dist/projects.js +305 -19
- package/dist/rotation.js +15 -7
- package/dist/sessions.d.ts +8 -0
- package/dist/sessions.js +73 -16
- package/dist/social.js +11 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -3
package/dist/social.js
CHANGED
|
@@ -294,10 +294,21 @@ export async function onUnfriendKind(app, env, r) {
|
|
|
294
294
|
return [makeEvent(env, "p2p.unfriend", r.envelope.ts, { from: await fromOf(app, r), peer: r.envelope.from })];
|
|
295
295
|
}
|
|
296
296
|
async function afterUnfriend(app, peer) {
|
|
297
|
+
// Only when it ended the last friendship with them (issue #3). An unfriend that arrives after a
|
|
298
|
+
// re-friend (a late copy, another device's, one queued while this device was away) ends only the
|
|
299
|
+
// friendships invited at or before it: the new one stands, and so must the caps it exchanged
|
|
300
|
+
// (caps name no friendship). Revoking them anyway left a "friend" neither side could message.
|
|
301
|
+
if (await stillFriends(app, peer))
|
|
302
|
+
return;
|
|
297
303
|
const caps = await capsToRevokeOnUnfriend(app.store, peer);
|
|
298
304
|
await app.revokeCaps(caps).catch(() => 0);
|
|
299
305
|
await app.store.removeCapsHeld((c) => c.iss === peer);
|
|
300
306
|
}
|
|
307
|
+
/** A friendship with `peer` that no unfriend this device holds ends. */
|
|
308
|
+
async function stillFriends(app, peer) {
|
|
309
|
+
const unfriends = await app.store.listUnfriends();
|
|
310
|
+
return (await liveFriendshipsV3(app.store, app.signerCtx())).some((f) => (f.inviter === peer || f.invitee === peer) && !unfriends.some((u) => unfriendApplies(f, u)));
|
|
311
|
+
}
|
|
301
312
|
export async function unfriend(app, who) {
|
|
302
313
|
const peer = await app.resolveUser(who);
|
|
303
314
|
// Handle what's queued first: it was sent while we were still friends.
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.2";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peer2peer/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "The standalone Peer2Peer v3 CLI (`p2p`): an account-free identity, friends, circles, end-to-end encrypted session messaging and status over open relays",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"peer2peer",
|
|
@@ -53,10 +53,13 @@
|
|
|
53
53
|
"registry": "https://registry.npmjs.org/"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@peer2peer/codex-bridge": "0.1.
|
|
57
|
-
"@peer2peer/core": "0.1.
|
|
56
|
+
"@peer2peer/codex-bridge": "0.1.2",
|
|
57
|
+
"@peer2peer/core": "0.1.2",
|
|
58
58
|
"commander": "15.0.0",
|
|
59
59
|
"uqr": "0.1.3",
|
|
60
60
|
"ws": "8.22.0"
|
|
61
|
+
},
|
|
62
|
+
"overrides": {
|
|
63
|
+
"minimatch": "^11.0.8"
|
|
61
64
|
}
|
|
62
65
|
}
|