@directive-run/core 1.21.0 → 1.22.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.
- package/README.md +2 -2
- package/dist/adapter-utils.d.cts +1 -1
- package/dist/adapter-utils.d.ts +1 -1
- package/dist/chunk-6NCC6RBC.js +3 -0
- package/dist/chunk-6NCC6RBC.js.map +1 -0
- package/dist/{chunk-4OXCKDKS.cjs → chunk-OAPD3HIG.cjs} +3 -3
- package/dist/{chunk-4OXCKDKS.cjs.map → chunk-OAPD3HIG.cjs.map} +1 -1
- package/dist/chunk-QTY2FXZY.cjs +3 -0
- package/dist/chunk-QTY2FXZY.cjs.map +1 -0
- package/dist/{chunk-E53A4NHM.js → chunk-YJEDX2JX.js} +3 -3
- package/dist/{chunk-E53A4NHM.js.map → chunk-YJEDX2JX.js.map} +1 -1
- package/dist/{index-DUbpbGw8.d.ts → index-BgKC_ZT_.d.ts} +1 -1
- package/dist/{index-CvQuu0tu.d.cts → index-DRPkZ8HE.d.cts} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -42
- package/dist/index.d.ts +46 -42
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +1 -1
- package/dist/internals.d.cts +39 -25
- package/dist/internals.d.ts +39 -25
- package/dist/internals.js +1 -1
- package/dist/plugins/index.cjs +2 -2
- package/dist/plugins/index.cjs.map +1 -1
- package/dist/plugins/index.d.cts +159 -3
- package/dist/plugins/index.d.ts +159 -3
- package/dist/plugins/index.js +2 -2
- package/dist/plugins/index.js.map +1 -1
- package/dist/{plugins-4IfhJV32.d.cts → plugins-5Supk7it.d.cts} +78 -30
- package/dist/{plugins-4IfhJV32.d.ts → plugins-5Supk7it.d.ts} +78 -30
- package/dist/{predicate-BW05x5el.d.ts → predicate-C9oMO_ny.d.ts} +1 -1
- package/dist/{predicate-DBTPnlg6.d.cts → predicate-DYb-3Mvl.d.cts} +1 -1
- package/dist/system-5FKUBLLV.cjs +2 -0
- package/dist/{system-SB7JYMRB.cjs.map → system-5FKUBLLV.cjs.map} +1 -1
- package/dist/system-6YWCXQOQ.js +2 -0
- package/dist/{system-SJBP4TO5.js.map → system-6YWCXQOQ.js.map} +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +1 -1
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6QAUJFQH.js +0 -3
- package/dist/chunk-6QAUJFQH.js.map +0 -1
- package/dist/chunk-M5PEB553.cjs +0 -3
- package/dist/chunk-M5PEB553.cjs.map +0 -1
- package/dist/system-SB7JYMRB.cjs +0 -2
- package/dist/system-SJBP4TO5.js +0 -2
package/dist/plugins/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AuditEntry, a as AuditEntryKind, b as AuditLedger, c as AuditLedgerOptions, d as AuditLedgerSink, Q as QueryFilter, e as createAuditLedger, m as memorySink } from '../index-
|
|
2
|
-
import { M as ModuleSchema, P as Plugin, ap as System } from '../plugins-
|
|
1
|
+
export { A as AuditEntry, a as AuditEntryKind, b as AuditLedger, c as AuditLedgerOptions, d as AuditLedgerSink, Q as QueryFilter, e as createAuditLedger, m as memorySink } from '../index-DRPkZ8HE.cjs';
|
|
2
|
+
import { M as ModuleSchema, P as Plugin, ap as System } from '../plugins-5Supk7it.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Logging Plugin - Console logging for Directive events
|
|
@@ -845,4 +845,160 @@ declare class CircuitBreakerOpenError extends Error {
|
|
|
845
845
|
*/
|
|
846
846
|
declare function createCircuitBreaker(config?: CircuitBreakerConfig): CircuitBreaker;
|
|
847
847
|
|
|
848
|
-
|
|
848
|
+
/**
|
|
849
|
+
* Clobber Alert Plugin – default high-severity alerting for
|
|
850
|
+
* `resolver.write.rejected { reason: "clobbered" }` events landing on
|
|
851
|
+
* facts tagged irreversible.
|
|
852
|
+
*
|
|
853
|
+
* The audit ledger already records every clobber event with full
|
|
854
|
+
* forensic detail (fact, expected, actual, resolver, requirementId).
|
|
855
|
+
* But a clobber on a fact tagged `"money"` / `"pii"` / `"irreversible"`
|
|
856
|
+
* is operationally far more urgent than a clobber on a UI status fact.
|
|
857
|
+
* Without this plugin, a consumer has to write their own SIEM rule to
|
|
858
|
+
* separate "noise" from "page an engineer NOW."
|
|
859
|
+
*
|
|
860
|
+
* Default behaviour: fire `console.error` on every clobber whose fact's
|
|
861
|
+
* schema meta carries any tag in `irreversibleTags`. Replace the
|
|
862
|
+
* `onAlert` callback to route to PagerDuty / Slack / Sentry / your SIEM
|
|
863
|
+
* of choice.
|
|
864
|
+
*
|
|
865
|
+
* @public
|
|
866
|
+
*/
|
|
867
|
+
|
|
868
|
+
/** Configuration for the {@link clobberAlertPlugin}. */
|
|
869
|
+
interface ClobberAlertPluginOptions {
|
|
870
|
+
/**
|
|
871
|
+
* Fact-meta tags that promote a clobber event from "noise" to
|
|
872
|
+
* "high-severity alert." A clobber whose fact's schema meta carries
|
|
873
|
+
* ANY of these tags fires `onAlert`.
|
|
874
|
+
*
|
|
875
|
+
* **Why tag the fact, not the resolver?** A clobber is detected at
|
|
876
|
+
* fact-write time. The audit event payload (`fact`, `expected`,
|
|
877
|
+
* `actual`) names the fact, not the side effect — the fact is the
|
|
878
|
+
* trigger surface for any irreversible work the resolver is about
|
|
879
|
+
* to do (a charge, a send, a delete). Tagging `payment.amount` with
|
|
880
|
+
* `"money"` marks the fact whose race-loss should page someone.
|
|
881
|
+
*
|
|
882
|
+
* If your model puts the irreversibility on the resolver rather than
|
|
883
|
+
* the fact, use `irreversibleResolvers` — both filters OR.
|
|
884
|
+
*
|
|
885
|
+
* Default: `["money", "pii", "irreversible"]`.
|
|
886
|
+
*/
|
|
887
|
+
irreversibleTags?: readonly string[];
|
|
888
|
+
/**
|
|
889
|
+
* Resolver IDs whose clobbered writes should always alert, regardless
|
|
890
|
+
* of fact tags. Use this when irreversibility is modeled on the
|
|
891
|
+
* resolver (e.g. `stripeCharge`) rather than on the trigger fact.
|
|
892
|
+
* Defaults to empty — the fact-tag path covers most cases.
|
|
893
|
+
*/
|
|
894
|
+
irreversibleResolvers?: readonly string[];
|
|
895
|
+
/**
|
|
896
|
+
* Callback fired when a clobber lands on a fact whose tags overlap
|
|
897
|
+
* `irreversibleTags`, or whose resolver is in `irreversibleResolvers`.
|
|
898
|
+
* Default: `console.error(...)`.
|
|
899
|
+
*/
|
|
900
|
+
onAlert?: (event: ClobberAlertEvent) => void;
|
|
901
|
+
/**
|
|
902
|
+
* Callback fired when the engine's per-resolver rate limit aggregates
|
|
903
|
+
* multiple per-write clobber events into a single
|
|
904
|
+
* `kind: "summary"` event (default cap: 10 per-resolver-instance).
|
|
905
|
+
* The summary names the resolver + dropped count but loses per-fact
|
|
906
|
+
* attribution — the engine has no way to enumerate every dropped
|
|
907
|
+
* write inside the cap.
|
|
908
|
+
*
|
|
909
|
+
* Only fires when EITHER:
|
|
910
|
+
* - the resolver is listed in `irreversibleResolvers`, OR
|
|
911
|
+
* - this plugin has previously fired `onAlert` for the resolver
|
|
912
|
+
* (i.e. the resolver has touched an irreversible fact in this
|
|
913
|
+
* session, so a follow-on burst is operationally relevant)
|
|
914
|
+
*
|
|
915
|
+
* Default: undefined (no summary alerts). Set this to preserve
|
|
916
|
+
* SIEM telemetry past the engine's rate-limit cap on a hot
|
|
917
|
+
* resolver fighting an irreversible fact.
|
|
918
|
+
*/
|
|
919
|
+
onSummary?: (event: ClobberSummaryEvent) => void;
|
|
920
|
+
/**
|
|
921
|
+
* Cooldown window keyed by `(fact, resolver)` pair. A second clobber
|
|
922
|
+
* from the same resolver on the same fact within this window does not
|
|
923
|
+
* re-fire `onAlert`. A clobber from a *different* resolver on the
|
|
924
|
+
* same fact still fires — fighting writers are a different
|
|
925
|
+
* operational incident than a single resolver retrying.
|
|
926
|
+
*
|
|
927
|
+
* The audit ledger records every clobber regardless of cooldown.
|
|
928
|
+
*
|
|
929
|
+
* Default: `0` (no cooldown — every event alerts).
|
|
930
|
+
*/
|
|
931
|
+
cooldownMs?: number;
|
|
932
|
+
}
|
|
933
|
+
/** Payload passed to {@link ClobberAlertPluginOptions.onAlert}. */
|
|
934
|
+
interface ClobberAlertEvent {
|
|
935
|
+
readonly fact: string;
|
|
936
|
+
/**
|
|
937
|
+
* Fact-meta tags that matched `irreversibleTags`. Empty when the alert
|
|
938
|
+
* fired only because the resolver matched `irreversibleResolvers`.
|
|
939
|
+
* Use {@link matchedBy} to distinguish without checking length.
|
|
940
|
+
*/
|
|
941
|
+
readonly tags: readonly string[];
|
|
942
|
+
/**
|
|
943
|
+
* Which filter triggered the alert:
|
|
944
|
+
* - `"tag"` — fact-meta tags overlapped `irreversibleTags`
|
|
945
|
+
* - `"resolver"` — resolver ID matched `irreversibleResolvers`
|
|
946
|
+
* - `"both"` — both filters matched
|
|
947
|
+
*/
|
|
948
|
+
readonly matchedBy: "tag" | "resolver" | "both";
|
|
949
|
+
readonly resolver: string;
|
|
950
|
+
readonly requirementId: string;
|
|
951
|
+
readonly expected: unknown;
|
|
952
|
+
readonly actual: unknown;
|
|
953
|
+
/** `Date.now()` at the moment the alert fired. */
|
|
954
|
+
readonly timestamp: number;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Payload passed to {@link ClobberAlertPluginOptions.onSummary}.
|
|
958
|
+
*
|
|
959
|
+
* Fired when the engine's per-resolver clobber rate-limit aggregates
|
|
960
|
+
* multiple per-write events into one summary. Per-fact attribution is
|
|
961
|
+
* lost (the engine cannot enumerate every dropped write inside the
|
|
962
|
+
* cap), but the resolver + dropped count are preserved so SIEM can
|
|
963
|
+
* page on "this resolver is still fighting an irreversible fact
|
|
964
|
+
* past the cap."
|
|
965
|
+
*/
|
|
966
|
+
interface ClobberSummaryEvent {
|
|
967
|
+
readonly resolver: string;
|
|
968
|
+
readonly requirementId: string;
|
|
969
|
+
/** Number of per-write clobber events the engine suppressed under the cap. */
|
|
970
|
+
readonly dropped: number;
|
|
971
|
+
/**
|
|
972
|
+
* Why the summary surfaced from this plugin's filter:
|
|
973
|
+
* - `"resolver-listed"` — the resolver was in `irreversibleResolvers`
|
|
974
|
+
* - `"prior-irreversible-alert"` — the resolver had already fired
|
|
975
|
+
* `onAlert` on an irreversible fact in this session
|
|
976
|
+
*/
|
|
977
|
+
readonly matchedBy: "resolver-listed" | "prior-irreversible-alert";
|
|
978
|
+
/** `Date.now()` at the moment the summary fired. */
|
|
979
|
+
readonly timestamp: number;
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Create a plugin that fires high-severity alerts for clobber events
|
|
983
|
+
* landing on irreversible-tagged facts.
|
|
984
|
+
*
|
|
985
|
+
* @example
|
|
986
|
+
* ```ts
|
|
987
|
+
* createSystem({
|
|
988
|
+
* module: myModule,
|
|
989
|
+
* plugins: [
|
|
990
|
+
* clobberAlertPlugin({
|
|
991
|
+
* irreversibleTags: ["money", "pii"],
|
|
992
|
+
* onAlert: (e) => pagerduty.trigger({
|
|
993
|
+
* severity: "critical",
|
|
994
|
+
* summary: `Clobber on ${e.fact} (${e.tags.join(", ")})`,
|
|
995
|
+
* details: e,
|
|
996
|
+
* }),
|
|
997
|
+
* }),
|
|
998
|
+
* ],
|
|
999
|
+
* });
|
|
1000
|
+
* ```
|
|
1001
|
+
*/
|
|
1002
|
+
declare function clobberAlertPlugin<M extends ModuleSchema>(options?: ClobberAlertPluginOptions): Plugin<M>;
|
|
1003
|
+
|
|
1004
|
+
export { type AggregatedMetric, type AlertConfig, type AlertEvent, type CircuitBreaker, type CircuitBreakerConfig, CircuitBreakerOpenError, type CircuitBreakerStats, type CircuitState, type ClobberAlertEvent, type ClobberAlertPluginOptions, type ConstraintMetrics, DEVTOOLS_EVENT_NAME, type DashboardData, type DevtoolsPluginOptions, type EffectMetrics, type HistogramBucket, type LoggingPluginOptions, type MetricDataPoint, type MetricType, type OTLPExporter, type OTLPExporterConfig, type ObservabilityConfig, type ObservabilityInstance, type PerformancePluginOptions, type PerformanceSnapshot, type PersistencePluginOptions, type ReconcileMetrics, type ResolverMetrics, type TraceEvent, type TraceSpan, clobberAlertPlugin, createAgentMetrics, createCircuitBreaker, createOTLPExporter, createObservability, devtoolsPlugin, emitDevToolsEvent, loggingPlugin, performancePlugin, persistencePlugin };
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AuditEntry, a as AuditEntryKind, b as AuditLedger, c as AuditLedgerOptions, d as AuditLedgerSink, Q as QueryFilter, e as createAuditLedger, m as memorySink } from '../index-
|
|
2
|
-
import { M as ModuleSchema, P as Plugin, ap as System } from '../plugins-
|
|
1
|
+
export { A as AuditEntry, a as AuditEntryKind, b as AuditLedger, c as AuditLedgerOptions, d as AuditLedgerSink, Q as QueryFilter, e as createAuditLedger, m as memorySink } from '../index-BgKC_ZT_.js';
|
|
2
|
+
import { M as ModuleSchema, P as Plugin, ap as System } from '../plugins-5Supk7it.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Logging Plugin - Console logging for Directive events
|
|
@@ -845,4 +845,160 @@ declare class CircuitBreakerOpenError extends Error {
|
|
|
845
845
|
*/
|
|
846
846
|
declare function createCircuitBreaker(config?: CircuitBreakerConfig): CircuitBreaker;
|
|
847
847
|
|
|
848
|
-
|
|
848
|
+
/**
|
|
849
|
+
* Clobber Alert Plugin – default high-severity alerting for
|
|
850
|
+
* `resolver.write.rejected { reason: "clobbered" }` events landing on
|
|
851
|
+
* facts tagged irreversible.
|
|
852
|
+
*
|
|
853
|
+
* The audit ledger already records every clobber event with full
|
|
854
|
+
* forensic detail (fact, expected, actual, resolver, requirementId).
|
|
855
|
+
* But a clobber on a fact tagged `"money"` / `"pii"` / `"irreversible"`
|
|
856
|
+
* is operationally far more urgent than a clobber on a UI status fact.
|
|
857
|
+
* Without this plugin, a consumer has to write their own SIEM rule to
|
|
858
|
+
* separate "noise" from "page an engineer NOW."
|
|
859
|
+
*
|
|
860
|
+
* Default behaviour: fire `console.error` on every clobber whose fact's
|
|
861
|
+
* schema meta carries any tag in `irreversibleTags`. Replace the
|
|
862
|
+
* `onAlert` callback to route to PagerDuty / Slack / Sentry / your SIEM
|
|
863
|
+
* of choice.
|
|
864
|
+
*
|
|
865
|
+
* @public
|
|
866
|
+
*/
|
|
867
|
+
|
|
868
|
+
/** Configuration for the {@link clobberAlertPlugin}. */
|
|
869
|
+
interface ClobberAlertPluginOptions {
|
|
870
|
+
/**
|
|
871
|
+
* Fact-meta tags that promote a clobber event from "noise" to
|
|
872
|
+
* "high-severity alert." A clobber whose fact's schema meta carries
|
|
873
|
+
* ANY of these tags fires `onAlert`.
|
|
874
|
+
*
|
|
875
|
+
* **Why tag the fact, not the resolver?** A clobber is detected at
|
|
876
|
+
* fact-write time. The audit event payload (`fact`, `expected`,
|
|
877
|
+
* `actual`) names the fact, not the side effect — the fact is the
|
|
878
|
+
* trigger surface for any irreversible work the resolver is about
|
|
879
|
+
* to do (a charge, a send, a delete). Tagging `payment.amount` with
|
|
880
|
+
* `"money"` marks the fact whose race-loss should page someone.
|
|
881
|
+
*
|
|
882
|
+
* If your model puts the irreversibility on the resolver rather than
|
|
883
|
+
* the fact, use `irreversibleResolvers` — both filters OR.
|
|
884
|
+
*
|
|
885
|
+
* Default: `["money", "pii", "irreversible"]`.
|
|
886
|
+
*/
|
|
887
|
+
irreversibleTags?: readonly string[];
|
|
888
|
+
/**
|
|
889
|
+
* Resolver IDs whose clobbered writes should always alert, regardless
|
|
890
|
+
* of fact tags. Use this when irreversibility is modeled on the
|
|
891
|
+
* resolver (e.g. `stripeCharge`) rather than on the trigger fact.
|
|
892
|
+
* Defaults to empty — the fact-tag path covers most cases.
|
|
893
|
+
*/
|
|
894
|
+
irreversibleResolvers?: readonly string[];
|
|
895
|
+
/**
|
|
896
|
+
* Callback fired when a clobber lands on a fact whose tags overlap
|
|
897
|
+
* `irreversibleTags`, or whose resolver is in `irreversibleResolvers`.
|
|
898
|
+
* Default: `console.error(...)`.
|
|
899
|
+
*/
|
|
900
|
+
onAlert?: (event: ClobberAlertEvent) => void;
|
|
901
|
+
/**
|
|
902
|
+
* Callback fired when the engine's per-resolver rate limit aggregates
|
|
903
|
+
* multiple per-write clobber events into a single
|
|
904
|
+
* `kind: "summary"` event (default cap: 10 per-resolver-instance).
|
|
905
|
+
* The summary names the resolver + dropped count but loses per-fact
|
|
906
|
+
* attribution — the engine has no way to enumerate every dropped
|
|
907
|
+
* write inside the cap.
|
|
908
|
+
*
|
|
909
|
+
* Only fires when EITHER:
|
|
910
|
+
* - the resolver is listed in `irreversibleResolvers`, OR
|
|
911
|
+
* - this plugin has previously fired `onAlert` for the resolver
|
|
912
|
+
* (i.e. the resolver has touched an irreversible fact in this
|
|
913
|
+
* session, so a follow-on burst is operationally relevant)
|
|
914
|
+
*
|
|
915
|
+
* Default: undefined (no summary alerts). Set this to preserve
|
|
916
|
+
* SIEM telemetry past the engine's rate-limit cap on a hot
|
|
917
|
+
* resolver fighting an irreversible fact.
|
|
918
|
+
*/
|
|
919
|
+
onSummary?: (event: ClobberSummaryEvent) => void;
|
|
920
|
+
/**
|
|
921
|
+
* Cooldown window keyed by `(fact, resolver)` pair. A second clobber
|
|
922
|
+
* from the same resolver on the same fact within this window does not
|
|
923
|
+
* re-fire `onAlert`. A clobber from a *different* resolver on the
|
|
924
|
+
* same fact still fires — fighting writers are a different
|
|
925
|
+
* operational incident than a single resolver retrying.
|
|
926
|
+
*
|
|
927
|
+
* The audit ledger records every clobber regardless of cooldown.
|
|
928
|
+
*
|
|
929
|
+
* Default: `0` (no cooldown — every event alerts).
|
|
930
|
+
*/
|
|
931
|
+
cooldownMs?: number;
|
|
932
|
+
}
|
|
933
|
+
/** Payload passed to {@link ClobberAlertPluginOptions.onAlert}. */
|
|
934
|
+
interface ClobberAlertEvent {
|
|
935
|
+
readonly fact: string;
|
|
936
|
+
/**
|
|
937
|
+
* Fact-meta tags that matched `irreversibleTags`. Empty when the alert
|
|
938
|
+
* fired only because the resolver matched `irreversibleResolvers`.
|
|
939
|
+
* Use {@link matchedBy} to distinguish without checking length.
|
|
940
|
+
*/
|
|
941
|
+
readonly tags: readonly string[];
|
|
942
|
+
/**
|
|
943
|
+
* Which filter triggered the alert:
|
|
944
|
+
* - `"tag"` — fact-meta tags overlapped `irreversibleTags`
|
|
945
|
+
* - `"resolver"` — resolver ID matched `irreversibleResolvers`
|
|
946
|
+
* - `"both"` — both filters matched
|
|
947
|
+
*/
|
|
948
|
+
readonly matchedBy: "tag" | "resolver" | "both";
|
|
949
|
+
readonly resolver: string;
|
|
950
|
+
readonly requirementId: string;
|
|
951
|
+
readonly expected: unknown;
|
|
952
|
+
readonly actual: unknown;
|
|
953
|
+
/** `Date.now()` at the moment the alert fired. */
|
|
954
|
+
readonly timestamp: number;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Payload passed to {@link ClobberAlertPluginOptions.onSummary}.
|
|
958
|
+
*
|
|
959
|
+
* Fired when the engine's per-resolver clobber rate-limit aggregates
|
|
960
|
+
* multiple per-write events into one summary. Per-fact attribution is
|
|
961
|
+
* lost (the engine cannot enumerate every dropped write inside the
|
|
962
|
+
* cap), but the resolver + dropped count are preserved so SIEM can
|
|
963
|
+
* page on "this resolver is still fighting an irreversible fact
|
|
964
|
+
* past the cap."
|
|
965
|
+
*/
|
|
966
|
+
interface ClobberSummaryEvent {
|
|
967
|
+
readonly resolver: string;
|
|
968
|
+
readonly requirementId: string;
|
|
969
|
+
/** Number of per-write clobber events the engine suppressed under the cap. */
|
|
970
|
+
readonly dropped: number;
|
|
971
|
+
/**
|
|
972
|
+
* Why the summary surfaced from this plugin's filter:
|
|
973
|
+
* - `"resolver-listed"` — the resolver was in `irreversibleResolvers`
|
|
974
|
+
* - `"prior-irreversible-alert"` — the resolver had already fired
|
|
975
|
+
* `onAlert` on an irreversible fact in this session
|
|
976
|
+
*/
|
|
977
|
+
readonly matchedBy: "resolver-listed" | "prior-irreversible-alert";
|
|
978
|
+
/** `Date.now()` at the moment the summary fired. */
|
|
979
|
+
readonly timestamp: number;
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Create a plugin that fires high-severity alerts for clobber events
|
|
983
|
+
* landing on irreversible-tagged facts.
|
|
984
|
+
*
|
|
985
|
+
* @example
|
|
986
|
+
* ```ts
|
|
987
|
+
* createSystem({
|
|
988
|
+
* module: myModule,
|
|
989
|
+
* plugins: [
|
|
990
|
+
* clobberAlertPlugin({
|
|
991
|
+
* irreversibleTags: ["money", "pii"],
|
|
992
|
+
* onAlert: (e) => pagerduty.trigger({
|
|
993
|
+
* severity: "critical",
|
|
994
|
+
* summary: `Clobber on ${e.fact} (${e.tags.join(", ")})`,
|
|
995
|
+
* details: e,
|
|
996
|
+
* }),
|
|
997
|
+
* }),
|
|
998
|
+
* ],
|
|
999
|
+
* });
|
|
1000
|
+
* ```
|
|
1001
|
+
*/
|
|
1002
|
+
declare function clobberAlertPlugin<M extends ModuleSchema>(options?: ClobberAlertPluginOptions): Plugin<M>;
|
|
1003
|
+
|
|
1004
|
+
export { type AggregatedMetric, type AlertConfig, type AlertEvent, type CircuitBreaker, type CircuitBreakerConfig, CircuitBreakerOpenError, type CircuitBreakerStats, type CircuitState, type ClobberAlertEvent, type ClobberAlertPluginOptions, type ConstraintMetrics, DEVTOOLS_EVENT_NAME, type DashboardData, type DevtoolsPluginOptions, type EffectMetrics, type HistogramBucket, type LoggingPluginOptions, type MetricDataPoint, type MetricType, type OTLPExporter, type OTLPExporterConfig, type ObservabilityConfig, type ObservabilityInstance, type PerformancePluginOptions, type PerformanceSnapshot, type PersistencePluginOptions, type ReconcileMetrics, type ResolverMetrics, type TraceEvent, type TraceSpan, clobberAlertPlugin, createAgentMetrics, createCircuitBreaker, createOTLPExporter, createObservability, devtoolsPlugin, emitDevToolsEvent, loggingPlugin, performancePlugin, persistencePlugin };
|