@absolutejs/ai 0.0.22 → 0.0.24

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.
@@ -12,9 +12,30 @@ export type ResilienceConfig = {
12
12
  /** Override the global resilience defaults (retry counts, breaker thresholds). */
13
13
  export declare const configureProviderResilience: (partial: Partial<ResilienceConfig>) => void;
14
14
  type CircuitState = "closed" | "open" | "half-open";
15
+ type ExternalStatus = {
16
+ available: boolean;
17
+ /** Statuspage indicator, e.g. "major_outage" | "operational" | "unknown". */
18
+ indicator: string;
19
+ reason: string;
20
+ checkedAt: number;
21
+ };
22
+ /**
23
+ * Feed externally-observed provider availability (typically from a status-page
24
+ * monitor) into the breaker. A report of `available: false` makes the provider
25
+ * fail fast immediately; `available: true` clears the external block (the
26
+ * reactive breaker still governs real failures).
27
+ */
28
+ export declare const setProviderAvailability: (provider: string, status: {
29
+ available: boolean;
30
+ indicator?: string;
31
+ reason?: string;
32
+ }) => void;
15
33
  export type ProviderHealth = {
16
34
  provider: string;
17
- /** True when the circuit is closed (provider believed healthy). */
35
+ /**
36
+ * True when the provider is usable: circuit closed AND not reported down by
37
+ * an external status monitor.
38
+ */
18
39
  healthy: boolean;
19
40
  state: CircuitState;
20
41
  consecutiveFailures: number;
@@ -28,6 +49,8 @@ export type ProviderHealth = {
28
49
  message: string;
29
50
  } | null;
30
51
  statusPageUrl: string | null;
52
+ /** Latest externally-observed status (e.g. status page), if any. */
53
+ external: ExternalStatus | null;
31
54
  };
32
55
  /**
33
56
  * Inspect provider health as tracked by the circuit breaker. Pass a provider
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/ai",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "homepage": "https://github.com/absolutejs/ai",
5
5
  "bugs": {
6
6
  "url": "https://github.com/absolutejs/ai/issues"