@agora-server/contract 0.11.0 → 0.13.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.
package/dist/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export * from "./pagination.js";
4
4
  export * from "./errors.js";
5
5
  export * from "./schemas.js";
6
6
  export * from "./secure-chat.js";
7
+ export * from "./social.js";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -6,3 +6,4 @@ export * from "./pagination.js";
6
6
  export * from "./errors.js";
7
7
  export * from "./schemas.js";
8
8
  export * from "./secure-chat.js";
9
+ export * from "./social.js";
package/dist/schemas.d.ts CHANGED
@@ -471,6 +471,16 @@ export declare const refreshSchema: z.ZodObject<{
471
471
  }, {
472
472
  refreshToken: string;
473
473
  }>;
474
+ export declare const grantRoleSchema: z.ZodObject<{
475
+ userId: z.ZodString;
476
+ role: z.ZodEnum<["owner", "admin", "steward"]>;
477
+ }, "strip", z.ZodTypeAny, {
478
+ role: "admin" | "owner" | "steward";
479
+ userId: string;
480
+ }, {
481
+ role: "admin" | "owner" | "steward";
482
+ userId: string;
483
+ }>;
474
484
  export declare const signOutSchema: z.ZodObject<{
475
485
  refreshToken: z.ZodOptional<z.ZodString>;
476
486
  }, "strip", z.ZodTypeAny, {
@@ -505,21 +515,31 @@ export declare const verifyEmailSchema: z.ZodObject<{
505
515
  tokenHash: string;
506
516
  type?: "email" | "signup" | "recovery" | undefined;
507
517
  }>;
518
+ export declare const resetPasswordSchema: z.ZodObject<{
519
+ token: z.ZodString;
520
+ newPassword: z.ZodString;
521
+ }, "strip", z.ZodTypeAny, {
522
+ newPassword: string;
523
+ token: string;
524
+ }, {
525
+ newPassword: string;
526
+ token: string;
527
+ }>;
508
528
  export declare const externalUserSchema: z.ZodEffects<z.ZodObject<{
509
529
  userJwt: z.ZodOptional<z.ZodString>;
510
530
  token: z.ZodOptional<z.ZodString>;
511
531
  }, "strip", z.ZodTypeAny, {
512
- userJwt?: string | undefined;
513
532
  token?: string | undefined;
514
- }, {
515
533
  userJwt?: string | undefined;
534
+ }, {
516
535
  token?: string | undefined;
517
- }>, {
518
536
  userJwt?: string | undefined;
537
+ }>, {
519
538
  token?: string | undefined;
520
- }, {
521
539
  userJwt?: string | undefined;
540
+ }, {
522
541
  token?: string | undefined;
542
+ userJwt?: string | undefined;
523
543
  }>;
524
544
  export declare const signTestingJwtSchema: z.ZodObject<{
525
545
  privateKey: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASyD,CAAC;AAEzF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;EAQ9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;EAOwD,CAAC;AAIzF,eAAO,MAAM,cA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EH,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAMkE,CAAC;AAElG,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAKH,eAAO,MAAM,6BAA6B,+MAehC,CAAC;AASX,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAShC,CAAC;AAKH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;EAMlC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;EAK/B,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;EAOnC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;EAEnC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;EAKmD,CAAC;AAQzF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKqD,CAAC;AAEpF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;EAE0D,CAAC;AAEzF,eAAO,MAAM,qBAAqB;;;;;;EAEhC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;EAGtC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAGH,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
package/dist/schemas.js CHANGED
@@ -178,7 +178,7 @@ export const createReportSchema = z.object({
178
178
  });
179
179
  // ─── auth ──────────────────────────────────────────────────────────────────
180
180
  export const signUpSchema = z.object({
181
- email: z.string().email(),
181
+ email: z.string().email().max(254),
182
182
  password: z.string().min(8).max(128),
183
183
  name: z.string().max(120).optional(),
184
184
  username: z.string().min(1).max(60).optional(),
@@ -190,6 +190,10 @@ export const signInSchema = z.object({
190
190
  export const refreshSchema = z.object({
191
191
  refreshToken: z.string().min(1),
192
192
  });
193
+ export const grantRoleSchema = z.object({
194
+ userId: z.string().uuid(),
195
+ role: z.enum(["owner", "admin", "steward"]),
196
+ });
193
197
  export const signOutSchema = z.object({
194
198
  refreshToken: z.string().min(1).optional(),
195
199
  });
@@ -198,12 +202,16 @@ export const changePasswordSchema = z.object({
198
202
  newPassword: z.string().min(8).max(128),
199
203
  });
200
204
  export const emailSchema = z.object({
201
- email: z.string().email(),
205
+ email: z.string().email().max(254),
202
206
  });
203
207
  export const verifyEmailSchema = z.object({
204
208
  tokenHash: z.string().min(1),
205
209
  type: z.enum(["signup", "email", "recovery"]).optional(),
206
210
  });
211
+ export const resetPasswordSchema = z.object({
212
+ token: z.string().min(1),
213
+ newPassword: z.string().min(8).max(128),
214
+ });
207
215
  export const externalUserSchema = z
208
216
  .object({
209
217
  // The SDK posts `userJwt`; `token` kept as a legacy alias.
@@ -228,6 +228,22 @@ export declare const uploadKeyBackupSchema: z.ZodObject<{
228
228
  version: number;
229
229
  deviceId?: string | null | undefined;
230
230
  }>;
231
+ export declare const uploadRestoreBlobSchema: z.ZodObject<{
232
+ conversationId: z.ZodString;
233
+ fromDeviceId: z.ZodString;
234
+ targetDeviceId: z.ZodString;
235
+ blob: z.ZodString;
236
+ }, "strip", z.ZodTypeAny, {
237
+ targetDeviceId: string;
238
+ blob: string;
239
+ conversationId: string;
240
+ fromDeviceId: string;
241
+ }, {
242
+ targetDeviceId: string;
243
+ blob: string;
244
+ conversationId: string;
245
+ fromDeviceId: string;
246
+ }>;
231
247
  export type RegisterDeviceBody = z.input<typeof registerDeviceSchema>;
232
248
  export type PublishKeyPackagesBody = z.input<typeof publishKeyPackagesSchema>;
233
249
  export type CreateSecureConversationBody = z.input<typeof createSecureConversationSchema>;
@@ -235,6 +251,7 @@ export type AddSecureMemberBody = z.input<typeof addSecureMemberSchema>;
235
251
  export type RemoveSecureMemberBody = z.input<typeof removeSecureMemberSchema>;
236
252
  export type SendSecureMessageBody = z.input<typeof sendSecureMessageSchema>;
237
253
  export type UploadKeyBackupBody = z.input<typeof uploadKeyBackupSchema>;
254
+ export type UploadRestoreBlobBody = z.input<typeof uploadRestoreBlobSchema>;
238
255
  export type WelcomeEnvelope = z.input<typeof welcomeSchema>;
239
256
  export type HandshakeBlob = z.input<typeof handshakeBlobSchema>;
240
257
  export interface SecureDeviceModel {
@@ -321,4 +338,16 @@ export interface SecureKeyBackupModel {
321
338
  createdAt: string;
322
339
  updatedAt: string;
323
340
  }
341
+ export interface RestoreBlobModel {
342
+ blobId: string;
343
+ conversationId: string;
344
+ fromDeviceId: string;
345
+ blob: string;
346
+ createdAt: string;
347
+ expiresAt: string;
348
+ }
349
+ export interface UploadRestoreBlobResponse {
350
+ blobId: string;
351
+ expiresAt: string;
352
+ }
324
353
  //# sourceMappingURL=secure-chat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"secure-chat.d.ts","sourceRoot":"","sources":["../src/secure-chat.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,MAAM,aAIiC,CAAC;AAGrD,eAAO,MAAM,WAAW,aAA2E,CAAC;AAMpG,eAAO,MAAM,aAAa;;;;;;;;;;;;EAIxB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAM/B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYnC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOzC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC;AAEH,eA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AC;IAC9B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAKD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -83,3 +83,26 @@ export const uploadKeyBackupSchema = z.object({
83
83
  cipher: z.enum(["xchacha20poly1305", "aes-256-gcm"]),
84
84
  version: z.number().int().positive(),
85
85
  });
86
+ // Restore blobs are bulk history (up to MAX_SECURE_RESTORE_BLOB_BYTES, default 16 MiB ≈ 22.4M base64
87
+ // chars) — larger than `base64`'s ~12 MiB pre-decode guard. Use a roomier guard sized above the default
88
+ // server cap so the REAL limit is enforced server-side as a 413 (secure-chat/restore-blob-too-large) —
89
+ // the SDK's chunk/INLINE fallback signal — instead of being preempted here as a 400. The absurd-length
90
+ // fast-fail still applies.
91
+ const MAX_RESTORE_B64_CHARS = 33_554_432; // ~24 MiB decoded
92
+ const restoreBlobBase64 = z
93
+ .string()
94
+ .min(1)
95
+ .max(MAX_RESTORE_B64_CHARS)
96
+ .regex(/^[A-Za-z0-9+/]+={0,2}$/, "must be base64");
97
+ // Upload a restore-history blob (IUC "history restore on a re-provisioned device", ENVELOPE variant):
98
+ // one opaque, client-sealed AEAD blob that device A couriers to a re-joined device B off the MLS
99
+ // channel. The decryption key K travels ONLY over MLS — it is NEVER a field here. fromDeviceId /
100
+ // targetDeviceId are device ROW ids; the server enforces caller-owns-fromDeviceId + both devices'
101
+ // users are members of conversationId. The real DECODED byte cap is server-side
102
+ // (MAX_SECURE_RESTORE_BLOB_BYTES). See apps/secure-chat/docs/RESTORE.md.
103
+ export const uploadRestoreBlobSchema = z.object({
104
+ conversationId: z.string().uuid(),
105
+ fromDeviceId: z.string().uuid(),
106
+ targetDeviceId: z.string().uuid(),
107
+ blob: restoreBlobBase64,
108
+ });
@@ -0,0 +1,272 @@
1
+ import { z } from "zod";
2
+ export declare const SOCIAL_PRIVACY_TIERS: readonly ["community", "corporate"];
3
+ export type SocialPrivacyTier = (typeof SOCIAL_PRIVACY_TIERS)[number];
4
+ export declare const CORPORATE_ONLY_FLAGS: readonly ["influenceScoresEnabled", "siloDetectionEnabled", "engagementScoresEnabled", "frictionAnalyticsEnabled", "readReceiptsAllowed"];
5
+ export type CorporateOnlyFlag = (typeof CORPORATE_ONLY_FLAGS)[number];
6
+ export interface ResolvedSocialConfig {
7
+ privacyTier: SocialPrivacyTier;
8
+ graphEnabled: boolean;
9
+ weatherEnabled: boolean;
10
+ constellationEnabled: boolean;
11
+ constellationKFloor: number;
12
+ neighborhoodEnabled: boolean;
13
+ /** When true, a member's Neighborhood also includes people they've recently *interacted* with (not
14
+ * just follows/connections). Default false — the project-wide default; a member can override it for
15
+ * their own view via the endpoint's `?includeInteractions=` query param. */
16
+ neighborhoodIncludeInteractions: boolean;
17
+ influenceScoresEnabled: boolean;
18
+ siloDetectionEnabled: boolean;
19
+ engagementScoresEnabled: boolean;
20
+ frictionVisibleToStewards: boolean;
21
+ frictionAnalyticsEnabled: boolean;
22
+ readAffinityEnabled: boolean;
23
+ readReceiptsAllowed: boolean;
24
+ warmthHalfLifeDays: number;
25
+ frictionHalfLifeDays: number;
26
+ }
27
+ export declare const SOCIAL_TIER_DEFAULTS: Record<SocialPrivacyTier, ResolvedSocialConfig>;
28
+ export declare const socialConfigSchema: z.ZodObject<{
29
+ privacyTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<["community", "corporate"]>>>;
30
+ graphEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
31
+ weatherEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
32
+ constellationEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
33
+ constellationKFloor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
34
+ neighborhoodEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
35
+ neighborhoodIncludeInteractions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
36
+ influenceScoresEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
37
+ siloDetectionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
38
+ engagementScoresEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
39
+ frictionVisibleToStewards: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
40
+ frictionAnalyticsEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
41
+ readAffinityEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
42
+ readReceiptsAllowed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
43
+ warmthHalfLifeDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
44
+ frictionHalfLifeDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ influenceScoresEnabled?: boolean | null | undefined;
47
+ siloDetectionEnabled?: boolean | null | undefined;
48
+ engagementScoresEnabled?: boolean | null | undefined;
49
+ frictionAnalyticsEnabled?: boolean | null | undefined;
50
+ readReceiptsAllowed?: boolean | null | undefined;
51
+ privacyTier?: "community" | "corporate" | null | undefined;
52
+ graphEnabled?: boolean | null | undefined;
53
+ weatherEnabled?: boolean | null | undefined;
54
+ constellationEnabled?: boolean | null | undefined;
55
+ constellationKFloor?: number | null | undefined;
56
+ neighborhoodEnabled?: boolean | null | undefined;
57
+ neighborhoodIncludeInteractions?: boolean | null | undefined;
58
+ frictionVisibleToStewards?: boolean | null | undefined;
59
+ readAffinityEnabled?: boolean | null | undefined;
60
+ warmthHalfLifeDays?: number | null | undefined;
61
+ frictionHalfLifeDays?: number | null | undefined;
62
+ }, {
63
+ influenceScoresEnabled?: boolean | null | undefined;
64
+ siloDetectionEnabled?: boolean | null | undefined;
65
+ engagementScoresEnabled?: boolean | null | undefined;
66
+ frictionAnalyticsEnabled?: boolean | null | undefined;
67
+ readReceiptsAllowed?: boolean | null | undefined;
68
+ privacyTier?: "community" | "corporate" | null | undefined;
69
+ graphEnabled?: boolean | null | undefined;
70
+ weatherEnabled?: boolean | null | undefined;
71
+ constellationEnabled?: boolean | null | undefined;
72
+ constellationKFloor?: number | null | undefined;
73
+ neighborhoodEnabled?: boolean | null | undefined;
74
+ neighborhoodIncludeInteractions?: boolean | null | undefined;
75
+ frictionVisibleToStewards?: boolean | null | undefined;
76
+ readAffinityEnabled?: boolean | null | undefined;
77
+ warmthHalfLifeDays?: number | null | undefined;
78
+ frictionHalfLifeDays?: number | null | undefined;
79
+ }>;
80
+ export type SocialConfigPatch = z.infer<typeof socialConfigSchema>;
81
+ /** The tier that results from applying `patch` over the currently-stored tier.
82
+ * `privacyTier: null` in a patch clears the override → community default. */
83
+ export declare function resultingSocialTier(patch: {
84
+ privacyTier?: SocialPrivacyTier | null | undefined;
85
+ }, currentTier: SocialPrivacyTier): SocialPrivacyTier;
86
+ /** Reject-on-write: keys in `patch` that the RESULTING tier (after applying the patch's own
87
+ * privacyTier, if any) forbids. Empty array = OK. Pass the currently-STORED tier — the
88
+ * current-vs-resulting derivation happens here so call sites can't get it wrong. */
89
+ export declare function forbiddenSocialKeys(patch: Partial<Record<string, unknown>> & {
90
+ privacyTier?: SocialPrivacyTier | null;
91
+ }, currentTier: SocialPrivacyTier): string[];
92
+ /** Clamp-on-read: overlay stored jsonb onto tier defaults, neutralizing anything the tier forbids. */
93
+ export declare function resolveSocialConfig(raw: unknown): ResolvedSocialConfig;
94
+ export declare const WEATHER_BANDS: readonly ["quiet", "stormy", "overcast", "fine", "sunny"];
95
+ export type WeatherBand = (typeof WEATHER_BANDS)[number];
96
+ export interface SocialWeather {
97
+ /** Mean S_p over the project; null when the graph has no interactions yet. 0..1 rounded to 2dp
98
+ * is a runtime convention of the server's weather computation, not enforced by this type. */
99
+ value: number | null;
100
+ /** Bucketed label, never null. "quiet" is ONLY the no-data sentinel (value === null); a low
101
+ * score with data is "stormy". Band moves with hysteresis — see apps/api lib/social-weather. */
102
+ band: WeatherBand;
103
+ /** value(now) − value(as of 7 days ago), 3dp; null when either window has no data. */
104
+ trend: number | null;
105
+ /** ISO timestamp of computation (results are cached ~1h server-side). */
106
+ asOf: string;
107
+ }
108
+ export declare const NEIGHBORHOOD_TIE_KINDS: readonly ["follow", "connection", "interaction", "coParticipation"];
109
+ export type NeighborhoodTieKind = (typeof NEIGHBORHOOD_TIE_KINDS)[number];
110
+ export interface NeighborhoodTie {
111
+ /** The friend's profile id (= the graph User id). */
112
+ userId: string;
113
+ username: string | null;
114
+ name: string | null;
115
+ avatar: string | null;
116
+ /** Dyadic brightness B(me, them) in [0.15, 1], rounded to 2dp. This is the caller's *tie* warmth —
117
+ * NOT the friend's global S_p, which is never exposed to a member. */
118
+ brightness: number;
119
+ /** Which relationship(s) make this person a tie: a follow, a (mutual) connection, recent
120
+ * interaction, and/or co-participation (commenting in the same thread). A pair whose only edge is
121
+ * friction never appears (friction isn't structure). */
122
+ tieKinds: NeighborhoodTieKind[];
123
+ }
124
+ export interface SocialNeighborhood {
125
+ /** The caller's ties, brightest-first. */
126
+ ties: NeighborhoodTie[];
127
+ /** The effective tie-set rule for this response: when true, interaction-only ties are included
128
+ * (not just follows/connections). Echoes the resolved query-param-or-project-default so a client
129
+ * can reflect the actual state of its toggle. */
130
+ includesInteractions: boolean;
131
+ /** Whether CO_PARTICIPATES (co-commenter) ties were folded into the neighbor set for this response.
132
+ * Echoes the request's ?includeCoParticipates flag (default false). A neutral structural edge: it can
133
+ * only ADD a neighbor (at the floor brightness), never change warmth or friction. */
134
+ includesCoParticipates: boolean;
135
+ /** ISO timestamp of computation. */
136
+ asOf: string;
137
+ }
138
+ export declare const BLOB_SIZE_BUCKETS: readonly ["5–9", "10–19", "20–49", "50–99", "100+"];
139
+ export type BlobSizeBucket = (typeof BLOB_SIZE_BUCKETS)[number];
140
+ export interface ConstellationBlob {
141
+ /** Bucketed member count — coarse on purpose (one of the §12 protections). Never an exact size. */
142
+ size: BlobSizeBucket;
143
+ /** Warmth tint, banded (reuses the Weather band scale). Warmth-only — friction never renders here. */
144
+ warmth: WeatherBand;
145
+ }
146
+ export interface SocialConstellation {
147
+ /** The community's blobs, shuffled — there is NO stable identity or ordering across epochs. Blobs
148
+ * carry no ids, names, or member lists; a cluster smaller than the k-anonymity floor is omitted. */
149
+ blobs: ConstellationBlob[];
150
+ /** ISO timestamp of the materialized snapshot, or null when none has been computed yet ("forming"). */
151
+ asOf: string | null;
152
+ /** Which clustering produced this snapshot (transparency): GDS Louvain, the by-space fallback, or
153
+ * null when not yet materialized. */
154
+ method: "louvain" | "space" | null;
155
+ }
156
+ export declare const SOCIAL_ANALYTICS_REPORTS: readonly ["influence", "silos", "engagement"];
157
+ export type SocialAnalyticsReport = (typeof SOCIAL_ANALYTICS_REPORTS)[number];
158
+ export interface InfluenceMember {
159
+ /** Profile id (= the graph User id). */
160
+ userId: string;
161
+ username: string | null;
162
+ name: string | null;
163
+ avatar: string | null;
164
+ /** GDS PageRank centrality — overall influence across the interaction/structural graph. */
165
+ pageRank: number;
166
+ /** GDS betweenness centrality — how often this person sits on shortest paths (a bridge/broker). */
167
+ betweenness: number;
168
+ }
169
+ export interface SocialInfluence {
170
+ /** Informal leaders, highest PageRank first. */
171
+ leaders: InfluenceMember[];
172
+ /** Bridge people, highest betweenness first. */
173
+ bridges: InfluenceMember[];
174
+ /** ISO timestamp of the materialized snapshot, or null when none has been computed yet. */
175
+ asOf: string | null;
176
+ }
177
+ export interface SiloMember {
178
+ userId: string;
179
+ username: string | null;
180
+ name: string | null;
181
+ avatar: string | null;
182
+ }
183
+ export interface SiloSpace {
184
+ spaceId: string;
185
+ name: string | null;
186
+ /** How many of this silo's members belong to the space — the mapping that labels the cluster. */
187
+ memberCount: number;
188
+ }
189
+ export interface Silo {
190
+ /** Stable only WITHIN a snapshot (the GDS community id); no identity across epochs. */
191
+ id: string;
192
+ /** Exact member count — operator view, no bucketing and no suppression. */
193
+ size: number;
194
+ members: SiloMember[];
195
+ /** The spaces this silo concentrates in, most-represented first — the human label for the cluster. */
196
+ spaces: SiloSpace[];
197
+ }
198
+ export interface SocialSilos {
199
+ silos: Silo[];
200
+ asOf: string | null;
201
+ }
202
+ export declare const CHURN_RISK_BANDS: readonly ["none", "watch", "at-risk"];
203
+ export type ChurnRiskBand = (typeof CHURN_RISK_BANDS)[number];
204
+ export interface EngagementMember {
205
+ userId: string;
206
+ username: string | null;
207
+ name: string | null;
208
+ avatar: string | null;
209
+ /** Current mean inbound brightness S_p (warmth this person receives) — the latest snapshot's value. */
210
+ sP: number;
211
+ /** Trailing per-snapshot S_p series, oldest→newest (one point per weekly epoch in the window). */
212
+ trend: number[];
213
+ /** sP(current) − sP(window start); negative = cooling. */
214
+ delta: number;
215
+ /** Banded churn risk derived from the trend's relative decline over the window. */
216
+ churnRisk: ChurnRiskBand;
217
+ }
218
+ export interface SocialEngagement {
219
+ members: EngagementMember[];
220
+ asOf: string | null;
221
+ }
222
+ export declare const SOCIAL_ANALYTICS_RECOMPUTE_TARGETS: readonly ["influence", "silos", "engagement", "all"];
223
+ export declare const socialAnalyticsRecomputeSchema: z.ZodObject<{
224
+ report: z.ZodOptional<z.ZodNullable<z.ZodEnum<["influence", "silos", "engagement", "all"]>>>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ report?: "influence" | "silos" | "engagement" | "all" | null | undefined;
227
+ }, {
228
+ report?: "influence" | "silos" | "engagement" | "all" | null | undefined;
229
+ }>;
230
+ export type SocialAnalyticsRecompute = z.infer<typeof socialAnalyticsRecomputeSchema>;
231
+ export interface ReadReceiptRecorded {
232
+ recorded: boolean;
233
+ /** ISO timestamp the read was recorded/refreshed. */
234
+ readAt: string;
235
+ }
236
+ export interface ReceiptAnnouncement {
237
+ /** The announcement entity (post) id. */
238
+ entityId: string;
239
+ /** The entity's title, hydrated fresh at read; null when the post has no title. */
240
+ title: string | null;
241
+ /** ISO creation timestamp of the post. */
242
+ createdAt: string;
243
+ /** Distinct active space members who have read this post. */
244
+ readerCount: number;
245
+ /** readerCount / memberCount in [0,1], 2dp — the share of the space that has seen this post. */
246
+ coverage: number;
247
+ }
248
+ export interface ReceiptSpace {
249
+ spaceId: string;
250
+ name: string | null;
251
+ /** Active members of the space — the coverage denominator. */
252
+ memberCount: number;
253
+ /** Recent posts in the space, newest first. */
254
+ announcements: ReceiptAnnouncement[];
255
+ }
256
+ export interface SocialReadReceipts {
257
+ spaces: ReceiptSpace[];
258
+ /** ISO timestamp of the (live) computation. */
259
+ asOf: string;
260
+ }
261
+ /** Coverage = distinct member readers / active members, clamped to [0,1] and rounded to 2dp.
262
+ * Zero members → 0 (no denominator). Pure so it's unit-testable and identical on both sides. */
263
+ export declare function readReceiptCoverage(readerCount: number, memberCount: number): number;
264
+ export declare const readReceiptsToggleSchema: z.ZodObject<{
265
+ enabled: z.ZodBoolean;
266
+ }, "strip", z.ZodTypeAny, {
267
+ enabled: boolean;
268
+ }, {
269
+ enabled: boolean;
270
+ }>;
271
+ export type ReadReceiptsToggle = z.infer<typeof readReceiptsTogg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DED
@@ -0,0 +1,166 @@
1
+ import { z } from "zod";
2
+ // ── Social graph config (projects.social_config jsonb) ──────────────────────────────────────────
3
+ // The community↔corporate privacy switch — see docs/SOCIAL-GRAPH.md §5 and docs/AGORA-CORP.md §4.
4
+ // The tier selects DEFAULTS; stored keys override within what the tier allows. Two enforcement
5
+ // points, both server-side: forbiddenSocialKeys() rejects disallowed writes (400), and
6
+ // resolveSocialConfig() clamps at read time (defense-in-depth for stale flags left behind by a
7
+ // corporate→community switch). Fail closed: garbage resolves to community defaults.
8
+ export const SOCIAL_PRIVACY_TIERS = ["community", "corporate"];
9
+ // Flags that may only be true under the corporate tier. INVARIANT (docs/AGORA-CORP.md §4): the
10
+ // k-anonymity floor is NOT in this list — no tier relaxes it below 5.
11
+ export const CORPORATE_ONLY_FLAGS = [
12
+ "influenceScoresEnabled",
13
+ "siloDetectionEnabled",
14
+ "engagementScoresEnabled",
15
+ "frictionAnalyticsEnabled",
16
+ "readReceiptsAllowed",
17
+ ];
18
+ const COMMUNITY_DEFAULTS = {
19
+ privacyTier: "community",
20
+ graphEnabled: true,
21
+ weatherEnabled: true,
22
+ constellationEnabled: true,
23
+ constellationKFloor: 5,
24
+ neighborhoodEnabled: true,
25
+ neighborhoodIncludeInteractions: false,
26
+ influenceScoresEnabled: false,
27
+ siloDetectionEnabled: false,
28
+ engagementScoresEnabled: false,
29
+ frictionVisibleToStewards: true,
30
+ frictionAnalyticsEnabled: false,
31
+ readAffinityEnabled: true,
32
+ readReceiptsAllowed: false,
33
+ warmthHalfLifeDays: 30,
34
+ frictionHalfLifeDays: 14,
35
+ };
36
+ export const SOCIAL_TIER_DEFAULTS = {
37
+ community: COMMUNITY_DEFAULTS,
38
+ corporate: {
39
+ ...COMMUNITY_DEFAULTS,
40
+ privacyTier: "corporate",
41
+ influenceScoresEnabled: true,
42
+ siloDetectionEnabled: true,
43
+ engagementScoresEnabled: true,
44
+ frictionAnalyticsEnabled: true,
45
+ readReceiptsAllowed: true,
46
+ },
47
+ };
48
+ // PATCH body (admin Settings → Social Graph). Every field nullish: omit = leave unchanged,
49
+ // null = clear the override (→ tier default). Mirrors moderatorConfigSchema.
50
+ export const socialConfigSchema = z.object({
51
+ privacyTier: z.enum(SOCIAL_PRIVACY_TIERS).nullish(),
52
+ graphEnabled: z.boolean().nullish(),
53
+ weatherEnabled: z.boolean().nullish(),
54
+ constellationEnabled: z.boolean().nullish(),
55
+ // LOCKSTEP: schema write bounds (5–1000) must stay aligned with resolver read bounds (intIn 1–1000 + Math.max(5)); change both together.
56
+ constellationKFloor: z.number().int().min(5).max(1000).nullish(),
57
+ neighborhoodEnabled: z.boolean().nullish(),
58
+ neighborhoodIncludeInteractions: z.boolean().nullish(),
59
+ influenceScoresEnabled: z.boolean().nullish(),
60
+ siloDetectionEnabled: z.boolean().nullish(),
61
+ engagementScoresEnabled: z.boolean().nullish(),
62
+ frictionVisibleToStewards: z.boolean().nullish(),
63
+ frictionAnalyticsEnabled: z.boolean().nullish(),
64
+ readAffinityEnabled: z.boolean().nullish(),
65
+ readReceiptsAllowed: z.boolean().nullish(),
66
+ warmthHalfLifeDays: z.number().int().min(1).max(365).nullish(),
67
+ frictionHalfLifeDays: z.number().int().min(1).max(365).nullish(),
68
+ });
69
+ /** The tier that results from applying `patch` over the currently-stored tier.
70
+ * `privacyTier: null` in a patch clears the override → community default. */
71
+ export function resultingSocialTier(patch, currentTier) {
72
+ if (patch.privacyTier === null)
73
+ return "community";
74
+ return patch.privacyTier ?? currentTier;
75
+ }
76
+ /** Reject-on-write: keys in `patch` that the RESULTING tier (after applying the patch's own
77
+ * privacyTier, if any) forbids. Empty array = OK. Pass the currently-STORED tier — the
78
+ * current-vs-resulting derivation happens here so call sites can't get it wrong. */
79
+ export function forbiddenSocialKeys(patch, currentTier) {
80
+ const tier = resultingSocialTier(patch, currentTier);
81
+ if (tier === "corporate")
82
+ return [];
83
+ return CORPORATE_ONLY_FLAGS.filter((k) => patch[k] === true);
84
+ }
85
+ const bool = (v, d) => (typeof v === "boolean" ? v : d);
86
+ const intIn = (v, d, min, max) => typeof v === "number" && Number.isInteger(v) && v >= min && v <= max ? v : d;
87
+ /** Clamp-on-read: overlay stored jsonb onto tier defaults, neutralizing anything the tier forbids. */
88
+ export function resolveSocialConfig(raw) {
89
+ const r = (raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {});
90
+ const tier = SOCIAL_PRIVACY_TIERS.includes(r.privacyTier)
91
+ ? r.privacyTier
92
+ : "community";
93
+ const d = SOCIAL_TIER_DEFAULTS[tier];
94
+ const cfg = {
95
+ privacyTier: tier,
96
+ graphEnabled: bool(r.graphEnabled, d.graphEnabled),
97
+ weatherEnabled: bool(r.weatherEnabled, d.weatherEnabled),
98
+ constellationEnabled: bool(r.constellationEnabled, d.constellationEnabled),
99
+ // LOCKSTEP: resolver read bounds (1–1000 + Math.max(5)) must stay aligned with schema write bounds (min 5, max 1000); change both together.
100
+ // The k-floor clamps UP only — a stored value below 5 is raised, never honored.
101
+ constellationKFloor: Math.max(5, intIn(r.constellationKFloor, d.constellationKFloor, 1, 1000)),
102
+ neighborhoodEnabled: bool(r.neighborhoodEnabled, d.neighborhoodEnabled),
103
+ neighborhoodIncludeInteractions: bool(r.neighborhoodIncludeInteractions, d.neighborhoodIncludeInteractions),
104
+ influenceScoresEnabled: bool(r.influenceScoresEnabled, d.influenceScoresEnabled),
105
+ siloDetectionEnabled: bool(r.siloDetectionEnabled, d.siloDetectionEnabled),
106
+ engagementScoresEnabled: bool(r.engagementScoresEnabled, d.engagementScoresEnabled),
107
+ frictionVisibleToStewards: bool(r.frictionVisibleToStewards, d.frictionVisibleToStewards),
108
+ frictionAnalyticsEnabled: bool(r.frictionAnalyticsEnabled, d.frictionAnalyticsEnabled),
109
+ readAffinityEnabled: bool(r.readAffinityEnabled, d.readAffinityEnabled),
110
+ readReceiptsAllowed: bool(r.readReceiptsAllowed, d.readReceiptsAllowed),
111
+ warmthHalfLifeDays: intIn(r.warmthHalfLifeDays, d.warmthHalfLifeDays, 1, 365),
112
+ frictionHalfLifeDays: intIn(r.frictionHalfLifeDays, d.frictionHalfLifeDays, 1, 365),
113
+ };
114
+ if (tier === "community") {
115
+ for (const k of CORPORATE_ONLY_FLAGS)
116
+ cfg[k] = false;
117
+ }
118
+ return cfg;
119
+ }
120
+ // ── Community Weather (GET /v7/:projectId/social/weather) ───────────────────────────────────────
121
+ // One aggregate scalar — the only place friction shows publicly, as a dip in collective climate
122
+ // (docs/AGORA-SOCIAL.md §5). Safe to publish per the magnitude-regime theorem: friction big enough
123
+ // to move this number involves too many people to single anyone out.
124
+ export const WEATHER_BANDS = ["quiet", "stormy", "overcast", "fine", "sunny"];
125
+ // ── Neighborhood (GET /v7/:projectId/social/neighborhood) ───────────────────────────────────────
126
+ // The most personal Garden lens (docs/AGORA-SOCIAL.md): zoom to YOURSELF — your own named ties, each
127
+ // rendered with its DYADIC brightness B(me, them). Self-view only. The brightness is *your tie's*
128
+ // warmth, NEVER the friend's global score — the asymmetry rule that closes the friction side-channel
129
+ // (cheat-sheet #6). Friction only DIMS an existing tie (FLOOR-bounded, so dim = friction-or-loneliness,
130
+ // unreadable); it never creates one.
131
+ export const NEIGHBORHOOD_TIE_KINDS = ["follow", "connection", "interaction", "coParticipation"];
132
+ // ── Constellation (GET /v7/:projectId/social/constellation) ─────────────────────────────────────
133
+ // The anonymous *shape* of the community (docs/AGORA-SOCIAL.md, §12): cluster blobs — size + warmth
134
+ // tint only, NEVER individual nodes. k-anonymity (clusters below the floor are suppressed), no
135
+ // persistent blob identity (re-clustered fresh each epoch, shuffled), warmth-only (friction never
136
+ // renders as structure). Materialized on a slow seasonal cadence (never per-load — §12), so the read
137
+ // just returns the latest snapshot.
138
+ export const BLOB_SIZE_BUCKETS = ["5–9", "10–19", "20–49", "50–99", "100+"];
139
+ // ── Admin Analytics (corporate tier · operator-only · NAMED) ────────────────────────────────────
140
+ // The corporate counterpart to the Garden (docs/AGORA-CORP.md; docs/SOCIAL-GRAPH.md §7 Phase 4).
141
+ // Unlike the member-facing lenses these NAME real people — the operator is the accountable employer,
142
+ // so the temporal-anonymity protections do NOT apply. Each report is corporate-tier-only, gated by its
143
+ // CORPORATE_ONLY_FLAG (`influenceScoresEnabled` / `siloDetectionEnabled` / `engagementScoresEnabled`),
144
+ // which the community tier forces off. Materialized on a slow (weekly) cadence plus an operator-forced
145
+ // recompute; the reads return the latest snapshot, names hydrated fresh so they never go stale.
146
+ export const SOCIAL_ANALYTICS_REPORTS = ["influence", "silos", "engagement"];
147
+ // Engagement — per-person warmth-RECEIVED (S_p) with a churn-risk trend. GET /admin/social/engagement.
148
+ export const CHURN_RISK_BANDS = ["none", "watch", "at-risk"];
149
+ // POST /admin/social/recompute — operator-forced, synchronous re-materialization. The body selects a
150
+ // single report or "all" (default); the request blocks while GDS runs over the whole graph.
151
+ export const SOCIAL_ANALYTICS_RECOMPUTE_TARGETS = [...SOCIAL_ANALYTICS_REPORTS, "all"];
152
+ export const socialAnalyticsRecomputeSchema = z.object({
153
+ report: z.enum(SOCIAL_ANALYTICS_RECOMPUTE_TARGETS).nullish(),
154
+ });
155
+ /** Coverage = distinct member readers / active members, clamped to [0,1] and rounded to 2dp.
156
+ * Zero members → 0 (no denominator). Pure so it's unit-testable and identical on both sides. */
157
+ export function readReceiptCoverage(readerCount, memberCount) {
158
+ if (memberCount <= 0)
159
+ return 0;
160
+ const c = Math.min(1, Math.max(0, readerCount / memberCount));
161
+ return Math.round(c * 100) / 100;
162
+ }
163
+ // PATCH /admin/social/read-receipts/spaces/:spaceId — operator flips a single space's opt-in.
164
+ export const readReceiptsToggleSchema = z.object({
165
+ enabled: z.boolean(),
166
+ });
package/dist/types.d.ts CHANGED
@@ -94,6 +94,8 @@ export interface AuthUser extends User {
94
94
  }[];
95
95
  authMethods: string[];
96
96
  isOperator: boolean;
97
+ isProjectOwner: boolean;
98
+ isProjectAdmin: boolean;
97
99
  isSteward: boolean;
98
100
  }
99
101
  export type ReportTargetType = "entity" | "comment" | "message";
@@ -122,6 +124,8 @@ export interface AuthContext {
122
124
  userId: string;
123
125
  role: "admin" | "moderator" | "visitor";
124
126
  isOperator: boolean;
127
+ isProjectOwner: boolean;
128
+ isProjectAdmin: boolean;
125
129
  isSteward: boolean;
126
130
  }
127
131
  export type ModerationVerdict = "allow" | "block" | "review";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnE,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;IACxC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CA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C,EAAE,WAAW,GAAG,IAAI,CAAC;CAC/B;AAGD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;CACpB;AAKD,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AAI7D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agora-server/contract",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "description": "Shared Agora API contract — response-model types + zod request schemas (no hono/drizzle).",
6
6
  "license": "Apache-2.0",