@camstack/system 1.2.42 → 1.2.43
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/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-BpVtesRV.mjs → dist-0-QV4BS4.mjs} +330 -243
- package/dist/{dist-DBeh_RnY.js → dist-CIVLMaWX.js} +330 -243
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -5281,6 +5281,292 @@ var MaskGridDimsSchema = z.object({
|
|
|
5281
5281
|
height: z.number()
|
|
5282
5282
|
});
|
|
5283
5283
|
/**
|
|
5284
|
+
* notification-output — canonical, capability-gated notification delivery.
|
|
5285
|
+
*
|
|
5286
|
+
* Apprise-derived model (see
|
|
5287
|
+
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
5288
|
+
* callers emit ONE canonical `Notification`; each provider declares a
|
|
5289
|
+
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
5290
|
+
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
5291
|
+
* message to what the kind supports — callers never special-case a service.
|
|
5292
|
+
*
|
|
5293
|
+
* DESIGN DECISIONS (locked):
|
|
5294
|
+
* - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
|
|
5295
|
+
* `setTargetEnabled`), each provider persisting via the `settings-store`
|
|
5296
|
+
* cap. Rationale: the admin UI needs one uniform surface across the
|
|
5297
|
+
* notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
|
|
5298
|
+
* alternative would fork the UI per addon and cannot host the
|
|
5299
|
+
* discovery→adopt flow.
|
|
5300
|
+
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
5301
|
+
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
5302
|
+
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
5303
|
+
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
5304
|
+
* `addonId` the generated collection router extracts from the call input.
|
|
5305
|
+
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
5306
|
+
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
5307
|
+
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
5308
|
+
* base64 fallback needed.
|
|
5309
|
+
*
|
|
5310
|
+
* TODO (deferred, closed-set change — separate decision): add
|
|
5311
|
+
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
5312
|
+
* admin "Integrations" page.
|
|
5313
|
+
*/
|
|
5314
|
+
/**
|
|
5315
|
+
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
5316
|
+
* adapter picks what it supports and the degrade engine filters the rest.
|
|
5317
|
+
*/
|
|
5318
|
+
var AttachmentMediaTypeSchema = z.enum([
|
|
5319
|
+
"image",
|
|
5320
|
+
"video",
|
|
5321
|
+
"gif",
|
|
5322
|
+
"audio",
|
|
5323
|
+
"icon"
|
|
5324
|
+
]);
|
|
5325
|
+
/**
|
|
5326
|
+
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
5327
|
+
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
5328
|
+
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
5329
|
+
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
5330
|
+
*/
|
|
5331
|
+
var AttachmentSchema = z.object({
|
|
5332
|
+
mediaType: AttachmentMediaTypeSchema,
|
|
5333
|
+
url: z.string().optional(),
|
|
5334
|
+
bytes: z.instanceof(Uint8Array).optional(),
|
|
5335
|
+
mime: z.string().optional(),
|
|
5336
|
+
name: z.string().optional()
|
|
5337
|
+
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
5338
|
+
var NotificationFormatSchema = z.enum([
|
|
5339
|
+
"text",
|
|
5340
|
+
"markdown",
|
|
5341
|
+
"html"
|
|
5342
|
+
]);
|
|
5343
|
+
/**
|
|
5344
|
+
* The CLOSED icon vocabulary an action button may use.
|
|
5345
|
+
*
|
|
5346
|
+
* A closed set, not a free string, and that is the whole point: an arbitrary
|
|
5347
|
+
* icon name is one that ntfy renders, zentik silently drops, and nobody
|
|
5348
|
+
* notices — the same class of gap as a zone vocabulary nothing produced
|
|
5349
|
+
* ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
|
|
5350
|
+
* declares `actionIcons: false` and the degrade engine strips the field.
|
|
5351
|
+
*
|
|
5352
|
+
* Named by INTENT, never by glyph. "check" would tie the vocabulary to one
|
|
5353
|
+
* renderer's icon set; "acknowledge" survives an adapter that draws it
|
|
5354
|
+
* differently.
|
|
5355
|
+
*/
|
|
5356
|
+
var NotificationActionIconSchema = z.enum([
|
|
5357
|
+
"acknowledge",
|
|
5358
|
+
"dismiss",
|
|
5359
|
+
"silence",
|
|
5360
|
+
"view",
|
|
5361
|
+
"play",
|
|
5362
|
+
"open",
|
|
5363
|
+
"close",
|
|
5364
|
+
"lock",
|
|
5365
|
+
"unlock",
|
|
5366
|
+
"arm",
|
|
5367
|
+
"disarm",
|
|
5368
|
+
"light",
|
|
5369
|
+
"alert"
|
|
5370
|
+
]);
|
|
5371
|
+
/** A single tap-through action button. */
|
|
5372
|
+
var NotificationActionSchema = z.object({
|
|
5373
|
+
id: z.string(),
|
|
5374
|
+
label: z.string(),
|
|
5375
|
+
url: z.string().optional(),
|
|
5376
|
+
/** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
|
|
5377
|
+
icon: NotificationActionIconSchema.optional(),
|
|
5378
|
+
/**
|
|
5379
|
+
* Renders in a warning style where the notifier supports it.
|
|
5380
|
+
*
|
|
5381
|
+
* A HINT, never a gate. The callback's authority is its token and nothing
|
|
5382
|
+
* else — see `notification-center/action-token.ts` for what that does and
|
|
5383
|
+
* does not buy.
|
|
5384
|
+
*/
|
|
5385
|
+
destructive: z.boolean().optional()
|
|
5386
|
+
});
|
|
5387
|
+
/**
|
|
5388
|
+
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
5389
|
+
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
5390
|
+
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
5391
|
+
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
5392
|
+
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
5393
|
+
* `priority` for that one target.
|
|
5394
|
+
*/
|
|
5395
|
+
var NotificationSchema = z.object({
|
|
5396
|
+
body: z.string(),
|
|
5397
|
+
title: z.string().optional(),
|
|
5398
|
+
format: NotificationFormatSchema.default("text"),
|
|
5399
|
+
priority: z.number().int().min(1).max(5).default(3),
|
|
5400
|
+
level: z.string().optional(),
|
|
5401
|
+
attachments: z.array(AttachmentSchema).optional(),
|
|
5402
|
+
clickUrl: z.string().optional(),
|
|
5403
|
+
actions: z.array(NotificationActionSchema).optional(),
|
|
5404
|
+
sound: z.string().optional(),
|
|
5405
|
+
ttl: z.number().optional(),
|
|
5406
|
+
tag: z.string().optional(),
|
|
5407
|
+
deviceId: z.number().optional(),
|
|
5408
|
+
eventId: z.string().optional(),
|
|
5409
|
+
metadata: z.record(z.string(), z.unknown()).optional()
|
|
5410
|
+
});
|
|
5411
|
+
/** One declared native severity/priority level for a kind. */
|
|
5412
|
+
var TargetKindLevelSchema = z.object({
|
|
5413
|
+
id: z.string(),
|
|
5414
|
+
label: z.string(),
|
|
5415
|
+
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
5416
|
+
ordinal: z.number().int().min(1).max(5).nullable(),
|
|
5417
|
+
flags: z.object({
|
|
5418
|
+
critical: z.boolean().optional(),
|
|
5419
|
+
silent: z.boolean().optional(),
|
|
5420
|
+
noPush: z.boolean().optional()
|
|
5421
|
+
}).optional(),
|
|
5422
|
+
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
5423
|
+
requires: z.array(z.string()).optional(),
|
|
5424
|
+
description: z.string().optional()
|
|
5425
|
+
});
|
|
5426
|
+
/** Attachment capabilities for a kind (drives the degrade engine + test panel). */
|
|
5427
|
+
var TargetKindAttachmentsCapsSchema = z.object({
|
|
5428
|
+
mediaTypes: z.array(AttachmentMediaTypeSchema),
|
|
5429
|
+
mode: z.enum([
|
|
5430
|
+
"url",
|
|
5431
|
+
"bytes",
|
|
5432
|
+
"both"
|
|
5433
|
+
]),
|
|
5434
|
+
max: z.number().int().nonnegative(),
|
|
5435
|
+
maxBytes: z.number().int().positive().optional()
|
|
5436
|
+
});
|
|
5437
|
+
/** The full capability block consulted before dispatch. */
|
|
5438
|
+
var TargetKindCapsSchema = z.object({
|
|
5439
|
+
attachments: TargetKindAttachmentsCapsSchema,
|
|
5440
|
+
/** Max action buttons (0 = none). */
|
|
5441
|
+
actions: z.number().int().nonnegative(),
|
|
5442
|
+
/**
|
|
5443
|
+
* Whether this kind renders a per-action ICON.
|
|
5444
|
+
*
|
|
5445
|
+
* `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
|
|
5446
|
+
* run on the addon cap path — three production failures in one day taught
|
|
5447
|
+
* this repo that once. Absent is read as false by the degrade engine, which
|
|
5448
|
+
* is the safe direction: an icon that is not rendered costs nothing, an icon
|
|
5449
|
+
* assumed and dropped costs the operator's trust in the field.
|
|
5450
|
+
*/
|
|
5451
|
+
actionIcons: z.boolean().optional(),
|
|
5452
|
+
levels: z.array(TargetKindLevelSchema),
|
|
5453
|
+
format: z.array(NotificationFormatSchema),
|
|
5454
|
+
clickUrl: z.boolean(),
|
|
5455
|
+
sound: z.boolean(),
|
|
5456
|
+
ttl: z.boolean(),
|
|
5457
|
+
bodyMaxLen: z.number().int().positive()
|
|
5458
|
+
});
|
|
5459
|
+
/**
|
|
5460
|
+
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
5461
|
+
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
5462
|
+
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
5463
|
+
* the union is large and not meant for runtime validation here; the exported
|
|
5464
|
+
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
5465
|
+
*/
|
|
5466
|
+
var ConfigSchemaPassthrough$1 = z.unknown();
|
|
5467
|
+
var TargetKindSchema = z.object({
|
|
5468
|
+
kind: z.string(),
|
|
5469
|
+
label: z.string(),
|
|
5470
|
+
icon: z.string(),
|
|
5471
|
+
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
5472
|
+
addonId: z.string(),
|
|
5473
|
+
/**
|
|
5474
|
+
* URL of the kind's bundled BRAND icon, served by the providing addon over
|
|
5475
|
+
* its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
|
|
5476
|
+
* when the addon bundles no icon for that kind — the client then falls back
|
|
5477
|
+
* to a neutral glyph rather than rendering the raw `icon` NAME as text.
|
|
5478
|
+
*
|
|
5479
|
+
* Root-relative on purpose: it resolves against whatever origin serves a web
|
|
5480
|
+
* client, and a native client joins it onto its own hub base.
|
|
5481
|
+
*
|
|
5482
|
+
* DECLARED here deliberately. It used to travel as an undeclared passthrough
|
|
5483
|
+
* field that survived only because the runtime cap-router forwards provider
|
|
5484
|
+
* output verbatim — so every consumer had to re-declare it by hand to stop
|
|
5485
|
+
* its own Zod parse from stripping it, and the whole arrangement would have
|
|
5486
|
+
* broken silently the moment output validation was tightened anywhere.
|
|
5487
|
+
*/
|
|
5488
|
+
iconUrl: z.string().optional(),
|
|
5489
|
+
/**
|
|
5490
|
+
* Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
|
|
5491
|
+
*
|
|
5492
|
+
* The server knows this and therefore says it, because the client cannot
|
|
5493
|
+
* safely guess: a React-Native client renders SVG and raster through two
|
|
5494
|
+
* DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
|
|
5495
|
+
* not decode SVG on iOS/Android), so without this it silently fell back to a
|
|
5496
|
+
* placeholder glyph for every vector icon while the web build looked fine.
|
|
5497
|
+
*
|
|
5498
|
+
* Absent when {@link iconUrl} is absent, or for a legacy provider that has
|
|
5499
|
+
* not been updated — a client that cannot determine the type should prefer
|
|
5500
|
+
* its raster path, which is the safe default for an unknown image.
|
|
5501
|
+
*/
|
|
5502
|
+
iconMediaType: z.string().optional(),
|
|
5503
|
+
configSchema: ConfigSchemaPassthrough$1,
|
|
5504
|
+
supportsDiscovery: z.boolean(),
|
|
5505
|
+
caps: TargetKindCapsSchema
|
|
5506
|
+
});
|
|
5507
|
+
/**
|
|
5508
|
+
* A persisted target. `config` holds secrets; providers REDACT secret fields
|
|
5509
|
+
* (return a presence marker only) when serving `listTargets` — never
|
|
5510
|
+
* round-trip a stored secret to the UI.
|
|
5511
|
+
*/
|
|
5512
|
+
var TargetSchema = z.object({
|
|
5513
|
+
id: z.string(),
|
|
5514
|
+
name: z.string(),
|
|
5515
|
+
kind: z.string(),
|
|
5516
|
+
addonId: z.string(),
|
|
5517
|
+
enabled: z.boolean(),
|
|
5518
|
+
config: z.record(z.string(), z.unknown())
|
|
5519
|
+
});
|
|
5520
|
+
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
5521
|
+
var DiscoveredTargetSchema = z.object({
|
|
5522
|
+
kind: z.string(),
|
|
5523
|
+
suggestedName: z.string(),
|
|
5524
|
+
config: z.record(z.string(), z.unknown())
|
|
5525
|
+
});
|
|
5526
|
+
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
5527
|
+
var RenderedAsSchema = z.object({
|
|
5528
|
+
level: z.string(),
|
|
5529
|
+
format: NotificationFormatSchema,
|
|
5530
|
+
attachmentsSent: z.number().int().nonnegative(),
|
|
5531
|
+
actionsSent: z.number().int().nonnegative(),
|
|
5532
|
+
truncated: z.boolean(),
|
|
5533
|
+
dropped: z.array(z.string())
|
|
5534
|
+
});
|
|
5535
|
+
var SendResultSchema = z.object({
|
|
5536
|
+
success: z.boolean(),
|
|
5537
|
+
error: z.string().optional(),
|
|
5538
|
+
renderedAs: RenderedAsSchema.optional()
|
|
5539
|
+
});
|
|
5540
|
+
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
5541
|
+
var TestResultSchema = SendResultSchema;
|
|
5542
|
+
var notificationOutputCapability = {
|
|
5543
|
+
name: "notification-output",
|
|
5544
|
+
scope: "system",
|
|
5545
|
+
mode: "collection",
|
|
5546
|
+
methods: {
|
|
5547
|
+
listTargetKinds: method(z.object({}), z.array(TargetKindSchema)),
|
|
5548
|
+
listTargets: method(z.object({}), z.array(TargetSchema)),
|
|
5549
|
+
discoverTargets: method(z.object({
|
|
5550
|
+
kind: z.string(),
|
|
5551
|
+
config: z.record(z.string(), z.unknown()).optional()
|
|
5552
|
+
}), z.array(DiscoveredTargetSchema)),
|
|
5553
|
+
send: method(z.object({
|
|
5554
|
+
targetId: z.string(),
|
|
5555
|
+
notification: NotificationSchema
|
|
5556
|
+
}), SendResultSchema, { kind: "mutation" }),
|
|
5557
|
+
testTarget: method(z.object({
|
|
5558
|
+
targetId: z.string(),
|
|
5559
|
+
sample: NotificationSchema.optional()
|
|
5560
|
+
}), TestResultSchema, { kind: "mutation" }),
|
|
5561
|
+
upsertTarget: method(z.object({ target: TargetSchema }), TargetSchema, { kind: "mutation" }),
|
|
5562
|
+
deleteTarget: method(z.object({ targetId: z.string() }), z.void(), { kind: "mutation" }),
|
|
5563
|
+
setTargetEnabled: method(z.object({
|
|
5564
|
+
targetId: z.string(),
|
|
5565
|
+
enabled: z.boolean()
|
|
5566
|
+
}), z.void(), { kind: "mutation" })
|
|
5567
|
+
}
|
|
5568
|
+
};
|
|
5569
|
+
/**
|
|
5284
5570
|
* notification-rules — the Notification Center rule surface (P1 core).
|
|
5285
5571
|
*
|
|
5286
5572
|
* Spec: `docs/superpowers/specs/2026-07-22-notification-center-requirements.md`
|
|
@@ -5465,6 +5751,28 @@ var NcRuleActionSequenceSchema = z.object({
|
|
|
5465
5751
|
actions: z.array(NcRuleActionSchema).min(1)
|
|
5466
5752
|
});
|
|
5467
5753
|
/**
|
|
5754
|
+
* One button carried by the notification, running a named sequence on tap.
|
|
5755
|
+
*
|
|
5756
|
+
* **Read this before adding a button that does something physical.** The tap
|
|
5757
|
+
* arrives over a link that travelled through third-party infrastructure — ntfy,
|
|
5758
|
+
* a push relay, whatever forwarded the message — and the callback's ONLY
|
|
5759
|
+
* authority is the token in that link: single-use, short-lived, bound to this
|
|
5760
|
+
* one action of this one notification. It does not identify who tapped.
|
|
5761
|
+
* Whoever holds the notification can run the button, once, inside the window.
|
|
5762
|
+
* That is the operator's explicit choice (2026-08-05), and `destructive` is a
|
|
5763
|
+
* rendering hint, not a second gate. [D47](decisions/adr-0047.md).
|
|
5764
|
+
*/
|
|
5765
|
+
var NcRuleNotificationButtonSchema = z.object({
|
|
5766
|
+
/** Stable id — travels in the callback and identifies the button in logs. */
|
|
5767
|
+
id: z.string().min(1).max(64),
|
|
5768
|
+
label: z.string().min(1).max(40),
|
|
5769
|
+
/** Name of a sequence in `onTrigger`. The dispatcher drops a button whose
|
|
5770
|
+
* sequence does not exist rather than minting a token for nothing. */
|
|
5771
|
+
sequence: z.string().min(1).max(120),
|
|
5772
|
+
icon: NotificationActionIconSchema.optional(),
|
|
5773
|
+
destructive: z.boolean().optional()
|
|
5774
|
+
});
|
|
5775
|
+
/**
|
|
5468
5776
|
* Sequences a rule runs, by hook point.
|
|
5469
5777
|
*
|
|
5470
5778
|
* ONLY `onTrigger` is here, deliberately. The reference also has activation /
|
|
@@ -5472,9 +5780,26 @@ var NcRuleActionSequenceSchema = z.object({
|
|
|
5472
5780
|
* repo's expensive failure mode is declaring a surface nothing produces, so a
|
|
5473
5781
|
* hook appears here in the same change that produces its edge, never before.
|
|
5474
5782
|
*/
|
|
5475
|
-
var NcRuleActionsSchema = z.object({
|
|
5476
|
-
/** Runs when the rule MATCHES. */
|
|
5477
|
-
onTrigger: z.array(NcRuleActionSequenceSchema).optional()
|
|
5783
|
+
var NcRuleActionsSchema = z.object({
|
|
5784
|
+
/** Runs when the rule MATCHES. */
|
|
5785
|
+
onTrigger: z.array(NcRuleActionSequenceSchema).optional(),
|
|
5786
|
+
/**
|
|
5787
|
+
* Buttons the NOTIFICATION carries, each running one of this rule's
|
|
5788
|
+
* sequences when tapped.
|
|
5789
|
+
*
|
|
5790
|
+
* Deliberately a REFERENCE to a sequence rather than a second place to
|
|
5791
|
+
* author steps. A button that could define its own actions would be a
|
|
5792
|
+
* parallel actuation vocabulary — the executor's device-scope check, the
|
|
5793
|
+
* stop-at-first-failure rule and the per-sequence throttle all live on
|
|
5794
|
+
* sequences, and a second authoring surface would drift from every one of
|
|
5795
|
+
* them.
|
|
5796
|
+
*
|
|
5797
|
+
* A sequence reachable ONLY by a button simply appears in `onTrigger` with
|
|
5798
|
+
* `enabled: false`: it is then authored, throttled and validated like the
|
|
5799
|
+
* rest, and nothing runs it automatically.
|
|
5800
|
+
*/
|
|
5801
|
+
buttons: z.array(NcRuleNotificationButtonSchema).max(8).optional()
|
|
5802
|
+
});
|
|
5478
5803
|
/**
|
|
5479
5804
|
* "This rule applies only while `deviceId` is in one of `states`."
|
|
5480
5805
|
*
|
|
@@ -16801,14 +17126,14 @@ var LlmProfileSchema = z.object({
|
|
|
16801
17126
|
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
16802
17127
|
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
16803
17128
|
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
16804
|
-
var ConfigSchemaPassthrough
|
|
17129
|
+
var ConfigSchemaPassthrough = z.unknown();
|
|
16805
17130
|
var LlmProfileKindDescriptorSchema = z.object({
|
|
16806
17131
|
kind: LlmProfileKindSchema,
|
|
16807
17132
|
label: z.string(),
|
|
16808
17133
|
icon: z.string(),
|
|
16809
17134
|
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
16810
17135
|
addonId: z.string(),
|
|
16811
|
-
configSchema: ConfigSchemaPassthrough
|
|
17136
|
+
configSchema: ConfigSchemaPassthrough
|
|
16812
17137
|
});
|
|
16813
17138
|
var LlmDefaultSelectorSchema = z.union([z.object({ consumer: z.string() }), z.object({ purpose: z.enum(["text", "vision"]) })]);
|
|
16814
17139
|
var LlmDefaultSchema = z.object({
|
|
@@ -17513,244 +17838,6 @@ var networkAccessCapability = {
|
|
|
17513
17838
|
}
|
|
17514
17839
|
};
|
|
17515
17840
|
/**
|
|
17516
|
-
* notification-output — canonical, capability-gated notification delivery.
|
|
17517
|
-
*
|
|
17518
|
-
* Apprise-derived model (see
|
|
17519
|
-
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
17520
|
-
* callers emit ONE canonical `Notification`; each provider declares a
|
|
17521
|
-
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
17522
|
-
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
17523
|
-
* message to what the kind supports — callers never special-case a service.
|
|
17524
|
-
*
|
|
17525
|
-
* DESIGN DECISIONS (locked):
|
|
17526
|
-
* - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
|
|
17527
|
-
* `setTargetEnabled`), each provider persisting via the `settings-store`
|
|
17528
|
-
* cap. Rationale: the admin UI needs one uniform surface across the
|
|
17529
|
-
* notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
|
|
17530
|
-
* alternative would fork the UI per addon and cannot host the
|
|
17531
|
-
* discovery→adopt flow.
|
|
17532
|
-
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
17533
|
-
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
17534
|
-
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
17535
|
-
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
17536
|
-
* `addonId` the generated collection router extracts from the call input.
|
|
17537
|
-
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
17538
|
-
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
17539
|
-
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
17540
|
-
* base64 fallback needed.
|
|
17541
|
-
*
|
|
17542
|
-
* TODO (deferred, closed-set change — separate decision): add
|
|
17543
|
-
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
17544
|
-
* admin "Integrations" page.
|
|
17545
|
-
*/
|
|
17546
|
-
/**
|
|
17547
|
-
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
17548
|
-
* adapter picks what it supports and the degrade engine filters the rest.
|
|
17549
|
-
*/
|
|
17550
|
-
var AttachmentMediaTypeSchema = z.enum([
|
|
17551
|
-
"image",
|
|
17552
|
-
"video",
|
|
17553
|
-
"gif",
|
|
17554
|
-
"audio",
|
|
17555
|
-
"icon"
|
|
17556
|
-
]);
|
|
17557
|
-
/**
|
|
17558
|
-
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
17559
|
-
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
17560
|
-
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
17561
|
-
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
17562
|
-
*/
|
|
17563
|
-
var AttachmentSchema = z.object({
|
|
17564
|
-
mediaType: AttachmentMediaTypeSchema,
|
|
17565
|
-
url: z.string().optional(),
|
|
17566
|
-
bytes: z.instanceof(Uint8Array).optional(),
|
|
17567
|
-
mime: z.string().optional(),
|
|
17568
|
-
name: z.string().optional()
|
|
17569
|
-
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
17570
|
-
var NotificationFormatSchema = z.enum([
|
|
17571
|
-
"text",
|
|
17572
|
-
"markdown",
|
|
17573
|
-
"html"
|
|
17574
|
-
]);
|
|
17575
|
-
/** A single tap-through action button. */
|
|
17576
|
-
var NotificationActionSchema = z.object({
|
|
17577
|
-
id: z.string(),
|
|
17578
|
-
label: z.string(),
|
|
17579
|
-
url: z.string().optional()
|
|
17580
|
-
});
|
|
17581
|
-
/**
|
|
17582
|
-
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
17583
|
-
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
17584
|
-
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
17585
|
-
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
17586
|
-
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
17587
|
-
* `priority` for that one target.
|
|
17588
|
-
*/
|
|
17589
|
-
var NotificationSchema = z.object({
|
|
17590
|
-
body: z.string(),
|
|
17591
|
-
title: z.string().optional(),
|
|
17592
|
-
format: NotificationFormatSchema.default("text"),
|
|
17593
|
-
priority: z.number().int().min(1).max(5).default(3),
|
|
17594
|
-
level: z.string().optional(),
|
|
17595
|
-
attachments: z.array(AttachmentSchema).optional(),
|
|
17596
|
-
clickUrl: z.string().optional(),
|
|
17597
|
-
actions: z.array(NotificationActionSchema).optional(),
|
|
17598
|
-
sound: z.string().optional(),
|
|
17599
|
-
ttl: z.number().optional(),
|
|
17600
|
-
tag: z.string().optional(),
|
|
17601
|
-
deviceId: z.number().optional(),
|
|
17602
|
-
eventId: z.string().optional(),
|
|
17603
|
-
metadata: z.record(z.string(), z.unknown()).optional()
|
|
17604
|
-
});
|
|
17605
|
-
/** One declared native severity/priority level for a kind. */
|
|
17606
|
-
var TargetKindLevelSchema = z.object({
|
|
17607
|
-
id: z.string(),
|
|
17608
|
-
label: z.string(),
|
|
17609
|
-
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
17610
|
-
ordinal: z.number().int().min(1).max(5).nullable(),
|
|
17611
|
-
flags: z.object({
|
|
17612
|
-
critical: z.boolean().optional(),
|
|
17613
|
-
silent: z.boolean().optional(),
|
|
17614
|
-
noPush: z.boolean().optional()
|
|
17615
|
-
}).optional(),
|
|
17616
|
-
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
17617
|
-
requires: z.array(z.string()).optional(),
|
|
17618
|
-
description: z.string().optional()
|
|
17619
|
-
});
|
|
17620
|
-
/** Attachment capabilities for a kind (drives the degrade engine + test panel). */
|
|
17621
|
-
var TargetKindAttachmentsCapsSchema = z.object({
|
|
17622
|
-
mediaTypes: z.array(AttachmentMediaTypeSchema),
|
|
17623
|
-
mode: z.enum([
|
|
17624
|
-
"url",
|
|
17625
|
-
"bytes",
|
|
17626
|
-
"both"
|
|
17627
|
-
]),
|
|
17628
|
-
max: z.number().int().nonnegative(),
|
|
17629
|
-
maxBytes: z.number().int().positive().optional()
|
|
17630
|
-
});
|
|
17631
|
-
/** The full capability block consulted before dispatch. */
|
|
17632
|
-
var TargetKindCapsSchema = z.object({
|
|
17633
|
-
attachments: TargetKindAttachmentsCapsSchema,
|
|
17634
|
-
/** Max action buttons (0 = none). */
|
|
17635
|
-
actions: z.number().int().nonnegative(),
|
|
17636
|
-
levels: z.array(TargetKindLevelSchema),
|
|
17637
|
-
format: z.array(NotificationFormatSchema),
|
|
17638
|
-
clickUrl: z.boolean(),
|
|
17639
|
-
sound: z.boolean(),
|
|
17640
|
-
ttl: z.boolean(),
|
|
17641
|
-
bodyMaxLen: z.number().int().positive()
|
|
17642
|
-
});
|
|
17643
|
-
/**
|
|
17644
|
-
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
17645
|
-
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
17646
|
-
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
17647
|
-
* the union is large and not meant for runtime validation here; the exported
|
|
17648
|
-
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
17649
|
-
*/
|
|
17650
|
-
var ConfigSchemaPassthrough = z.unknown();
|
|
17651
|
-
var TargetKindSchema = z.object({
|
|
17652
|
-
kind: z.string(),
|
|
17653
|
-
label: z.string(),
|
|
17654
|
-
icon: z.string(),
|
|
17655
|
-
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
17656
|
-
addonId: z.string(),
|
|
17657
|
-
/**
|
|
17658
|
-
* URL of the kind's bundled BRAND icon, served by the providing addon over
|
|
17659
|
-
* its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
|
|
17660
|
-
* when the addon bundles no icon for that kind — the client then falls back
|
|
17661
|
-
* to a neutral glyph rather than rendering the raw `icon` NAME as text.
|
|
17662
|
-
*
|
|
17663
|
-
* Root-relative on purpose: it resolves against whatever origin serves a web
|
|
17664
|
-
* client, and a native client joins it onto its own hub base.
|
|
17665
|
-
*
|
|
17666
|
-
* DECLARED here deliberately. It used to travel as an undeclared passthrough
|
|
17667
|
-
* field that survived only because the runtime cap-router forwards provider
|
|
17668
|
-
* output verbatim — so every consumer had to re-declare it by hand to stop
|
|
17669
|
-
* its own Zod parse from stripping it, and the whole arrangement would have
|
|
17670
|
-
* broken silently the moment output validation was tightened anywhere.
|
|
17671
|
-
*/
|
|
17672
|
-
iconUrl: z.string().optional(),
|
|
17673
|
-
/**
|
|
17674
|
-
* Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
|
|
17675
|
-
*
|
|
17676
|
-
* The server knows this and therefore says it, because the client cannot
|
|
17677
|
-
* safely guess: a React-Native client renders SVG and raster through two
|
|
17678
|
-
* DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
|
|
17679
|
-
* not decode SVG on iOS/Android), so without this it silently fell back to a
|
|
17680
|
-
* placeholder glyph for every vector icon while the web build looked fine.
|
|
17681
|
-
*
|
|
17682
|
-
* Absent when {@link iconUrl} is absent, or for a legacy provider that has
|
|
17683
|
-
* not been updated — a client that cannot determine the type should prefer
|
|
17684
|
-
* its raster path, which is the safe default for an unknown image.
|
|
17685
|
-
*/
|
|
17686
|
-
iconMediaType: z.string().optional(),
|
|
17687
|
-
configSchema: ConfigSchemaPassthrough,
|
|
17688
|
-
supportsDiscovery: z.boolean(),
|
|
17689
|
-
caps: TargetKindCapsSchema
|
|
17690
|
-
});
|
|
17691
|
-
/**
|
|
17692
|
-
* A persisted target. `config` holds secrets; providers REDACT secret fields
|
|
17693
|
-
* (return a presence marker only) when serving `listTargets` — never
|
|
17694
|
-
* round-trip a stored secret to the UI.
|
|
17695
|
-
*/
|
|
17696
|
-
var TargetSchema = z.object({
|
|
17697
|
-
id: z.string(),
|
|
17698
|
-
name: z.string(),
|
|
17699
|
-
kind: z.string(),
|
|
17700
|
-
addonId: z.string(),
|
|
17701
|
-
enabled: z.boolean(),
|
|
17702
|
-
config: z.record(z.string(), z.unknown())
|
|
17703
|
-
});
|
|
17704
|
-
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
17705
|
-
var DiscoveredTargetSchema = z.object({
|
|
17706
|
-
kind: z.string(),
|
|
17707
|
-
suggestedName: z.string(),
|
|
17708
|
-
config: z.record(z.string(), z.unknown())
|
|
17709
|
-
});
|
|
17710
|
-
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
17711
|
-
var RenderedAsSchema = z.object({
|
|
17712
|
-
level: z.string(),
|
|
17713
|
-
format: NotificationFormatSchema,
|
|
17714
|
-
attachmentsSent: z.number().int().nonnegative(),
|
|
17715
|
-
actionsSent: z.number().int().nonnegative(),
|
|
17716
|
-
truncated: z.boolean(),
|
|
17717
|
-
dropped: z.array(z.string())
|
|
17718
|
-
});
|
|
17719
|
-
var SendResultSchema = z.object({
|
|
17720
|
-
success: z.boolean(),
|
|
17721
|
-
error: z.string().optional(),
|
|
17722
|
-
renderedAs: RenderedAsSchema.optional()
|
|
17723
|
-
});
|
|
17724
|
-
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
17725
|
-
var TestResultSchema = SendResultSchema;
|
|
17726
|
-
var notificationOutputCapability = {
|
|
17727
|
-
name: "notification-output",
|
|
17728
|
-
scope: "system",
|
|
17729
|
-
mode: "collection",
|
|
17730
|
-
methods: {
|
|
17731
|
-
listTargetKinds: method(z.object({}), z.array(TargetKindSchema)),
|
|
17732
|
-
listTargets: method(z.object({}), z.array(TargetSchema)),
|
|
17733
|
-
discoverTargets: method(z.object({
|
|
17734
|
-
kind: z.string(),
|
|
17735
|
-
config: z.record(z.string(), z.unknown()).optional()
|
|
17736
|
-
}), z.array(DiscoveredTargetSchema)),
|
|
17737
|
-
send: method(z.object({
|
|
17738
|
-
targetId: z.string(),
|
|
17739
|
-
notification: NotificationSchema
|
|
17740
|
-
}), SendResultSchema, { kind: "mutation" }),
|
|
17741
|
-
testTarget: method(z.object({
|
|
17742
|
-
targetId: z.string(),
|
|
17743
|
-
sample: NotificationSchema.optional()
|
|
17744
|
-
}), TestResultSchema, { kind: "mutation" }),
|
|
17745
|
-
upsertTarget: method(z.object({ target: TargetSchema }), TargetSchema, { kind: "mutation" }),
|
|
17746
|
-
deleteTarget: method(z.object({ targetId: z.string() }), z.void(), { kind: "mutation" }),
|
|
17747
|
-
setTargetEnabled: method(z.object({
|
|
17748
|
-
targetId: z.string(),
|
|
17749
|
-
enabled: z.boolean()
|
|
17750
|
-
}), z.void(), { kind: "mutation" })
|
|
17751
|
-
}
|
|
17752
|
-
};
|
|
17753
|
-
/**
|
|
17754
17841
|
* core-blocks — user-authored TypeScript, stored in the kernel and executed in
|
|
17755
17842
|
* its own process.
|
|
17756
17843
|
*
|