@crossworks/client-types 0.500.1 → 0.500.12

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.500.1",
3
+ "version": "0.500.12",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -261,4 +261,61 @@ export interface AiWorkerConfig {
261
261
  nativeDocProviders: string[];
262
262
  /** Online tailnet peer MagicDNS names (route base-URL datalist). */
263
263
  tailnetPeers: string[];
264
+ /** The decider's last failure (the `decision` provider alert, open or
265
+ * closed), or null when it never failed. Absent from a brain before
266
+ * decider plan Part 3. */
267
+ deciderLastFailure?: DeciderLastFailure | null;
264
268
  }
269
+
270
+ /**
271
+ * The decider's last failure, for its worker screen. `reason` is fixed text
272
+ * chosen by `code`, never provider text.
273
+ */
274
+ export interface DeciderLastFailure {
275
+ /** The provider classifier's code (`quota`, `auth`, `model`, `timeout`, ...)
276
+ * or the decider's own (`privacy_route`, `cut`, `answer`). */
277
+ code: string;
278
+ permanent: boolean;
279
+ reason: string;
280
+ provider: string | null;
281
+ model: string | null;
282
+ /** When this run of failures started, and the latest one (ISO). */
283
+ since: string;
284
+ lastAt: string;
285
+ /** Failures recorded in this run (one write a minute per process). */
286
+ count: number;
287
+ /** Admins see it as an alert now (permanent at once, else after 10 min). */
288
+ shown: boolean;
289
+ /** When a decision worked again (ISO); null while it still fails. */
290
+ resolvedAt: string | null;
291
+ /** The open row is about the decider that runs now (enabled, a use on,
292
+ * the same model). False once closed, and for an open row no decision
293
+ * can close any more: it is not listed as an alert then. */
294
+ current: boolean;
295
+ }
296
+
297
+ /** `POST /api/ai-workers/:id/test/decision`: one small request to the saved
298
+ * decider model with its real privacy level, timeout and request limits. */
299
+ export type DecisionTestResult = {
300
+ model: string;
301
+ provider: string;
302
+ privacy: 'zdr' | 'no_training';
303
+ timeoutMs: number;
304
+ ms: number;
305
+ } & (
306
+ | {
307
+ ok: true;
308
+ adapter: string;
309
+ tokensIn: number | null;
310
+ costUsd: number | null;
311
+ answers: Record<string, unknown>;
312
+ }
313
+ | {
314
+ ok: false;
315
+ code: string;
316
+ /** One fixed sentence for an admin. */
317
+ reason: string;
318
+ /** The provider's or the adapter's own words, for a settings admin. */
319
+ detail: string | null;
320
+ }
321
+ );
package/src/dto/rows.ts CHANGED
@@ -703,6 +703,10 @@ export type TeamMemberActivity = {
703
703
  export type BoxPolicyReport = {
704
704
  /** MANTLE_POLICY_TELEGRAM=off. */
705
705
  telegram: { off: boolean };
706
+ /** MANTLE_POLICY_EMAIL_SEND=off: MantleOS's own mail transports refuse
707
+ * (reading and syncing mail are not touched). Every box that knows the
708
+ * rule fills it; absent from a box older than the rule (read: not off). */
709
+ emailSend?: { off: boolean };
706
710
  /** MANTLE_POLICY_MODEL_DENY patterns (lowercase) and
707
711
  * MANTLE_POLICY_PROVIDER_ALLOW ids (null: any provider). */
708
712
  models: { deny: string[]; providerAllow: string[] | null };
@@ -732,8 +736,11 @@ export type BoxPolicyReport = {
732
736
  */
733
737
  export type ProviderAlert = {
734
738
  /** `model_policy`: a call the box policy (MANTLE_POLICY_MODEL_DENY,
735
- * MANTLE_POLICY_PROVIDER_ALLOW) refused; `code` is `policy`. */
736
- subject: 'embedding' | 'extraction' | 'model_policy';
739
+ * MANTLE_POLICY_PROVIDER_ALLOW) refused; `code` is `policy`.
740
+ * `decision`: the decider fails (search and chat run without it); never
741
+ * probed, a decision that works closes it. These two come in
742
+ * `otherAlerts`, never in `alerts` (`ProviderAlertsAnswer`). */
743
+ subject: 'embedding' | 'extraction' | 'model_policy' | 'decision';
737
744
  /** quota | auth | no_key | model | policy (permanent); rate_limit | server |
738
745
  * network | timeout (transient, shown after 10 min). */
739
746
  code: string;
@@ -749,10 +756,23 @@ export type ProviderAlert = {
749
756
  /** When the brain tries one tiny call again (ISO), or null. */
750
757
  nextProbeAt: string | null;
751
758
  /** Extract jobs that wait: queued, retrying, running and dead-lettered.
752
- * Null when the queue has not started yet. */
759
+ * Null when the queue has not started yet, and for a subject the queue
760
+ * does not wait on (`model_policy`, `decision`). */
753
761
  waiting: number | null;
754
762
  };
755
763
 
764
+ /**
765
+ * The outages in `GET /api/embedding/recover` and `GET /api/embedding`.
766
+ * `alerts` holds only `embedding` and `extraction`, the subjects a released
767
+ * client knows; `model_policy` and `decision` go in `otherAlerts` (absent
768
+ * on an older brain). A `decision` alert is listed only while it is about
769
+ * the decider that runs now (enabled, a use on, the same model).
770
+ */
771
+ export type ProviderAlertsAnswer = {
772
+ alerts: ProviderAlert[];
773
+ otherAlerts: ProviderAlert[];
774
+ };
775
+
756
776
  export type AccountFoldersResult =
757
777
  | {
758
778
  ok: true;