@ouro.bot/cli 0.1.0-alpha.1147 → 0.1.0-alpha.1149
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/changelog.json +12 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/senses/app-sessions/app-interface.js +9 -1
- package/node_modules/@ouro.bot/friends/LICENSE +201 -0
- package/node_modules/@ouro.bot/friends/README.md +674 -0
- package/node_modules/@ouro.bot/friends/changelog.json +125 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/a2a-message.d.ts +39 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/a2a-message.js +54 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/adapter.d.ts +117 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/adapter.js +202 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/agent-card.d.ts +50 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/agent-card.js +32 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-key.d.ts +38 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-key.js +120 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-verifier.d.ts +195 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-verifier.js +342 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-web.d.ts +26 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/did-web.js +140 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/envelope-binding.d.ts +62 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/envelope-binding.js +79 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/index.d.ts +26 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/index.js +82 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/jcs.d.ts +5 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/jcs.js +84 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/reachability.d.ts +22 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/reachability.js +17 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/roster-verify.d.ts +15 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/roster-verify.js +61 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/seal.d.ts +47 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/seal.js +95 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sealed-envelope.d.ts +58 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sealed-envelope.js +113 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sign.d.ts +42 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sign.js +87 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sodium.d.ts +5 -0
- package/node_modules/@ouro.bot/friends/dist/a2a-client/sodium.js +19 -0
- package/node_modules/@ouro.bot/friends/dist/account-roster.d.ts +52 -0
- package/node_modules/@ouro.bot/friends/dist/account-roster.js +108 -0
- package/node_modules/@ouro.bot/friends/dist/agent-peer.d.ts +26 -0
- package/node_modules/@ouro.bot/friends/dist/agent-peer.js +138 -0
- package/node_modules/@ouro.bot/friends/dist/audit.d.ts +42 -0
- package/node_modules/@ouro.bot/friends/dist/audit.js +86 -0
- package/node_modules/@ouro.bot/friends/dist/channel.d.ts +11 -0
- package/node_modules/@ouro.bot/friends/dist/channel.js +161 -0
- package/node_modules/@ouro.bot/friends/dist/connect-authority.d.ts +43 -0
- package/node_modules/@ouro.bot/friends/dist/connect-authority.js +84 -0
- package/node_modules/@ouro.bot/friends/dist/connect.d.ts +56 -0
- package/node_modules/@ouro.bot/friends/dist/connect.js +163 -0
- package/node_modules/@ouro.bot/friends/dist/consent.d.ts +34 -0
- package/node_modules/@ouro.bot/friends/dist/consent.js +65 -0
- package/node_modules/@ouro.bot/friends/dist/coordination.d.ts +116 -0
- package/node_modules/@ouro.bot/friends/dist/coordination.js +329 -0
- package/node_modules/@ouro.bot/friends/dist/delegation-grant.d.ts +21 -0
- package/node_modules/@ouro.bot/friends/dist/delegation-grant.js +39 -0
- package/node_modules/@ouro.bot/friends/dist/file-bundle.d.ts +17 -0
- package/node_modules/@ouro.bot/friends/dist/file-bundle.js +27 -0
- package/node_modules/@ouro.bot/friends/dist/friend-lookup.d.ts +9 -0
- package/node_modules/@ouro.bot/friends/dist/friend-lookup.js +69 -0
- package/node_modules/@ouro.bot/friends/dist/grant-store-file.d.ts +16 -0
- package/node_modules/@ouro.bot/friends/dist/grant-store-file.js +136 -0
- package/node_modules/@ouro.bot/friends/dist/grant-store.d.ts +7 -0
- package/node_modules/@ouro.bot/friends/dist/grant-store.js +8 -0
- package/node_modules/@ouro.bot/friends/dist/grants.d.ts +39 -0
- package/node_modules/@ouro.bot/friends/dist/grants.js +84 -0
- package/node_modules/@ouro.bot/friends/dist/group-context.d.ts +21 -0
- package/node_modules/@ouro.bot/friends/dist/group-context.js +145 -0
- package/node_modules/@ouro.bot/friends/dist/identity.d.ts +17 -0
- package/node_modules/@ouro.bot/friends/dist/identity.js +68 -0
- package/node_modules/@ouro.bot/friends/dist/index.d.ts +73 -0
- package/node_modules/@ouro.bot/friends/dist/index.js +161 -0
- package/node_modules/@ouro.bot/friends/dist/link-identity.d.ts +14 -0
- package/node_modules/@ouro.bot/friends/dist/link-identity.js +157 -0
- package/node_modules/@ouro.bot/friends/dist/mailbox/index.d.ts +105 -0
- package/node_modules/@ouro.bot/friends/dist/mailbox/index.js +205 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/bin.d.ts +2 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/bin.js +16 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/dispatch.d.ts +40 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/dispatch.js +549 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/index.d.ts +6 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/index.js +14 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/run-main.d.ts +7 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/run-main.js +48 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/schemas.d.ts +10 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/schemas.js +445 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/server.d.ts +30 -0
- package/node_modules/@ouro.bot/friends/dist/mcp/server.js +194 -0
- package/node_modules/@ouro.bot/friends/dist/message.d.ts +75 -0
- package/node_modules/@ouro.bot/friends/dist/message.js +99 -0
- package/node_modules/@ouro.bot/friends/dist/mission-result.d.ts +82 -0
- package/node_modules/@ouro.bot/friends/dist/mission-result.js +200 -0
- package/node_modules/@ouro.bot/friends/dist/mission-share.d.ts +94 -0
- package/node_modules/@ouro.bot/friends/dist/mission-share.js +232 -0
- package/node_modules/@ouro.bot/friends/dist/mission-store-file.d.ts +18 -0
- package/node_modules/@ouro.bot/friends/dist/mission-store-file.js +161 -0
- package/node_modules/@ouro.bot/friends/dist/mission-store.d.ts +10 -0
- package/node_modules/@ouro.bot/friends/dist/mission-store.js +9 -0
- package/node_modules/@ouro.bot/friends/dist/missions.d.ts +31 -0
- package/node_modules/@ouro.bot/friends/dist/missions.js +98 -0
- package/node_modules/@ouro.bot/friends/dist/notes.d.ts +11 -0
- package/node_modules/@ouro.bot/friends/dist/notes.js +90 -0
- package/node_modules/@ouro.bot/friends/dist/observability.d.ts +27 -0
- package/node_modules/@ouro.bot/friends/dist/observability.js +31 -0
- package/node_modules/@ouro.bot/friends/dist/outcomes.d.ts +9 -0
- package/node_modules/@ouro.bot/friends/dist/outcomes.js +51 -0
- package/node_modules/@ouro.bot/friends/dist/resolver.d.ts +59 -0
- package/node_modules/@ouro.bot/friends/dist/resolver.js +276 -0
- package/node_modules/@ouro.bot/friends/dist/results.d.ts +10 -0
- package/node_modules/@ouro.bot/friends/dist/results.js +2 -0
- package/node_modules/@ouro.bot/friends/dist/room.d.ts +22 -0
- package/node_modules/@ouro.bot/friends/dist/room.js +40 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store-file.d.ts +16 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store-file.js +125 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store-memory.d.ts +9 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store-memory.js +20 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store.d.ts +29 -0
- package/node_modules/@ouro.bot/friends/dist/roster-store.js +9 -0
- package/node_modules/@ouro.bot/friends/dist/roster-verifier.d.ts +23 -0
- package/node_modules/@ouro.bot/friends/dist/roster-verifier.js +47 -0
- package/node_modules/@ouro.bot/friends/dist/share.d.ts +108 -0
- package/node_modules/@ouro.bot/friends/dist/share.js +278 -0
- package/node_modules/@ouro.bot/friends/dist/standing.d.ts +83 -0
- package/node_modules/@ouro.bot/friends/dist/standing.js +111 -0
- package/node_modules/@ouro.bot/friends/dist/store-file.d.ts +82 -0
- package/node_modules/@ouro.bot/friends/dist/store-file.js +1074 -0
- package/node_modules/@ouro.bot/friends/dist/store.d.ts +43 -0
- package/node_modules/@ouro.bot/friends/dist/store.js +4 -0
- package/node_modules/@ouro.bot/friends/dist/tokens.d.ts +8 -0
- package/node_modules/@ouro.bot/friends/dist/tokens.js +26 -0
- package/node_modules/@ouro.bot/friends/dist/trust-explanation.d.ts +22 -0
- package/node_modules/@ouro.bot/friends/dist/trust-explanation.js +90 -0
- package/node_modules/@ouro.bot/friends/dist/trust-mutation.d.ts +16 -0
- package/node_modules/@ouro.bot/friends/dist/trust-mutation.js +67 -0
- package/node_modules/@ouro.bot/friends/dist/types.d.ts +321 -0
- package/node_modules/@ouro.bot/friends/dist/types.js +55 -0
- package/node_modules/@ouro.bot/friends/dist/util/cap-string.d.ts +7 -0
- package/node_modules/@ouro.bot/friends/dist/util/cap-string.js +35 -0
- package/node_modules/@ouro.bot/friends/dist/verifier.d.ts +11 -0
- package/node_modules/@ouro.bot/friends/dist/verifier.js +29 -0
- package/node_modules/@ouro.bot/friends/dist/whoami.d.ts +7 -0
- package/node_modules/@ouro.bot/friends/dist/whoami.js +39 -0
- package/node_modules/@ouro.bot/friends/package.json +81 -0
- package/node_modules/libsodium/LICENSE +16 -0
- package/node_modules/libsodium/README.md +281 -0
- package/node_modules/libsodium/dist/modules/libsodium.js +1 -0
- package/node_modules/libsodium/dist/modules-esm/libsodium.mjs +1 -0
- package/node_modules/libsodium/package.json +54 -0
- package/node_modules/libsodium-wrappers/LICENSE +16 -0
- package/node_modules/libsodium-wrappers/README.md +281 -0
- package/node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.d.ts +2155 -0
- package/node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js +1 -0
- package/node_modules/libsodium-wrappers/dist/modules-esm/libsodium-wrappers.d.mts +2743 -0
- package/node_modules/libsodium-wrappers/dist/modules-esm/libsodium-wrappers.mjs +1 -0
- package/node_modules/libsodium-wrappers/package.json +74 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// FileGrantStore — filesystem adapter for GrantStore.
|
|
3
|
+
// Stores each ShareGrant as one JSON file in a sibling `_grants/` collection next
|
|
4
|
+
// to the friends directory. Mirrors FileFriendStore's structure (mkdir on
|
|
5
|
+
// construct, one file per record, guarded reads) so the two stores feel uniform.
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.FileGrantStore = void 0;
|
|
41
|
+
exports.grantsDirFor = grantsDirFor;
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const fsPromises = __importStar(require("fs/promises"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const observability_1 = require("./observability");
|
|
46
|
+
const types_1 = require("./types");
|
|
47
|
+
/** The sibling grants directory for a given friends directory: `<friendsDir>/_grants`.
|
|
48
|
+
* The collection lives UNDER the friends dir (a reserved `_`-prefixed subdir) so a
|
|
49
|
+
* single `--dir` still points the whole substrate at one place. */
|
|
50
|
+
function grantsDirFor(friendsDir) {
|
|
51
|
+
return path.join(friendsDir, "_grants");
|
|
52
|
+
}
|
|
53
|
+
class FileGrantStore {
|
|
54
|
+
grantsPath;
|
|
55
|
+
constructor(grantsPath) {
|
|
56
|
+
this.grantsPath = grantsPath;
|
|
57
|
+
fs.mkdirSync(grantsPath, { recursive: true });
|
|
58
|
+
(0, observability_1.emitNervesEvent)({
|
|
59
|
+
component: "friends",
|
|
60
|
+
event: "friends.grant_store_init",
|
|
61
|
+
message: "file grant store initialized",
|
|
62
|
+
meta: {},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async get(id) {
|
|
66
|
+
const grant = await this.readJson(path.join(this.grantsPath, `${id}.json`));
|
|
67
|
+
return grant ? this.normalize(grant) : null;
|
|
68
|
+
}
|
|
69
|
+
async put(id, grant) {
|
|
70
|
+
await fsPromises.writeFile(path.join(this.grantsPath, `${id}.json`), JSON.stringify(this.normalize(grant), null, 2), "utf-8");
|
|
71
|
+
}
|
|
72
|
+
async delete(id) {
|
|
73
|
+
try {
|
|
74
|
+
await fsPromises.unlink(path.join(this.grantsPath, `${id}.json`));
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
if (err?.code === "ENOENT")
|
|
78
|
+
return;
|
|
79
|
+
throw err;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async listAll() {
|
|
83
|
+
let entries;
|
|
84
|
+
try {
|
|
85
|
+
entries = await fsPromises.readdir(this.grantsPath);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
/* v8 ignore next -- defensive: dir is mkdir'd in the constructor, so readdir
|
|
89
|
+
only throws if it's deleted mid-run; unreachable through the API @preserve */
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
const grants = [];
|
|
93
|
+
for (const entry of entries) {
|
|
94
|
+
if (!entry.endsWith(".json"))
|
|
95
|
+
continue;
|
|
96
|
+
const raw = await this.readJson(path.join(this.grantsPath, entry));
|
|
97
|
+
if (!raw)
|
|
98
|
+
continue;
|
|
99
|
+
grants.push(this.normalize(raw));
|
|
100
|
+
}
|
|
101
|
+
return grants;
|
|
102
|
+
}
|
|
103
|
+
normalize(raw) {
|
|
104
|
+
return {
|
|
105
|
+
id: raw.id,
|
|
106
|
+
// Fork D compat seam (a): on-disk schemaVersion-1 grants carry the legacy
|
|
107
|
+
// `subjectFriendId`; newer ones carry `subjectKey`. Read both, persist
|
|
108
|
+
// forward as `subjectKey` so the legacy field migrates on the next write.
|
|
109
|
+
subjectKey: raw.subjectKey ?? raw.subjectFriendId ?? "",
|
|
110
|
+
recipientAgentId: raw.recipientAgentId,
|
|
111
|
+
scope: (0, types_1.isShareScope)(raw.scope) ? raw.scope : "identity",
|
|
112
|
+
grantedAt: typeof raw.grantedAt === "string" ? raw.grantedAt : new Date().toISOString(),
|
|
113
|
+
...(typeof raw.expiresAt === "string" ? { expiresAt: raw.expiresAt } : {}),
|
|
114
|
+
...(typeof raw.revokedAt === "string" ? { revokedAt: raw.revokedAt } : {}),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
async readJson(filePath) {
|
|
118
|
+
try {
|
|
119
|
+
const raw = await fsPromises.readFile(filePath, "utf-8");
|
|
120
|
+
try {
|
|
121
|
+
const parsed = JSON.parse(raw);
|
|
122
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
return parsed;
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.FileGrantStore = FileGrantStore;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Grant store abstraction.
|
|
3
|
+
// Consent state (ShareGrant records) persists through GrantStore — a sibling to
|
|
4
|
+
// FriendStore, mirroring its shape. Grants are many-to-many (one subject ↔ many
|
|
5
|
+
// recipients ↔ many scopes) with their own lifecycle, so they live in their own
|
|
6
|
+
// collection rather than on the friend record. No grant module imports `fs`
|
|
7
|
+
// directly except the FileGrantStore adapter.
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { GrantStore } from "./grant-store";
|
|
2
|
+
import type { ShareGrant, ShareScope } from "./types";
|
|
3
|
+
/** Whether a grant currently consents: not revoked, and not past its expiry as
|
|
4
|
+
* of `now`. The single source of truth for "effective", shared by the consent
|
|
5
|
+
* policies and the audit listing. */
|
|
6
|
+
export declare function isGrantEffective(grant: ShareGrant, now?: Date): boolean;
|
|
7
|
+
export interface GrantShareInput {
|
|
8
|
+
/** The subject whose data may be shared — a friend UUID, or a missionKey
|
|
9
|
+
* (Fork D: opaque subject key). */
|
|
10
|
+
subjectKey: string;
|
|
11
|
+
recipientAgentId: string;
|
|
12
|
+
scope: ShareScope;
|
|
13
|
+
/** Optional ISO expiry; absent ⇒ the grant never expires. */
|
|
14
|
+
expiresAt?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Mint an explicit share grant. Returns the persisted ShareGrant. */
|
|
17
|
+
export declare function grantShare(grants: GrantStore, input: GrantShareInput): Promise<ShareGrant>;
|
|
18
|
+
export interface RevokeShareResult {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
status: "revoked" | "not_found" | "noop";
|
|
21
|
+
grant?: ShareGrant;
|
|
22
|
+
}
|
|
23
|
+
/** Revoke a grant by id. Tombstones it (sets `revokedAt`) rather than deleting,
|
|
24
|
+
* so the audit trail survives. Re-revoking an already-revoked grant is a noop. */
|
|
25
|
+
export declare function revokeShare(grants: GrantStore, grantId: string): Promise<RevokeShareResult>;
|
|
26
|
+
export interface ListSharesFilter {
|
|
27
|
+
/** Filter to one subject (a friend UUID, or a missionKey). */
|
|
28
|
+
subjectKey?: string;
|
|
29
|
+
recipientAgentId?: string;
|
|
30
|
+
/** When true, only grants that currently consent (effective) are returned. */
|
|
31
|
+
effectiveOnly?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface ListedShare extends ShareGrant {
|
|
34
|
+
/** Whether this grant currently consents (not revoked, not expired). */
|
|
35
|
+
effective: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** List grants with their effective state, optionally filtered by subject /
|
|
38
|
+
* recipient / effectiveness. The inspect-and-revoke surface. */
|
|
39
|
+
export declare function listShares(grants: GrantStore, filter?: ListSharesFilter): Promise<ListedShare[]>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isGrantEffective = isGrantEffective;
|
|
4
|
+
exports.grantShare = grantShare;
|
|
5
|
+
exports.revokeShare = revokeShare;
|
|
6
|
+
exports.listShares = listShares;
|
|
7
|
+
// Consent-grant lifecycle — grantShare / revokeShare / listShares.
|
|
8
|
+
//
|
|
9
|
+
// The audit + revoke surface over a GrantStore (the GDPR / right-to-be-forgotten
|
|
10
|
+
// seam). `grantShare` mints an explicit ShareGrant; `revokeShare` tombstones one
|
|
11
|
+
// (sets `revokedAt` rather than deleting, so the audit trail survives);
|
|
12
|
+
// `listShares` returns grants with their effective state for inspection. The
|
|
13
|
+
// consent policies in `consent.ts` read these grants to decide whether a share is
|
|
14
|
+
// permitted — this module owns their CRUD, not the permission decision.
|
|
15
|
+
const node_crypto_1 = require("node:crypto");
|
|
16
|
+
const observability_1 = require("./observability");
|
|
17
|
+
/** Whether a grant currently consents: not revoked, and not past its expiry as
|
|
18
|
+
* of `now`. The single source of truth for "effective", shared by the consent
|
|
19
|
+
* policies and the audit listing. */
|
|
20
|
+
function isGrantEffective(grant, now = new Date()) {
|
|
21
|
+
if (grant.revokedAt)
|
|
22
|
+
return false;
|
|
23
|
+
if (grant.expiresAt && Date.parse(grant.expiresAt) <= now.getTime())
|
|
24
|
+
return false;
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
/** Mint an explicit share grant. Returns the persisted ShareGrant. */
|
|
28
|
+
async function grantShare(grants, input) {
|
|
29
|
+
const now = new Date().toISOString();
|
|
30
|
+
const grant = {
|
|
31
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
32
|
+
subjectKey: input.subjectKey,
|
|
33
|
+
recipientAgentId: input.recipientAgentId,
|
|
34
|
+
scope: input.scope,
|
|
35
|
+
grantedAt: now,
|
|
36
|
+
...(input.expiresAt !== undefined ? { expiresAt: input.expiresAt } : {}),
|
|
37
|
+
};
|
|
38
|
+
await grants.put(grant.id, grant);
|
|
39
|
+
(0, observability_1.emitNervesEvent)({
|
|
40
|
+
component: "friends",
|
|
41
|
+
event: "friends.share_granted",
|
|
42
|
+
message: "granted profile share",
|
|
43
|
+
meta: { subjectKey: input.subjectKey, recipientAgentId: input.recipientAgentId, scope: input.scope },
|
|
44
|
+
});
|
|
45
|
+
return grant;
|
|
46
|
+
}
|
|
47
|
+
/** Revoke a grant by id. Tombstones it (sets `revokedAt`) rather than deleting,
|
|
48
|
+
* so the audit trail survives. Re-revoking an already-revoked grant is a noop. */
|
|
49
|
+
async function revokeShare(grants, grantId) {
|
|
50
|
+
const grant = await grants.get(grantId);
|
|
51
|
+
if (!grant) {
|
|
52
|
+
return { ok: false, status: "not_found" };
|
|
53
|
+
}
|
|
54
|
+
if (grant.revokedAt) {
|
|
55
|
+
return { ok: true, status: "noop", grant };
|
|
56
|
+
}
|
|
57
|
+
const revoked = { ...grant, revokedAt: new Date().toISOString() };
|
|
58
|
+
await grants.put(revoked.id, revoked);
|
|
59
|
+
(0, observability_1.emitNervesEvent)({
|
|
60
|
+
component: "friends",
|
|
61
|
+
event: "friends.share_revoked",
|
|
62
|
+
message: "revoked profile share",
|
|
63
|
+
meta: { grantId },
|
|
64
|
+
});
|
|
65
|
+
return { ok: true, status: "revoked", grant: revoked };
|
|
66
|
+
}
|
|
67
|
+
/** List grants with their effective state, optionally filtered by subject /
|
|
68
|
+
* recipient / effectiveness. The inspect-and-revoke surface. */
|
|
69
|
+
async function listShares(grants, filter = {}) {
|
|
70
|
+
const all = await grants.listAll();
|
|
71
|
+
const now = new Date();
|
|
72
|
+
const listed = all
|
|
73
|
+
.filter((g) => filter.subjectKey === undefined || g.subjectKey === filter.subjectKey)
|
|
74
|
+
.filter((g) => filter.recipientAgentId === undefined || g.recipientAgentId === filter.recipientAgentId)
|
|
75
|
+
.map((g) => ({ ...g, effective: isGrantEffective(g, now) }))
|
|
76
|
+
.filter((g) => filter.effectiveOnly !== true || g.effective);
|
|
77
|
+
(0, observability_1.emitNervesEvent)({
|
|
78
|
+
component: "friends",
|
|
79
|
+
event: "friends.shares_listed",
|
|
80
|
+
message: "listed profile shares",
|
|
81
|
+
meta: { count: listed.length },
|
|
82
|
+
});
|
|
83
|
+
return listed;
|
|
84
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FriendStore } from "./store";
|
|
2
|
+
import type { TrustLevel } from "./types";
|
|
3
|
+
export interface GroupContextParticipant {
|
|
4
|
+
provider: "imessage-handle" | "aad" | "teams-conversation";
|
|
5
|
+
externalId: string;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GroupContextUpsertResult {
|
|
9
|
+
friendId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
trustLevel: TrustLevel;
|
|
12
|
+
created: boolean;
|
|
13
|
+
updated: boolean;
|
|
14
|
+
addedGroupExternalId: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function upsertGroupContextParticipants(input: {
|
|
17
|
+
store: FriendStore;
|
|
18
|
+
participants: GroupContextParticipant[];
|
|
19
|
+
groupExternalId: string;
|
|
20
|
+
now?: () => string;
|
|
21
|
+
}): Promise<GroupContextUpsertResult[]>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upsertGroupContextParticipants = upsertGroupContextParticipants;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const observability_1 = require("./observability");
|
|
6
|
+
const CURRENT_SCHEMA_VERSION = 1;
|
|
7
|
+
function normalizeDisplayName(externalId, displayName) {
|
|
8
|
+
const trimmed = displayName?.trim();
|
|
9
|
+
return trimmed && trimmed.length > 0 ? trimmed : externalId;
|
|
10
|
+
}
|
|
11
|
+
function buildNameNotes(name, now) {
|
|
12
|
+
return name !== "Unknown"
|
|
13
|
+
? { name: { value: name, savedAt: now } }
|
|
14
|
+
: {};
|
|
15
|
+
}
|
|
16
|
+
function dedupeParticipants(participants) {
|
|
17
|
+
const deduped = new Map();
|
|
18
|
+
for (const participant of participants) {
|
|
19
|
+
const externalId = participant.externalId.trim();
|
|
20
|
+
if (!externalId)
|
|
21
|
+
continue;
|
|
22
|
+
const key = `${participant.provider}:${externalId}`;
|
|
23
|
+
if (!deduped.has(key)) {
|
|
24
|
+
deduped.set(key, {
|
|
25
|
+
...participant,
|
|
26
|
+
externalId,
|
|
27
|
+
displayName: participant.displayName?.trim() || undefined,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return Array.from(deduped.values());
|
|
32
|
+
}
|
|
33
|
+
function createGroupExternalId(provider, groupExternalId, linkedAt) {
|
|
34
|
+
return {
|
|
35
|
+
provider,
|
|
36
|
+
externalId: groupExternalId,
|
|
37
|
+
linkedAt,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function shouldPromoteToAcquaintance(friend) {
|
|
41
|
+
// A record whose DID reset is pending stays at stranger until the owner raises it.
|
|
42
|
+
return (friend.trustLevel ?? "stranger") === "stranger" && friend.trustReset === undefined;
|
|
43
|
+
}
|
|
44
|
+
function createAcquaintanceRecord(participant, groupExternalId, linkedAt) {
|
|
45
|
+
const name = normalizeDisplayName(participant.externalId, participant.displayName);
|
|
46
|
+
return {
|
|
47
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
48
|
+
name,
|
|
49
|
+
role: "acquaintance",
|
|
50
|
+
trustLevel: "acquaintance",
|
|
51
|
+
connections: [],
|
|
52
|
+
externalIds: [
|
|
53
|
+
{
|
|
54
|
+
provider: participant.provider,
|
|
55
|
+
externalId: participant.externalId,
|
|
56
|
+
linkedAt,
|
|
57
|
+
},
|
|
58
|
+
createGroupExternalId(participant.provider, groupExternalId, linkedAt),
|
|
59
|
+
],
|
|
60
|
+
tenantMemberships: [],
|
|
61
|
+
toolPreferences: {},
|
|
62
|
+
notes: buildNameNotes(name, linkedAt),
|
|
63
|
+
totalTokens: 0,
|
|
64
|
+
createdAt: linkedAt,
|
|
65
|
+
updatedAt: linkedAt,
|
|
66
|
+
schemaVersion: CURRENT_SCHEMA_VERSION,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async function upsertGroupContextParticipants(input) {
|
|
70
|
+
(0, observability_1.emitNervesEvent)({
|
|
71
|
+
component: "friends",
|
|
72
|
+
event: "friends.group_context_upsert_start",
|
|
73
|
+
message: "upserting shared-group participant context",
|
|
74
|
+
meta: {
|
|
75
|
+
participantCount: input.participants.length,
|
|
76
|
+
hasGroupExternalId: input.groupExternalId.trim().length > 0,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
const groupExternalId = input.groupExternalId.trim();
|
|
80
|
+
if (!groupExternalId) {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
const now = input.now ?? (() => new Date().toISOString());
|
|
84
|
+
const participants = dedupeParticipants(input.participants);
|
|
85
|
+
const results = [];
|
|
86
|
+
for (const participant of participants) {
|
|
87
|
+
const linkedAt = now();
|
|
88
|
+
const existing = await input.store.findByExternalId(participant.provider, participant.externalId);
|
|
89
|
+
if (!existing) {
|
|
90
|
+
const created = createAcquaintanceRecord(participant, groupExternalId, linkedAt);
|
|
91
|
+
await input.store.put(created.id, created);
|
|
92
|
+
results.push({
|
|
93
|
+
friendId: created.id,
|
|
94
|
+
name: created.name,
|
|
95
|
+
trustLevel: "acquaintance",
|
|
96
|
+
created: true,
|
|
97
|
+
updated: false,
|
|
98
|
+
addedGroupExternalId: true,
|
|
99
|
+
});
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const hasGroupExternalId = existing.externalIds.some((externalId) => externalId.externalId === groupExternalId);
|
|
103
|
+
const promoteToAcquaintance = shouldPromoteToAcquaintance(existing);
|
|
104
|
+
const trustLevel = promoteToAcquaintance
|
|
105
|
+
? "acquaintance"
|
|
106
|
+
: existing.trustLevel;
|
|
107
|
+
const role = promoteToAcquaintance
|
|
108
|
+
? "acquaintance"
|
|
109
|
+
: existing.role;
|
|
110
|
+
const updatedExternalIds = hasGroupExternalId
|
|
111
|
+
? existing.externalIds
|
|
112
|
+
: [...existing.externalIds, createGroupExternalId(participant.provider, groupExternalId, linkedAt)];
|
|
113
|
+
const updated = promoteToAcquaintance || !hasGroupExternalId;
|
|
114
|
+
const record = updated
|
|
115
|
+
? {
|
|
116
|
+
...existing,
|
|
117
|
+
role,
|
|
118
|
+
trustLevel,
|
|
119
|
+
externalIds: updatedExternalIds,
|
|
120
|
+
updatedAt: linkedAt,
|
|
121
|
+
}
|
|
122
|
+
: existing;
|
|
123
|
+
if (updated) {
|
|
124
|
+
await input.store.put(record.id, record);
|
|
125
|
+
}
|
|
126
|
+
results.push({
|
|
127
|
+
friendId: record.id,
|
|
128
|
+
name: record.name,
|
|
129
|
+
trustLevel,
|
|
130
|
+
created: false,
|
|
131
|
+
updated,
|
|
132
|
+
addedGroupExternalId: !hasGroupExternalId,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
(0, observability_1.emitNervesEvent)({
|
|
136
|
+
component: "friends",
|
|
137
|
+
event: "friends.group_context_upsert_end",
|
|
138
|
+
message: "upserted shared-group participant context",
|
|
139
|
+
meta: {
|
|
140
|
+
participantCount: participants.length,
|
|
141
|
+
updatedCount: results.filter((result) => result.created || result.updated).length,
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
return results;
|
|
145
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AgentMeta } from "./types";
|
|
2
|
+
/** The resolved durable identity of an agent peer — independent of which on-disk
|
|
3
|
+
* shape carried it. All fields optional: a did-less legacy record reads clean. */
|
|
4
|
+
export interface ResolvedAgentIdentity {
|
|
5
|
+
did?: string;
|
|
6
|
+
pinnedKey?: string;
|
|
7
|
+
handle?: string;
|
|
8
|
+
pinnedAt?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Read an agent's durable identity, preferring `meta.identity` and lifting the
|
|
11
|
+
* legacy `meta.a2a.did` on a miss (migrate-on-read). Returns `{}` for a did-less
|
|
12
|
+
* or absent meta. (Unit 4a stub — not implemented.) */
|
|
13
|
+
export declare function resolveAgentIdentity(meta: AgentMeta | undefined): ResolvedAgentIdentity;
|
|
14
|
+
/** Return a meta whose `identity.did` is backfilled from `a2a.did` when the durable
|
|
15
|
+
* home is absent (migrate-on-write); a meta already carrying `identity` is returned
|
|
16
|
+
* unchanged (no clobber). Absent meta is returned as-is. (Unit 4a stub.) */
|
|
17
|
+
export declare function withMigratedIdentity(meta: AgentMeta | undefined): AgentMeta | undefined;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveAgentIdentity = resolveAgentIdentity;
|
|
4
|
+
exports.withMigratedIdentity = withMigratedIdentity;
|
|
5
|
+
// Agent identity migrate-on-read (p11 Item 2 — the DID re-key).
|
|
6
|
+
//
|
|
7
|
+
// The durable identity home is `AgentMeta.identity` ({ did, pinnedKey?, handle?,
|
|
8
|
+
// pinnedAt? }). Legacy records carry only the optional `a2a.did` hint (or nothing).
|
|
9
|
+
// `resolveAgentIdentity` reads either, preferring the durable home and lifting
|
|
10
|
+
// `a2a.did` on a miss (migrate-on-read), mirroring FileGrantStore.normalize's
|
|
11
|
+
// legacy-field handling. `withMigratedIdentity` backfills `identity.did` from
|
|
12
|
+
// `a2a.did` so the next `put` persists it forward (migrate-on-write), matching the
|
|
13
|
+
// resolver's local-id migration + the grant subjectFriendId→subjectKey pattern.
|
|
14
|
+
const observability_1 = require("./observability");
|
|
15
|
+
/** Read an agent's durable identity, preferring `meta.identity` and lifting the
|
|
16
|
+
* legacy `meta.a2a.did` on a miss (migrate-on-read). Returns `{}` for a did-less
|
|
17
|
+
* or absent meta. (Unit 4a stub — not implemented.) */
|
|
18
|
+
function resolveAgentIdentity(meta) {
|
|
19
|
+
if (!meta)
|
|
20
|
+
return {};
|
|
21
|
+
// Durable home wins (authoritative). Spread only the present optional fields so
|
|
22
|
+
// a partial identity ({ did } only) doesn't surface undefined keys. SECURITY
|
|
23
|
+
// (finding 6, LOW): an empty-string did is NOT a did — omit it so it can never be a
|
|
24
|
+
// matchable identity key (ties to findFriendByDid's falsy-did guard, finding 4).
|
|
25
|
+
//
|
|
26
|
+
// NOTE (finding 5-D): when BOTH meta.identity.did and a legacy meta.a2a.did are
|
|
27
|
+
// present and DIVERGE, the durable home silently wins here. That divergence can be a
|
|
28
|
+
// tampering signal (a record's legacy hint disagreeing with its pinned identity).
|
|
29
|
+
// We don't warn from this hot path (resolveAgentIdentity runs per-record in the
|
|
30
|
+
// findFriendByDid scan and per-audit-derivation); a divergence audit belongs in a
|
|
31
|
+
// write-time reconciliation (e.g. withMigratedIdentity / the onboard path), not here.
|
|
32
|
+
if (meta.identity) {
|
|
33
|
+
const { did, pinnedKey, handle, pinnedAt } = meta.identity;
|
|
34
|
+
return {
|
|
35
|
+
...(did ? { did } : {}),
|
|
36
|
+
...(pinnedKey !== undefined ? { pinnedKey } : {}),
|
|
37
|
+
...(handle !== undefined ? { handle } : {}),
|
|
38
|
+
...(pinnedAt !== undefined ? { pinnedAt } : {}),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// Migrate-on-read: lift the legacy a2a.did hint when the durable home is absent.
|
|
42
|
+
// A falsy (absent or empty-string) hint is treated as no-did.
|
|
43
|
+
if (meta.a2a?.did)
|
|
44
|
+
return { did: meta.a2a.did };
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
/** Return a meta whose `identity.did` is backfilled from `a2a.did` when the durable
|
|
48
|
+
* home is absent (migrate-on-write); a meta already carrying `identity` is returned
|
|
49
|
+
* unchanged (no clobber). Absent meta is returned as-is. (Unit 4a stub.) */
|
|
50
|
+
function withMigratedIdentity(meta) {
|
|
51
|
+
if (!meta)
|
|
52
|
+
return undefined;
|
|
53
|
+
// Already carries the durable home → no clobber.
|
|
54
|
+
if (meta.identity)
|
|
55
|
+
return meta;
|
|
56
|
+
// Nothing to migrate from → unchanged. A falsy (absent or empty-string) a2a.did is
|
|
57
|
+
// not a real did to backfill (finding 6).
|
|
58
|
+
if (!meta.a2a?.did)
|
|
59
|
+
return meta;
|
|
60
|
+
// Backfill identity.did from the legacy a2a.did so the next put persists forward.
|
|
61
|
+
(0, observability_1.emitNervesEvent)({
|
|
62
|
+
component: "friends",
|
|
63
|
+
event: "friends.identity_migrated",
|
|
64
|
+
message: "backfilled AgentMeta.identity.did from legacy a2a.did",
|
|
65
|
+
meta: { did: meta.a2a.did },
|
|
66
|
+
});
|
|
67
|
+
return { ...meta, identity: { did: meta.a2a.did } };
|
|
68
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export type { FriendRecord, DelegationGrant, FriendConnection, ExternalId, IdentityProvider, Integration, Channel, TrustLevel, AdmissionState, InitiativePolicy, RelationshipPolicyProvenance, RelationshipPolicyPrimitive, RelationshipPolicyPreference, RelationshipPolicy, AgentMeta, AgentAttribution, RelationshipOutcome, NoteSourceReference, NoteProvenance, ImportedNote, ShareScope, ShareGrant, MissionKey, MissionLearning, ImportedLearning, MissionRecord, CoordinationIntent, CoordinationLogEntry, MissionCoordination, ChannelCapabilities, ResolvedContext, SenseType, } from "./types";
|
|
2
|
+
export type { Facing } from "./channel";
|
|
3
|
+
export type { TrustExplanation, TrustBasis } from "./trust-explanation";
|
|
4
|
+
export type { Standing, StandingTier, StandingTally, StandingExplanation, StandingRule, StandingRuleInput, } from "./standing";
|
|
5
|
+
export type { FriendStore, ExternalIdClaimStore, ExternalIdClaimInput, ExternalIdCreateCandidate, ExternalIdClaimTarget, ExternalIdClaimResult, } from "./store";
|
|
6
|
+
export type { GrantStore } from "./grant-store";
|
|
7
|
+
export type { MissionStore } from "./mission-store";
|
|
8
|
+
export type { FriendResolverParams } from "./resolver";
|
|
9
|
+
export type { GroupContextParticipant, GroupContextUpsertResult, } from "./group-context";
|
|
10
|
+
export type { UsageData } from "./tokens";
|
|
11
|
+
export type { FriendOpResult, FriendOpStatus } from "./results";
|
|
12
|
+
export type { ApplyFriendNoteInput } from "./notes";
|
|
13
|
+
export type { RoomView, RoomMember, RoomKnownVia } from "./room";
|
|
14
|
+
export type { ConsentPolicy, ConsentRecipient, ConsentDecisionInput, } from "./consent";
|
|
15
|
+
export type { AgentVerifier } from "./verifier";
|
|
16
|
+
export type { ProfileShareEnvelope, SharedNote, PrepareProfileShareInput, PrepareProfileShareResult, PrepareProfileShareStatus, ImportProfileShareInput, ImportProfileShareOptions, ImportProfileShareResult, ImportProfileShareStatus, } from "./share";
|
|
17
|
+
export type { GrantShareInput, RevokeShareResult, ListSharesFilter, ListedShare, } from "./grants";
|
|
18
|
+
export { TRUSTED_LEVELS, IDENTITY_SCOPES, isTrustedLevel, isIdentityProvider, isIntegration, isShareScope, isCoordinationIntent, } from "./types";
|
|
19
|
+
export { FileFriendStore } from "./store-file";
|
|
20
|
+
export { FileGrantStore, grantsDirFor } from "./grant-store-file";
|
|
21
|
+
export { FileMissionStore, missionsDirFor } from "./mission-store-file";
|
|
22
|
+
export { openFileBundle } from "./file-bundle";
|
|
23
|
+
export type { FileBundle } from "./file-bundle";
|
|
24
|
+
export { FriendResolver, machineOwnerUsername, isLocalMachineOwnerIdentity, _setMachineOwnerUsernameForTest, } from "./resolver";
|
|
25
|
+
export { getChannelCapabilities, channelToFacing, isRemoteChannel, getAlwaysOnSenseNames, } from "./channel";
|
|
26
|
+
export { describeTrustContext } from "./trust-explanation";
|
|
27
|
+
export { assessStanding, explainStanding, DEFAULT_STANDING_RULE } from "./standing";
|
|
28
|
+
export { upsertGroupContextParticipants } from "./group-context";
|
|
29
|
+
export { accumulateFriendTokens } from "./tokens";
|
|
30
|
+
export { applyFriendNote } from "./notes";
|
|
31
|
+
export { prepareMessage, receiveMessage, MAX_MESSAGE_TEXT_CHARS, MAX_CONVERSATION_ID_CHARS } from "./message";
|
|
32
|
+
export type { MessageEnvelope, ReceivedMessage, PrepareMessageInput, PrepareMessageResult, ReceiveMessageInput, ReceiveMessageOptions, ReceiveMessageResult } from "./message";
|
|
33
|
+
export { checkPinnedDelegationGrant } from "./delegation-grant";
|
|
34
|
+
export type { PinnedDelegationGrant, PinnedDelegationGrantCheck } from "./delegation-grant";
|
|
35
|
+
export { setFriendTrust } from "./trust-mutation";
|
|
36
|
+
export type { SetFriendTrustContext } from "./trust-mutation";
|
|
37
|
+
export { MemoryAuditSink, FileAuditSink, auditPathFor } from "./audit";
|
|
38
|
+
export type { AuditSink, ControlPlaneAuditRecord } from "./audit";
|
|
39
|
+
export { linkExternalId, unlinkExternalId } from "./link-identity";
|
|
40
|
+
export { upsertAgentPeer } from "./agent-peer";
|
|
41
|
+
export { connectAgents } from "./connect";
|
|
42
|
+
export type { ConnectPeer, ConnectAgentsInput, ConnectAgentsDeps, ConnectResult, ConnectStatus } from "./connect";
|
|
43
|
+
export { authorizeConnect } from "./connect-authority";
|
|
44
|
+
export type { AuthorizeConnectInput, ConnectAuthorization } from "./connect-authority";
|
|
45
|
+
export { resolveAgentIdentity, withMigratedIdentity } from "./identity";
|
|
46
|
+
export type { ResolvedAgentIdentity } from "./identity";
|
|
47
|
+
export { findFriendByDid } from "./friend-lookup";
|
|
48
|
+
export { FileRosterStore, rostersDirFor } from "./roster-store-file";
|
|
49
|
+
export type { RosterStore, AccountRoster, RosterPin } from "./roster-store";
|
|
50
|
+
export { identityRosterVerifier, DEFAULT_ROSTER_VERIFIER } from "./roster-verifier";
|
|
51
|
+
export type { RosterVerifier } from "./roster-verifier";
|
|
52
|
+
export { MemoryRosterStore } from "./roster-store-memory";
|
|
53
|
+
export { evaluateAccountMembership, verifiedCandidate, _resetRosterVerifierWarningForTest } from "./account-roster";
|
|
54
|
+
export type { AccountMembershipDecision, AccountMembershipResult, EvaluateAccountMembershipInput, VerifiedCandidate, } from "./account-roster";
|
|
55
|
+
export { recordRelationshipOutcome } from "./outcomes";
|
|
56
|
+
export { recordMission } from "./missions";
|
|
57
|
+
export type { RecordMissionInput } from "./missions";
|
|
58
|
+
export { whoami } from "./whoami";
|
|
59
|
+
export type { WhoamiResult } from "./whoami";
|
|
60
|
+
export { resolveRoom } from "./room";
|
|
61
|
+
export { strictPolicy, trustImpliedPolicy, tieredPolicy, DEFAULT_CONSENT_POLICY, } from "./consent";
|
|
62
|
+
export { tofuVerifier, DEFAULT_AGENT_VERIFIER } from "./verifier";
|
|
63
|
+
export { prepareProfileShare, importProfileShare } from "./share";
|
|
64
|
+
export { prepareMissionShare, importMissionShare } from "./mission-share";
|
|
65
|
+
export type { MissionShareEnvelope, SharedLearning, PrepareMissionShareInput, PrepareMissionShareResult, PrepareMissionShareStatus, ImportMissionShareInput, ImportMissionShareOptions, ImportMissionShareResult, ImportMissionShareStatus, } from "./mission-share";
|
|
66
|
+
export { prepareCoordination, importCoordination } from "./coordination";
|
|
67
|
+
export type { CoordinationEnvelope, PrepareCoordinationInput, PrepareCoordinationResult, PrepareCoordinationStatus, ImportCoordinationInput, ImportCoordinationOptions, ImportCoordinationResult, ImportCoordinationStatus, } from "./coordination";
|
|
68
|
+
export { prepareMissionResult, importMissionResult } from "./mission-result";
|
|
69
|
+
export type { PrepareMissionResultInput, PrepareMissionResultResult, PrepareMissionResultStatus, ImportMissionResultInput, ImportMissionResultOptions, ImportMissionResultResult, ImportMissionResultStatus, } from "./mission-result";
|
|
70
|
+
export type { MissionTaskSpec, MissionResult, MissionResultEnvelope } from "./types";
|
|
71
|
+
export { grantShare, revokeShare, listShares, isGrantEffective } from "./grants";
|
|
72
|
+
export { emitNervesEvent, setNervesEmitter, } from "./observability";
|
|
73
|
+
export type { NervesEvent, NervesEmitter, LogLevel } from "./observability";
|