@joe-broadhead/messaging 0.7.1 → 0.8.0

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +214 -2
  2. package/dist/bin/messaging-mcp.js +5043 -4054
  3. package/dist/bin/messaging-relay.js +8263 -5425
  4. package/dist/bin/messaging.js +5982 -4906
  5. package/dist/bin/messagingd.js +19956 -13716
  6. package/dist/lib/modules/core/agent/operations.js +19 -327
  7. package/dist/lib/modules/core/agent/present.js +15 -55
  8. package/dist/lib/modules/core/agent-tools.js +23 -139
  9. package/dist/lib/modules/core/consent.js +1 -1
  10. package/dist/lib/modules/core/conversation/event.js +29 -4
  11. package/dist/lib/modules/core/conversation/guest-invitation.js +42 -0
  12. package/dist/lib/modules/core/conversation/log.js +287 -65
  13. package/dist/lib/modules/core/conversation/request-log.js +158 -0
  14. package/dist/lib/modules/core/conversation/request-seal.js +41 -0
  15. package/dist/lib/modules/core/conversation/requests.js +87 -0
  16. package/dist/lib/modules/core/conversation/seal.js +90 -37
  17. package/dist/lib/modules/core/conversation-agent-tools.js +69 -0
  18. package/dist/lib/modules/core/federation/directory-proof.js +83 -0
  19. package/dist/lib/modules/core/federation/proof-state.js +167 -0
  20. package/dist/lib/modules/core/federation/roster-proof.js +74 -0
  21. package/dist/lib/modules/core/index.js +8 -3
  22. package/dist/lib/modules/core/jelly-host.js +5 -5
  23. package/dist/lib/modules/core/schema/common.js +31 -5
  24. package/dist/lib/modules/core/schema/consent.js +5 -4
  25. package/dist/lib/modules/core/schema/contact-request.js +22 -0
  26. package/dist/lib/modules/core/schema/conv-frames.js +94 -0
  27. package/dist/lib/modules/core/schema/conversation.js +67 -33
  28. package/dist/lib/modules/core/schema/envelope.js +8 -24
  29. package/dist/lib/modules/core/schema/errors.js +4 -3
  30. package/dist/lib/modules/core/schema/guest-invitation.js +13 -0
  31. package/dist/lib/modules/core/schema/index.js +5 -0
  32. package/dist/lib/modules/core/schema/ipc/consent.js +13 -9
  33. package/dist/lib/modules/core/schema/ipc/conversation-views.js +80 -0
  34. package/dist/lib/modules/core/schema/ipc/conversations.js +128 -0
  35. package/dist/lib/modules/core/schema/ipc/device.js +2 -0
  36. package/dist/lib/modules/core/schema/ipc/jelly.js +3 -38
  37. package/dist/lib/modules/core/schema/ipc/shapes.js +14 -72
  38. package/dist/lib/modules/core/schema/ipc/surfaces.js +12 -195
  39. package/dist/lib/modules/core/schema/ipc/tasks.js +31 -0
  40. package/dist/lib/modules/core/schema/ipc.js +18 -44
  41. package/dist/lib/modules/core/testing.js +1 -1
  42. package/dist/lib/modules/core/version.js +1 -1
  43. package/dist/lib/modules/ipc/client.js +10 -2
  44. package/dist/lib/modules/ipc/server.js +14 -5
  45. package/dist/lib/modules/ipc/testing.js +13 -23
  46. package/dist/spec/messaging-v1.md +546 -409
  47. package/dist/third-party-notices.md +1 -1
  48. package/dist/third-party.json +1 -1
  49. package/dist/types/core/agent/operations.d.ts +5 -52
  50. package/dist/types/core/agent/present.d.ts +6 -21
  51. package/dist/types/core/agent-tools.d.ts +263 -442
  52. package/dist/types/core/conversation/event.d.ts +6 -6
  53. package/dist/types/core/conversation/guest-invitation.d.ts +8 -0
  54. package/dist/types/core/conversation/log.d.ts +28 -13
  55. package/dist/types/core/conversation/request-log.d.ts +24 -0
  56. package/dist/types/core/conversation/request-seal.d.ts +6 -0
  57. package/dist/types/core/conversation/requests.d.ts +14 -0
  58. package/dist/types/core/conversation/seal.d.ts +32 -9
  59. package/dist/types/core/conversation-agent-tools.d.ts +918 -0
  60. package/dist/types/core/federation/directory-proof.d.ts +8 -0
  61. package/dist/types/core/federation/proof-state.d.ts +114 -0
  62. package/dist/types/core/federation/roster-proof.d.ts +7 -0
  63. package/dist/types/core/index.d.ts +10 -5
  64. package/dist/types/core/jelly-host.d.ts +1 -1
  65. package/dist/types/core/schema/common.d.ts +31 -6
  66. package/dist/types/core/schema/consent.d.ts +7 -7
  67. package/dist/types/core/schema/contact-request.d.ts +264 -0
  68. package/dist/types/core/schema/conv-frames.d.ts +1200 -0
  69. package/dist/types/core/schema/conversation.d.ts +1410 -264
  70. package/dist/types/core/schema/envelope.d.ts +83 -130
  71. package/dist/types/core/schema/errors.d.ts +3 -1
  72. package/dist/types/core/schema/guest-invitation.d.ts +51 -0
  73. package/dist/types/core/schema/index.d.ts +5 -0
  74. package/dist/types/core/schema/ipc/consent.d.ts +89 -49
  75. package/dist/types/core/schema/ipc/conversation-views.d.ts +1023 -0
  76. package/dist/types/core/schema/ipc/conversations.d.ts +3987 -0
  77. package/dist/types/core/schema/ipc/device.d.ts +4 -0
  78. package/dist/types/core/schema/ipc/jelly.d.ts +2 -105
  79. package/dist/types/core/schema/ipc/shapes.d.ts +13 -95
  80. package/dist/types/core/schema/ipc/surfaces.d.ts +25 -427
  81. package/dist/types/core/schema/ipc/tasks.d.ts +208 -0
  82. package/dist/types/core/schema/ipc.d.ts +2671 -525
  83. package/dist/types/core/schema/relay.d.ts +8 -4
  84. package/dist/types/core/testing.d.ts +1 -1
  85. package/dist/types/core/version.d.ts +1 -1
  86. package/dist/types/ipc/client.d.ts +4 -1
  87. package/dist/types/ipc/server.d.ts +10 -1
  88. package/dist/types/ipc/testing.d.ts +21 -8
  89. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import type { JellyKey } from "../directory/jelly-token.js";
2
+ import { type ForeignVerifyInput, type ForeignVerifyResult } from "./proof-state.js";
3
+ /** Key resolution is trusted issuer configuration, never keys embedded in a foreign response.
4
+ * `options.heads` may only shrink the recent-head working window (tests exercise eviction with a
5
+ * few heads); it never exceeds FOREIGN_BUDGET.heads. */
6
+ export declare function verifyForeignDirectory(input: ForeignVerifyInput, key: (kid: string) => JellyKey | undefined, options?: {
7
+ heads?: number;
8
+ }): ForeignVerifyResult;
@@ -0,0 +1,114 @@
1
+ export declare const FOREIGN_LIMITS: {
2
+ readonly fetchMs: number;
3
+ readonly headMs: number;
4
+ readonly futureMs: number;
5
+ };
6
+ /** Internal work budgets, independent of transport limits. `heads` bounds the recent-head
7
+ * working window only; the caller's durable archive retains observations beyond it. */
8
+ export declare const FOREIGN_BUDGET: {
9
+ readonly proofBytes: 1048576;
10
+ readonly stateBytes: 4194304;
11
+ readonly nodes: 32768;
12
+ readonly depth: 32;
13
+ readonly rosterEntries: 1024;
14
+ readonly rotations: 64;
15
+ readonly consistency: 64;
16
+ readonly heads: 1024;
17
+ };
18
+ export declare class ForeignInputError extends Error {
19
+ constructor();
20
+ }
21
+ /** Bound traversal before canonicalization allocates/sorts the complete value. No accessors run. */
22
+ export declare function checkForeignValue(value: unknown, maxBytes?: number): void;
23
+ export declare function admitForeignProof(proof: unknown, kind: "directory" | "roster"): void;
24
+ export interface ForeignSubject {
25
+ readonly realm: string;
26
+ readonly person: string;
27
+ }
28
+ export interface ForeignPin {
29
+ readonly kind: "directory" | "roster";
30
+ readonly realm: string;
31
+ /** DirectoryRealmConfig, or { genesis: the pinned genesis hash }. Never supplied by a proof. */
32
+ readonly root: unknown;
33
+ }
34
+ export interface ForeignHead {
35
+ readonly position: number;
36
+ readonly hash: string;
37
+ readonly issuedAt: number;
38
+ readonly expiresAt: number;
39
+ }
40
+ export interface ForeignDevice {
41
+ readonly signingKey: string;
42
+ readonly encryptionKey?: string | undefined;
43
+ readonly keyVersion: number;
44
+ /** Last non-self replacement, retained even after a subsequent self rotation. */
45
+ readonly review: string | null;
46
+ }
47
+ export interface VerifiedForeignRealm {
48
+ readonly realm: string;
49
+ readonly pinDigest: string;
50
+ readonly head: ForeignHead;
51
+ /** Private verifier state. Only previously verified results may supply this. */
52
+ readonly cursor: unknown;
53
+ }
54
+ export interface VerifiedForeignIdentity {
55
+ readonly subject: ForeignSubject;
56
+ readonly head: ForeignHead;
57
+ readonly devices: readonly ForeignDevice[];
58
+ readonly removed: readonly string[];
59
+ readonly erased: boolean;
60
+ readonly proofDigest: string;
61
+ readonly cursor: unknown;
62
+ }
63
+ export interface ForeignVerifyInput {
64
+ readonly pin: ForeignPin;
65
+ readonly subject: ForeignSubject;
66
+ readonly proof: unknown;
67
+ readonly now: number;
68
+ readonly realm?: VerifiedForeignRealm | undefined;
69
+ readonly known?: VerifiedForeignIdentity | undefined;
70
+ /** A locally verified historical observation, looked up in the caller's durable archive. */
71
+ readonly observedHead?: ForeignHead | undefined;
72
+ }
73
+ export interface ForeignVerifiedState {
74
+ readonly realm: VerifiedForeignRealm;
75
+ readonly identity: VerifiedForeignIdentity;
76
+ }
77
+ export type ForeignVerifyResult = ({
78
+ readonly ok: true;
79
+ } & ForeignVerifiedState) | {
80
+ readonly ok: false;
81
+ readonly reason: "stale";
82
+ readonly verified: ForeignVerifiedState;
83
+ readonly evidence: {
84
+ readonly code: string;
85
+ readonly digest: string;
86
+ };
87
+ } | {
88
+ readonly ok: false;
89
+ readonly reason: "invalid" | "root" | "rollback" | "fork";
90
+ readonly evidence: {
91
+ readonly code: string;
92
+ readonly digest: string;
93
+ readonly compatible?: true;
94
+ };
95
+ };
96
+ export declare class ForeignProofError extends Error {
97
+ readonly reason: Extract<ForeignVerifyResult, {
98
+ ok: false;
99
+ }>["reason"];
100
+ readonly code: string;
101
+ readonly compatible: boolean;
102
+ constructor(reason: Extract<ForeignVerifyResult, {
103
+ ok: false;
104
+ }>["reason"], code: string, compatible?: boolean);
105
+ }
106
+ export declare function requireProof(condition: boolean, code: string, reason?: ForeignProofError["reason"], compatible?: boolean): asserts condition;
107
+ export declare function proofDigest(value: unknown): string;
108
+ export declare function proofFailure(error: unknown, proof: unknown): ForeignVerifyResult;
109
+ /** Expiry changes key eligibility, never the authenticated history we must retain. */
110
+ export declare function verifiedProof(verified: ForeignVerifiedState, now: number): ForeignVerifyResult;
111
+ export declare function checkContext(input: ForeignVerifyInput, kind: ForeignPin["kind"]): void;
112
+ export declare function checkHeadTime(head: ForeignHead, now: number): void;
113
+ /** Caller clock only. A future local fetch time (including clock rollback) fails closed. */
114
+ export declare function foreignFresh(head: ForeignHead, fetchedAt: number, now: number): boolean;
@@ -0,0 +1,7 @@
1
+ import { type ForeignVerifyInput, type ForeignVerifyResult } from "./proof-state.js";
2
+ /** Internal until X3-2/3 supplies the normative contract. */
3
+ export declare const DOMAIN: {
4
+ readonly rosterCheckpoint: "messaging/1/federation/roster-checkpoint\n";
5
+ };
6
+ /** Full history only; the caller has separately authorized its disclosure. */
7
+ export declare function verifyForeignRoster(input: ForeignVerifyInput): ForeignVerifyResult;
@@ -1,8 +1,13 @@
1
1
  export * from "./schema/index.js";
2
+ export * from "./conversation-agent-tools.js";
2
3
  export { b64u } from "./b64u.js";
3
4
  export { VERSION } from "./version.js";
4
5
  export { canonicalize } from "./jcs.js";
5
6
  export { parseWire } from "./wire.js";
7
+ export * from "./conversation/requests.js";
8
+ export * from "./conversation/request-log.js";
9
+ export * from "./conversation/request-seal.js";
10
+ export * from "./conversation/guest-invitation.js";
6
11
  export { sha256 } from "./hash.js";
7
12
  export { ulid } from "./ulid.js";
8
13
  export { Identity, IdentityFile, generateIdentity, exportIdentity, importIdentity } from "./identity.js";
@@ -32,14 +37,14 @@ export { createGrant, verifyChain, type GrantArgs, type ChainHop, type ChainCont
32
37
  export { canTransition, isTerminal, isInterrupted } from "./task.js";
33
38
  export { TERMINAL_STATES } from "./schema/a2a.js";
34
39
  export { cleanPeerText, createFence, terminalSafe, displayWidth, HOST_TAGS, PEER_FENCE_TAG, PEER_DATA_NOTICE, provenanceOf, type CleanOptions, type Fence, type FenceAttributes, type FenceOptions, type TerminalOptions } from "./peer-text.js";
35
- export { AgentTool, TOOL_VERBS, TOOL_DESCRIPTIONS, ToolExpect, UNTRUSTED_SENTENCE, TOOL_REMEDIES, STORE_REFUSED_REMEDIES, DONE_STATES, TaskStateName, ToolErrorBody, ToolFiles, a2aTaskState, conversationOf, decodeToolCursor, encodeToolCursor, formatToolAddress, parseToolAddress, taskStateName, toolErrorBody, toolName, type ToolAddress, type ToolAuthor, type ToolChain, type ToolConsent, type ToolCursor, type ToolInput, type ToolOutput, type ToolPart, type ToolTask, type ToolVerb, } from "./agent-tools.js";
36
- export { Operations, type CallSession, type ChatAccess, type OperationsContext, type OperationsHooks, type SendPlan, type ToolLink, } from "./agent/operations.js";
37
- export { agentCan, consentOf, conversationOfPeer, followUpRead, isoOf, presentAgent, presentConvEntry, presentInboxItem, presentLine, presentMail, presentSent, presentTask, presentTaskItem, presentTaskView, } from "./agent/present.js";
40
+ export { AgentTool, TOOL_VERBS, TOOL_DESCRIPTIONS, ToolExpect, UNTRUSTED_SENTENCE, TOOL_REMEDIES, STORE_REFUSED_REMEDIES, DONE_STATES, TaskStateName, ToolErrorBody, ToolFiles, a2aTaskState, formatToolAddress, parseToolAddress, taskStateName, toolErrorBody, toolName, type ToolAddress, type ToolAuthor, type ToolChain, type ToolConsent, type ToolInput, type ToolOutput, type ToolPart, type ToolTask, type ToolVerb, } from "./agent-tools.js";
41
+ export { Operations, type CallSession, type ChatAccess, type OperationsContext, type OperationsHooks, type ToolLink, } from "./agent/operations.js";
42
+ export { agentCan, consentOf, followUpRead, isoOf, presentAgent, presentInboxItem, presentTaskEnvelope, presentTask, presentTaskItem, presentTaskView, } from "./agent/present.js";
38
43
  export { chainPath, compact, delegated, delegationPrompt, EXPECT_TEXT, isSafeId, messageAttributes, validatedAddress, type SessionAddressParts, type ToolFramer, } from "./agent/text.js";
39
44
  export { dmConvId, selfConvId, participantOf, participantPerson, participantAgent } from "./conversation/ids.js";
40
45
  export { admitConvEvent, convEntryHash, convEventDigest, convEventHeader, convEventSigned, convGenesisHash, convLinkHash, signConvEvent, verifyConvEvent, } from "./conversation/event.js";
41
46
  export { chainStep, ReceiverChains, ReceiverChainsState, SenderChain, SenderChainState } from "./conversation/ratchet.js";
42
- export { openConvMeta, openConvMsg, openKeyShares, sealConvMeta, sealConvMsg, sealKeyShares, type ShareRecipient, type UnsealedKeys, type UnsealedMsg, } from "./conversation/seal.js";
43
- export { ConvLog, type ConvApplyOptions, type ConvExpiredEntry, type ConvLiveChecks, type ConvMessage, type ConvParticipant, type ConvSnapshot, type ConvVote, } from "./conversation/log.js";
47
+ export { openConvMeta, openConvMsg, openConvState, openKeyShares, sealConvMeta, sealConvMsg, sealConvState, sealKeyShare, type ShareRecipient, type UnsealedKeys, type UnsealedMsg, type UnsealedOpEvent, type UnsealedStateOp, } from "./conversation/seal.js";
48
+ export { ConvLog, type ConvApplyOptions, type ConvLiveChecks, type ConvMessage, type ConvParticipant, type ConvSnapshot, type ConvVote, } from "./conversation/log.js";
44
49
  export { checkVia, currentLinks, linkReader } from "./conversation/link.js";
45
50
  export { CONTEXT_DEFAULTS, contextKindOf, matchContextRule, resolveContext, seatReads, type ContextConv, type ContextDecision, } from "./conversation/context.js";
@@ -15,7 +15,7 @@ export declare const JELLY_HOST_SKEW_S = 5;
15
15
  export type ActionClass = "view" | "chat" | "local";
16
16
  /**
17
17
  * The class a method grant must name in `cls` for each human- and admin-tier method (spec §8.11): `chat` for
18
- * `person.send`, `conv.markRead` and `notice.ack`, `view` for the read-only human-tier methods, `local` for every
18
+ * line mutations and `notice.ack`, `view` for the read-only human-tier methods, `local` for every
19
19
  * other. A plugin's `jelly` declaration gives each action and read the same class; a test there checks one against
20
20
  * the other.
21
21
  */
@@ -54,6 +54,12 @@ export declare const DOMAIN: {
54
54
  readonly convMsg: "messaging/1/conv-msg";
55
55
  /** Conversations (spec §16.5): HKDF `info` for a sender chain's next chain key. */
56
56
  readonly convChain: "messaging/1/conv-chain";
57
+ readonly request: "messaging/1/contact-request\n";
58
+ readonly requestContent: "messaging/1/contact-request-content\n";
59
+ readonly requestDigest: "messaging/1/contact-request-digest\n";
60
+ readonly requestDecision: "messaging/1/contact-request-decision\n";
61
+ readonly contactAuthorization: "messaging/1/contact-authorization\n";
62
+ readonly guestInvitation: "messaging/1/guest-invitation\n";
57
63
  };
58
64
  /** A2A extension and binding URIs owned by Messaging. */
59
65
  export declare const URI: {
@@ -81,8 +87,6 @@ export declare const HostedPersonId: z.ZodString;
81
87
  export declare const PersonId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
82
88
  /** A channel's name (spec §6.8). Unique among the channels one machine holds, not across the team. */
83
89
  export declare const ChannelName: z.ZodString;
84
- /** A chat room (spec §6.8): `dm:<person>` for a direct human message, `channel:<name>` for a channel. */
85
- export declare const RoomRef: z.ZodString;
86
90
  export declare const SessionName: z.ZodString;
87
91
  export declare const MachineLabel: z.ZodString;
88
92
  export declare const TeamName: z.ZodString;
@@ -90,7 +94,7 @@ export declare const TeamName: z.ZodString;
90
94
  export declare const AgentKind: z.ZodString;
91
95
  /**
92
96
  * The agent kind of the human `messaging` command line (spec §8.2, §8.3): never kept or expired on
93
- * disconnect, refused as a task executor, and the only sender of group addresses.
97
+ * disconnect and refused as a task executor. No sender can use group addresses.
94
98
  */
95
99
  export declare const CLI_AGENT = "cli";
96
100
  /** Milliseconds since the Unix epoch. */
@@ -141,6 +145,8 @@ export declare const LIMITS: {
141
145
  readonly plaintextBytes: 262144;
142
146
  /** Max characters in a single text part. */
143
147
  readonly textPartChars: 65536;
148
+ /** Existing model-visible per-part cap, shared with fenced conversation events. */
149
+ readonly toolTextChars: 32768;
144
150
  /** Max parts in one message. */
145
151
  readonly partsPerMessage: 16;
146
152
  /** Default and max envelope TTL, and the max invite lifetime (`expires − ts`). */
@@ -292,12 +298,32 @@ export declare const LIMITS: {
292
298
  readonly rekeyScheduleMs: number;
293
299
  /** Max chain keys in one sealed key share, and in one `keys` sync of the `self` conversation. */
294
300
  readonly keyShares: 512;
295
- /** Max recipient devices one `keys` event seals to; a larger share is split over several events. */
296
- readonly keySharesPerEvent: 500;
297
301
  /** Max agents one event's `wake` hint names. */
298
302
  readonly wakeHints: 5;
299
303
  /** Max context rules a person holds (spec §16.8). */
300
304
  readonly contextRules: 500;
305
+ /** Relay (spec §7, "Conversation frames"): appends one device makes to one conversation, a burst of this many... */
306
+ readonly convAppendBurst: 20;
307
+ /** ...refilled at this many a minute. */
308
+ readonly convAppendsPerMinute: 60;
309
+ /** Appends to one conversation from all its devices, a minute (burst and refill). */
310
+ readonly convAppendsPerConvPerMinute: 600;
311
+ /** `rekey` ops with a cause the log cannot prove (`device`, `schedule`) per device per conversation, an hour. */
312
+ readonly convRekeysPerHour: 4;
313
+ /** Conversations one device takes part in, through its person (create, add and join refuse past it). */
314
+ readonly convsPerDevice: 5000;
315
+ /** Conversations one device creates, an hour (burst and refill). */
316
+ readonly convCreatesPerHour: 60;
317
+ /** Key-share events in one `conv.share` frame. */
318
+ readonly convSharesPerFrame: 100;
319
+ /** Key shares one sender device holds at the relay for one recipient device in one conversation. */
320
+ readonly convSharesPerPair: 256;
321
+ /** Key shares one device sends to one conversation, a burst of this many, refilled per minute. */
322
+ readonly convSharesPerMinute: 10000;
323
+ /** Entries (and shares) in one `conv.entries` reply. */
324
+ readonly convFetchEntries: 500;
325
+ /** Conversations named in one `conv.head`, and heads in one `conv.heads` reply. */
326
+ readonly convHeads: 500;
301
327
  };
302
328
  /**
303
329
  * True for a relay URL a client may connect to: `wss://`, or `ws://` to a loopback host (`localhost`,
@@ -315,7 +341,6 @@ export type PersonName = z.infer<typeof PersonName>;
315
341
  export type HostedPersonId = z.infer<typeof HostedPersonId>;
316
342
  export type PersonId = z.infer<typeof PersonId>;
317
343
  export type ChannelName = z.infer<typeof ChannelName>;
318
- export type RoomRef = z.infer<typeof RoomRef>;
319
344
  export type SessionName = z.infer<typeof SessionName>;
320
345
  export type MachineLabel = z.infer<typeof MachineLabel>;
321
346
  export type Millis = z.infer<typeof Millis>;
@@ -19,16 +19,16 @@ export declare const AgentMailLevel: z.ZodEnum<{
19
19
  export type AgentMailLevel = z.infer<typeof AgentMailLevel>;
20
20
  /** Mail and tasks from the subject or their agents to the person's agents: `request` holds each one for the person to answer. */
21
21
  export declare const AskLevel: z.ZodEnum<{
22
- open: "open";
23
22
  request: "request";
23
+ open: "open";
24
24
  no: "no";
25
25
  }>;
26
26
  export type AskLevel = z.infer<typeof AskLevel>;
27
- /** Whom a grant is about: one person, or every member of one channel (by its id). */
27
+ /** Whom a grant is about: one person, or the verified participants of one conversation. */
28
28
  export declare const GrantSubject: z.ZodUnion<readonly [z.ZodObject<{
29
29
  person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
30
30
  }, z.core.$strict>, z.ZodObject<{
31
- channel: z.ZodString;
31
+ conv: z.ZodString;
32
32
  }, z.core.$strict>]>;
33
33
  export type GrantSubject = z.infer<typeof GrantSubject>;
34
34
  /**
@@ -49,7 +49,7 @@ export declare const ConsentGrant: z.ZodObject<{
49
49
  subject: z.ZodUnion<readonly [z.ZodObject<{
50
50
  person: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
51
51
  }, z.core.$strict>, z.ZodObject<{
52
- channel: z.ZodString;
52
+ conv: z.ZodString;
53
53
  }, z.core.$strict>]>;
54
54
  chat: z.ZodOptional<z.ZodEnum<{
55
55
  open: "open";
@@ -61,8 +61,8 @@ export declare const ConsentGrant: z.ZodObject<{
61
61
  blocked: "blocked";
62
62
  }>>;
63
63
  ask: z.ZodOptional<z.ZodEnum<{
64
- open: "open";
65
64
  request: "request";
65
+ open: "open";
66
66
  no: "no";
67
67
  }>>;
68
68
  trustedUntil: z.ZodOptional<z.ZodNumber>;
@@ -93,8 +93,8 @@ export declare const CardCan: z.ZodObject<{
93
93
  chat: z.ZodBoolean;
94
94
  agentMail: z.ZodBoolean;
95
95
  ask: z.ZodEnum<{
96
- open: "open";
97
96
  request: "request";
97
+ open: "open";
98
98
  no: "no";
99
99
  }>;
100
100
  trustedUntil: z.ZodOptional<z.ZodNumber>;
@@ -119,8 +119,8 @@ export declare const ContactCard: z.ZodObject<{
119
119
  chat: z.ZodBoolean;
120
120
  agentMail: z.ZodBoolean;
121
121
  ask: z.ZodEnum<{
122
- open: "open";
123
122
  request: "request";
123
+ open: "open";
124
124
  no: "no";
125
125
  }>;
126
126
  trustedUntil: z.ZodOptional<z.ZodNumber>;
@@ -0,0 +1,264 @@
1
+ /** Portable same-realm contact requests (spec §16.11). All proofs are strict and domain-separated. */
2
+ import { z } from "zod";
3
+ export declare const RequestDescriptor: z.ZodObject<{
4
+ id: z.ZodString;
5
+ issuedAt: z.ZodNumber;
6
+ expiresAt: z.ZodNumber;
7
+ commitment: z.ZodString;
8
+ by: z.ZodString;
9
+ sig: z.ZodString;
10
+ v: z.ZodLiteral<"messaging/1">;
11
+ realm: z.ZodString;
12
+ cid: z.ZodString;
13
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
14
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
15
+ }, z.core.$strict>;
16
+ export type RequestDescriptor = z.infer<typeof RequestDescriptor>;
17
+ export declare const RequestOpening: z.ZodObject<{
18
+ salt: z.ZodString;
19
+ text: z.ZodString;
20
+ }, z.core.$strict>;
21
+ export type RequestOpening = z.infer<typeof RequestOpening>;
22
+ export declare const PortableRequest: z.ZodObject<{
23
+ descriptor: z.ZodObject<{
24
+ id: z.ZodString;
25
+ issuedAt: z.ZodNumber;
26
+ expiresAt: z.ZodNumber;
27
+ commitment: z.ZodString;
28
+ by: z.ZodString;
29
+ sig: z.ZodString;
30
+ v: z.ZodLiteral<"messaging/1">;
31
+ realm: z.ZodString;
32
+ cid: z.ZodString;
33
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
34
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
35
+ }, z.core.$strict>;
36
+ opening: z.ZodObject<{
37
+ salt: z.ZodString;
38
+ text: z.ZodString;
39
+ }, z.core.$strict>;
40
+ }, z.core.$strict>;
41
+ export type PortableRequest = z.infer<typeof PortableRequest>;
42
+ /** A block is conveyed as decline. The first valid terminal answer is sequenced in the recipient mailbox. */
43
+ export declare const RequestDecision: z.ZodObject<{
44
+ id: z.ZodString;
45
+ descriptor: z.ZodString;
46
+ answer: z.ZodEnum<{
47
+ accept: "accept";
48
+ decline: "decline";
49
+ }>;
50
+ at: z.ZodNumber;
51
+ by: z.ZodString;
52
+ sig: z.ZodString;
53
+ v: z.ZodLiteral<"messaging/1">;
54
+ realm: z.ZodString;
55
+ cid: z.ZodString;
56
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
57
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
58
+ }, z.core.$strict>;
59
+ export type RequestDecision = z.infer<typeof RequestDecision>;
60
+ export declare const RequestActivation: z.ZodObject<{
61
+ descriptor: z.ZodObject<{
62
+ id: z.ZodString;
63
+ issuedAt: z.ZodNumber;
64
+ expiresAt: z.ZodNumber;
65
+ commitment: z.ZodString;
66
+ by: z.ZodString;
67
+ sig: z.ZodString;
68
+ v: z.ZodLiteral<"messaging/1">;
69
+ realm: z.ZodString;
70
+ cid: z.ZodString;
71
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
72
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
73
+ }, z.core.$strict>;
74
+ decision: z.ZodObject<{
75
+ id: z.ZodString;
76
+ descriptor: z.ZodString;
77
+ answer: z.ZodEnum<{
78
+ accept: "accept";
79
+ decline: "decline";
80
+ }>;
81
+ at: z.ZodNumber;
82
+ by: z.ZodString;
83
+ sig: z.ZodString;
84
+ v: z.ZodLiteral<"messaging/1">;
85
+ realm: z.ZodString;
86
+ cid: z.ZodString;
87
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
88
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
89
+ }, z.core.$strict>;
90
+ }, z.core.$strict>;
91
+ export type RequestActivation = z.infer<typeof RequestActivation>;
92
+ /** Existing contacts authorize the exact human DM on both sides, under their current local grants. */
93
+ export declare const ContactAuthorization: z.ZodObject<{
94
+ at: z.ZodNumber;
95
+ by: z.ZodString;
96
+ sig: z.ZodString;
97
+ v: z.ZodLiteral<"messaging/1">;
98
+ realm: z.ZodString;
99
+ cid: z.ZodString;
100
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
101
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
102
+ }, z.core.$strict>;
103
+ export type ContactAuthorization = z.infer<typeof ContactAuthorization>;
104
+ export declare const ActivationProof: z.ZodUnion<readonly [z.ZodObject<{
105
+ descriptor: z.ZodObject<{
106
+ id: z.ZodString;
107
+ issuedAt: z.ZodNumber;
108
+ expiresAt: z.ZodNumber;
109
+ commitment: z.ZodString;
110
+ by: z.ZodString;
111
+ sig: z.ZodString;
112
+ v: z.ZodLiteral<"messaging/1">;
113
+ realm: z.ZodString;
114
+ cid: z.ZodString;
115
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
116
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
117
+ }, z.core.$strict>;
118
+ decision: z.ZodObject<{
119
+ id: z.ZodString;
120
+ descriptor: z.ZodString;
121
+ answer: z.ZodEnum<{
122
+ accept: "accept";
123
+ decline: "decline";
124
+ }>;
125
+ at: z.ZodNumber;
126
+ by: z.ZodString;
127
+ sig: z.ZodString;
128
+ v: z.ZodLiteral<"messaging/1">;
129
+ realm: z.ZodString;
130
+ cid: z.ZodString;
131
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
132
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
133
+ }, z.core.$strict>;
134
+ }, z.core.$strict>, z.ZodObject<{
135
+ contacts: z.ZodTuple<[z.ZodObject<{
136
+ at: z.ZodNumber;
137
+ by: z.ZodString;
138
+ sig: z.ZodString;
139
+ v: z.ZodLiteral<"messaging/1">;
140
+ realm: z.ZodString;
141
+ cid: z.ZodString;
142
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
143
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
144
+ }, z.core.$strict>, z.ZodObject<{
145
+ at: z.ZodNumber;
146
+ by: z.ZodString;
147
+ sig: z.ZodString;
148
+ v: z.ZodLiteral<"messaging/1">;
149
+ realm: z.ZodString;
150
+ cid: z.ZodString;
151
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
152
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
153
+ }, z.core.$strict>], null>;
154
+ }, z.core.$strict>]>;
155
+ export type ActivationProof = z.infer<typeof ActivationProof>;
156
+ export declare const RequestImport: z.ZodObject<{
157
+ opening: z.ZodObject<{
158
+ salt: z.ZodString;
159
+ text: z.ZodString;
160
+ }, z.core.$strict>;
161
+ descriptor: z.ZodObject<{
162
+ id: z.ZodString;
163
+ issuedAt: z.ZodNumber;
164
+ expiresAt: z.ZodNumber;
165
+ commitment: z.ZodString;
166
+ by: z.ZodString;
167
+ sig: z.ZodString;
168
+ v: z.ZodLiteral<"messaging/1">;
169
+ realm: z.ZodString;
170
+ cid: z.ZodString;
171
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
172
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
173
+ }, z.core.$strict>;
174
+ decision: z.ZodObject<{
175
+ id: z.ZodString;
176
+ descriptor: z.ZodString;
177
+ answer: z.ZodEnum<{
178
+ accept: "accept";
179
+ decline: "decline";
180
+ }>;
181
+ at: z.ZodNumber;
182
+ by: z.ZodString;
183
+ sig: z.ZodString;
184
+ v: z.ZodLiteral<"messaging/1">;
185
+ realm: z.ZodString;
186
+ cid: z.ZodString;
187
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
188
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
189
+ }, z.core.$strict>;
190
+ t: z.ZodLiteral<"request.import">;
191
+ }, z.core.$strict>;
192
+ export type RequestImport = z.infer<typeof RequestImport>;
193
+ /** No opening or request text is sent to the relay. */
194
+ export declare const RequestSettleFrame: z.ZodObject<{
195
+ descriptor: z.ZodObject<{
196
+ id: z.ZodString;
197
+ issuedAt: z.ZodNumber;
198
+ expiresAt: z.ZodNumber;
199
+ commitment: z.ZodString;
200
+ by: z.ZodString;
201
+ sig: z.ZodString;
202
+ v: z.ZodLiteral<"messaging/1">;
203
+ realm: z.ZodString;
204
+ cid: z.ZodString;
205
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
206
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
207
+ }, z.core.$strict>;
208
+ decision: z.ZodObject<{
209
+ id: z.ZodString;
210
+ descriptor: z.ZodString;
211
+ answer: z.ZodEnum<{
212
+ accept: "accept";
213
+ decline: "decline";
214
+ }>;
215
+ at: z.ZodNumber;
216
+ by: z.ZodString;
217
+ sig: z.ZodString;
218
+ v: z.ZodLiteral<"messaging/1">;
219
+ realm: z.ZodString;
220
+ cid: z.ZodString;
221
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
222
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
223
+ }, z.core.$strict>;
224
+ t: z.ZodLiteral<"request.settle">;
225
+ req: z.ZodString;
226
+ }, z.core.$strict>;
227
+ export declare const RequestStateFrame: z.ZodObject<{
228
+ t: z.ZodLiteral<"request.state">;
229
+ req: z.ZodString;
230
+ descriptor: z.ZodObject<{
231
+ id: z.ZodString;
232
+ issuedAt: z.ZodNumber;
233
+ expiresAt: z.ZodNumber;
234
+ commitment: z.ZodString;
235
+ by: z.ZodString;
236
+ sig: z.ZodString;
237
+ v: z.ZodLiteral<"messaging/1">;
238
+ realm: z.ZodString;
239
+ cid: z.ZodString;
240
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
241
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
242
+ }, z.core.$strict>;
243
+ }, z.core.$strict>;
244
+ export declare const RequestSettledFrame: z.ZodObject<{
245
+ t: z.ZodLiteral<"request.settled">;
246
+ req: z.ZodString;
247
+ id: z.ZodString;
248
+ decision: z.ZodOptional<z.ZodObject<{
249
+ id: z.ZodString;
250
+ descriptor: z.ZodString;
251
+ answer: z.ZodEnum<{
252
+ accept: "accept";
253
+ decline: "decline";
254
+ }>;
255
+ at: z.ZodNumber;
256
+ by: z.ZodString;
257
+ sig: z.ZodString;
258
+ v: z.ZodLiteral<"messaging/1">;
259
+ realm: z.ZodString;
260
+ cid: z.ZodString;
261
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
262
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
263
+ }, z.core.$strict>>;
264
+ }, z.core.$strict>;