@foir/cli 0.64.0 → 0.65.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.
@@ -153,12 +153,23 @@ interface AccessInput {
153
153
  ownerPlane: 'customer' | 'admin' | 'project';
154
154
  /**
155
155
  * Visibility new records start at (the record descriptor modes):
156
- * - `'private'` — only the owner and explicit grants. The default.
157
- * - `'public_project'` — readable by anyone in the project.
158
- * - `'public_world'` — readable by anyone (public API).
159
- * Omit to use the platform default (private).
156
+ * - `'private'` — only the owner and explicit grants.
157
+ * - `'public'` — readable by anyone with API access, including signed-in
158
+ * customers on the public API.
159
+ *
160
+ * On a PROJECT-plane model, omitting this defaults to `'public'` at
161
+ * CREATION — project content is meant to be read, and `'private'` there does
162
+ * not mean what it looks like: a project record has no owner, so it stays
163
+ * readable by anonymous and server-side callers while being hidden from
164
+ * signed-in customers. Set `'private'` explicitly to opt a project model out.
165
+ *
166
+ * The default is applied by the platform, at the create path only. Omitting it
167
+ * on a model that already exists means "leave it alone" — it will not reset a
168
+ * visibility you changed in the console. Owned planes (customer/admin) are
169
+ * always private (the platform rejects a public default there) regardless of
170
+ * this value.
160
171
  */
161
- defaultVisibility?: 'private' | 'public_project' | 'public_world';
172
+ defaultVisibility?: 'private' | 'public';
162
173
  }
163
174
  interface ApplyConfigModelInput {
164
175
  key: string;
@@ -216,8 +227,17 @@ interface ApplyConfigOperationInput {
216
227
  };
217
228
  /** Retry policy for failed executions. */
218
229
  retryPolicy?: Record<string, unknown>;
219
- /** Roles allowed to execute this operation. */
220
- allowedRoles?: string[];
230
+ /**
231
+ * Admin permission verbs required to execute this operation.
232
+ *
233
+ * CONJUNCTIVE: the caller must hold EVERY verb listed, so adding one always
234
+ * narrows who may execute. Omit or pass `[]` for no gate. Entries are verbs
235
+ * from the admin permission vocabulary, e.g. `['content:write']`.
236
+ *
237
+ * Replaced `allowedRoles` (TTS-1049), which named role KEYS. Role keys are
238
+ * yours to choose, so renaming a role silently changed who could execute.
239
+ */
240
+ allowedPermissions?: string[];
221
241
  /** Precondition that must be met before execution (e.g., segment membership). */
222
242
  precondition?: Precondition;
223
243
  /**
@@ -358,6 +378,37 @@ interface ApplyConfigContextDimensionInput {
358
378
  sourceModelKey?: string;
359
379
  defaultRecordKey?: string;
360
380
  }
381
+ /**
382
+ * A project locale. Natural key is the locale `code` (e.g. "en-GB").
383
+ * Reconciled by `foir push` — declared locales are created / updated. Locales
384
+ * are also admin-editable and carry no config ownership, so a push never
385
+ * DELETES a locale it did not declare (create/update only).
386
+ */
387
+ interface ApplyConfigLocaleInput {
388
+ /** BCP-47 locale code, immutable after create (e.g. "en", "fr-CA"). */
389
+ locale: string;
390
+ displayName: string;
391
+ nativeName?: string;
392
+ isDefault?: boolean;
393
+ isActive?: boolean;
394
+ isRtl?: boolean;
395
+ /** Locale code to fall back to when a translation is missing. */
396
+ fallbackLocale?: string;
397
+ }
398
+ /**
399
+ * A variant-catalog entry — a named targeting definition. Natural key is `key`.
400
+ * Reconciled by `foir push` (create/update only, same rationale as locales).
401
+ */
402
+ interface ApplyConfigVariantCatalogEntryInput {
403
+ key: string;
404
+ name: string;
405
+ description?: string;
406
+ /** RuleExpression object evaluated to decide whether this variant applies. */
407
+ targetingRules?: Record<string, unknown>;
408
+ priority?: number;
409
+ isDefault?: boolean;
410
+ isActive?: boolean;
411
+ }
361
412
  interface ApplyConfigScheduleInput {
362
413
  /** Unique key for this schedule. Defaults to operationKey if not provided. */
363
414
  key?: string;
@@ -612,11 +663,20 @@ interface ApplyConfigProjectSettingsInput {
612
663
  */
613
664
  customerWelcomeEmailEnabled?: boolean;
614
665
  /**
615
- * Whether the public CustomerRegister mutation is allowed. Default true.
616
- * When false, customers can only be created via secret-key admin paths
617
- * (CreateCustomer, CreateCustomerInvitation).
666
+ * Self-serve customer signup mode. Default `public`. `restricted` accepts only
667
+ * invited emails, `waitlist` queues signups for approval, `closed` disables
668
+ * self-serve signup entirely.
618
669
  */
619
- customerSignupEnabled?: boolean;
670
+ signupMode?: SignupModeName;
671
+ /**
672
+ * Email hygiene + allow/block restrictions applied to `public`-mode signups.
673
+ * `blockSubaddresses` requires the canonical inbox form (rejects subaddress
674
+ * tags, Gmail dots, and the googlemail alias domain). An allowlist, when
675
+ * non-empty, is exclusive and beats the blocklist. List patterns: exact
676
+ * `user@domain.com`, whole domain (`domain.com`), wildcard subdomains
677
+ * (`*.domain.com`).
678
+ */
679
+ signupRestrictions?: SignupRestrictionsInput;
620
680
  /**
621
681
  * Whether email/password customer login is exposed. Default true. Disable
622
682
  * for a passwordless project (one-time codes or single sign-on only).
@@ -627,6 +687,15 @@ interface ApplyConfigProjectSettingsInput {
627
687
  */
628
688
  customerOtpEnabled?: boolean;
629
689
  }
690
+ /** Self-serve signup mode, as authored in config-as-code. */
691
+ type SignupModeName = 'public' | 'restricted' | 'waitlist' | 'closed';
692
+ /** Email hygiene + allow/block restrictions, as authored in config-as-code. */
693
+ interface SignupRestrictionsInput {
694
+ blockSubaddresses?: boolean;
695
+ blockDisposable?: boolean;
696
+ allowlist?: string[];
697
+ blocklist?: string[];
698
+ }
630
699
  /**
631
700
  * Project pin + declarative settings. The pin (id / tenantId) is a guard
632
701
  * against pushing one folder's config into another folder's project; the
@@ -683,6 +752,10 @@ interface ApplyConfigInput {
683
752
  models?: ApplyConfigModelInput[];
684
753
  operations?: ApplyConfigOperationInput[];
685
754
  contextDimensions?: ApplyConfigContextDimensionInput[];
755
+ /** Project locales, reconciled by `foir push` (create/update only). */
756
+ locales?: ApplyConfigLocaleInput[];
757
+ /** Variant-catalog entries, reconciled by `foir push` (create/update only). */
758
+ variantCatalog?: ApplyConfigVariantCatalogEntryInput[];
686
759
  schedules?: ApplyConfigScheduleInput[];
687
760
  hooks?: ApplyConfigHookInput[];
688
761
  authProviders?: ApplyConfigAuthProviderInput[];
@@ -727,6 +800,10 @@ declare function defineEnumField(field: EnumFieldDefinitionInput): FieldDefiniti
727
800
  declare function defineOperation(operation: ApplyConfigOperationInput): ApplyConfigOperationInput;
728
801
  /** Define a context dimension (segment rule / model source) with type safety. */
729
802
  declare function defineContextDimension(dimension: ApplyConfigContextDimensionInput): ApplyConfigContextDimensionInput;
803
+ /** Define a project locale. */
804
+ declare function defineLocale(locale: ApplyConfigLocaleInput): ApplyConfigLocaleInput;
805
+ /** Define a variant-catalog entry (targeting definition). */
806
+ declare function defineVariantCatalogEntry(entry: ApplyConfigVariantCatalogEntryInput): ApplyConfigVariantCatalogEntryInput;
730
807
  /** Define a cron schedule for an operation. */
731
808
  declare function defineSchedule(schedule: ApplyConfigScheduleInput): ApplyConfigScheduleInput;
732
809
  /** Define an auth provider. */
@@ -771,4 +848,4 @@ interface FoirSecretsConfig {
771
848
  */
772
849
  declare function defineSecrets(config: FoirSecretsConfig): FoirSecretsConfig;
773
850
 
774
- export { type AccessInput, type AppInput, type AppPlacementFieldChoiceInput, type AppSinkMappingInput, type AppSourceMappingInput, type ApplyConfigApiKeyInput, type ApplyConfigAuthProviderInput, type ApplyConfigContextDimensionInput, type ApplyConfigCustomerRoleInput, type ApplyConfigDesignTokensInput, type ApplyConfigHookInput, type ApplyConfigInput, type ApplyConfigModelInput, type ApplyConfigOperationInput, type ApplyConfigPlacementInput, type ApplyConfigProjectInput, type ApplyConfigProjectSettingsInput, type ApplyConfigRelyingPartyInput, type ApplyConfigRelyingPartyLoginMethods, type ApplyConfigScheduleInput, type EnumFieldConfig, type EnumFieldDefinitionInput, type EnumFieldOption, type FieldAccessInput, type FieldDefinitionInput, type FieldRelationshipInput, type FoirSecretsConfig, type LookupDefinitionInput, type QuotaRule, type ReferenceFieldConfig, type ReferenceFieldDefinitionInput, type SecretDeclaration, type SecretOwnerKind, type SelectFieldConfig, type SelectFieldDefinitionInput, defineAuthProvider, defineConfig, defineContextDimension, defineDesignTokens, defineEnumField, defineField, defineHook, defineModel, defineOperation, definePlacement, defineRelyingParty, defineSchedule, defineSecrets, defineSelectField };
851
+ export { type AccessInput, type AppInput, type AppPlacementFieldChoiceInput, type AppSinkMappingInput, type AppSourceMappingInput, type ApplyConfigApiKeyInput, type ApplyConfigAuthProviderInput, type ApplyConfigContextDimensionInput, type ApplyConfigCustomerRoleInput, type ApplyConfigDesignTokensInput, type ApplyConfigHookInput, type ApplyConfigInput, type ApplyConfigLocaleInput, type ApplyConfigModelInput, type ApplyConfigOperationInput, type ApplyConfigPlacementInput, type ApplyConfigProjectInput, type ApplyConfigProjectSettingsInput, type ApplyConfigRelyingPartyInput, type ApplyConfigRelyingPartyLoginMethods, type ApplyConfigScheduleInput, type ApplyConfigVariantCatalogEntryInput, type EnumFieldConfig, type EnumFieldDefinitionInput, type EnumFieldOption, type FieldAccessInput, type FieldDefinitionInput, type FieldRelationshipInput, type FoirSecretsConfig, type LookupDefinitionInput, type QuotaRule, type ReferenceFieldConfig, type ReferenceFieldDefinitionInput, type SecretDeclaration, type SecretOwnerKind, type SelectFieldConfig, type SelectFieldDefinitionInput, type SignupModeName, type SignupRestrictionsInput, defineAuthProvider, defineConfig, defineContextDimension, defineDesignTokens, defineEnumField, defineField, defineHook, defineLocale, defineModel, defineOperation, definePlacement, defineRelyingParty, defineSchedule, defineSecrets, defineSelectField, defineVariantCatalogEntry };
@@ -23,6 +23,12 @@ function defineOperation(operation) {
23
23
  function defineContextDimension(dimension) {
24
24
  return dimension;
25
25
  }
26
+ function defineLocale(locale) {
27
+ return locale;
28
+ }
29
+ function defineVariantCatalogEntry(entry) {
30
+ return entry;
31
+ }
26
32
  function defineSchedule(schedule) {
27
33
  return schedule;
28
34
  }
@@ -49,11 +55,13 @@ export {
49
55
  defineEnumField,
50
56
  defineField,
51
57
  defineHook,
58
+ defineLocale,
52
59
  defineModel,
53
60
  defineOperation,
54
61
  definePlacement,
55
62
  defineRelyingParty,
56
63
  defineSchedule,
57
64
  defineSecrets,
58
- defineSelectField
65
+ defineSelectField,
66
+ defineVariantCatalogEntry
59
67
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foir/cli",
3
- "version": "0.64.0",
3
+ "version": "0.65.0",
4
4
  "description": "Universal platform CLI for Foir platform",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -37,6 +37,8 @@
37
37
  "@bufbuild/protovalidate": "^1.1.1",
38
38
  "@connectrpc/connect": "^2.0.0",
39
39
  "@connectrpc/connect-node": "^2.0.0",
40
+ "@modelcontextprotocol/sdk": "^1.29.0",
41
+ "ai": "^7.0.29",
40
42
  "chalk": "^5.3.0",
41
43
  "commander": "^12.1.0",
42
44
  "dotenv": "^16.4.5",
@@ -55,8 +57,11 @@
55
57
  "tsx": "^4.20.0",
56
58
  "typescript": "5.9.2",
57
59
  "vitest": "^3.2.4",
60
+ "@foir/assistant": "0.0.0",
61
+ "@foir/proto-ts": "0.109.0",
62
+ "@foir/console-routes": "0.0.0",
58
63
  "@foir/rpc-node": "0.0.0",
59
- "@foir/proto-ts": "0.109.0"
64
+ "@foir/sdk": "0.9.0"
60
65
  },
61
66
  "engines": {
62
67
  "node": ">=18.0.0"