diff options
| author | Adam Malczewski <[email protected]> | 2026-06-01 09:28:30 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-01 09:28:30 +0900 |
| commit | 21cdb1199599c4dc6e2a941e52713ba6511cd675 (patch) | |
| tree | e3711384f16c476bf5d8def148dc922f9ceb5f3d /packaging/dispatch-api-wrapper.sh | |
| parent | 5e72191cac9469c2ade91aaba1e62f69fa1ad94a (diff) | |
| download | dispatch-21cdb1199599c4dc6e2a941e52713ba6511cd675.tar.gz dispatch-21cdb1199599c4dc6e2a941e52713ba6511cd675.zip | |
feat(api): wire notification dispatcher into app + /notifications routes
PermissionManager: add onPromptAdded(listener) callback. Fires exactly
once per unique pending prompt id, even when broadcastPending is called
repeatedly for unrelated mutations (e.g. another prompt resolving while
this one is still pending).
app.ts: instantiate NotificationDispatcher, attach to both AgentManager
and PermissionManager. Tab-title lookup via core's getTab so the
notifications carry human-readable context instead of raw UUIDs.
routes/notifications.ts:
- GET /notifications — current config (auth token redacted) plus
the event-type catalog and defaults
- PUT /notifications — partial update; auth token semantics are
undefined=keep, ''=clear, otherwise replace
- POST /notifications/test — sends a test notification with the current
config (rejects if disabled or topic invalid)
Tests:
- new permission-manager.test.ts covers the onPromptAdded contract
(one-fire-per-prompt, dedup across rebroadcasts, unsubscribe, listener
throws don't break siblings)
- existing routes.test.ts gets stubs for the new core notification
exports so the @dispatch/core mock stays complete
Diffstat (limited to 'packaging/dispatch-api-wrapper.sh')
0 files changed, 0 insertions, 0 deletions
