@crossworks/client-types 0.400.39 → 0.400.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossworks/client-types",
3
- "version": "0.400.39",
3
+ "version": "0.400.43",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/dto/rows.ts CHANGED
@@ -695,13 +695,44 @@ export type TeamMemberActivity = {
695
695
  unread: number;
696
696
  };
697
697
 
698
+ /**
699
+ * GET /api/policy (docs/policy.md): the box policy the operator set in the
700
+ * box .env, read only (the Policy panel under Settings). The route answers
701
+ * 404 when no policy is set: the panel does not appear.
702
+ */
703
+ export type BoxPolicyReport = {
704
+ /** MANTLE_POLICY_TELEGRAM=off. */
705
+ telegram: { off: boolean };
706
+ /** MANTLE_POLICY_MODEL_DENY patterns (lowercase) and
707
+ * MANTLE_POLICY_PROVIDER_ALLOW ids (null: any provider). */
708
+ models: { deny: string[]; providerAllow: string[] | null };
709
+ /** MANTLE_POLICY_PASSWORD_MIN: `set` false is today's rule (8, no list). */
710
+ passwords: { set: boolean; min: number; commonList: boolean };
711
+ /** Every enabled assistant, worker or embedder route the model block
712
+ * refuses: `ref` is `agent:<slug>`, `worker:<kind>` or `embedding`. */
713
+ blocked: {
714
+ ref: string;
715
+ route: 'primary' | 'backup';
716
+ provider: string;
717
+ model: string;
718
+ rule: 'provider_allow' | 'endpoint_allow' | 'model_deny' | 'auto_router';
719
+ }[];
720
+ /** MANTLE_POLICY_ENDPOINT_ALLOW hosts (null: none). */
721
+ endpointAllow: string[] | null;
722
+ /** Logins the password rule holds now: `change` (a weak password, held to
723
+ * the change step) and `recheck` (not yet signed in under the rule). */
724
+ heldLogins: { change: number; recheck: number };
725
+ };
726
+
698
727
  /**
699
728
  * One open provider outage, as an admin sees it. `reason` is fixed text
700
729
  * chosen by `code`, never provider text: it is safe on a banner and a phone.
701
730
  */
702
731
  export type ProviderAlert = {
703
- subject: 'embedding' | 'extraction';
704
- /** quota | auth | no_key | model (permanent); rate_limit | server |
732
+ /** `model_policy`: a call the box policy (MANTLE_POLICY_MODEL_DENY,
733
+ * MANTLE_POLICY_PROVIDER_ALLOW) refused; `code` is `policy`. */
734
+ subject: 'embedding' | 'extraction' | 'model_policy';
735
+ /** quota | auth | no_key | model | policy (permanent); rate_limit | server |
705
736
  * network | timeout (transient, shown after 10 min). */
706
737
  code: string;
707
738
  permanent: boolean;
@@ -249,8 +249,24 @@ export type AuthWhoami = {
249
249
  workspaces: ShellWorkspace[];
250
250
  areas: WorkspaceArea[];
251
251
  isOwner: boolean;
252
+ /** Present (true) only while the box password policy holds this login
253
+ * (docs/policy.md): every route but the change-password step answers
254
+ * 403 `password_change_required` until POST /api/auth/change-password
255
+ * takes a new password that meets `passwordRule`. Absent otherwise. */
256
+ mustChangePassword?: true;
257
+ /** The rule a new password must meet; present with mustChangePassword. */
258
+ passwordRule?: PasswordRule;
252
259
  };
253
260
 
261
+ /** The password rule in force (docs/policy.md): at least `min` characters,
262
+ * and, under a box policy, not a common password (`commonList`). */
263
+ export type PasswordRule = { min: number; commonList: boolean };
264
+
265
+ /** Every `code` a refused new password carries (HTTP 400 `{ error, code,
266
+ * min }`), and the hold's 403 code. */
267
+ export type PasswordErrorCode =
268
+ 'password_too_short' | 'password_too_long' | 'password_common' | 'password_change_required';
269
+
254
270
  /** Every `code` a /api/workspaces refusal carries. */
255
271
  export type WorkspaceErrorCode =
256
272
  | 'invalid'
package/src/index.ts CHANGED
@@ -235,6 +235,8 @@ export type { HistoryActor, LoginRole } from './role-names';
235
235
  // Types only; WORKSPACE_AREAS (runtime) is the `@mantle/client-types/dto/workspaces` subpath.
236
236
  export type {
237
237
  AuthWhoami,
238
+ PasswordErrorCode,
239
+ PasswordRule,
238
240
  ShellWorkspace,
239
241
  ShellWorkspaces,
240
242
  Workspace,