@wrongstack/core 0.291.2 → 0.292.1
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/dist/coordination/director-tools.d.ts.map +1 -1
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +276 -152
- package/dist/coordination/index.js.map +4 -4
- package/dist/coordination/mailbox-http-router.d.ts +38 -0
- package/dist/coordination/mailbox-http-router.d.ts.map +1 -1
- package/dist/coordination/provider-status-tracker.d.ts.map +1 -1
- package/dist/core/agent-loop.d.ts.map +1 -1
- package/dist/core/agent-response.d.ts.map +1 -1
- package/dist/core/context.d.ts +10 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/fallback-model.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +20 -1
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/defaults/index.d.ts +1 -0
- package/dist/defaults/index.d.ts.map +1 -1
- package/dist/defaults/index.js +3137 -2441
- package/dist/defaults/index.js.map +4 -4
- package/dist/execution/auto-compaction-middleware.d.ts +34 -2
- package/dist/execution/auto-compaction-middleware.d.ts.map +1 -1
- package/dist/execution/compaction-core.d.ts +59 -0
- package/dist/execution/compaction-core.d.ts.map +1 -1
- package/dist/execution/compactor.d.ts.map +1 -1
- package/dist/execution/error-handler.d.ts +7 -0
- package/dist/execution/error-handler.d.ts.map +1 -1
- package/dist/execution/index.d.ts +1 -0
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +4684 -3924
- package/dist/execution/index.js.map +4 -4
- package/dist/execution/intelligent-compactor.d.ts.map +1 -1
- package/dist/execution/model-runtime.d.ts.map +1 -1
- package/dist/execution/one-shot-llm.d.ts.map +1 -1
- package/dist/execution/selective-compactor.d.ts +10 -0
- package/dist/execution/selective-compactor.d.ts.map +1 -1
- package/dist/execution/subagent-compaction.d.ts +24 -0
- package/dist/execution/subagent-compaction.d.ts.map +1 -0
- package/dist/hq/alerts.d.ts +5 -0
- package/dist/hq/alerts.d.ts.map +1 -1
- package/dist/hq/auth-audit.d.ts +115 -0
- package/dist/hq/auth-audit.d.ts.map +1 -0
- package/dist/hq/auth-store.d.ts +98 -2
- package/dist/hq/auth-store.d.ts.map +1 -1
- package/dist/hq/brain-bridge.d.ts +2 -8
- package/dist/hq/brain-bridge.d.ts.map +1 -1
- package/dist/hq/bridge-context.d.ts +74 -0
- package/dist/hq/bridge-context.d.ts.map +1 -0
- package/dist/hq/cost-bridge.d.ts +4 -10
- package/dist/hq/cost-bridge.d.ts.map +1 -1
- package/dist/hq/fleet-bridge.d.ts +2 -8
- package/dist/hq/fleet-bridge.d.ts.map +1 -1
- package/dist/hq/index.d.ts +2 -0
- package/dist/hq/index.d.ts.map +1 -1
- package/dist/hq/index.js +358 -222
- package/dist/hq/index.js.map +4 -4
- package/dist/hq/protocol/session.d.ts +13 -0
- package/dist/hq/protocol/session.d.ts.map +1 -1
- package/dist/hq/tool-bridge.d.ts +2 -8
- package/dist/hq/tool-bridge.d.ts.map +1 -1
- package/dist/hq/worktree-bridge.d.ts +2 -8
- package/dist/hq/worktree-bridge.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6332 -4853
- package/dist/index.js.map +4 -4
- package/dist/infrastructure/index.js +32 -15
- package/dist/infrastructure/index.js.map +2 -2
- package/dist/infrastructure/provider-cache-ledger.d.ts +48 -0
- package/dist/infrastructure/provider-cache-ledger.d.ts.map +1 -0
- package/dist/infrastructure/token-counter.d.ts +4 -2
- package/dist/infrastructure/token-counter.d.ts.map +1 -1
- package/dist/kernel/events/brain-events.d.ts +2 -0
- package/dist/kernel/events/brain-events.d.ts.map +1 -1
- package/dist/kernel/events/memory-events.d.ts +102 -0
- package/dist/kernel/events/memory-events.d.ts.map +1 -1
- package/dist/kernel/events/session-events.d.ts +35 -0
- package/dist/kernel/events/session-events.d.ts.map +1 -1
- package/dist/models/index.js +161 -78
- package/dist/models/index.js.map +3 -3
- package/dist/models/llm-selector.d.ts.map +1 -1
- package/dist/notifications/index.d.ts +40 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/notifier-impl.d.ts +34 -0
- package/dist/notifications/notifier-impl.d.ts.map +1 -0
- package/dist/notifications/notifier.d.ts +95 -0
- package/dist/notifications/notifier.d.ts.map +1 -0
- package/dist/notifications/types.d.ts +111 -0
- package/dist/notifications/types.d.ts.map +1 -0
- package/dist/plugin/api.d.ts +10 -1
- package/dist/plugin/api.d.ts.map +1 -1
- package/dist/registry/provider-registry.d.ts +1 -1
- package/dist/registry/provider-registry.d.ts.map +1 -1
- package/dist/security/index.js +15 -15
- package/dist/security/index.js.map +3 -3
- package/dist/skills/index.js +80 -80
- package/dist/skills/index.js.map +3 -3
- package/dist/storage/config-loader.d.ts +3 -5
- package/dist/storage/config-loader.d.ts.map +1 -1
- package/dist/storage/index.js +325 -259
- package/dist/storage/index.js.map +4 -4
- package/dist/storage/memory-consolidator.d.ts +14 -2
- package/dist/storage/memory-consolidator.d.ts.map +1 -1
- package/dist/storage/queue-store.d.ts +2 -0
- package/dist/storage/queue-store.d.ts.map +1 -1
- package/dist/tools/index.js +14 -7
- package/dist/tools/index.js.map +3 -3
- package/dist/tools/mcp-control.d.ts +1 -1
- package/dist/types/config.d.ts +64 -20
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.js +65 -35
- package/dist/types/index.js.map +3 -3
- package/dist/types/plugin.d.ts +11 -0
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/provider.d.ts +31 -0
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/token-counter.d.ts +8 -1
- package/dist/types/token-counter.d.ts.map +1 -1
- package/dist/utils/cache-key.d.ts +19 -0
- package/dist/utils/cache-key.d.ts.map +1 -0
- package/dist/utils/compaction-preview.d.ts +8 -0
- package/dist/utils/compaction-preview.d.ts.map +1 -0
- package/dist/utils/connectivity.d.ts +36 -0
- package/dist/utils/connectivity.d.ts.map +1 -0
- package/dist/utils/context-breakdown.d.ts +59 -0
- package/dist/utils/context-breakdown.d.ts.map +1 -0
- package/dist/utils/context-evidence.d.ts +22 -0
- package/dist/utils/context-evidence.d.ts.map +1 -1
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1761 -1541
- package/dist/utils/index.js.map +4 -4
- package/dist/utils/token-estimate.d.ts +27 -0
- package/dist/utils/token-estimate.d.ts.map +1 -1
- package/instructions/llm/memory-consolidator.md +19 -3
- package/instructions/system.md +10 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-selector.d.ts","sourceRoot":"","sources":["../../src/models/llm-selector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"llm-selector.d.ts","sourceRoot":"","sources":["../../src/models/llm-selector.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,QAAQ,EAAE,QAAQ,CAAC;IACnB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CACvD;AAmDD;;;;GAIG;AACH,qBAAa,WAAY,YAAW,eAAe;IACjD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAkC;IAEvE,YAAY,IAAI,EAAE,kBAAkB,EAenC;IAEK,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAmE5E;IAED,OAAO,CAAC,cAAc;IAiCtB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;CAiF5B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notifications subsystem — one-way channel-agnostic delivery.
|
|
3
|
+
*
|
|
4
|
+
* This module defines the contracts and interfaces for sending notifications
|
|
5
|
+
* from the agent to the user through any registered channel (Telegram,
|
|
6
|
+
* Slack webhook, generic webhook, email, ntfy, etc.). The system is built
|
|
7
|
+
* around three core abstractions:
|
|
8
|
+
*
|
|
9
|
+
* - `NotificationMessage` — a channel-agnostic payload with title, body,
|
|
10
|
+
* severity level, and optional metadata.
|
|
11
|
+
* - `NotificationChannel` — an interface each provider implements to
|
|
12
|
+
* handle delivery to its specific medium.
|
|
13
|
+
* - `Notifier` — the central dispatch that routes messages to channels
|
|
14
|
+
* by name and aggregates results.
|
|
15
|
+
*
|
|
16
|
+
* Usage (conceptual):
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { Notifier } from '@wrongstack/core';
|
|
20
|
+
*
|
|
21
|
+
* // The host registers channels at startup:
|
|
22
|
+
* notifier.registerChannel(new SlackWebhookChannel({ webhookUrl }));
|
|
23
|
+
* notifier.registerChannel(new TelegramChannel({ bot, chatId }));
|
|
24
|
+
*
|
|
25
|
+
* // Any caller sends a notification:
|
|
26
|
+
* await notifier.notify(['slack', 'telegram'], {
|
|
27
|
+
* title: 'Deploy complete',
|
|
28
|
+
* body: 'v2.1.0 deployed to production — 12/12 tests passed.',
|
|
29
|
+
* level: 'info',
|
|
30
|
+
* source: 'ci:pipeline',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @packageDocumentation
|
|
35
|
+
* @module notifications
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export { type NotificationChannel, type NotificationChannelStatus, type NotificationLevel, type NotificationMessage, type NotificationResult, type Notifier, type NotifierCounters, } from './notifier.js';
|
|
39
|
+
export { NotifierImpl } from './notifier-impl.js';
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NotifierImpl — concrete implementation of the Notifier interface.
|
|
3
|
+
*
|
|
4
|
+
* Holds a registry of named NotificationChannel instances and dispatches
|
|
5
|
+
* notify() calls to the matching channels. Tracks delivery counters per
|
|
6
|
+
* channel for diagnostics and health reporting.
|
|
7
|
+
*
|
|
8
|
+
* Thread-safe: all public methods are re-entrant. `notify()` may be called
|
|
9
|
+
* concurrently for different messages; each channel's `deliver()` runs in
|
|
10
|
+
* its own Promise (no serialisation).
|
|
11
|
+
*
|
|
12
|
+
* @module notifications
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
import type { NotificationChannel, NotificationMessage, NotificationResult } from './types.js';
|
|
16
|
+
import type { NotificationChannelStatus, Notifier, NotifierCounters } from './notifier.js';
|
|
17
|
+
export declare class NotifierImpl implements Notifier {
|
|
18
|
+
#private;
|
|
19
|
+
notify(channels: string | string[], message: NotificationMessage): Promise<NotificationResult[]>;
|
|
20
|
+
registerChannel(channel: NotificationChannel): void;
|
|
21
|
+
unregisterChannel(name: string): void;
|
|
22
|
+
channels(): Promise<NotificationChannelStatus[]>;
|
|
23
|
+
counters(): NotifierCounters;
|
|
24
|
+
/**
|
|
25
|
+
* Return per-channel counters for detailed diagnostics.
|
|
26
|
+
* Not part of the `Notifier` interface — available on the concrete class.
|
|
27
|
+
*/
|
|
28
|
+
perChannelCounters(): Record<string, {
|
|
29
|
+
attempted: number;
|
|
30
|
+
delivered: number;
|
|
31
|
+
failed: number;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=notifier-impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifier-impl.d.ts","sourceRoot":"","sources":["../../src/notifications/notifier-impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,KAAK,EACV,yBAAyB,EACzB,QAAQ,EACR,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAqBvB,qBAAa,YAAa,YAAW,QAAQ;;IAW3C,MAAM,CACJ,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAC3B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA2C/B;IAED,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAYlD;IAED,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGpC;IAEK,QAAQ,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAiBrD;IAED,QAAQ,IAAI,gBAAgB,CAY3B;IAED;;;OAGG;IACH,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAU7F;CACF"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notifier — central dispatch for one-way notification delivery.
|
|
3
|
+
*
|
|
4
|
+
* The `Notifier` is the entry point for all notification traffic. It maps
|
|
5
|
+
* channel names to `NotificationChannel` instances and handles dispatch,
|
|
6
|
+
* result aggregation, and channel health reporting.
|
|
7
|
+
*
|
|
8
|
+
* A host (CLI, TUI, WebUI) creates one `Notifier` instance at startup,
|
|
9
|
+
* registers channels from plugins and config, and makes it available via
|
|
10
|
+
* the container or context. Plugins and the agent loop call
|
|
11
|
+
* `notifier.notify()` to deliver messages.
|
|
12
|
+
*
|
|
13
|
+
* @module notifications
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
import type { NotificationChannel, NotificationMessage, NotificationResult } from './types.js';
|
|
17
|
+
/**
|
|
18
|
+
* Central dispatch for one-way notifications.
|
|
19
|
+
*
|
|
20
|
+
* Implementations aggregate results across all targeted channels and report
|
|
21
|
+
* delivery status per channel. The caller does NOT need to know which
|
|
22
|
+
* channel implementations are registered — it addresses channels by their
|
|
23
|
+
* configured name.
|
|
24
|
+
*/
|
|
25
|
+
export interface Notifier {
|
|
26
|
+
/**
|
|
27
|
+
* Deliver a message to one or more named channels.
|
|
28
|
+
*
|
|
29
|
+
* @param channels - Channel name or an array of channel names (e.g.
|
|
30
|
+
* `"slack"`, `["telegram", "slack"]`). Unknown names are silently
|
|
31
|
+
* skipped — the result array only includes entries for registered
|
|
32
|
+
* channels. An empty array or all-unknown names produces an empty
|
|
33
|
+
* result array.
|
|
34
|
+
* @param message - The notification payload. The `source` field is
|
|
35
|
+
* automatically set to the caller's identifier if not already present.
|
|
36
|
+
*
|
|
37
|
+
* @returns One `NotificationResult` per matched channel, in registration
|
|
38
|
+
* order. The caller should NOT treat `ok = false` on one channel as
|
|
39
|
+
* a reason to retry the whole batch — channels have independent
|
|
40
|
+
* circuit breakers and backoff policies.
|
|
41
|
+
*/
|
|
42
|
+
notify(channels: string | string[], message: NotificationMessage): Promise<NotificationResult[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Register a channel implementation.
|
|
45
|
+
*
|
|
46
|
+
* Channels are identified by `NotificationChannel.name`. Registering a
|
|
47
|
+
* channel with a name that already exists **replaces** the previous
|
|
48
|
+
* registration (last-write-wins). This lets config changes swap out a
|
|
49
|
+
* channel implementation without restarting.
|
|
50
|
+
*/
|
|
51
|
+
registerChannel(channel: NotificationChannel): void;
|
|
52
|
+
/**
|
|
53
|
+
* Remove a registered channel by name. Idempotent — removing a
|
|
54
|
+
* non-existent name is a no-op.
|
|
55
|
+
*/
|
|
56
|
+
unregisterChannel(name: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Return the current state of all registered channels.
|
|
59
|
+
*
|
|
60
|
+
* Calls `ping()` on each channel in parallel. A channel that throws
|
|
61
|
+
* during `ping()` is reported as `{ ok: false, error: "ping failed" }`
|
|
62
|
+
* rather than propagating the error to the caller.
|
|
63
|
+
*/
|
|
64
|
+
channels(): Promise<NotificationChannelStatus[]>;
|
|
65
|
+
/**
|
|
66
|
+
* Return a snapshot of the delivery counters aggregated across all
|
|
67
|
+
* channels since the notifier was created (or since the last reset).
|
|
68
|
+
* Useful for diagnostics and the health endpoint.
|
|
69
|
+
*/
|
|
70
|
+
counters(): NotifierCounters;
|
|
71
|
+
}
|
|
72
|
+
export type { NotificationChannel, NotificationLevel, NotificationMessage, NotificationResult, } from './types.js';
|
|
73
|
+
/** Per-channel health status produced by `Notifier.channels()`. */
|
|
74
|
+
export interface NotificationChannelStatus {
|
|
75
|
+
/** Channel name (matches `NotificationChannel.name`). */
|
|
76
|
+
name: string;
|
|
77
|
+
/** Channel type discriminator. */
|
|
78
|
+
type: string;
|
|
79
|
+
/** Whether `ping()` returned success. */
|
|
80
|
+
ok: boolean;
|
|
81
|
+
/** Error message when `ok` is false. */
|
|
82
|
+
error?: string | undefined;
|
|
83
|
+
}
|
|
84
|
+
/** Aggregate counters exposed by `Notifier.counters()`. */
|
|
85
|
+
export interface NotifierCounters {
|
|
86
|
+
/** Total delivery attempts across all channels. */
|
|
87
|
+
attempted: number;
|
|
88
|
+
/** Successful deliveries. */
|
|
89
|
+
delivered: number;
|
|
90
|
+
/** Failed deliveries. */
|
|
91
|
+
failed: number;
|
|
92
|
+
/** Deliveries suppressed by circuit breakers. */
|
|
93
|
+
suppressed: number;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=notifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifier.d.ts","sourceRoot":"","sources":["../../src/notifications/notifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAM/F;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAEjG;;;;;;;OAOG;IACH,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAEpD;;;OAGG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC;;;;;;OAMG;IACH,QAAQ,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAAC;IAEjD;;;;OAIG;IACH,QAAQ,IAAI,gBAAgB,CAAC;CAC9B;AAMD,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAMpB,mEAAmE;AACnE,MAAM,WAAW,yBAAyB;IACxC,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,EAAE,EAAE,OAAO,CAAC;IACZ,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core notification types for the Notifications/Channels system.
|
|
3
|
+
*
|
|
4
|
+
* This module defines the contracts for **one-way** communication from the
|
|
5
|
+
* agent to the user through any registered notification channel. Every channel
|
|
6
|
+
* (Telegram, Slack webhook, generic webhook, email, ntfy, etc.) implements
|
|
7
|
+
* the same `NotificationChannel` interface.
|
|
8
|
+
*
|
|
9
|
+
* Design principles:
|
|
10
|
+
*
|
|
11
|
+
* 1. **One-way only.** Notifications are fire-and-forget — the agent sends,
|
|
12
|
+
* the channel delivers. Reply-style 2-way communication (read, approve,
|
|
13
|
+
* callback queries) belongs in the specific channel's own subsystem
|
|
14
|
+
* (e.g. Telegram's telegram_read / telegram_approve tools).
|
|
15
|
+
*
|
|
16
|
+
* 2. **Channel-agnostic.** A `NotificationMessage` has no Telegram-specific
|
|
17
|
+
* fields. The channel implementation decides how to render it (emoji,
|
|
18
|
+
* markdown, JSON, etc.).
|
|
19
|
+
*
|
|
20
|
+
* 3. **Level-gated.** Each message carries a severity level so channels can
|
|
21
|
+
* filter by importance (e.g. "only critical to email").
|
|
22
|
+
*
|
|
23
|
+
* 4. **Config-driven routing.** Messages flow to channels through a central
|
|
24
|
+
* `Notifier` that maps event → channel names. Channels are registered
|
|
25
|
+
* by the host or by plugins at startup.
|
|
26
|
+
*
|
|
27
|
+
* @module notifications
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
/** Notification severity — hints at urgency without prescribing delivery. */
|
|
31
|
+
export type NotificationLevel = 'info' | 'warning' | 'critical';
|
|
32
|
+
/**
|
|
33
|
+
* A message to be delivered through one or more notification channels.
|
|
34
|
+
* Channels render the fields as appropriate for their medium (plain text,
|
|
35
|
+
* Slack blocks, HTML email, etc.).
|
|
36
|
+
*/
|
|
37
|
+
export interface NotificationMessage {
|
|
38
|
+
/** Short headline — ideally under 80 chars for push notifications. */
|
|
39
|
+
title: string;
|
|
40
|
+
/** Body text with details. Supports plain text only; channels that accept
|
|
41
|
+
* markdown (Slack, Discord) may apply light formatting on delivery. */
|
|
42
|
+
body: string;
|
|
43
|
+
/** Severity hint for the channel's routing logic (e.g. "critical" bypasses
|
|
44
|
+
* summarisation, triggers push alerts). */
|
|
45
|
+
level: NotificationLevel;
|
|
46
|
+
/**
|
|
47
|
+
* Machine-readable source identifier — the event or subsystem that
|
|
48
|
+
* triggered the notification, such as `"session.end"`, `"tool.exec"`,
|
|
49
|
+
* `"delegate.completed"`, `"notify.send"`.
|
|
50
|
+
*/
|
|
51
|
+
source: string;
|
|
52
|
+
/**
|
|
53
|
+
* Optional structured context the channel may use for rendering decisions.
|
|
54
|
+
* Values must be JSON-serialisable. Example keys: `durationMs`, `ok`,
|
|
55
|
+
* `tokens`, `url`.
|
|
56
|
+
*/
|
|
57
|
+
metadata?: Record<string, unknown> | undefined;
|
|
58
|
+
}
|
|
59
|
+
/** Outcome of a single delivery attempt on one channel. */
|
|
60
|
+
export interface NotificationResult {
|
|
61
|
+
/** Whether the channel accepted and delivered the message. */
|
|
62
|
+
ok: boolean;
|
|
63
|
+
/** Channel name (matches `NotificationChannel.name`). */
|
|
64
|
+
channel: string;
|
|
65
|
+
/** Human-readable error when `ok` is false. */
|
|
66
|
+
error?: string | undefined;
|
|
67
|
+
/** ISO-8601 timestamp of when delivery was attempted. */
|
|
68
|
+
deliveredAt: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A deliverable notification channel.
|
|
72
|
+
*
|
|
73
|
+
* Implement this interface to add a new notification provider. Each provider
|
|
74
|
+
* is responsible for its own connection lifecycle, authentication, and
|
|
75
|
+
* delivery semantics. The host calls `deliver(msg)` and expects a truthful
|
|
76
|
+
* result — the channel should catch and report errors rather than throwing.
|
|
77
|
+
*
|
|
78
|
+
* Channels are **not** expected to be long-running servers; a channel may
|
|
79
|
+
* open a connection per call (webhook POST) or maintain a persistent
|
|
80
|
+
* connection (WebSocket, Telegram long-polling sender).
|
|
81
|
+
*/
|
|
82
|
+
export interface NotificationChannel {
|
|
83
|
+
/** Canonical name used in config routes, e.g. `"slack"`, `"telegram"`. */
|
|
84
|
+
readonly name: string;
|
|
85
|
+
/** Type discriminator for diagnostics, e.g. `"webhook"`, `"telegram"`,
|
|
86
|
+
* `"email"`. Multiple channels may share a type (e.g. Slack and Discord
|
|
87
|
+
* are both `"webhook"`). */
|
|
88
|
+
readonly type: string;
|
|
89
|
+
/**
|
|
90
|
+
* Deliver a notification message through this channel.
|
|
91
|
+
*
|
|
92
|
+
* **Must not throw.** Catch transport errors and return
|
|
93
|
+
* `{ ok: false, error: "…" }` instead. The `Notifier` uses this contract
|
|
94
|
+
* to count failures and manage circuit breakers.
|
|
95
|
+
*/
|
|
96
|
+
deliver(msg: NotificationMessage): Promise<NotificationResult>;
|
|
97
|
+
/**
|
|
98
|
+
* Liveness check — called by the host's `health()` aggregator and by the
|
|
99
|
+
* `Notifier.channels()` status view.
|
|
100
|
+
*
|
|
101
|
+
* Should make a best-effort probe of the channel's reachability without
|
|
102
|
+
* sending a real notification. When the channel cannot probe (e.g. no
|
|
103
|
+
* permanent connection), return `{ ok: true }` — the host treats an
|
|
104
|
+
* absent probe as "assume healthy".
|
|
105
|
+
*/
|
|
106
|
+
ping(): Promise<{
|
|
107
|
+
ok: boolean;
|
|
108
|
+
error?: string | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/notifications/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAMH,6EAA6E;AAC7E,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAMhE;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd;2EACuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb;+CAC2C;IAC3C,KAAK,EAAE,iBAAiB,CAAC;IACzB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAChD;AAMD,2DAA2D;AAC3D,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,EAAE,EAAE,OAAO,CAAC;IACZ,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;CACrB;AAMD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;gCAE4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,OAAO,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE/D;;;;;;;;OAQG;IACH,IAAI,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;CAC9D"}
|
package/dist/plugin/api.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { Config } from '../types/config.js';
|
|
|
10
10
|
import type { HookEvent, HookMatcher, InProcessHook } from '../types/hooks.js';
|
|
11
11
|
import type { Logger } from '../types/logger.js';
|
|
12
12
|
import type { ModelsRegistry } from '../types/models-registry.js';
|
|
13
|
-
import type { MCPRegistryView, MetricsSinkView, PluginAPI, PluginCapabilities, PluginDependency, PluginLLM, PluginPipelines, ProviderRegistryView, SessionWriterView, SlashCommandRegistryView, ToolRegistryView } from '../types/plugin.js';
|
|
13
|
+
import type { MCPRegistryView, MetricsSinkView, Notifier, PluginAPI, PluginCapabilities, PluginDependency, PluginLLM, PluginPipelines, ProviderRegistryView, SessionWriterView, SlashCommandRegistryView, ToolRegistryView } from '../types/plugin.js';
|
|
14
14
|
import type { Provider } from '../types/provider.js';
|
|
15
15
|
import type { SystemPromptContributor } from '../types/system-prompt-contributor.js';
|
|
16
16
|
import type { JSONSchema } from '../types/tool.js';
|
|
@@ -63,6 +63,12 @@ export interface PluginAPIInit {
|
|
|
63
63
|
* When not provided, those plugins should gracefully no-op.
|
|
64
64
|
*/
|
|
65
65
|
mailbox?: Mailbox | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Notification router for one-way channel delivery. Plugins that
|
|
68
|
+
* implement `NotificationChannel` register their channel here during
|
|
69
|
+
* `setup()`. Optional — minimal hosts/tests may omit it.
|
|
70
|
+
*/
|
|
71
|
+
notifier?: Notifier | undefined;
|
|
66
72
|
/**
|
|
67
73
|
* LLM wiring for `api.llm`. When provided, `DefaultPluginAPI` exposes a
|
|
68
74
|
* `PluginLLM` that routes completions through the host's provider layer:
|
|
@@ -82,6 +88,8 @@ export interface PluginAPIInit {
|
|
|
82
88
|
llm?: {
|
|
83
89
|
provider: Provider;
|
|
84
90
|
model: string;
|
|
91
|
+
getProvider?: (() => Provider) | undefined;
|
|
92
|
+
getModel?: (() => string) | undefined;
|
|
85
93
|
createProvider?: ((name: string, model?: string) => Provider) | undefined;
|
|
86
94
|
} | undefined;
|
|
87
95
|
config: Config;
|
|
@@ -122,6 +130,7 @@ export declare class DefaultPluginAPI implements PluginAPI {
|
|
|
122
130
|
readonly log: Logger;
|
|
123
131
|
readonly modelsRegistry: ModelsRegistry | undefined;
|
|
124
132
|
readonly mailbox: Mailbox | undefined;
|
|
133
|
+
readonly notifier: Notifier | undefined;
|
|
125
134
|
readonly llm: PluginLLM | undefined;
|
|
126
135
|
private readonly configStore;
|
|
127
136
|
private readonly hookRegistry;
|
package/dist/plugin/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/plugin/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,8BAA8B,CAAC;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,YAAY,CAAC,EAAE,CAAC,MAAM,GAAG,gBAAgB,CAAC,EAAE,GAAG,SAAS,CAAC;IACzD,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACrC,KAAK,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD,CAkBA"}
|
|
@@ -45,7 +45,7 @@ export declare class ProviderRegistry {
|
|
|
45
45
|
* removed, false if none was registered for that type.
|
|
46
46
|
*/
|
|
47
47
|
unregister(type: string): boolean;
|
|
48
|
-
create(cfg: ProviderConfig): Provider;
|
|
48
|
+
create(cfg: ProviderConfig, factoryType?: string): Provider;
|
|
49
49
|
list(): string[];
|
|
50
50
|
}
|
|
51
51
|
//# sourceMappingURL=provider-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-registry.d.ts","sourceRoot":"","sources":["../../src/registry/provider-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,GAAG,EAAE,cAAc,GAAG,QAAQ,CAAC;CACvC;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsC;IAEhE;;;;OAIG;IACH,QAAQ,CAAC,CAAC,EAAE,eAAe,GAAG,IAAI,CAEjC;IAED;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,IAAI,CAE9C;IAED;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,GAAG,IAAI,CAK/C;IAED,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzB;IAED;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhC;IAED,MAAM,CAAC,GAAG,EAAE,cAAc,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"provider-registry.d.ts","sourceRoot":"","sources":["../../src/registry/provider-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,GAAG,EAAE,cAAc,GAAG,QAAQ,CAAC;CACvC;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsC;IAEhE;;;;OAIG;IACH,QAAQ,CAAC,CAAC,EAAE,eAAe,GAAG,IAAI,CAEjC;IAED;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,IAAI,CAE9C;IAED;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,GAAG,IAAI,CAK/C;IAED,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzB;IAED;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhC;IAED,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE,WAAW,GAAE,MAAiB,GAAG,QAAQ,CAQpE;IAED,IAAI,IAAI,MAAM,EAAE,CAEf;CACF"}
|
package/dist/security/index.js
CHANGED
|
@@ -270,6 +270,21 @@ async function renameWithRetry(from, to) {
|
|
|
270
270
|
throw lastErr;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
// src/utils/error.ts
|
|
274
|
+
function toErrorMessage(err) {
|
|
275
|
+
return err instanceof Error ? err.message : String(err);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// src/utils/expect-defined.ts
|
|
279
|
+
function expectDefined(value, label) {
|
|
280
|
+
if (value === null || value === void 0) {
|
|
281
|
+
const err = new Error(label ? `Expected ${label} to be defined` : "Expected value to be defined");
|
|
282
|
+
err.name = "ExpectDefinedError";
|
|
283
|
+
throw err;
|
|
284
|
+
}
|
|
285
|
+
return value;
|
|
286
|
+
}
|
|
287
|
+
|
|
273
288
|
// src/utils/deep-merge.ts
|
|
274
289
|
var FORBIDDEN_PROTO_KEYS = /* @__PURE__ */ new Set([
|
|
275
290
|
"__proto__",
|
|
@@ -329,21 +344,6 @@ function deepMerge(base, patch, options = {}) {
|
|
|
329
344
|
return out;
|
|
330
345
|
}
|
|
331
346
|
|
|
332
|
-
// src/utils/error.ts
|
|
333
|
-
function toErrorMessage(err) {
|
|
334
|
-
return err instanceof Error ? err.message : String(err);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
// src/utils/expect-defined.ts
|
|
338
|
-
function expectDefined(value, label) {
|
|
339
|
-
if (value === null || value === void 0) {
|
|
340
|
-
const err = new Error(label ? `Expected ${label} to be defined` : "Expected value to be defined");
|
|
341
|
-
err.name = "ExpectDefinedError";
|
|
342
|
-
throw err;
|
|
343
|
-
}
|
|
344
|
-
return value;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
347
|
// src/utils/glob-match.ts
|
|
348
348
|
function escapeRegex(s) {
|
|
349
349
|
return s.replace(/[.+^${}()|\\]/g, "\\$&");
|