@camstack/addon-admin-ui 1.2.103 → 1.2.105

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.
Files changed (100) hide show
  1. package/dist/assets/{AddLocationWizard-DaP6_A46.js → AddLocationWizard-BwHEDbEg.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-nyWYiJDc.js → AddonCollectionPage-vlqsGeyj.js} +1 -1
  3. package/dist/assets/{Addons-CWWOTg0U.js → Addons-9q0s2Ppm.js} +1 -1
  4. package/dist/assets/{AdminTabs-Czxta2mh.js → AdminTabs-CswhcjTN.js} +1 -1
  5. package/dist/assets/{AiProfiles-C0pMBH8I.js → AiProfiles-B7Vbmfk0.js} +1 -1
  6. package/dist/assets/{BrokerForm-BxTezkNC.js → BrokerForm-DursQth8.js} +1 -1
  7. package/dist/assets/{Build-BtEumGI6.js → Build-DHGbVjDQ.js} +1 -1
  8. package/dist/assets/{Capabilities-Br7NRp9v.js → Capabilities-DrFddVD_.js} +1 -1
  9. package/dist/assets/{CapabilityBadges-D0JFygyN.js → CapabilityBadges-Dhe3vu7F.js} +1 -1
  10. package/dist/assets/{Cluster-CNkXokiW.js → Cluster-H3DmtaM3.js} +1 -1
  11. package/dist/assets/{Data-Cpi8zlqS.js → Data-DhiRyh3i.js} +1 -1
  12. package/dist/assets/{DetectionIntelligence-D5457LWO.js → DetectionIntelligence-BvNF48x8.js} +1 -1
  13. package/dist/assets/{DeviceAggregateSection-CRGubEqf.js → DeviceAggregateSection-DwbBg67T.js} +1 -1
  14. package/dist/assets/{DeviceDetail-LFXiIuPr.js → DeviceDetail-BMILT2RU.js} +1 -1
  15. package/dist/assets/{Devices-Bpwz1iYB.js → Devices-2cOZkmAM.js} +1 -1
  16. package/dist/assets/{EmbedPlayerPage-DGsEdaTJ.js → EmbedPlayerPage-CnJDFh6F.js} +1 -1
  17. package/dist/assets/{Events-D6kMH49l.js → Events-DLeLSAfJ.js} +1 -1
  18. package/dist/assets/{FormBuilder-ClH7B8PL.js → FormBuilder-DxuKSTAt.js} +1 -1
  19. package/dist/assets/{Identity-ESyEdFYd.js → Identity-5V51SHHB.js} +1 -1
  20. package/dist/assets/{IntegrationDetail-BNWu0UHs.js → IntegrationDetail-BIBqdm2D.js} +1 -1
  21. package/dist/assets/{Integrations-C3RNkXgq.js → Integrations-BcDZ4wzh.js} +1 -1
  22. package/dist/assets/{Integrations-DPNPWp1y.js → Integrations-D3VbnHkU.js} +1 -1
  23. package/dist/assets/Logs-DSEDXvqd.js +1 -0
  24. package/dist/assets/{MotionZonesSettings-B8AShyPC.js → MotionZonesSettings-BAld-2Lw.js} +1 -1
  25. package/dist/assets/{MyAccess-CE0FuC4H.js → MyAccess-CHoNzUOK.js} +1 -1
  26. package/dist/assets/{Network-CC6Uh7my.js → Network-5fWoYmw4.js} +1 -1
  27. package/dist/assets/{NodeAddonsSettingsPanel-Bg3Rx-rO.js → NodeAddonsSettingsPanel-D0bcWyDF.js} +1 -1
  28. package/dist/assets/{NodeInferenceDevices-VZSQudL0.js → NodeInferenceDevices-Bg-zYXgf.js} +1 -1
  29. package/dist/assets/{Notifications-B_Iy7T49.js → Notifications-4n60xdw-.js} +1 -1
  30. package/dist/assets/{Pipeline-DUSuuX9E.js → Pipeline-a0fPNE4H.js} +1 -1
  31. package/dist/assets/{Plates-PiYyE435.js → Plates-CdqnM7CG.js} +1 -1
  32. package/dist/assets/{PrivacyMaskSettings-Mkjx3Wsl.js → PrivacyMaskSettings-t81B_gek.js} +1 -1
  33. package/dist/assets/{ProviderIcon--75xJaei.js → ProviderIcon-_nJJkNh4.js} +1 -1
  34. package/dist/assets/{Recordings-hKFEsNib.js → Recordings-B3C8IVWT.js} +1 -1
  35. package/dist/assets/{ScanNetworkModal-BIf9KytP.js → ScanNetworkModal-BF2WWAZD.js} +1 -1
  36. package/dist/assets/{SceneMonitorEditor-CjJXkyxy.js → SceneMonitorEditor-B57j4d9e.js} +1 -1
  37. package/dist/assets/{Scenes-CcpgVJtX.js → Scenes-Dp9xkZsr.js} +1 -1
  38. package/dist/assets/{Settings-DMs9Jd9K.js → Settings-q78x-tiR.js} +1 -1
  39. package/dist/assets/{Showroom-B9VM3EL0.js → Showroom-Cs-VlUfr.js} +1 -1
  40. package/dist/assets/{Terminal-CF5uQHom.js → Terminal-BVMZawy_.js} +1 -1
  41. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DK9B4R7J.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CEeQdIzi.js} +1 -1
  42. package/dist/assets/{bell-ring-BVWtC7kI.js → bell-ring-CgJLSGOy.js} +1 -1
  43. package/dist/assets/{boxes-Qmd6WnZ8.js → boxes-MjCuNJfS.js} +1 -1
  44. package/dist/assets/{build-cluster-graph-Bahs_9Ho.js → build-cluster-graph--QzXdVVs.js} +1 -1
  45. package/dist/assets/circle-check-big-DXR6PsNj.js +1 -0
  46. package/dist/assets/{circle-x-C150uNWh.js → circle-x-OV2jSxXw.js} +1 -1
  47. package/dist/assets/clock-BLU1oQKQ.js +1 -0
  48. package/dist/assets/{copy-CVW_9pP2.js → copy-CiWLNJ8B.js} +1 -1
  49. package/dist/assets/{debounced-invalidate-C0yrXEMj.js → debounced-invalidate-BWvXThV9.js} +1 -1
  50. package/dist/assets/{dist-CLok0S8J.js → dist-BiaTzHe6.js} +1 -1
  51. package/dist/assets/dist-CxVTxcO_.js +349 -0
  52. package/dist/assets/{download-DwUIiHtP.js → download-QTstfvsj.js} +1 -1
  53. package/dist/assets/{face-bbox-CCMxuWbS.js → face-bbox-Dpsjx-B7.js} +1 -1
  54. package/dist/assets/{hostInit-Byx0xNZ7.js → hostInit-CxLmGSHf.js} +1 -1
  55. package/dist/assets/{index-C4ZumSL3.js → index-T1xot7dw.js} +3 -3
  56. package/dist/assets/{key-round-lB56F1Ys.js → key-round-D4PBkhYx.js} +1 -1
  57. package/dist/assets/{layers-CfdK3HVz.js → layers-BZWHSpd6.js} +1 -1
  58. package/dist/assets/{mf-entry-bootstrap-0-aef68a91.js → mf-entry-bootstrap-0-01d71ac0.js} +2 -2
  59. package/dist/assets/{pencil-H6Yq51LI.js → pencil-DDsXSrd-.js} +1 -1
  60. package/dist/assets/play-D3AwtDty.js +1 -0
  61. package/dist/assets/{player-overlays-CCLUhzOH.js → player-overlays-C1Oe-16j.js} +1 -1
  62. package/dist/assets/plus-BQpFV6gw.js +1 -0
  63. package/dist/assets/power-B3yJJmyb.js +1 -0
  64. package/dist/assets/{radio-D6LU--aB.js → radio-93VJ3hWn.js} +1 -1
  65. package/dist/assets/{refresh-cw-BIuNSTm2.js → refresh-cw-B3f__24L.js} +1 -1
  66. package/dist/assets/remoteEntry-DoeH9b02.js +1 -0
  67. package/dist/assets/rotate-ccw-C1iPwyeg.js +1 -0
  68. package/dist/assets/rotate-cw-BZi-2oAz.js +1 -0
  69. package/dist/assets/{send-BUWXQB_L.js → send-VUaiqixm.js} +1 -1
  70. package/dist/assets/{server-DYvYwfzj.js → server-ux2rIVKF.js} +1 -1
  71. package/dist/assets/{shield-CBa-_zS9.js → shield-Cer88Me6.js} +1 -1
  72. package/dist/assets/square-BgFxYCbu.js +1 -0
  73. package/dist/assets/{square-check-big-CoiR0MrH.js → square-check-big-C6Xl-hCg.js} +1 -1
  74. package/dist/assets/src-DLoxi-uA.js +349 -0
  75. package/dist/assets/{src-Bnzp_4un.js → src-la5hU4AG.js} +17 -17
  76. package/dist/assets/{star-DtLD0XCB.js → star-B1OZWbzw.js} +1 -1
  77. package/dist/assets/{undo-2-BqRjog65.js → undo-2-5e62fUpN.js} +1 -1
  78. package/dist/assets/{upload-BPwkcjcA.js → upload-ClpIqH1s.js} +1 -1
  79. package/dist/assets/{use-scenes-feed-B3mLEcqD.js → use-scenes-feed-6XlIebRD.js} +1 -1
  80. package/dist/assets/useEventInvalidation-CMy-Ga4p.js +1 -0
  81. package/dist/assets/{video-CGa96NMP.js → video-ClDkKxyy.js} +1 -1
  82. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-C4zTZRyK.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-iHXiknmX.js} +2 -2
  83. package/dist/assets/{wifi-BppHK6Ke.js → wifi-C7vZbNyp.js} +1 -1
  84. package/dist/assets/{zap-Bj48PE7R.js → zap-kCOZ8YPh.js} +1 -1
  85. package/dist/index.html +5 -5
  86. package/dist/server/addon.js +410 -31
  87. package/package.json +1 -1
  88. package/dist/assets/Logs-Ds0WAXGY.js +0 -1
  89. package/dist/assets/circle-check-big-hqSxF3X3.js +0 -1
  90. package/dist/assets/clock-IndoSe_I.js +0 -1
  91. package/dist/assets/dist-EvnUhZFU.js +0 -349
  92. package/dist/assets/play-CrKYmytT.js +0 -1
  93. package/dist/assets/plus-BzDdzkqf.js +0 -1
  94. package/dist/assets/power-KFh7AhbJ.js +0 -1
  95. package/dist/assets/remoteEntry-B8tBMyi_.js +0 -1
  96. package/dist/assets/rotate-ccw-zJuAaRRf.js +0 -1
  97. package/dist/assets/rotate-cw-CxErjJTg.js +0 -1
  98. package/dist/assets/square-z88Fbhnc.js +0 -1
  99. package/dist/assets/src-CCyejt1U.js +0 -349
  100. package/dist/assets/useEventInvalidation-DyLB_hSC.js +0 -1
@@ -7471,6 +7471,111 @@ var CameraSwitchGroupSchema = object({
7471
7471
  fetchedAt: number()
7472
7472
  });
7473
7473
  /**
7474
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
7475
+ * an addon declares its channels in.
7476
+ *
7477
+ * ## Two axes, deliberately separated
7478
+ *
7479
+ * - **DECLARATION** — which channels exist. Only the addon knows:
7480
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7481
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
7482
+ * and rots silently. So a channel is declared where it is consulted, and the
7483
+ * `log-channels` capability enumerates the declarations.
7484
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
7485
+ * thing: the logging settings document on the `system` cap. Two authorities
7486
+ * over the values is the exact defect
7487
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7488
+ * remove; re-introducing it from the cure side would be grotesque.
7489
+ *
7490
+ * Nothing in this file reads a clock, an env var or a store. The registry is
7491
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7492
+ * the hot path with a value somebody actually read, and by
7493
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7494
+ * never reaches here, so it can neither disarm an armed channel nor arm a
7495
+ * disarmed one (D49).
7496
+ *
7497
+ * ## The canonical call shape
7498
+ *
7499
+ * ```ts
7500
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7501
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7502
+ * }
7503
+ * ```
7504
+ *
7505
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7506
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
7507
+ * object literal is never constructed because it lives inside the branch. It
7508
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
7509
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
7510
+ * destination floor (measured at 1.93 ns/call when off).
7511
+ *
7512
+ * ## Why a channel emits at `info`
7513
+ *
7514
+ * `loki-logging.addon.ts` pins the destination default at `info` and
7515
+ * `loki-destination.ts` drops everything below it, so a line emitted at
7516
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7517
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
7518
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7519
+ * emits at the channel's declared level, whose schema floor is `info`.
7520
+ */
7521
+ /**
7522
+ * The level a channel writes at once armed.
7523
+ *
7524
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7525
+ * not leave the process for Loki, and the whole point of arming a channel is
7526
+ * to read it later.
7527
+ */
7528
+ var LogChannelLevelSchema = _enum([
7529
+ "info",
7530
+ "warn",
7531
+ "error"
7532
+ ]);
7533
+ /**
7534
+ * What an addon declares about one channel. No value, no state — a
7535
+ * declaration is inert.
7536
+ */
7537
+ var LogChannelDescriptorSchema = object({
7538
+ /**
7539
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7540
+ * the addon's short name so an operator reading a channel list can tell who
7541
+ * owns it without a second lookup.
7542
+ */
7543
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7544
+ /** One sentence: what the operator will SEE after arming it. */
7545
+ description: string().min(1),
7546
+ /** The level its lines are emitted at. Never below `info`. */
7547
+ defaultLevel: LogChannelLevelSchema,
7548
+ /**
7549
+ * Whether this channel can be narrowed to a camera.
7550
+ *
7551
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
7552
+ * consulted with the numeric device id, AND every line the channel admits
7553
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
7554
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7555
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7556
+ * the body is the only way to filter.
7557
+ *
7558
+ * A channel whose lines carry the device only in `meta` (or not at all) is
7559
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7560
+ * the operator narrows to one camera, sees nothing, and concludes the code
7561
+ * path was never taken.
7562
+ */
7563
+ perDevice: boolean()
7564
+ });
7565
+ /**
7566
+ * An armed window over one channel, as the document hands it to a mirror.
7567
+ *
7568
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7569
+ * expires by itself, which is the one failure a boolean cannot avoid.
7570
+ */
7571
+ var LogChannelWindowSchema = object({
7572
+ channel: string().min(1),
7573
+ /** Epoch ms the window closes at. */
7574
+ armedUntilMs: number(),
7575
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7576
+ deviceIds: array(number().int()).readonly().nullable()
7577
+ });
7578
+ /**
7474
7579
  * Ops-log — the durable, append-only operations audit shared by the
7475
7580
  * recordings and events management surfaces.
7476
7581
  *
@@ -10989,6 +11094,35 @@ var MutationFilterSchema = object({
10989
11094
  whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
10990
11095
  whereNot: record(string(), unknown()).optional()
10991
11096
  });
11097
+ /**
11098
+ * One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
11099
+ *
11100
+ * `as` names the slot in the result, so the SAME column may be asked twice with
11101
+ * two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
11102
+ * a `Record<column, op>` shape could not express.
11103
+ */
11104
+ var AggregateFieldSchema = object({
11105
+ /** Result key. */
11106
+ as: string().min(1),
11107
+ /** Column to aggregate. Must be a real column of a declared collection. */
11108
+ field: string().min(1),
11109
+ op: _enum([
11110
+ "sum",
11111
+ "min",
11112
+ "max"
11113
+ ])
11114
+ });
11115
+ /**
11116
+ * `COUNT(*)` plus one number per requested field.
11117
+ *
11118
+ * `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
11119
+ * that really is 0 are different facts, and an accounting caller that renders
11120
+ * "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
11121
+ */
11122
+ var AggregateResultSchema = object({
11123
+ count: number().int(),
11124
+ values: record(string(), number().nullable())
11125
+ });
10992
11126
  /** A single stored record: `{ id, data }`. */
10993
11127
  var SettingsRecordSchema = object({
10994
11128
  id: string(),
@@ -11073,6 +11207,11 @@ method(object({
11073
11207
  collection: string(),
11074
11208
  filter: QueryFilterSchema.optional()
11075
11209
  }), number()), method(object({
11210
+ namespace: string().optional(),
11211
+ collection: string(),
11212
+ fields: array(AggregateFieldSchema).readonly(),
11213
+ filter: QueryFilterSchema.optional()
11214
+ }), AggregateResultSchema), method(object({
11076
11215
  namespace: string().optional(),
11077
11216
  collection: string(),
11078
11217
  field: string(),
@@ -11189,6 +11328,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11189
11328
  collection: string(),
11190
11329
  filter: QueryFilterSchema.optional()
11191
11330
  }), number(), { auth: "admin" }), method(object({
11331
+ namespace: string().optional(),
11332
+ collection: string(),
11333
+ fields: array(AggregateFieldSchema).readonly(),
11334
+ filter: QueryFilterSchema.optional()
11335
+ }), AggregateResultSchema, { auth: "admin" }), method(object({
11192
11336
  namespace: string().optional(),
11193
11337
  collection: string(),
11194
11338
  field: string(),
@@ -11750,24 +11894,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
11750
11894
  kind: "mutation",
11751
11895
  auth: "admin"
11752
11896
  });
11753
- /**
11754
- * Device Manager capability — hub-side singleton that unifies device persistence,
11755
- * live registry access, and all management operations into a single tRPC surface.
11756
- *
11757
- * Replaces:
11758
- * - `device-persistence` capability (persistence methods absorbed here)
11759
- * - `device-management.router.ts` (deleted in Phase 2)
11760
- * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
11761
- *
11762
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
11763
- * fork into separate processes but never run on remote cluster agents. Therefore:
11764
- * - No nodeId routing needed — this is a pure hub singleton.
11765
- * - The hub's DeviceRegistry is the single source of truth for all live devices.
11766
- * - No shadow registry or cross-node aggregation required.
11767
- *
11768
- * Forked workers register devices back to the hub via `ctx.devices`
11769
- * (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
11770
- */
11771
11897
  /** One child-placement directive on a container's `childLayout`. Structurally
11772
11898
  * identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
11773
11899
  * shape for the same field. The child is identified by its re-sync-stable
@@ -12136,7 +12262,7 @@ method(object({
12136
12262
  * it answers today and the caller filters as it already does.
12137
12263
  */
12138
12264
  deviceIds: array(number()).optional()
12139
- }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12265
+ }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ parentDeviceIds: array(number()).max(256) }), record(string(), array(DeviceInfoSchema))), method(object({ deviceId: number() }), object({
12140
12266
  mode: LinkedDevicesModeSchema,
12141
12267
  devices: array(LinkedDeviceSchema)
12142
12268
  })), method(object({ deviceIds: array(number()) }), array(LinkedDevicesForDeviceSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
@@ -12860,6 +12986,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
12860
12986
  kind: "mutation",
12861
12987
  auth: "admin"
12862
12988
  });
12989
+ /**
12990
+ * `log-channels` — the capability an addon DECLARES its diagnostic channels
12991
+ * through. It stores nothing.
12992
+ *
12993
+ * ## Why a capability at all, and why this shape
12994
+ *
12995
+ * Which channels exist is knowledge only the addon has: `stream-broker` knows
12996
+ * webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
12997
+ * maintained by hand rots at the first addition and rots INVISIBLY — nothing
12998
+ * fails, an operator just never sees the channel somebody added. So the list
12999
+ * is assembled from declarations at runtime.
13000
+ *
13001
+ * The shape is copied from `log-destination.cap.ts`, which already does
13002
+ * exactly this job: `mode: 'collection'`, `internal: true`,
13003
+ * `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
13004
+ * `addons.listCapabilityProviders` still enumerates it, and the hub's
13005
+ * `CapabilityRegistry` still holds an RPC proxy per provider so a forked
13006
+ * runner's declarations reach hub-main over the transport that already exists.
13007
+ * No new UDS message, no second registry.
13008
+ *
13009
+ * ## What it deliberately does NOT own
13010
+ *
13011
+ * The VALUES — which channel is armed, for which cameras, until when — live in
13012
+ * ONE place: the logging settings document on the `system` cap
13013
+ * (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
13014
+ * value is the defect the plan behind this work exists to remove, and
13015
+ * `setRequestCensus` was retired (D245) rather than allowed to be a second
13016
+ * one. {@link logChannelsCapability} therefore has no getter for a level, no
13017
+ * setter for a window and no persistence of any kind.
13018
+ *
13019
+ * ## Why `apply` is here even so
13020
+ *
13021
+ * The gate lives in the addon's PROCESS; the document lives in hub-main. Some
13022
+ * seam has to carry the value from the authority to the mirror, and a channel
13023
+ * that cannot be reached is precisely the dead knob this whole slice exists to
13024
+ * make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
13025
+ * `apply` is that seam and nothing more: it writes an in-memory mirror, it
13026
+ * persists nothing, it is never the source of a value, and it is called only
13027
+ * with a set the hub actually read (D49 — a read that fails does not call it
13028
+ * at all, so no channel is silently disarmed by a bad read).
13029
+ */
13030
+ /** What `apply` reports back — enough to log, not enough to be a second state. */
13031
+ var LogChannelApplyResultSchema = object({
13032
+ /** How many declared channels are armed in this process after the call. */
13033
+ armed: number().int().min(0),
13034
+ /**
13035
+ * Names the document armed that this process does not declare. Reported
13036
+ * rather than swallowed: a name here is either a typo or an addon that has
13037
+ * not booted, and both deserve a line instead of silence.
13038
+ */
13039
+ unknown: array(string()).readonly()
13040
+ });
13041
+ method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
12863
13042
  var LogLevelSchema = _enum([
12864
13043
  "debug",
12865
13044
  "info",
@@ -26115,17 +26294,60 @@ var SetSiteLocationInputSchema = object({
26115
26294
  longitude: number().min(-180).max(180)
26116
26295
  }).nullable();
26117
26296
  /**
26118
- * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26297
+ * The TRANSPORT a call arrived on.
26298
+ *
26299
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26300
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26301
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26302
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26303
+ * checkable rather than asserted.
26304
+ *
26305
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26306
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26307
+ * connection; the viewer talks to the hub over `wsLink`
26308
+ * exclusively, so this is the plane the HTTP census could not see.
26309
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26310
+ * never touches a socket and therefore never touched a census.
26311
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26312
+ * that is exactly what its `0` asserts: every plane the hub has can name
26313
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26314
+ * plane nobody instrumented lands here instead of vanishing from the total.
26315
+ */
26316
+ var TransportPlaneSchema = _enum([
26317
+ "http",
26318
+ "ws",
26319
+ "mesh",
26320
+ "unknown"
26321
+ ]);
26322
+ /**
26323
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26324
+ * reads as "not instrumented", which is the one thing this census must never
26325
+ * make an operator wonder about.
26326
+ */
26327
+ var TransportPlaneCountsSchema = object({
26328
+ http: number(),
26329
+ ws: number(),
26330
+ mesh: number(),
26331
+ unknown: number()
26332
+ });
26333
+ /**
26334
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26119
26335
  * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26120
26336
  * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26121
26337
  * already prints - never a token, never an `Authorization` header.
26338
+ *
26339
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26340
+ * and lives for hours, so folding it into a call count makes one long-lived
26341
+ * stream look like a storm.
26122
26342
  */
26123
26343
  var RequestCensusGroupSchema = object({
26344
+ plane: TransportPlaneSchema,
26124
26345
  procedure: string(),
26125
26346
  userAgent: string(),
26126
26347
  ip: string(),
26127
26348
  principal: string(),
26128
26349
  calls: number(),
26350
+ subscriptions: number(),
26129
26351
  perMin: number()
26130
26352
  });
26131
26353
  /**
@@ -26138,6 +26360,14 @@ var RequestCensusGroupSchema = object({
26138
26360
  var RequestCensusProcedureSchema = object({
26139
26361
  procedure: string(),
26140
26362
  calls: number(),
26363
+ /**
26364
+ * The same total, split by transport. THIS is the row that answers the
26365
+ * question the census exists for: one look at `deviceManager.listAll` says
26366
+ * which plane carried the 4 960, without joining two log lines by eye.
26367
+ */
26368
+ planes: TransportPlaneCountsSchema,
26369
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26370
+ subscriptions: number(),
26141
26371
  perMin: number()
26142
26372
  });
26143
26373
  /**
@@ -26165,14 +26395,45 @@ var RequestCensusStatusSchema = object({
26165
26395
  */
26166
26396
  procedureCalls: number(),
26167
26397
  /**
26398
+ * `procedureCalls` split by transport. The four keys sum to
26399
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26400
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26401
+ */
26402
+ planes: TransportPlaneCountsSchema,
26403
+ /**
26404
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26405
+ * on no plane at all - which is a RESULT (a plane is missing from the
26406
+ * instrument), not a failure, and it has to be visible to be read as one.
26407
+ */
26408
+ planesExplainTotal: boolean(),
26409
+ /**
26168
26410
  * tRPC WebSocket connections opened during the window. NOT calls - the WS
26169
- * transport resolves one context per connection - but the number that says
26170
- * whether a plane this census cannot see was busy while HTTP was quiet.
26411
+ * adapter resolves one context per connection - kept because a plane's call
26412
+ * count of zero against 37 open connections says something different from a
26413
+ * plane with no connections at all.
26171
26414
  */
26172
26415
  wsConnections: number(),
26416
+ /**
26417
+ * Client frames the WS plane looked at. `wsMessages` far above
26418
+ * `planes.ws + subscriptions` means most traffic is not operations
26419
+ * (keepalives, connection params) - which is itself an answer.
26420
+ */
26421
+ wsMessages: number(),
26422
+ /**
26423
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26424
+ * purpose: one live-events stream opened at boot and held for six hours is
26425
+ * one subscription, and counting it as a call would let a quiet plane
26426
+ * masquerade as the storm.
26427
+ */
26428
+ subscriptions: number(),
26429
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26430
+ subscriptionStops: number(),
26173
26431
  distinctGroups: number(),
26174
- /** Calls counted in the totals whose group attribution was shed at the
26175
- * cardinality bound. */
26432
+ /**
26433
+ * Operations counted in the totals whose CALLER attribution was shed at the
26434
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26435
+ * which transport they arrived on, they just lost their group row.
26436
+ */
26176
26437
  unattributedCalls: number(),
26177
26438
  procedures: array(RequestCensusProcedureSchema).readonly(),
26178
26439
  groups: array(RequestCensusGroupSchema).readonly()
@@ -26195,10 +26456,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
26195
26456
  * The layers of the level hierarchy, general → specific. The most specific
26196
26457
  * layer that carries an explicit value wins.
26197
26458
  *
26198
- * `component` is DECLARED and not yet resolvable: the per-component channels
26199
- * are a later slice of the same plan, and a `levelSource` enum that has to
26200
- * grow later would force every consumer of this document to change with it.
26201
- * Nothing returns `component` today.
26459
+ * `component` became RESOLVABLE on 2026-08-27: a component is a declared log
26460
+ * CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
26461
+ * `scopeComponent`. It was declared-but-dark in the first slice precisely so
26462
+ * that turning it on would not force every consumer of this document to widen
26463
+ * a `levelSource` enum — which is what has now not happened.
26202
26464
  */
26203
26465
  var LoggingScopeKindSchema = _enum([
26204
26466
  "cluster",
@@ -26225,6 +26487,14 @@ var LoggingLevelLayerSchema = object({
26225
26487
  scope: LoggingScopeKindSchema,
26226
26488
  /** The node this layer speaks for; `null` on the cluster layer. */
26227
26489
  nodeId: string().nullable(),
26490
+ /**
26491
+ * The declared channel this layer speaks for; `null` on every layer but
26492
+ * `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
26493
+ * by design — the convention this repo settled on is one orchestrator-wide
26494
+ * setting, never per node (D52) — so a component layer that carried a node
26495
+ * would invite a per-node copy of a value that has no per-node meaning.
26496
+ */
26497
+ component: string().nullable(),
26228
26498
  /** Explicitly set here, or `null` when this layer inherits. */
26229
26499
  level: LogLevelSchema$1.nullable()
26230
26500
  });
@@ -26266,6 +26536,49 @@ var DiagnosticWindowPatchSchema = object({
26266
26536
  reportEveryMs: number().int().positive().optional()
26267
26537
  });
26268
26538
  /**
26539
+ * A channel ARMED, as the document reports it.
26540
+ *
26541
+ * `armMs` is not echoed back: what an operator needs to see is the deadline
26542
+ * and the time left, because a diagnostic left running is itself an incident
26543
+ * and "armed for 10 minutes" said an hour ago is not an answer.
26544
+ */
26545
+ var LogChannelWindowStateSchema = object({
26546
+ channel: string(),
26547
+ armed: boolean(),
26548
+ /** Epoch ms the window closes at. 0 when disarmed. */
26549
+ armedUntilMs: number(),
26550
+ /** Ms left before it expires on its own. 0 when disarmed. */
26551
+ remainingMs: number(),
26552
+ /**
26553
+ * The cameras it is narrowed to, or `null` for every camera.
26554
+ *
26555
+ * A channel declared `perDevice: false` can only ever report `null` here:
26556
+ * its lines do not carry `tags: { deviceId }`, so narrowing them would
26557
+ * produce a filter that silently matches nothing. The server REFUSES such a
26558
+ * patch rather than quietly widening it — ignoring the request would teach
26559
+ * the operator that per-camera filtering works on that channel when it does
26560
+ * not.
26561
+ */
26562
+ deviceIds: array(number().int()).readonly().nullable()
26563
+ });
26564
+ /**
26565
+ * `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
26566
+ * for the same reason: a channel is a window with a deadline, never a switch.
26567
+ */
26568
+ var LogChannelWindowPatchSchema = object({
26569
+ channel: string().min(1),
26570
+ armMs: number().int().min(0),
26571
+ /**
26572
+ * Narrow to these numeric device ids. Absent or `null` = every camera.
26573
+ *
26574
+ * Numeric because the repo's own rule makes it possible: every log line
26575
+ * about a device carries `tags: { deviceId }` with the numeric id. That rule
26576
+ * was paid for with a 22% thumbnail gap and a 3-hour media blackout both
26577
+ * diagnosed by hand, and this is the first thing that collects on it.
26578
+ */
26579
+ deviceIds: array(number().int()).readonly().nullable().optional()
26580
+ });
26581
+ /**
26269
26582
  * A PATCH, and patches MERGE.
26270
26583
  *
26271
26584
  * A field absent from the patch is left exactly as it was — arming a
@@ -26284,7 +26597,14 @@ var LoggingSettingsPatchSchema = object({
26284
26597
  * Only the diagnostics NAMED here change. An armed window that is not listed
26285
26598
  * keeps running — a patch is never a full replacement.
26286
26599
  */
26287
- diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26600
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
26601
+ /**
26602
+ * Only the channels NAMED here change. An armed channel that is not listed
26603
+ * keeps running — same rule as `diagnostics`, because a patch that silently
26604
+ * disarmed the channels it did not mention would make the Levels page and
26605
+ * the Diagnostics page fight over the same value.
26606
+ */
26607
+ channels: array(LogChannelWindowPatchSchema).readonly().optional()
26288
26608
  });
26289
26609
  /**
26290
26610
  * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
@@ -26297,9 +26617,22 @@ var LoggingSettingsPatchSchema = object({
26297
26617
  * authority over the whole hierarchy and answers for every layer, so the
26298
26618
  * layer selector needs a name the transport does not already own.
26299
26619
  */
26300
- var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26620
+ var GetLoggingSettingsInputSchema = object({
26621
+ scopeNodeId: string().optional(),
26622
+ /**
26623
+ * The declared CHANNEL this document is addressed at, when the caller wants
26624
+ * the `component` layer. Absent = the node/cluster hierarchy only.
26625
+ *
26626
+ * Naming it separately rather than overloading `scopeNodeId` keeps the two
26627
+ * axes from collapsing: a component level is cluster-wide, a node level is
26628
+ * not, and one selector for both would make "which of these two did I just
26629
+ * set" unanswerable — the exact ambiguity `explicit` exists to remove.
26630
+ */
26631
+ scopeComponent: string().optional()
26632
+ });
26301
26633
  var SetLoggingSettingsInputSchema = object({
26302
26634
  scopeNodeId: string().optional(),
26635
+ scopeComponent: string().optional(),
26303
26636
  patch: LoggingSettingsPatchSchema
26304
26637
  });
26305
26638
  /**
@@ -26314,9 +26647,20 @@ var SetLoggingSettingsInputSchema = object({
26314
26647
  var LoggingSettingsStateSchema = object({
26315
26648
  /** The layer this document was read at. `null` = the cluster layer. */
26316
26649
  scopeNodeId: string().nullable(),
26650
+ /** The channel this document was read at. `null` = no component layer. */
26651
+ scopeComponent: string().nullable(),
26317
26652
  effective: LoggingEffectiveSchema,
26318
26653
  explicit: LoggingExplicitSchema,
26319
26654
  activeWindows: array(DiagnosticWindowSchema).readonly(),
26655
+ /**
26656
+ * Every channel the cluster's addons DECLARE, gathered from the
26657
+ * `log-channels` providers. Not stored anywhere: assembled per read, so a
26658
+ * channel added by a redeployed addon appears without anybody editing a
26659
+ * list, and a channel whose addon is gone stops being offered.
26660
+ */
26661
+ channels: array(LogChannelDescriptorSchema).readonly(),
26662
+ /** The channels ARMED right now, each with its deadline. */
26663
+ activeChannels: array(LogChannelWindowStateSchema).readonly(),
26320
26664
  persisted: boolean()
26321
26665
  });
26322
26666
  method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
@@ -27893,6 +28237,12 @@ Object.freeze({
27893
28237
  addonId: null,
27894
28238
  access: "view"
27895
28239
  },
28240
+ "dataStoreProvider.aggregate": {
28241
+ capName: "data-store-provider",
28242
+ capScope: "system",
28243
+ addonId: null,
28244
+ access: "view"
28245
+ },
27896
28246
  "dataStoreProvider.count": {
27897
28247
  capName: "data-store-provider",
27898
28248
  capScope: "system",
@@ -28307,6 +28657,12 @@ Object.freeze({
28307
28657
  addonId: null,
28308
28658
  access: "view"
28309
28659
  },
28660
+ "deviceManager.getChildrenBatch": {
28661
+ capName: "device-manager",
28662
+ capScope: "system",
28663
+ addonId: null,
28664
+ access: "view"
28665
+ },
28310
28666
  "deviceManager.getConfigSchema": {
28311
28667
  capName: "device-manager",
28312
28668
  capScope: "system",
@@ -29357,6 +29713,18 @@ Object.freeze({
29357
29713
  addonId: null,
29358
29714
  access: "create"
29359
29715
  },
29716
+ "logChannels.apply": {
29717
+ capName: "log-channels",
29718
+ capScope: "system",
29719
+ addonId: null,
29720
+ access: "create"
29721
+ },
29722
+ "logChannels.list": {
29723
+ capName: "log-channels",
29724
+ capScope: "system",
29725
+ addonId: null,
29726
+ access: "view"
29727
+ },
29360
29728
  "logDestination.query": {
29361
29729
  capName: "log-destination",
29362
29730
  capScope: "system",
@@ -31511,6 +31879,12 @@ Object.freeze({
31511
31879
  addonId: null,
31512
31880
  access: "create"
31513
31881
  },
31882
+ "settingsStore.aggregate": {
31883
+ capName: "settings-store",
31884
+ capScope: "system",
31885
+ addonId: null,
31886
+ access: "view"
31887
+ },
31514
31888
  "settingsStore.count": {
31515
31889
  capName: "settings-store",
31516
31890
  capScope: "system",
@@ -33090,6 +33464,11 @@ Object.freeze({
33090
33464
  form: "single",
33091
33465
  optional: false
33092
33466
  }],
33467
+ "deviceManager.getChildrenBatch": [{
33468
+ name: "parentDeviceIds",
33469
+ form: "array",
33470
+ optional: false
33471
+ }],
33093
33472
  "deviceManager.getConfigSchema": [{
33094
33473
  name: "deviceId",
33095
33474
  form: "single",
@@ -35059,7 +35438,7 @@ var AdminUIAddon = class extends BaseAddon {
35059
35438
  capability: adminUiCapability,
35060
35439
  provider: {
35061
35440
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
35062
- getVersion: async () => ({ version: "1.2.103" })
35441
+ getVersion: async () => ({ version: "1.2.105" })
35063
35442
  }
35064
35443
  }];
35065
35444
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-admin-ui",
3
- "version": "1.2.103",
3
+ "version": "1.2.105",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin UI — Vite frontend build and server-side addon",
@@ -1 +0,0 @@
1
- import{Q as e,S as t,W as n,q as r,x as i}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{$o as a,Dn as o,On as s,Y as c,ia as l,ts as u}from"./src-Bnzp_4un.js";import{t as d}from"./layers-CfdK3HVz.js";import{B as f,K as p,c as m,h,q as g,t as _,w as v}from"./index-C4ZumSL3.js";import{t as y}from"./AdminPage-CCD07UMs.js";import{t as b}from"./AdminTabs-Czxta2mh.js";import{t as x}from"./AddonCollectionPage-nyWYiJDc.js";import{t as S}from"./addon-display-names-DvSEQty-.js";var C=g(`file-text`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),w=g(`timer-reset`,[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]);e();var T=5e3,E={"winston-logging":`Rotated log files on this node’s disk.`,"console-logging":`stdout / stderr of the node process.`,"loki-logging":`Pushes to a Grafana Loki instance. Off until enabled with a URL.`,"hub-forwarder":`Agent-only — forwards this node’s entries to the hub.`};function D(){let e=s({capName:`log-destination`},{refetchInterval:T}),t=o(void 0,{refetchInterval:T}),r=n(()=>S(t.data??[]),[t.data]),a=n(()=>{let e=new Map;for(let n of t.data??[]){let t=n.description,r=n.id;typeof r==`string`&&typeof t==`string`&&t.length>0&&e.set(r,t)}return e},[t.data]);return i(x,{title:`Logging`,subtitle:`Every registered log destination. Entries are fanned to all enabled destinations at once — enabling one does not disable another. Each destination's own configuration is docked under it.`,pageIcon:h,itemIcon:C,capability:`log-destination`,installButtonLabel:`Add destination`,items:n(()=>(e.data??[]).map(e=>({addonId:e.addonId,displayName:r.get(e.addonId)??e.addonId,isActive:e.isActive,caption:a.get(e.addonId)??E[e.addonId]??``})),[e.data,r,a]),isLoading:e.isLoading,emptyTitle:`No log destinations registered`,emptyDescription:`This should not happen — the console and rotated-file destinations are builtins. If the list is empty, the node is still booting.`,renderStatusBadges:e=>e.caption.length>0?i(`span`,{className:`text-[10px] text-foreground-subtle`,children:e.caption}):null})}e();var O=[12e4,3e5,6e5,18e5],k={"request-census":`Counts tRPC calls arriving over HTTP by procedure, caller, address and user-agent. Arm it, then restart — the deadline is persisted, so the window is still running when clients reconnect.`};function A(){let{t:e}=_(),n=a({},{refetchInterval:5e3}),o=u(),[s,c]=r(null),l=(e,t)=>{c(e),o.mutate({patch:{diagnostics:[{id:e,armMs:t}]}},{onSettled:()=>{c(null),n.refetch()}})},d=n.data?.activeWindows??[];return i(y,{icon:p,title:e(`logging.diagnostics.title`,`Diagnostics`),subtitle:e(`logging.diagnostics.subtitle`,`Diagnostics are armed for a window, never switched on. Each carries a deadline and expires by itself — one left running is an incident of its own.`),children:n.isLoading?t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[i(v,{className:`h-3.5 w-3.5 animate-spin`}),e(`common.loading`,`Loading…`)]}):i(`div`,{className:`rounded-lg border border-border bg-surface divide-y divide-border`,children:d.map(e=>i(j,{window:e,busy:s===e.id,onArm:t=>l(e.id,t)},e.id))})})}function j({window:e,busy:n,onArm:r}){let{t:a}=_();return t(`div`,{className:`flex flex-col gap-2 p-3 lg:flex-row lg:items-center lg:justify-between`,children:[t(`div`,{className:`min-w-0`,children:[t(`div`,{className:`flex items-center gap-2`,children:[i(`span`,{className:`text-sm font-medium text-foreground`,children:e.id}),e.armed?t(`span`,{className:`inline-flex items-center gap-1 rounded bg-warning/10 px-1.5 py-0.5 text-[10px] font-semibold text-warning`,children:[i(w,{className:`h-3 w-3`}),a(`logging.diagnostics.expiresIn`,`expires in {{left}}`,{left:M(e.remainingMs)})]}):i(`span`,{className:`rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground-subtle`,children:a(`logging.diagnostics.disarmed`,`disarmed`)}),e.armed&&!e.persisted&&i(`span`,{className:`text-[10px] text-warning`,children:a(`logging.diagnostics.notPersisted`,`not persisted — will not survive a restart`)})]}),i(`p`,{className:`mt-0.5 max-w-2xl text-[11px] text-foreground-subtle`,children:k[e.id]??``})]}),t(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1`,children:[O.map(e=>i(`button`,{type:`button`,disabled:n,onClick:()=>r(e),className:`rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground disabled:opacity-50`,children:M(e)},e)),i(`button`,{type:`button`,disabled:n||!e.armed,onClick:()=>r(0),className:`rounded bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground disabled:opacity-40`,children:a(`logging.diagnostics.disarm`,`Disarm`)})]})]})}function M(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/60),r=t%60;return n===0?`${r}s`:r===0?`${n}m`:`${n}m ${r}s`}e();var N=[`debug`,`info`,`warn`,`error`],P=``;function F(){let{t:e}=_(),[o,s]=r(P),c=l(void 0,{staleTime:6e4}),f=n(()=>(c.data??[]).filter(e=>typeof e.id==`string`).map(e=>({id:e.id,label:typeof e.name==`string`&&e.name?e.name:e.id})),[c.data]),p=a(o===P?{}:{scopeNodeId:o},{refetchInterval:15e3}),m=u(),h=p.data,g=m.isPending||p.isFetching,b=(e,t)=>{m.mutate({...e.nodeId===null?{}:{scopeNodeId:e.nodeId},patch:{level:t}},{onSuccess:()=>void p.refetch()})};return i(y,{icon:d,title:e(`logging.levels.title`,`Levels`),subtitle:e(`logging.levels.subtitle`,`Cluster → node, most specific wins. The floor gates what reaches the log destinations; the in-memory viewer keeps every line either way.`),actions:t(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[e(`logging.levels.scope`,`Scope`),t(`select`,{className:`rounded border border-border bg-surface px-2 py-1 text-xs text-foreground`,value:o,onChange:e=>s(e.target.value),children:[i(`option`,{value:P,children:e(`logging.levels.cluster`,`Cluster`)}),f.map(e=>i(`option`,{value:e.id,children:e.label},e.id))]})]}),children:p.isLoading||h===void 0?t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[i(v,{className:`h-3.5 w-3.5 animate-spin`}),e(`common.loading`,`Loading…`)]}):t(`div`,{className:`space-y-3`,children:[i(I,{level:h.effective.level,source:h.effective.levelSource,persisted:h.persisted}),i(`div`,{className:`rounded-lg border border-border bg-surface divide-y divide-border`,children:h.explicit.layers.map(e=>i(L,{layer:e,inForce:e.scope===h.effective.levelSource,busy:g,onSet:t=>b(e,t),onClear:()=>b(e,null)},`${e.scope}:${e.nodeId??`cluster`}`))}),i(`p`,{className:`text-[11px] text-foreground-subtle`,children:e(`logging.levels.componentNote`,`A per-component layer is planned and not resolvable yet — nothing on this page inherits from one.`)})]})})}function I({level:e,source:n,persisted:r}){let{t:a}=_();return t(`div`,{className:`rounded-lg border border-border bg-surface p-3`,children:[t(`div`,{className:`flex items-center gap-2`,children:[i(`span`,{className:`text-xs text-foreground-subtle`,children:a(`logging.levels.effective`,`In force here`)}),i(`span`,{className:`rounded bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary`,children:e}),i(`span`,{className:`text-[11px] text-foreground-subtle`,children:n==="default"?a(`logging.levels.fromDefault`,`nothing is set anywhere — this is the default`):a(`logging.levels.fromLayer`,`decided by the {{source}} layer`,{source:n})})]}),!r&&i(`p`,{className:`mt-1 text-[11px] text-warning`,children:a(`logging.levels.notPersisted`,`The settings store could not be read or written — what you see is live, but it would not survive a restart.`)})]})}function L({layer:e,inForce:n,busy:r,onSet:a,onClear:o}){let{t:s}=_();return t(`div`,{className:`flex flex-col gap-2 p-3 sm:flex-row sm:items-center sm:justify-between`,children:[t(`div`,{className:`min-w-0`,children:[t(`div`,{className:`flex items-center gap-2`,children:[i(`span`,{className:`text-sm font-medium text-foreground`,children:e.scope===`cluster`?s(`logging.levels.cluster`,`Cluster`):e.nodeId??``}),n&&t(`span`,{className:`inline-flex items-center gap-1 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold text-primary`,children:[i(f,{className:`h-3 w-3`}),s(`logging.levels.inForce`,`in force`)]})]}),i(`p`,{className:`mt-0.5 text-[11px] text-foreground-subtle`,children:e.level===null?s(`logging.levels.inherits`,`inherits — nothing set at this layer`):s(`logging.levels.setHere`,`set here: {{level}}`,{level:e.level})})]}),t(`div`,{className:`flex shrink-0 items-center gap-1`,children:[N.map(t=>i(`button`,{type:`button`,disabled:r,onClick:()=>a(t),className:`rounded px-2 py-1 text-[11px] font-medium transition-colors disabled:opacity-50 ${e.level===t?`bg-primary text-primary-foreground`:`border border-border text-foreground-subtle hover:text-foreground`}`,children:t},t)),i(`button`,{type:`button`,disabled:r||e.level===null,onClick:o,className:`rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground disabled:opacity-40`,children:s(`logging.levels.clear`,`Clear`)})]})]})}function R(){return i(y,{children:i(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:i(c,{limit:500,maxHeight:`max-h-[calc(100vh-310px)]`,showScope:!0,showFilters:!0})})})}function z(){return i(`div`,{className:`flex flex-col p-4`,children:i(b,{tabs:[{id:`viewer`,label:`Viewer`,icon:m,content:i(R,{})},{id:`destinations`,label:`Destinations`,icon:h,content:i(D,{})},{id:`levels`,label:`Levels`,icon:d,content:i(F,{})},{id:`diagnostics`,label:`Diagnostics`,icon:p,content:i(A,{})}]})})}export{z as LogsPage};
@@ -1 +0,0 @@
1
- import{q as e}from"./index-C4ZumSL3.js";var t=e(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
@@ -1 +0,0 @@
1
- import{q as e}from"./index-C4ZumSL3.js";var t=e(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]);export{t};