@oxy.so/contracts 1.0.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 (147) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +16 -0
  3. package/dist/cjs/.tsbuildinfo +1 -0
  4. package/dist/cjs/accountGraph.js +489 -0
  5. package/dist/cjs/agency.js +439 -0
  6. package/dist/cjs/browserHub.js +215 -0
  7. package/dist/cjs/civic.js +163 -0
  8. package/dist/cjs/commonsSignIn.js +59 -0
  9. package/dist/cjs/deviceBoot.js +50 -0
  10. package/dist/cjs/deviceDirectory.js +189 -0
  11. package/dist/cjs/devicePairing.js +138 -0
  12. package/dist/cjs/deviceSession.js +164 -0
  13. package/dist/cjs/emailAgentContext.js +32 -0
  14. package/dist/cjs/followGraph.js +28 -0
  15. package/dist/cjs/identity.js +258 -0
  16. package/dist/cjs/inboxPush.js +24 -0
  17. package/dist/cjs/index.js +618 -0
  18. package/dist/cjs/inference/accountBilling.js +334 -0
  19. package/dist/cjs/inference/aliaModelRelease.js +262 -0
  20. package/dist/cjs/inference/attribution.js +106 -0
  21. package/dist/cjs/inference/catalogue.js +487 -0
  22. package/dist/cjs/inference/entitlement.js +217 -0
  23. package/dist/cjs/inference/errors.js +309 -0
  24. package/dist/cjs/inference/identifiers.js +224 -0
  25. package/dist/cjs/inference/inbox.js +105 -0
  26. package/dist/cjs/inference/modelDocumentation.js +433 -0
  27. package/dist/cjs/inference/money.js +188 -0
  28. package/dist/cjs/inference/priceVersion.js +110 -0
  29. package/dist/cjs/inference/providerConnection.js +455 -0
  30. package/dist/cjs/inference/request.js +477 -0
  31. package/dist/cjs/inference/routingPolicy.js +318 -0
  32. package/dist/cjs/inference/streamEvents.js +258 -0
  33. package/dist/cjs/inference/usage.js +329 -0
  34. package/dist/cjs/inference/version.js +105 -0
  35. package/dist/cjs/keyRecovery.js +91 -0
  36. package/dist/cjs/keyRotation.js +75 -0
  37. package/dist/cjs/links.js +68 -0
  38. package/dist/cjs/moderationReputation.js +298 -0
  39. package/dist/cjs/oauth.js +66 -0
  40. package/dist/cjs/oxyRecordTypes.js +71 -0
  41. package/dist/cjs/protocol.js +53 -0
  42. package/dist/cjs/recommendations.js +168 -0
  43. package/dist/cjs/reputation.js +297 -0
  44. package/dist/cjs/sessionStatus.js +121 -0
  45. package/dist/cjs/transparency.js +89 -0
  46. package/dist/cjs/updates.js +252 -0
  47. package/dist/cjs/userInvalidation.js +89 -0
  48. package/dist/cjs/userResponse.js +245 -0
  49. package/dist/cjs/username.js +290 -0
  50. package/dist/cjs/webauthn.js +71 -0
  51. package/dist/esm/.tsbuildinfo +1 -0
  52. package/dist/esm/accountGraph.js +480 -0
  53. package/dist/esm/agency.js +436 -0
  54. package/dist/esm/browserHub.js +212 -0
  55. package/dist/esm/civic.js +160 -0
  56. package/dist/esm/commonsSignIn.js +56 -0
  57. package/dist/esm/deviceBoot.js +47 -0
  58. package/dist/esm/deviceDirectory.js +186 -0
  59. package/dist/esm/devicePairing.js +135 -0
  60. package/dist/esm/deviceSession.js +161 -0
  61. package/dist/esm/emailAgentContext.js +29 -0
  62. package/dist/esm/followGraph.js +27 -0
  63. package/dist/esm/identity.js +255 -0
  64. package/dist/esm/inboxPush.js +21 -0
  65. package/dist/esm/index.js +172 -0
  66. package/dist/esm/inference/accountBilling.js +331 -0
  67. package/dist/esm/inference/aliaModelRelease.js +259 -0
  68. package/dist/esm/inference/attribution.js +103 -0
  69. package/dist/esm/inference/catalogue.js +484 -0
  70. package/dist/esm/inference/entitlement.js +214 -0
  71. package/dist/esm/inference/errors.js +306 -0
  72. package/dist/esm/inference/identifiers.js +221 -0
  73. package/dist/esm/inference/inbox.js +102 -0
  74. package/dist/esm/inference/modelDocumentation.js +430 -0
  75. package/dist/esm/inference/money.js +185 -0
  76. package/dist/esm/inference/priceVersion.js +107 -0
  77. package/dist/esm/inference/providerConnection.js +452 -0
  78. package/dist/esm/inference/request.js +474 -0
  79. package/dist/esm/inference/routingPolicy.js +315 -0
  80. package/dist/esm/inference/streamEvents.js +255 -0
  81. package/dist/esm/inference/usage.js +326 -0
  82. package/dist/esm/inference/version.js +102 -0
  83. package/dist/esm/keyRecovery.js +88 -0
  84. package/dist/esm/keyRotation.js +72 -0
  85. package/dist/esm/links.js +65 -0
  86. package/dist/esm/moderationReputation.js +295 -0
  87. package/dist/esm/oauth.js +63 -0
  88. package/dist/esm/oxyRecordTypes.js +68 -0
  89. package/dist/esm/protocol.js +50 -0
  90. package/dist/esm/recommendations.js +165 -0
  91. package/dist/esm/reputation.js +293 -0
  92. package/dist/esm/sessionStatus.js +118 -0
  93. package/dist/esm/transparency.js +86 -0
  94. package/dist/esm/updates.js +249 -0
  95. package/dist/esm/userInvalidation.js +85 -0
  96. package/dist/esm/userResponse.js +240 -0
  97. package/dist/esm/username.js +283 -0
  98. package/dist/esm/webauthn.js +68 -0
  99. package/dist/types/.tsbuildinfo +1 -0
  100. package/dist/types/accountGraph.d.ts +378 -0
  101. package/dist/types/agency.d.ts +2162 -0
  102. package/dist/types/browserHub.d.ts +856 -0
  103. package/dist/types/civic.d.ts +338 -0
  104. package/dist/types/commonsSignIn.d.ts +58 -0
  105. package/dist/types/deviceBoot.d.ts +74 -0
  106. package/dist/types/deviceDirectory.d.ts +1317 -0
  107. package/dist/types/devicePairing.d.ts +130 -0
  108. package/dist/types/deviceSession.d.ts +411 -0
  109. package/dist/types/emailAgentContext.d.ts +248 -0
  110. package/dist/types/followGraph.d.ts +150 -0
  111. package/dist/types/identity.d.ts +402 -0
  112. package/dist/types/inboxPush.d.ts +30 -0
  113. package/dist/types/index.d.ts +100 -0
  114. package/dist/types/inference/accountBilling.d.ts +738 -0
  115. package/dist/types/inference/aliaModelRelease.d.ts +609 -0
  116. package/dist/types/inference/attribution.d.ts +176 -0
  117. package/dist/types/inference/catalogue.d.ts +1618 -0
  118. package/dist/types/inference/entitlement.d.ts +519 -0
  119. package/dist/types/inference/errors.d.ts +242 -0
  120. package/dist/types/inference/identifiers.d.ts +182 -0
  121. package/dist/types/inference/inbox.d.ts +374 -0
  122. package/dist/types/inference/modelDocumentation.d.ts +1603 -0
  123. package/dist/types/inference/money.d.ts +185 -0
  124. package/dist/types/inference/priceVersion.d.ts +182 -0
  125. package/dist/types/inference/providerConnection.d.ts +968 -0
  126. package/dist/types/inference/request.d.ts +2800 -0
  127. package/dist/types/inference/routingPolicy.d.ts +616 -0
  128. package/dist/types/inference/streamEvents.d.ts +950 -0
  129. package/dist/types/inference/usage.d.ts +1164 -0
  130. package/dist/types/inference/version.d.ts +102 -0
  131. package/dist/types/keyRecovery.d.ts +138 -0
  132. package/dist/types/keyRotation.d.ts +103 -0
  133. package/dist/types/links.d.ts +96 -0
  134. package/dist/types/moderationReputation.d.ts +487 -0
  135. package/dist/types/oauth.d.ts +86 -0
  136. package/dist/types/oxyRecordTypes.d.ts +62 -0
  137. package/dist/types/protocol.d.ts +86 -0
  138. package/dist/types/recommendations.d.ts +542 -0
  139. package/dist/types/reputation.d.ts +457 -0
  140. package/dist/types/sessionStatus.d.ts +231 -0
  141. package/dist/types/transparency.d.ts +392 -0
  142. package/dist/types/updates.d.ts +545 -0
  143. package/dist/types/userInvalidation.d.ts +94 -0
  144. package/dist/types/userResponse.d.ts +1706 -0
  145. package/dist/types/username.d.ts +265 -0
  146. package/dist/types/webauthn.d.ts +77 -0
  147. package/package.json +87 -0
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Generic "Oxy Protocol" record surface — the app-agnostic conventions every app
3
+ * follows to decentralize its own content on the shared signed-record substrate.
4
+ *
5
+ * The base `signedRecordEnvelopeSchema` (`./identity`) is the WIRE grammar: a
6
+ * signed envelope whose `type` is an open string and whose `record` is an opaque
7
+ * `Record<string, unknown>`. An app layers its own LEXICON on top of that
8
+ * grammar — a typed projection of the `record` payload, addressed by an
9
+ * AtProto-style `(collection, rkey)` key — WITHOUT forking the envelope schema.
10
+ *
11
+ * ## Recipe — defining an app lexicon record
12
+ *
13
+ * For each record kind an app wants to publish:
14
+ *
15
+ * 1. Define the `record` PAYLOAD schema as a `z.ZodType<XPayload>` (e.g.
16
+ * `app.mention.feed.post` → `mentionPostRecordSchema: z.ZodType<MentionPost>`).
17
+ * This validates ONLY the inner `record`, not the envelope.
18
+ * 2. Declare the `collection` NSID as a constant (e.g.
19
+ * `export const MENTION_POST_COLLECTION = 'app.mention.feed.post'`).
20
+ * 3. Reuse the UNCHANGED {@link signedRecordEnvelopeSchema} for the envelope. The
21
+ * base treats `record` as `z.record(z.unknown())`, so the app validates the
22
+ * envelope with the base schema first, then parses `envelope.record` with its
23
+ * own payload schema. {@link LexiconRecord} is the typed projection that pairs
24
+ * the `(collection, rkey)` key with the parsed payload.
25
+ *
26
+ * The Oxy civic contracts (`./civic`) already follow this convention implicitly:
27
+ * each civic record (`real_life_attestation`, `personhood_vouch`, `credential`,
28
+ * …) ships a `record`-payload schema and is carried by the base envelope.
29
+ *
30
+ * ## Chain-wire shapes
31
+ *
32
+ * {@link ChainHeadResponse} and {@link LogPageResponse} are the shared response
33
+ * shapes every chain store exposes (Oxy's `GET /identity/records/:userId/chain/head`,
34
+ * `GET /identity/head/:userId`, `GET /identity/log/:userId`, and any app node's
35
+ * equivalents). They are defined ONCE here so producers and consumers (the API
36
+ * handlers, the SDK identity/nodes mixins, app nodes) cannot drift.
37
+ *
38
+ * Platform-agnostic — zod only, no react/react-native/expo, ESM-safe.
39
+ */
40
+ import { z } from 'zod';
41
+ import { type SignedRecordEnvelope } from './identity';
42
+ /**
43
+ * The typed projection of a signed envelope's `record` payload, addressed by an
44
+ * AtProto-style `(collection, rkey)` key.
45
+ *
46
+ * - `collection` is the lexicon NSID (e.g. `app.mention.feed.post`) — the
47
+ * envelope's `collection` field.
48
+ * - `rkey` is the record key within the collection (e.g. a post id) — the
49
+ * envelope's `rkey` field.
50
+ * - `record` is the app-typed payload (`TPayload`) the app validated out of the
51
+ * envelope's opaque `record`.
52
+ *
53
+ * This is a COMPILE-TIME convenience only: the wire shape is the base envelope.
54
+ * An app builds a `LexiconRecord<TPayload>` from a verified envelope by parsing
55
+ * `envelope.record` with its own `z.ZodType<TPayload>` payload schema.
56
+ */
57
+ export interface LexiconRecord<TPayload> {
58
+ collection: string;
59
+ rkey: string;
60
+ record: TPayload;
61
+ }
62
+ /**
63
+ * The current head of a subject's per-subject hash chain.
64
+ *
65
+ * `headRecordId` is the content address of the latest record (or `null` when the
66
+ * subject has no chain yet); `seq` is its sequence number (`-1` when there is no
67
+ * chain — so the next record's coordinates are always `seq: head.seq + 1`,
68
+ * genesis `0`, and `prev: head.headRecordId`, genesis `null`); `recordCount` is
69
+ * the total number of records on the chain.
70
+ */
71
+ export interface ChainHeadResponse {
72
+ headRecordId: string | null;
73
+ seq: number;
74
+ recordCount: number;
75
+ }
76
+ export declare const chainHeadResponseSchema: z.ZodType<ChainHeadResponse>;
77
+ /**
78
+ * An ordered page of a subject's verified signed-record chain — the FULL
79
+ * envelopes (so a node or any verifier re-checks them independently). `count` is
80
+ * `records.length`, echoed for convenience.
81
+ */
82
+ export interface LogPageResponse {
83
+ records: SignedRecordEnvelope[];
84
+ count: number;
85
+ }
86
+ export declare const logPageResponseSchema: z.ZodType<LogPageResponse>;
@@ -0,0 +1,542 @@
1
+ /**
2
+ * Recommendation-engine API contracts.
3
+ *
4
+ * SINGLE SOURCE OF TRUTH for the wire shape of the reputation-weighted
5
+ * profile-recommendation surface (`POST /profiles/recommendations`) and the
6
+ * cross-app signal-ingest endpoint (`POST /app-signals/ingest`). The API
7
+ * validates its INPUT/OUTPUT against these schemas; consumer SDKs validate the
8
+ * same definitions, so the producer and every consumer cannot drift.
9
+ *
10
+ * Platform-agnostic — zod is the only runtime dependency (no react / react-native
11
+ * / expo, ESM-safe).
12
+ */
13
+ import { z } from 'zod';
14
+ /** User-type filters a caller may exclude from the recommendation surface. */
15
+ export declare const recommendationExcludeTypeSchema: z.ZodEnum<["federated", "agent", "automated"]>;
16
+ export type RecommendationExcludeType = z.infer<typeof recommendationExcludeTypeSchema>;
17
+ /**
18
+ * A caller-supplied editorial boost. `userIds` are nudged up (or down, for a
19
+ * negative weight) in the ranking; the optional `reason` is for audit/telemetry
20
+ * only and never surfaced to end users. Boost members still pass the eligibility
21
+ * gate — a boost cannot resurrect a private/restricted/ineligible account.
22
+ */
23
+ export declare const recommendationBoostSchema: z.ZodObject<{
24
+ userIds: z.ZodArray<z.ZodString, "many">;
25
+ weight: z.ZodNumber;
26
+ reason: z.ZodOptional<z.ZodString>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ userIds: string[];
29
+ weight: number;
30
+ reason?: string | undefined;
31
+ }, {
32
+ userIds: string[];
33
+ weight: number;
34
+ reason?: string | undefined;
35
+ }>;
36
+ export type RecommendationBoost = z.infer<typeof recommendationBoostSchema>;
37
+ /**
38
+ * Per-request overrides for the scoring signal weights. Every key is optional
39
+ * and clamped server-side to the resolved weight profile's allowed range — a
40
+ * caller can re-weight signals but never escape the profile's bounds.
41
+ */
42
+ export declare const recommendationSignalWeightsSchema: z.ZodObject<{
43
+ graph: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
44
+ completeness: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
45
+ verified: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
46
+ curation: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
47
+ interest: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
48
+ appBoost: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
49
+ repCandidate: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
50
+ affinity: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ verified?: number | undefined;
53
+ graph?: number | undefined;
54
+ completeness?: number | undefined;
55
+ curation?: number | undefined;
56
+ interest?: number | undefined;
57
+ appBoost?: number | undefined;
58
+ repCandidate?: number | undefined;
59
+ affinity?: number | undefined;
60
+ }, {
61
+ verified?: number | undefined;
62
+ graph?: number | undefined;
63
+ completeness?: number | undefined;
64
+ curation?: number | undefined;
65
+ interest?: number | undefined;
66
+ appBoost?: number | undefined;
67
+ repCandidate?: number | undefined;
68
+ affinity?: number | undefined;
69
+ }>;
70
+ export type RecommendationSignalWeights = z.infer<typeof recommendationSignalWeightsSchema>;
71
+ /**
72
+ * Request body for `POST /profiles/recommendations`.
73
+ *
74
+ * `clientId` selects the per-app weight profile (the Application `_id`); when
75
+ * omitted the default profile is used. `excludeIds` removes accounts the caller
76
+ * has already seen/handled; `boosts` and `signalWeights` let the caller bias the
77
+ * ranking within server-enforced bounds.
78
+ */
79
+ export declare const recommendationRequestSchema: z.ZodObject<{
80
+ clientId: z.ZodOptional<z.ZodString>;
81
+ limit: z.ZodOptional<z.ZodNumber>;
82
+ offset: z.ZodOptional<z.ZodNumber>;
83
+ excludeTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["federated", "agent", "automated"]>, "many">>;
84
+ excludeIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
85
+ boosts: z.ZodOptional<z.ZodArray<z.ZodObject<{
86
+ userIds: z.ZodArray<z.ZodString, "many">;
87
+ weight: z.ZodNumber;
88
+ reason: z.ZodOptional<z.ZodString>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ userIds: string[];
91
+ weight: number;
92
+ reason?: string | undefined;
93
+ }, {
94
+ userIds: string[];
95
+ weight: number;
96
+ reason?: string | undefined;
97
+ }>, "many">>;
98
+ signalWeights: z.ZodOptional<z.ZodObject<{
99
+ graph: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
100
+ completeness: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
101
+ verified: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
102
+ curation: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
103
+ interest: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
104
+ appBoost: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
105
+ repCandidate: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
106
+ affinity: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ verified?: number | undefined;
109
+ graph?: number | undefined;
110
+ completeness?: number | undefined;
111
+ curation?: number | undefined;
112
+ interest?: number | undefined;
113
+ appBoost?: number | undefined;
114
+ repCandidate?: number | undefined;
115
+ affinity?: number | undefined;
116
+ }, {
117
+ verified?: number | undefined;
118
+ graph?: number | undefined;
119
+ completeness?: number | undefined;
120
+ curation?: number | undefined;
121
+ interest?: number | undefined;
122
+ appBoost?: number | undefined;
123
+ repCandidate?: number | undefined;
124
+ affinity?: number | undefined;
125
+ }>>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ limit?: number | undefined;
128
+ clientId?: string | undefined;
129
+ offset?: number | undefined;
130
+ excludeTypes?: ("agent" | "federated" | "automated")[] | undefined;
131
+ excludeIds?: string[] | undefined;
132
+ boosts?: {
133
+ userIds: string[];
134
+ weight: number;
135
+ reason?: string | undefined;
136
+ }[] | undefined;
137
+ signalWeights?: {
138
+ verified?: number | undefined;
139
+ graph?: number | undefined;
140
+ completeness?: number | undefined;
141
+ curation?: number | undefined;
142
+ interest?: number | undefined;
143
+ appBoost?: number | undefined;
144
+ repCandidate?: number | undefined;
145
+ affinity?: number | undefined;
146
+ } | undefined;
147
+ }, {
148
+ limit?: number | undefined;
149
+ clientId?: string | undefined;
150
+ offset?: number | undefined;
151
+ excludeTypes?: ("agent" | "federated" | "automated")[] | undefined;
152
+ excludeIds?: string[] | undefined;
153
+ boosts?: {
154
+ userIds: string[];
155
+ weight: number;
156
+ reason?: string | undefined;
157
+ }[] | undefined;
158
+ signalWeights?: {
159
+ verified?: number | undefined;
160
+ graph?: number | undefined;
161
+ completeness?: number | undefined;
162
+ curation?: number | undefined;
163
+ interest?: number | undefined;
164
+ appBoost?: number | undefined;
165
+ repCandidate?: number | undefined;
166
+ affinity?: number | undefined;
167
+ } | undefined;
168
+ }>;
169
+ export type RecommendationRequest = z.infer<typeof recommendationRequestSchema>;
170
+ /** Follower/following counts attached to a recommendation item. */
171
+ export declare const recommendationCountSchema: z.ZodObject<{
172
+ followers: z.ZodNumber;
173
+ following: z.ZodNumber;
174
+ }, "strip", z.ZodTypeAny, {
175
+ following: number;
176
+ followers: number;
177
+ }, {
178
+ following: number;
179
+ followers: number;
180
+ }>;
181
+ export type RecommendationCount = z.infer<typeof recommendationCountSchema>;
182
+ /**
183
+ * A single recommended profile.
184
+ *
185
+ * `name` reuses the canonical {@link userNameSchema} so `name.displayName` is the
186
+ * already-resolved server-side value. `score` and `matchedSignals` are present
187
+ * only on the scored (v2) path; `mutualCount` and `_count` are always present.
188
+ */
189
+ export declare const recommendationItemSchema: z.ZodObject<{
190
+ id: z.ZodString;
191
+ username: z.ZodOptional<z.ZodString>;
192
+ name: z.ZodType<import("./userResponse").UserNameResponse, z.ZodTypeDef, import("./userResponse").UserNameResponse>;
193
+ avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
194
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
195
+ verified: z.ZodOptional<z.ZodBoolean>;
196
+ trustTier: z.ZodOptional<z.ZodString>;
197
+ mutualCount: z.ZodNumber;
198
+ score: z.ZodOptional<z.ZodNumber>;
199
+ matchedSignals: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
200
+ isFederated: z.ZodOptional<z.ZodBoolean>;
201
+ isAgent: z.ZodOptional<z.ZodBoolean>;
202
+ isAutomated: z.ZodOptional<z.ZodBoolean>;
203
+ instance: z.ZodOptional<z.ZodString>;
204
+ _count: z.ZodObject<{
205
+ followers: z.ZodNumber;
206
+ following: z.ZodNumber;
207
+ }, "strip", z.ZodTypeAny, {
208
+ following: number;
209
+ followers: number;
210
+ }, {
211
+ following: number;
212
+ followers: number;
213
+ }>;
214
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
215
+ id: z.ZodString;
216
+ username: z.ZodOptional<z.ZodString>;
217
+ name: z.ZodType<import("./userResponse").UserNameResponse, z.ZodTypeDef, import("./userResponse").UserNameResponse>;
218
+ avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
+ verified: z.ZodOptional<z.ZodBoolean>;
221
+ trustTier: z.ZodOptional<z.ZodString>;
222
+ mutualCount: z.ZodNumber;
223
+ score: z.ZodOptional<z.ZodNumber>;
224
+ matchedSignals: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
225
+ isFederated: z.ZodOptional<z.ZodBoolean>;
226
+ isAgent: z.ZodOptional<z.ZodBoolean>;
227
+ isAutomated: z.ZodOptional<z.ZodBoolean>;
228
+ instance: z.ZodOptional<z.ZodString>;
229
+ _count: z.ZodObject<{
230
+ followers: z.ZodNumber;
231
+ following: z.ZodNumber;
232
+ }, "strip", z.ZodTypeAny, {
233
+ following: number;
234
+ followers: number;
235
+ }, {
236
+ following: number;
237
+ followers: number;
238
+ }>;
239
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
240
+ id: z.ZodString;
241
+ username: z.ZodOptional<z.ZodString>;
242
+ name: z.ZodType<import("./userResponse").UserNameResponse, z.ZodTypeDef, import("./userResponse").UserNameResponse>;
243
+ avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
244
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ verified: z.ZodOptional<z.ZodBoolean>;
246
+ trustTier: z.ZodOptional<z.ZodString>;
247
+ mutualCount: z.ZodNumber;
248
+ score: z.ZodOptional<z.ZodNumber>;
249
+ matchedSignals: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
250
+ isFederated: z.ZodOptional<z.ZodBoolean>;
251
+ isAgent: z.ZodOptional<z.ZodBoolean>;
252
+ isAutomated: z.ZodOptional<z.ZodBoolean>;
253
+ instance: z.ZodOptional<z.ZodString>;
254
+ _count: z.ZodObject<{
255
+ followers: z.ZodNumber;
256
+ following: z.ZodNumber;
257
+ }, "strip", z.ZodTypeAny, {
258
+ following: number;
259
+ followers: number;
260
+ }, {
261
+ following: number;
262
+ followers: number;
263
+ }>;
264
+ }, z.ZodTypeAny, "passthrough">>;
265
+ export type RecommendationItem = z.infer<typeof recommendationItemSchema>;
266
+ /** Wire shape of the recommendation response — an array of items. */
267
+ export declare const recommendationResponseSchema: z.ZodArray<z.ZodObject<{
268
+ id: z.ZodString;
269
+ username: z.ZodOptional<z.ZodString>;
270
+ name: z.ZodType<import("./userResponse").UserNameResponse, z.ZodTypeDef, import("./userResponse").UserNameResponse>;
271
+ avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
272
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
+ verified: z.ZodOptional<z.ZodBoolean>;
274
+ trustTier: z.ZodOptional<z.ZodString>;
275
+ mutualCount: z.ZodNumber;
276
+ score: z.ZodOptional<z.ZodNumber>;
277
+ matchedSignals: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
278
+ isFederated: z.ZodOptional<z.ZodBoolean>;
279
+ isAgent: z.ZodOptional<z.ZodBoolean>;
280
+ isAutomated: z.ZodOptional<z.ZodBoolean>;
281
+ instance: z.ZodOptional<z.ZodString>;
282
+ _count: z.ZodObject<{
283
+ followers: z.ZodNumber;
284
+ following: z.ZodNumber;
285
+ }, "strip", z.ZodTypeAny, {
286
+ following: number;
287
+ followers: number;
288
+ }, {
289
+ following: number;
290
+ followers: number;
291
+ }>;
292
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
293
+ id: z.ZodString;
294
+ username: z.ZodOptional<z.ZodString>;
295
+ name: z.ZodType<import("./userResponse").UserNameResponse, z.ZodTypeDef, import("./userResponse").UserNameResponse>;
296
+ avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
297
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
298
+ verified: z.ZodOptional<z.ZodBoolean>;
299
+ trustTier: z.ZodOptional<z.ZodString>;
300
+ mutualCount: z.ZodNumber;
301
+ score: z.ZodOptional<z.ZodNumber>;
302
+ matchedSignals: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
303
+ isFederated: z.ZodOptional<z.ZodBoolean>;
304
+ isAgent: z.ZodOptional<z.ZodBoolean>;
305
+ isAutomated: z.ZodOptional<z.ZodBoolean>;
306
+ instance: z.ZodOptional<z.ZodString>;
307
+ _count: z.ZodObject<{
308
+ followers: z.ZodNumber;
309
+ following: z.ZodNumber;
310
+ }, "strip", z.ZodTypeAny, {
311
+ following: number;
312
+ followers: number;
313
+ }, {
314
+ following: number;
315
+ followers: number;
316
+ }>;
317
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
318
+ id: z.ZodString;
319
+ username: z.ZodOptional<z.ZodString>;
320
+ name: z.ZodType<import("./userResponse").UserNameResponse, z.ZodTypeDef, import("./userResponse").UserNameResponse>;
321
+ avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
322
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
323
+ verified: z.ZodOptional<z.ZodBoolean>;
324
+ trustTier: z.ZodOptional<z.ZodString>;
325
+ mutualCount: z.ZodNumber;
326
+ score: z.ZodOptional<z.ZodNumber>;
327
+ matchedSignals: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
328
+ isFederated: z.ZodOptional<z.ZodBoolean>;
329
+ isAgent: z.ZodOptional<z.ZodBoolean>;
330
+ isAutomated: z.ZodOptional<z.ZodBoolean>;
331
+ instance: z.ZodOptional<z.ZodString>;
332
+ _count: z.ZodObject<{
333
+ followers: z.ZodNumber;
334
+ following: z.ZodNumber;
335
+ }, "strip", z.ZodTypeAny, {
336
+ following: number;
337
+ followers: number;
338
+ }, {
339
+ following: number;
340
+ followers: number;
341
+ }>;
342
+ }, z.ZodTypeAny, "passthrough">>, "many">;
343
+ export type RecommendationResponse = z.infer<typeof recommendationResponseSchema>;
344
+ /** One endorsement edge an app reports: `ownerId` endorses `memberId`. */
345
+ export declare const appEndorsementInputSchema: z.ZodObject<{
346
+ ownerId: z.ZodString;
347
+ memberId: z.ZodString;
348
+ op: z.ZodDefault<z.ZodEnum<["add", "remove"]>>;
349
+ sourceId: z.ZodOptional<z.ZodString>;
350
+ }, "strip", z.ZodTypeAny, {
351
+ ownerId: string;
352
+ memberId: string;
353
+ op: "add" | "remove";
354
+ sourceId?: string | undefined;
355
+ }, {
356
+ ownerId: string;
357
+ memberId: string;
358
+ op?: "add" | "remove" | undefined;
359
+ sourceId?: string | undefined;
360
+ }>;
361
+ export type AppEndorsementInput = z.infer<typeof appEndorsementInputSchema>;
362
+ /** One interest signal an app reports: how interested `userId` is in a topic. */
363
+ export declare const appInterestInputSchema: z.ZodObject<{
364
+ userId: z.ZodString;
365
+ interestScore: z.ZodNumber;
366
+ }, "strip", z.ZodTypeAny, {
367
+ userId: string;
368
+ interestScore: number;
369
+ }, {
370
+ userId: string;
371
+ interestScore: number;
372
+ }>;
373
+ export type AppInterestInput = z.infer<typeof appInterestInputSchema>;
374
+ /**
375
+ * Request body for `POST /app-signals/ingest` (service token, `signals:write`).
376
+ *
377
+ * At least one of `endorsements` / `interests` must be non-empty — an ingest
378
+ * with neither is a no-op and rejected so a misconfigured caller is surfaced
379
+ * rather than silently succeeding.
380
+ */
381
+ export declare const appUserSignalIngestSchema: z.ZodEffects<z.ZodObject<{
382
+ endorsements: z.ZodOptional<z.ZodArray<z.ZodObject<{
383
+ ownerId: z.ZodString;
384
+ memberId: z.ZodString;
385
+ op: z.ZodDefault<z.ZodEnum<["add", "remove"]>>;
386
+ sourceId: z.ZodOptional<z.ZodString>;
387
+ }, "strip", z.ZodTypeAny, {
388
+ ownerId: string;
389
+ memberId: string;
390
+ op: "add" | "remove";
391
+ sourceId?: string | undefined;
392
+ }, {
393
+ ownerId: string;
394
+ memberId: string;
395
+ op?: "add" | "remove" | undefined;
396
+ sourceId?: string | undefined;
397
+ }>, "many">>;
398
+ interests: z.ZodOptional<z.ZodArray<z.ZodObject<{
399
+ userId: z.ZodString;
400
+ interestScore: z.ZodNumber;
401
+ }, "strip", z.ZodTypeAny, {
402
+ userId: string;
403
+ interestScore: number;
404
+ }, {
405
+ userId: string;
406
+ interestScore: number;
407
+ }>, "many">>;
408
+ }, "strip", z.ZodTypeAny, {
409
+ endorsements?: {
410
+ ownerId: string;
411
+ memberId: string;
412
+ op: "add" | "remove";
413
+ sourceId?: string | undefined;
414
+ }[] | undefined;
415
+ interests?: {
416
+ userId: string;
417
+ interestScore: number;
418
+ }[] | undefined;
419
+ }, {
420
+ endorsements?: {
421
+ ownerId: string;
422
+ memberId: string;
423
+ op?: "add" | "remove" | undefined;
424
+ sourceId?: string | undefined;
425
+ }[] | undefined;
426
+ interests?: {
427
+ userId: string;
428
+ interestScore: number;
429
+ }[] | undefined;
430
+ }>, {
431
+ endorsements?: {
432
+ ownerId: string;
433
+ memberId: string;
434
+ op: "add" | "remove";
435
+ sourceId?: string | undefined;
436
+ }[] | undefined;
437
+ interests?: {
438
+ userId: string;
439
+ interestScore: number;
440
+ }[] | undefined;
441
+ }, {
442
+ endorsements?: {
443
+ ownerId: string;
444
+ memberId: string;
445
+ op?: "add" | "remove" | undefined;
446
+ sourceId?: string | undefined;
447
+ }[] | undefined;
448
+ interests?: {
449
+ userId: string;
450
+ interestScore: number;
451
+ }[] | undefined;
452
+ }>;
453
+ export type AppUserSignalIngest = z.infer<typeof appUserSignalIngestSchema>;
454
+ /**
455
+ * The directed interaction types a consuming app may report between two users.
456
+ * Each type carries a server-side default weight (see the API's
457
+ * `AFFINITY_EVENT_WEIGHTS`); a caller may override the applied weight per event.
458
+ */
459
+ export declare const appAffinityEventTypeSchema: z.ZodEnum<["like", "reply", "boost", "follow", "mention", "profile_view", "quote", "repost"]>;
460
+ export type AppAffinityEventType = z.infer<typeof appAffinityEventTypeSchema>;
461
+ /**
462
+ * One directed interaction event: `fromUserId` interacted with `toUserId`
463
+ * (`type`) at `occurredAt`. The Oxy affinity-graph folds these into a per-app,
464
+ * time-decayed directed affinity edge (`fromUserId → toUserId`).
465
+ *
466
+ * - `weight` (optional) overrides the per-type default weight for this event.
467
+ * - `occurredAt` (optional, ISO) is the event time; absent means "now" at ingest.
468
+ * - `eventId` (optional) makes an event idempotent — a repeated `eventId` for the
469
+ * same application is folded at most once (bounded dedup window).
470
+ */
471
+ export declare const appAffinityEventSchema: z.ZodObject<{
472
+ fromUserId: z.ZodString;
473
+ toUserId: z.ZodString;
474
+ type: z.ZodEnum<["like", "reply", "boost", "follow", "mention", "profile_view", "quote", "repost"]>;
475
+ weight: z.ZodOptional<z.ZodNumber>;
476
+ occurredAt: z.ZodOptional<z.ZodString>;
477
+ eventId: z.ZodOptional<z.ZodString>;
478
+ }, "strip", z.ZodTypeAny, {
479
+ type: "like" | "reply" | "boost" | "follow" | "mention" | "profile_view" | "quote" | "repost";
480
+ fromUserId: string;
481
+ toUserId: string;
482
+ eventId?: string | undefined;
483
+ occurredAt?: string | undefined;
484
+ weight?: number | undefined;
485
+ }, {
486
+ type: "like" | "reply" | "boost" | "follow" | "mention" | "profile_view" | "quote" | "repost";
487
+ fromUserId: string;
488
+ toUserId: string;
489
+ eventId?: string | undefined;
490
+ occurredAt?: string | undefined;
491
+ weight?: number | undefined;
492
+ }>;
493
+ export type AppAffinityEvent = z.infer<typeof appAffinityEventSchema>;
494
+ /**
495
+ * Request body for `POST /app-signals/events` (service token, `signals:write`).
496
+ *
497
+ * A non-empty batch (1..1000) of directed interaction events for the requesting
498
+ * application. Self-edges (`fromUserId === toUserId`) are dropped server-side.
499
+ */
500
+ export declare const appAffinityEventsIngestSchema: z.ZodObject<{
501
+ events: z.ZodArray<z.ZodObject<{
502
+ fromUserId: z.ZodString;
503
+ toUserId: z.ZodString;
504
+ type: z.ZodEnum<["like", "reply", "boost", "follow", "mention", "profile_view", "quote", "repost"]>;
505
+ weight: z.ZodOptional<z.ZodNumber>;
506
+ occurredAt: z.ZodOptional<z.ZodString>;
507
+ eventId: z.ZodOptional<z.ZodString>;
508
+ }, "strip", z.ZodTypeAny, {
509
+ type: "like" | "reply" | "boost" | "follow" | "mention" | "profile_view" | "quote" | "repost";
510
+ fromUserId: string;
511
+ toUserId: string;
512
+ eventId?: string | undefined;
513
+ occurredAt?: string | undefined;
514
+ weight?: number | undefined;
515
+ }, {
516
+ type: "like" | "reply" | "boost" | "follow" | "mention" | "profile_view" | "quote" | "repost";
517
+ fromUserId: string;
518
+ toUserId: string;
519
+ eventId?: string | undefined;
520
+ occurredAt?: string | undefined;
521
+ weight?: number | undefined;
522
+ }>, "many">;
523
+ }, "strip", z.ZodTypeAny, {
524
+ events: {
525
+ type: "like" | "reply" | "boost" | "follow" | "mention" | "profile_view" | "quote" | "repost";
526
+ fromUserId: string;
527
+ toUserId: string;
528
+ eventId?: string | undefined;
529
+ occurredAt?: string | undefined;
530
+ weight?: number | undefined;
531
+ }[];
532
+ }, {
533
+ events: {
534
+ type: "like" | "reply" | "boost" | "follow" | "mention" | "profile_view" | "quote" | "repost";
535
+ fromUserId: string;
536
+ toUserId: string;
537
+ eventId?: string | undefined;
538
+ occurredAt?: string | undefined;
539
+ weight?: number | undefined;
540
+ }[];
541
+ }>;
542
+ export type AppAffinityEventsIngest = z.infer<typeof appAffinityEventsIngestSchema>;