@oxy.so/contracts 5.2.0 → 5.3.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 (40) hide show
  1. package/dist/cjs/accountGraph.js +8 -5
  2. package/dist/cjs/accountName.js +20 -0
  3. package/dist/cjs/accountSubject.js +4 -2
  4. package/dist/cjs/client/accountGraph.js +2 -0
  5. package/dist/cjs/client/accountName.js +56 -0
  6. package/dist/cjs/client/index.js +12 -4
  7. package/dist/cjs/client/organizations.js +5 -4
  8. package/dist/cjs/index.js +22 -15
  9. package/dist/cjs/organizations.js +3 -7
  10. package/dist/esm/accountGraph.js +9 -6
  11. package/dist/esm/accountName.js +12 -0
  12. package/dist/esm/accountSubject.js +4 -2
  13. package/dist/esm/client/accountGraph.js +2 -0
  14. package/dist/esm/client/accountName.js +51 -0
  15. package/dist/esm/client/index.js +1 -0
  16. package/dist/esm/client/organizations.js +5 -4
  17. package/dist/esm/index.js +1 -0
  18. package/dist/esm/organizations.js +4 -8
  19. package/dist/types/accountAccess.d.ts +5 -5
  20. package/dist/types/accountGraph.d.ts +12 -12
  21. package/dist/types/accountName.d.ts +5 -0
  22. package/dist/types/accountSubject.d.ts +3 -2
  23. package/dist/types/agency.d.ts +28 -28
  24. package/dist/types/client/accountGraph.d.ts +12 -6
  25. package/dist/types/client/accountName.d.ts +48 -0
  26. package/dist/types/client/deviceDirectory.d.ts +3 -3
  27. package/dist/types/client/index.d.ts +1 -0
  28. package/dist/types/client/organizations.d.ts +8 -7
  29. package/dist/types/client/safety.d.ts +2 -2
  30. package/dist/types/deviceDirectory.d.ts +33 -33
  31. package/dist/types/externalIdentity.d.ts +14 -14
  32. package/dist/types/index.d.ts +2 -0
  33. package/dist/types/inference/economics.d.ts +2 -2
  34. package/dist/types/inference/providerConnection.d.ts +4 -4
  35. package/dist/types/notifications.d.ts +4 -4
  36. package/dist/types/organizations.d.ts +41 -40
  37. package/dist/types/safety.d.ts +22 -22
  38. package/dist/types/stickers.d.ts +9 -9
  39. package/dist/types/userResponse.d.ts +42 -42
  40. package/package.json +1 -1
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
5
5
  */
6
+ import { ACCOUNT_TITLE_MAX_LENGTH, accountTitleCheck } from './accountName.js';
6
7
  import { array, boolean, datetime, exact, maxItems, maxLength, minLength, nullable, oneOf, optional, pattern, refine, strictObject, string, trim, url, } from './check.js';
7
8
  /** Real-world identity classification, independent of account topics and permissions. */
8
9
  export const ORGANIZATION_TYPES = [
@@ -22,7 +23,8 @@ export const ORGANIZATION_ALIAS_KINDS = [
22
23
  'misspelling',
23
24
  ];
24
25
  export const ORGANIZATION_CLAIM_DECISIONS = ['pending', 'approved', 'rejected'];
25
- export const ORGANIZATION_NAME_MAX_LENGTH = 300;
26
+ /** An organization's name is a title; the cap is the title policy's. */
27
+ export const ORGANIZATION_NAME_MAX_LENGTH = ACCOUNT_TITLE_MAX_LENGTH;
26
28
  export const ORGANIZATION_ERROR_CODES = [
27
29
  'bad_request',
28
30
  'unauthorized',
@@ -47,9 +49,8 @@ const organizationAlias = strictObject({
47
49
  kind: oneOf(ORGANIZATION_ALIAS_KINDS),
48
50
  language: optional(string(minLength(2), maxLength(35))),
49
51
  });
50
- /** The twin of `organizationNameSchema`. */
51
- export const organizationNameCheck = refine(string(trim, minLength(1), maxLength(ORGANIZATION_NAME_MAX_LENGTH)), (value) => !/[<>]/.test(value) &&
52
- Array.from(value).every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127), 'Organization name must be plain text');
52
+ /** The twin of `organizationNameSchema`: the title policy (`./accountName.ts`). */
53
+ export const organizationNameCheck = accountTitleCheck;
53
54
  const organizationFields = {
54
55
  name: organizationNameCheck,
55
56
  organizationType: oneOf(ORGANIZATION_TYPES),
package/dist/esm/index.js CHANGED
@@ -10,6 +10,7 @@
10
10
  * expo, no `require()` in the ESM build.
11
11
  */
12
12
  export { ACCOUNT_KINDS, accountKindSchema, CHILD_ACCOUNT_KINDS, childAccountKindSchema, isAccountKind, isDelegatedActAsEligibleKind, isOperatorSwitchTargetKind, ACCOUNT_CATEGORY_IDS, ACCOUNT_CATEGORY_KINDS, accountCategoriesSchema, accountCategoryIdSchema, isSelectableAccountCategoryId, kindAcceptsAccountCategories, MAX_ACCOUNT_CATEGORIES, newlyAddedRetiredCategories, RETIRED_ACCOUNT_CATEGORY_IDS, SELECTABLE_ACCOUNT_CATEGORY_IDS, createAccountRequestSchema, accountNameSchema, } from './accountGraph.js';
13
+ export { ACCOUNT_NAME_POLICY_BY_KIND, ACCOUNT_TITLE_DISALLOWED_SOURCE, ACCOUNT_TITLE_MAX_LENGTH, accountNamePolicyForKind, accountTitleSchema, isPlainTextTitle, } from './accountName.js';
13
14
  export { AVATAR_EYE_SPACING, AVATAR_PICKABLE_COLORS, AVATAR_PICKABLE_SHAPES, avatarCharacterFor, avatarCharacterSchema, parseAvatarCharacter, } from './avatarCharacter.js';
14
15
  export { ACCOUNT_ACTOR_NATURES, ACCOUNT_SUBJECT_CONTRACT_VERSION, FINANCIAL_EFFECT_DIRECTIONS, KIND_INDEPENDENT_ACCOUNT_DIMENSIONS, accountActorChainFromSession, accountActorChainSchema, accountActorNatureSchema, accountKindActorNature, accountKindActsAsItself, attributeFinancialEffect, financialEffectAttributionSchema, } from './accountSubject.js';
15
16
  export { usernameSchema, usernameSchemaForAccountKind, isValidUsername, stripDisallowedUsernameCharacters, applyBotUsernameSuffix, USERNAME_MIN_LENGTH, USERNAME_MAX_LENGTH, USERNAME_INVALID_MESSAGE, BOT_USERNAME_INVALID_MESSAGE, RESERVED_USERNAME_MESSAGE, NUMERIC_USERNAME_MESSAGE, } from './username.js';
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
+ import { accountTitleSchema } from './accountName.js';
2
3
  // The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
3
4
  // it is re-exported here so the root entry is unchanged.
4
- import { ORGANIZATION_TYPES, ORGANIZATION_STATUSES, ORGANIZATION_CLAIM_STATUSES, ORGANIZATION_ALIAS_KINDS, ORGANIZATION_CLAIM_DECISIONS, ORGANIZATION_NAME_MAX_LENGTH, ORGANIZATION_ERROR_CODES, } from './client/organizations.js';
5
+ import { ORGANIZATION_TYPES, ORGANIZATION_STATUSES, ORGANIZATION_CLAIM_STATUSES, ORGANIZATION_ALIAS_KINDS, ORGANIZATION_CLAIM_DECISIONS, ORGANIZATION_ERROR_CODES, } from './client/organizations.js';
5
6
  export { ORGANIZATION_TYPES, ORGANIZATION_STATUSES, ORGANIZATION_CLAIM_STATUSES, ORGANIZATION_ALIAS_KINDS, ORGANIZATION_CLAIM_DECISIONS, ORGANIZATION_NAME_MAX_LENGTH, ORGANIZATION_ERROR_CODES, } from './client/organizations.js';
6
7
  const id = z.string().min(1).max(128);
7
8
  const optionalText = (max) => z.string().trim().min(1).max(max).nullable().optional();
@@ -12,13 +13,8 @@ export const organizationAliasSchema = z
12
13
  language: z.string().min(2).max(35).optional(),
13
14
  })
14
15
  .strict();
15
- export const organizationNameSchema = z
16
- .string()
17
- .trim()
18
- .min(1)
19
- .max(ORGANIZATION_NAME_MAX_LENGTH)
20
- .refine((value) => !/[<>]/.test(value) &&
21
- Array.from(value).every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127), 'Organization name must be plain text');
16
+ /** An organization is named by the title policy every non-personal account uses. */
17
+ export const organizationNameSchema = accountTitleSchema;
22
18
  export const createOrganizationSchema = z
23
19
  .object({
24
20
  name: organizationNameSchema,
@@ -69,7 +69,7 @@ export type AccountAccessGrant = z.infer<typeof accountAccessGrantSchema>;
69
69
  export declare const accountAccessVerdictSchema: z.ZodEffects<z.ZodObject<{
70
70
  accountId: z.ZodString;
71
71
  /** `null` when no such account exists. */
72
- kind: z.ZodNullable<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
72
+ kind: z.ZodNullable<z.ZodEnum<["personal", "organization", "project", "bot", "channel", "community"]>>;
73
73
  /** `null` means: this person may not act for this account. */
74
74
  access: z.ZodNullable<z.ZodObject<{
75
75
  role: z.ZodString;
@@ -89,7 +89,7 @@ export declare const accountAccessVerdictSchema: z.ZodEffects<z.ZodObject<{
89
89
  source: "self" | "direct" | "inherited";
90
90
  }>>;
91
91
  }, "strip", z.ZodTypeAny, {
92
- kind: "organization" | "personal" | "project" | "bot" | "channel" | null;
92
+ kind: "personal" | "organization" | "project" | "bot" | "channel" | "community" | null;
93
93
  accountId: string;
94
94
  access: {
95
95
  status: "active";
@@ -98,7 +98,7 @@ export declare const accountAccessVerdictSchema: z.ZodEffects<z.ZodObject<{
98
98
  source: "self" | "direct" | "inherited";
99
99
  } | null;
100
100
  }, {
101
- kind: "organization" | "personal" | "project" | "bot" | "channel" | null;
101
+ kind: "personal" | "organization" | "project" | "bot" | "channel" | "community" | null;
102
102
  accountId: string;
103
103
  access: {
104
104
  status: "active";
@@ -107,7 +107,7 @@ export declare const accountAccessVerdictSchema: z.ZodEffects<z.ZodObject<{
107
107
  source: "self" | "direct" | "inherited";
108
108
  } | null;
109
109
  }>, {
110
- kind: "organization" | "personal" | "project" | "bot" | "channel" | null;
110
+ kind: "personal" | "organization" | "project" | "bot" | "channel" | "community" | null;
111
111
  accountId: string;
112
112
  access: {
113
113
  status: "active";
@@ -116,7 +116,7 @@ export declare const accountAccessVerdictSchema: z.ZodEffects<z.ZodObject<{
116
116
  source: "self" | "direct" | "inherited";
117
117
  } | null;
118
118
  }, {
119
- kind: "organization" | "personal" | "project" | "bot" | "channel" | null;
119
+ kind: "personal" | "organization" | "project" | "bot" | "channel" | "community" | null;
120
120
  accountId: string;
121
121
  access: {
122
122
  status: "active";
@@ -9,7 +9,7 @@
9
9
  import { z } from 'zod';
10
10
  export { ACCOUNT_KINDS, CHILD_ACCOUNT_KINDS, isDelegatedActAsEligibleKind, isOperatorSwitchTargetKind, isAccountKind, ACCOUNT_CATEGORY_IDS, RETIRED_ACCOUNT_CATEGORY_IDS, isSelectableAccountCategoryId, SELECTABLE_ACCOUNT_CATEGORY_IDS, newlyAddedRetiredCategories, MAX_ACCOUNT_CATEGORIES, ACCOUNT_CATEGORY_KINDS, kindAcceptsAccountCategories, } from './client/accountGraph';
11
11
  export type { AccountKind, AccountKindGap, ChildAccountKind, ChildAccountKindGap, AccountCategoryId, AccountCategoryKind, } from './client/accountGraph';
12
- export declare const accountKindSchema: z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>;
12
+ export declare const accountKindSchema: z.ZodEnum<["personal", "organization", "project", "bot", "channel", "community"]>;
13
13
  export declare const childAccountKindSchema: z.ZodEnum<["organization", "project", "bot", "channel"]>;
14
14
  /**
15
15
  * Accepts EVERY id, withdrawn ones included — see rule 3.
@@ -30,7 +30,7 @@ export declare const accountCategoryIdSchema: z.ZodEnum<["news", "politics", "bu
30
30
  * property the list exists to carry. A duplicate only ever comes from a client
31
31
  * bug, and a 400 naming the index is how that bug gets found.
32
32
  */
33
- export declare const accountCategoriesSchema: z.ZodEffects<z.ZodArray<z.ZodEnum<["news", "politics", "business", "startup", "finance", "crypto", "marketplace", "retail", "real_estate", "agency", "landlord", "cooperative", "architecture", "technology", "software", "ai", "security", "automation", "science", "education", "books", "health", "fitness", "sports", "gaming", "music", "film", "podcast", "art", "photography", "comedy", "food", "travel", "fashion", "home_garden", "diy", "automotive", "animals", "family", "nonprofit", "government", "community", "activism", "environment", "religion", "other"]>, "many">, ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "government" | "activism" | "environment" | "religion")[], ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "government" | "activism" | "environment" | "religion")[]>;
33
+ export declare const accountCategoriesSchema: z.ZodEffects<z.ZodArray<z.ZodEnum<["news", "politics", "business", "startup", "finance", "crypto", "marketplace", "retail", "real_estate", "agency", "landlord", "cooperative", "architecture", "technology", "software", "ai", "security", "automation", "science", "education", "books", "health", "fitness", "sports", "gaming", "music", "film", "podcast", "art", "photography", "comedy", "food", "travel", "fashion", "home_garden", "diy", "automotive", "animals", "family", "nonprofit", "government", "community", "activism", "environment", "religion", "other"]>, "many">, ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[], ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[]>;
34
34
  /**
35
35
  * An account's name on the create/update wire.
36
36
  *
@@ -67,7 +67,7 @@ export declare const accountNameSchema: z.ZodOptional<z.ZodObject<{
67
67
  * this route. The refinement the single-valued predecessor needed disappeared
68
68
  * along with the restriction that made it necessary. A child kind that does NOT
69
69
  * accept categories would break that reasoning silently, so
70
- * `__tests__/accountGraph.test.ts` asserts the two lists agree.
70
+ * `__tests__/accountGraph.test.ts` asserts every child kind is a category kind.
71
71
  */
72
72
  export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
73
73
  parentAccountId: z.ZodOptional<z.ZodString>;
@@ -118,7 +118,7 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
118
118
  */
119
119
  color: z.ZodOptional<z.ZodString>;
120
120
  /** Ordered, PRIMARY FIRST — see rule 2 above {@link ACCOUNT_CATEGORY_IDS}. */
121
- accountCategories: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["news", "politics", "business", "startup", "finance", "crypto", "marketplace", "retail", "real_estate", "agency", "landlord", "cooperative", "architecture", "technology", "software", "ai", "security", "automation", "science", "education", "books", "health", "fitness", "sports", "gaming", "music", "film", "podcast", "art", "photography", "comedy", "food", "travel", "fashion", "home_garden", "diy", "automotive", "animals", "family", "nonprofit", "government", "community", "activism", "environment", "religion", "other"]>, "many">, ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "government" | "activism" | "environment" | "religion")[], ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "government" | "activism" | "environment" | "religion")[]>>;
121
+ accountCategories: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["news", "politics", "business", "startup", "finance", "crypto", "marketplace", "retail", "real_estate", "agency", "landlord", "cooperative", "architecture", "technology", "software", "ai", "security", "automation", "science", "education", "books", "health", "fitness", "sports", "gaming", "music", "film", "podcast", "art", "photography", "comedy", "food", "travel", "fashion", "home_garden", "diy", "automotive", "animals", "family", "nonprofit", "government", "community", "activism", "environment", "religion", "other"]>, "many">, ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[], ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[]>>;
122
122
  organizationType: z.ZodOptional<z.ZodEnum<["business", "nonprofit", "public_body", "community", "other"]>>;
123
123
  /**
124
124
  * Create the account already opted OUT of discovery.
@@ -177,12 +177,12 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
177
177
  last?: string | undefined;
178
178
  displayName?: string | undefined;
179
179
  } | undefined;
180
- organizationType?: "business" | "nonprofit" | "public_body" | "community" | "other" | undefined;
180
+ organizationType?: "community" | "business" | "nonprofit" | "other" | "public_body" | undefined;
181
181
  avatar?: string | undefined;
182
182
  parentAccountId?: string | undefined;
183
183
  bio?: string | undefined;
184
184
  description?: string | undefined;
185
- accountCategories?: ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "government" | "activism" | "environment" | "religion")[] | undefined;
185
+ accountCategories?: ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[] | undefined;
186
186
  isPrivateAccount?: boolean | undefined;
187
187
  character?: import("./avatarCharacter").AvatarCharacter | undefined;
188
188
  }, {
@@ -194,12 +194,12 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
194
194
  last?: string | undefined;
195
195
  displayName?: string | undefined;
196
196
  } | undefined;
197
- organizationType?: "business" | "nonprofit" | "public_body" | "community" | "other" | undefined;
197
+ organizationType?: "community" | "business" | "nonprofit" | "other" | "public_body" | undefined;
198
198
  avatar?: string | undefined;
199
199
  parentAccountId?: string | undefined;
200
200
  bio?: string | undefined;
201
201
  description?: string | undefined;
202
- accountCategories?: ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "government" | "activism" | "environment" | "religion")[] | undefined;
202
+ accountCategories?: ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[] | undefined;
203
203
  isPrivateAccount?: boolean | undefined;
204
204
  character?: unknown;
205
205
  }>, {
@@ -211,12 +211,12 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
211
211
  last?: string | undefined;
212
212
  displayName?: string | undefined;
213
213
  } | undefined;
214
- organizationType?: "business" | "nonprofit" | "public_body" | "community" | "other" | undefined;
214
+ organizationType?: "community" | "business" | "nonprofit" | "other" | "public_body" | undefined;
215
215
  avatar?: string | undefined;
216
216
  parentAccountId?: string | undefined;
217
217
  bio?: string | undefined;
218
218
  description?: string | undefined;
219
- accountCategories?: ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "government" | "activism" | "environment" | "religion")[] | undefined;
219
+ accountCategories?: ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[] | undefined;
220
220
  isPrivateAccount?: boolean | undefined;
221
221
  character?: import("./avatarCharacter").AvatarCharacter | undefined;
222
222
  }, {
@@ -228,12 +228,12 @@ export declare const createAccountRequestSchema: z.ZodEffects<z.ZodObject<{
228
228
  last?: string | undefined;
229
229
  displayName?: string | undefined;
230
230
  } | undefined;
231
- organizationType?: "business" | "nonprofit" | "public_body" | "community" | "other" | undefined;
231
+ organizationType?: "community" | "business" | "nonprofit" | "other" | "public_body" | undefined;
232
232
  avatar?: string | undefined;
233
233
  parentAccountId?: string | undefined;
234
234
  bio?: string | undefined;
235
235
  description?: string | undefined;
236
- accountCategories?: ("business" | "nonprofit" | "community" | "other" | "news" | "politics" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "government" | "activism" | "environment" | "religion")[] | undefined;
236
+ accountCategories?: ("community" | "news" | "politics" | "business" | "startup" | "finance" | "crypto" | "marketplace" | "retail" | "real_estate" | "agency" | "landlord" | "cooperative" | "architecture" | "technology" | "software" | "ai" | "security" | "automation" | "science" | "education" | "books" | "health" | "fitness" | "sports" | "gaming" | "music" | "film" | "podcast" | "art" | "photography" | "comedy" | "food" | "travel" | "fashion" | "home_garden" | "diy" | "automotive" | "animals" | "family" | "nonprofit" | "government" | "activism" | "environment" | "religion" | "other")[] | undefined;
237
237
  isPrivateAccount?: boolean | undefined;
238
238
  character?: unknown;
239
239
  }>;
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export { ACCOUNT_NAME_POLICY_BY_KIND, ACCOUNT_TITLE_DISALLOWED_SOURCE, ACCOUNT_TITLE_MAX_LENGTH, accountNamePolicyForKind, isPlainTextTitle, } from './client/accountName';
3
+ export type { AccountNamePolicy } from './client/accountName';
4
+ /** A non-personal account's title — see `./client/accountName.ts` for the policy. */
5
+ export declare const accountTitleSchema: z.ZodEffects<z.ZodString, string, string>;
@@ -41,8 +41,9 @@ export declare const ACCOUNT_SUBJECT_CONTRACT_VERSION: 1;
41
41
  * - `person` — a human; a personal account is its own actor.
42
42
  * - `agent` — an AI agent; a bot is its own actor (ADR 0018 `ActorRef`
43
43
  * `{type:'agent'}`), and audit records the bot, never the human who owns it.
44
- * - `operated` — never its own actor. An organization, project or channel only
45
- * acts through a member, and that member is the actor.
44
+ * - `operated` — never its own actor. An organization, project, channel or
45
+ * community only acts through a member (a community's moderators), and that
46
+ * member is the actor.
46
47
  */
47
48
  export declare const ACCOUNT_ACTOR_NATURES: readonly ["person", "agent", "operated"];
48
49
  export type AccountActorNature = (typeof ACCOUNT_ACTOR_NATURES)[number];
@@ -319,7 +319,7 @@ export declare const delegationGrantSchema: z.ZodObject<{
319
319
  version: string;
320
320
  digest: string;
321
321
  } | null;
322
- capabilityPackages: ("create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
322
+ capabilityPackages: ("finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
323
323
  capabilities: string[];
324
324
  toolOverrides: {
325
325
  decision: "allow" | "deny";
@@ -357,7 +357,7 @@ export declare const delegationGrantSchema: z.ZodObject<{
357
357
  version: string;
358
358
  digest: string;
359
359
  } | null;
360
- capabilityPackages: ("create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
360
+ capabilityPackages: ("finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
361
361
  capabilities: string[];
362
362
  maximumAutonomy: "read_only" | "draft" | "execute_on_request" | "autonomous";
363
363
  toolOverrides?: {
@@ -408,7 +408,7 @@ export declare const agentRequesterCeilingWriteSchema: z.ZodObject<{
408
408
  }>, "many">>;
409
409
  maximumAutonomy: z.ZodEnum<["read_only", "autonomous"]>;
410
410
  }, "strict", z.ZodTypeAny, {
411
- capabilityPackages: ("create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
411
+ capabilityPackages: ("finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
412
412
  capabilities: string[];
413
413
  toolOverrides: {
414
414
  decision: "allow" | "deny";
@@ -421,7 +421,7 @@ export declare const agentRequesterCeilingWriteSchema: z.ZodObject<{
421
421
  }[];
422
422
  maximumAutonomy: "read_only" | "autonomous";
423
423
  }, {
424
- capabilityPackages: ("create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
424
+ capabilityPackages: ("finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
425
425
  maximumAutonomy: "read_only" | "autonomous";
426
426
  capabilities?: string[] | undefined;
427
427
  toolOverrides?: {
@@ -493,7 +493,7 @@ export declare const agentRequesterCeilingSchema: z.ZodObject<{
493
493
  version: string;
494
494
  digest: string;
495
495
  };
496
- capabilityPackages: ("create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
496
+ capabilityPackages: ("finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
497
497
  capabilities: string[];
498
498
  toolOverrides: {
499
499
  decision: "allow" | "deny";
@@ -518,7 +518,7 @@ export declare const agentRequesterCeilingSchema: z.ZodObject<{
518
518
  version: string;
519
519
  digest: string;
520
520
  };
521
- capabilityPackages: ("create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
521
+ capabilityPackages: ("finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate")[];
522
522
  maximumAutonomy: "read_only" | "autonomous";
523
523
  revokedAt: string | null;
524
524
  agentAccountId: string;
@@ -2341,7 +2341,7 @@ export declare const catalogToolSchema: z.ZodEffects<z.ZodObject<{
2341
2341
  version: string;
2342
2342
  rollback: "none" | "manual" | "supported";
2343
2343
  inputSchema: Record<string, unknown>;
2344
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2344
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2345
2345
  requiredCapabilities: string[];
2346
2346
  resourceTypes: string[];
2347
2347
  idempotency: "none" | "supported" | "required";
@@ -2363,7 +2363,7 @@ export declare const catalogToolSchema: z.ZodEffects<z.ZodObject<{
2363
2363
  version: string;
2364
2364
  rollback: "none" | "manual" | "supported";
2365
2365
  inputSchema: Record<string, unknown>;
2366
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2366
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2367
2367
  requiredCapabilities: string[];
2368
2368
  resourceTypes: string[];
2369
2369
  idempotency: "none" | "supported" | "required";
@@ -2385,7 +2385,7 @@ export declare const catalogToolSchema: z.ZodEffects<z.ZodObject<{
2385
2385
  version: string;
2386
2386
  rollback: "none" | "manual" | "supported";
2387
2387
  inputSchema: Record<string, unknown>;
2388
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2388
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2389
2389
  requiredCapabilities: string[];
2390
2390
  resourceTypes: string[];
2391
2391
  idempotency: "none" | "supported" | "required";
@@ -2407,7 +2407,7 @@ export declare const catalogToolSchema: z.ZodEffects<z.ZodObject<{
2407
2407
  version: string;
2408
2408
  rollback: "none" | "manual" | "supported";
2409
2409
  inputSchema: Record<string, unknown>;
2410
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2410
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2411
2411
  requiredCapabilities: string[];
2412
2412
  resourceTypes: string[];
2413
2413
  idempotency: "none" | "supported" | "required";
@@ -2549,7 +2549,7 @@ export declare const appCapabilityCatalogSchema: z.ZodEffects<z.ZodObject<{
2549
2549
  version: string;
2550
2550
  rollback: "none" | "manual" | "supported";
2551
2551
  inputSchema: Record<string, unknown>;
2552
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2552
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2553
2553
  requiredCapabilities: string[];
2554
2554
  resourceTypes: string[];
2555
2555
  idempotency: "none" | "supported" | "required";
@@ -2571,7 +2571,7 @@ export declare const appCapabilityCatalogSchema: z.ZodEffects<z.ZodObject<{
2571
2571
  version: string;
2572
2572
  rollback: "none" | "manual" | "supported";
2573
2573
  inputSchema: Record<string, unknown>;
2574
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2574
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2575
2575
  requiredCapabilities: string[];
2576
2576
  resourceTypes: string[];
2577
2577
  idempotency: "none" | "supported" | "required";
@@ -2593,7 +2593,7 @@ export declare const appCapabilityCatalogSchema: z.ZodEffects<z.ZodObject<{
2593
2593
  version: string;
2594
2594
  rollback: "none" | "manual" | "supported";
2595
2595
  inputSchema: Record<string, unknown>;
2596
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2596
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2597
2597
  requiredCapabilities: string[];
2598
2598
  resourceTypes: string[];
2599
2599
  idempotency: "none" | "supported" | "required";
@@ -2615,7 +2615,7 @@ export declare const appCapabilityCatalogSchema: z.ZodEffects<z.ZodObject<{
2615
2615
  version: string;
2616
2616
  rollback: "none" | "manual" | "supported";
2617
2617
  inputSchema: Record<string, unknown>;
2618
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2618
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2619
2619
  requiredCapabilities: string[];
2620
2620
  resourceTypes: string[];
2621
2621
  idempotency: "none" | "supported" | "required";
@@ -2664,7 +2664,7 @@ export declare const appCapabilityCatalogSchema: z.ZodEffects<z.ZodObject<{
2664
2664
  version: string;
2665
2665
  rollback: "none" | "manual" | "supported";
2666
2666
  inputSchema: Record<string, unknown>;
2667
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2667
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2668
2668
  requiredCapabilities: string[];
2669
2669
  resourceTypes: string[];
2670
2670
  idempotency: "none" | "supported" | "required";
@@ -2711,7 +2711,7 @@ export declare const appCapabilityCatalogSchema: z.ZodEffects<z.ZodObject<{
2711
2711
  version: string;
2712
2712
  rollback: "none" | "manual" | "supported";
2713
2713
  inputSchema: Record<string, unknown>;
2714
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2714
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2715
2715
  requiredCapabilities: string[];
2716
2716
  resourceTypes: string[];
2717
2717
  idempotency: "none" | "supported" | "required";
@@ -2758,7 +2758,7 @@ export declare const appCapabilityCatalogSchema: z.ZodEffects<z.ZodObject<{
2758
2758
  version: string;
2759
2759
  rollback: "none" | "manual" | "supported";
2760
2760
  inputSchema: Record<string, unknown>;
2761
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2761
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2762
2762
  requiredCapabilities: string[];
2763
2763
  resourceTypes: string[];
2764
2764
  idempotency: "none" | "supported" | "required";
@@ -2805,7 +2805,7 @@ export declare const appCapabilityCatalogSchema: z.ZodEffects<z.ZodObject<{
2805
2805
  version: string;
2806
2806
  rollback: "none" | "manual" | "supported";
2807
2807
  inputSchema: Record<string, unknown>;
2808
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2808
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2809
2809
  requiredCapabilities: string[];
2810
2810
  resourceTypes: string[];
2811
2811
  idempotency: "none" | "supported" | "required";
@@ -2924,7 +2924,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
2924
2924
  version: string;
2925
2925
  rollback: "none" | "manual" | "supported";
2926
2926
  inputSchema: Record<string, unknown>;
2927
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2927
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2928
2928
  requiredCapabilities: string[];
2929
2929
  resourceTypes: string[];
2930
2930
  idempotency: "none" | "supported" | "required";
@@ -2946,7 +2946,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
2946
2946
  version: string;
2947
2947
  rollback: "none" | "manual" | "supported";
2948
2948
  inputSchema: Record<string, unknown>;
2949
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2949
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2950
2950
  requiredCapabilities: string[];
2951
2951
  resourceTypes: string[];
2952
2952
  idempotency: "none" | "supported" | "required";
@@ -2968,7 +2968,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
2968
2968
  version: string;
2969
2969
  rollback: "none" | "manual" | "supported";
2970
2970
  inputSchema: Record<string, unknown>;
2971
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2971
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2972
2972
  requiredCapabilities: string[];
2973
2973
  resourceTypes: string[];
2974
2974
  idempotency: "none" | "supported" | "required";
@@ -2990,7 +2990,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
2990
2990
  version: string;
2991
2991
  rollback: "none" | "manual" | "supported";
2992
2992
  inputSchema: Record<string, unknown>;
2993
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
2993
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
2994
2994
  requiredCapabilities: string[];
2995
2995
  resourceTypes: string[];
2996
2996
  idempotency: "none" | "supported" | "required";
@@ -3039,7 +3039,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
3039
3039
  version: string;
3040
3040
  rollback: "none" | "manual" | "supported";
3041
3041
  inputSchema: Record<string, unknown>;
3042
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
3042
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
3043
3043
  requiredCapabilities: string[];
3044
3044
  resourceTypes: string[];
3045
3045
  idempotency: "none" | "supported" | "required";
@@ -3086,7 +3086,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
3086
3086
  version: string;
3087
3087
  rollback: "none" | "manual" | "supported";
3088
3088
  inputSchema: Record<string, unknown>;
3089
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
3089
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
3090
3090
  requiredCapabilities: string[];
3091
3091
  resourceTypes: string[];
3092
3092
  idempotency: "none" | "supported" | "required";
@@ -3133,7 +3133,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
3133
3133
  version: string;
3134
3134
  rollback: "none" | "manual" | "supported";
3135
3135
  inputSchema: Record<string, unknown>;
3136
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
3136
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
3137
3137
  requiredCapabilities: string[];
3138
3138
  resourceTypes: string[];
3139
3139
  idempotency: "none" | "supported" | "required";
@@ -3180,7 +3180,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
3180
3180
  version: string;
3181
3181
  rollback: "none" | "manual" | "supported";
3182
3182
  inputSchema: Record<string, unknown>;
3183
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
3183
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
3184
3184
  requiredCapabilities: string[];
3185
3185
  resourceTypes: string[];
3186
3186
  idempotency: "none" | "supported" | "required";
@@ -3233,7 +3233,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
3233
3233
  version: string;
3234
3234
  rollback: "none" | "manual" | "supported";
3235
3235
  inputSchema: Record<string, unknown>;
3236
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
3236
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
3237
3237
  requiredCapabilities: string[];
3238
3238
  resourceTypes: string[];
3239
3239
  idempotency: "none" | "supported" | "required";
@@ -3285,7 +3285,7 @@ export declare const catalogRegistrationSchema: z.ZodObject<{
3285
3285
  version: string;
3286
3286
  rollback: "none" | "manual" | "supported";
3287
3287
  inputSchema: Record<string, unknown>;
3288
- capabilityPackage: "create" | "finance" | "security" | "read" | "publish" | "communicate" | "administer" | "delegate";
3288
+ capabilityPackage: "finance" | "security" | "create" | "read" | "publish" | "communicate" | "administer" | "delegate";
3289
3289
  requiredCapabilities: string[];
3290
3290
  resourceTypes: string[];
3291
3291
  idempotency: "none" | "supported" | "required";
@@ -19,7 +19,7 @@
19
19
  * #1520): it owns resources, holds roles, plans and a balance, receives funds
20
20
  * and pays for itself under the same rules as a person, and is its own actor.
21
21
  */
22
- export type AccountKind = 'personal' | 'organization' | 'project' | 'bot' | 'channel';
22
+ export type AccountKind = 'personal' | 'organization' | 'project' | 'bot' | 'channel' | 'community';
23
23
  /**
24
24
  * The union is spelled out above and the array proves coverage BOTH ways
25
25
  * (`satisfies` here, the `Gap` alias below) — the same shape this package's
@@ -32,14 +32,20 @@ export type AccountKind = 'personal' | 'organization' | 'project' | 'bot' | 'cha
32
32
  * and an indexed-access type is materially more expensive to check there than a
33
33
  * literal union.
34
34
  */
35
- export declare const ACCOUNT_KINDS: readonly ["personal", "organization", "project", "bot", "channel"];
35
+ export declare const ACCOUNT_KINDS: readonly ["personal", "organization", "project", "bot", "channel", "community"];
36
36
  /** `never` while `ACCOUNT_KINDS` covers the union. */
37
37
  export type AccountKindGap = Exclude<AccountKind, (typeof ACCOUNT_KINDS)[number]>;
38
38
  /**
39
- * Kinds that may be CREATED as children of another account. Exactly
40
- * `ACCOUNT_KINDS` minus `personal`, which is always a tree root.
39
+ * Kinds that may be CREATED as children of another account: `ACCOUNT_KINDS`
40
+ * minus `personal`, which is always a tree root, and minus `community`.
41
+ *
42
+ * A `community` is a forum its members post INTO and that re-broadcasts what
43
+ * they post (an ActivityPub `Group`: a Lemmy or Mbin community). Oxy records
44
+ * remote communities; it does not host one, because nothing here forwards a
45
+ * member's post to the community's followers yet. Creating one would make an
46
+ * account that promises that and cannot keep it.
41
47
  */
42
- export type ChildAccountKind = Exclude<AccountKind, 'personal'>;
48
+ export type ChildAccountKind = Exclude<AccountKind, 'personal' | 'community'>;
43
49
  export declare const CHILD_ACCOUNT_KINDS: readonly ["organization", "project", "bot", "channel"];
44
50
  /** `never` while `CHILD_ACCOUNT_KINDS` covers the child union. */
45
51
  export type ChildAccountKindGap = Exclude<ChildAccountKind, (typeof CHILD_ACCOUNT_KINDS)[number]>;
@@ -191,7 +197,7 @@ export declare const MAX_ACCOUNT_CATEGORIES = 4;
191
197
  * !== 'personal'` test silently admits every kind invented after it was
192
198
  * written, whereas this list forces whoever adds one to decide.
193
199
  */
194
- export declare const ACCOUNT_CATEGORY_KINDS: readonly ["organization", "project", "bot", "channel"];
200
+ export declare const ACCOUNT_CATEGORY_KINDS: readonly ["organization", "project", "bot", "channel", "community"];
195
201
  export type AccountCategoryKind = (typeof ACCOUNT_CATEGORY_KINDS)[number];
196
202
  /**
197
203
  * Whether an account of this kind may carry categories.
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The account-name policy, without Zod. Schema: `../accountName.ts`.
3
+ *
4
+ * Part of `@oxy.so/contracts/client`: never import `zod` here (see `./check.ts`).
5
+ *
6
+ * An account's name follows ONE of two policies, chosen by its `kind` and by
7
+ * nothing else — not by which route wrote it, nor by whether it is native or
8
+ * federated:
9
+ *
10
+ * - `person`: a human name. Letters of the allowlisted scripts, combining
11
+ * marks, spaces, the apostrophe and letter-flanked name separators; no
12
+ * digits. The character classes are generated data and live in
13
+ * `@oxy.so/core` (`isValidDisplayName`), which applies this table through
14
+ * `isValidAccountName`.
15
+ * - `title`: what an organization, project, bot, channel or community is called. Plain
16
+ * text — digits and punctuation are part of real titles ("Studio 54",
17
+ * "Blink-182") — without markup or control characters. Defined here, once.
18
+ */
19
+ import type { AccountKind } from './accountGraph';
20
+ import { type Check } from './check';
21
+ export type AccountNamePolicy = 'person' | 'title';
22
+ /**
23
+ * The policy for each kind. A `Record` over the whole union, so adding a kind
24
+ * fails this file's typecheck until someone decides how it is named.
25
+ */
26
+ export declare const ACCOUNT_NAME_POLICY_BY_KIND: {
27
+ readonly personal: "person";
28
+ readonly organization: "title";
29
+ readonly project: "title";
30
+ readonly bot: "title";
31
+ readonly channel: "title";
32
+ readonly community: "title";
33
+ };
34
+ /** A missing kind is `personal`, the `users.kind` column default. */
35
+ export declare function accountNamePolicyForKind(kind: AccountKind | null | undefined): AccountNamePolicy;
36
+ /** Longest title, in UTF-16 code units after trimming. */
37
+ export declare const ACCOUNT_TITLE_MAX_LENGTH = 300;
38
+ /**
39
+ * Source of the characters a title may not contain: `<`, `>`, the C0 controls
40
+ * and DEL. A class of literal code points — no property escapes — so it
41
+ * compiles on Hermes. The probe below rejects with it; the API compiles it with
42
+ * `g` to strip untrusted titles, so the gate and the strip cannot disagree.
43
+ */
44
+ export declare const ACCOUNT_TITLE_DISALLOWED_SOURCE = "[<>\\u0000-\\u001F\\u007F]";
45
+ /** Whether `value` holds no character the title policy disallows. */
46
+ export declare function isPlainTextTitle(value: string): boolean;
47
+ /** The twin of `accountTitleSchema`. */
48
+ export declare const accountTitleCheck: Check<string>;