@camstack/types 1.2.113 → 1.2.115
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/addon.js +2 -1
- package/dist/addon.mjs +2 -1
- package/dist/capabilities/data-store-provider.cap.d.ts +34 -0
- package/dist/capabilities/device-manager.cap.d.ts +99 -0
- package/dist/capabilities/index.d.ts +6 -3
- package/dist/capabilities/log-channels.cap.d.ts +93 -0
- package/dist/capabilities/settings-store.cap.d.ts +81 -1
- package/dist/capabilities/system.cap.d.ts +240 -7
- package/dist/generated/addon-api.d.ts +44 -0
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/collection-array-methods.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +2 -2
- package/dist/generated/system-proxy.d.ts +2 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.js +807 -12
- package/dist/index.mjs +791 -13
- package/dist/interfaces/logging.d.ts +15 -0
- package/dist/interfaces/storage.d.ts +26 -0
- package/dist/logging/log-channel-provider.d.ts +62 -0
- package/dist/logging/log-channel.d.ts +194 -0
- package/dist/logging/log-channel.singleton.d.ts +33 -0
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -312,7 +312,7 @@ function materialise(defaults) {
|
|
|
312
312
|
* barrel (`ALL_CAPABILITY_DEFINITIONS`), which would cost ~144MB RSS per
|
|
313
313
|
* forked runner. See docs/decisions/adr-0028.md.
|
|
314
314
|
*
|
|
315
|
-
* Coverage:
|
|
315
|
+
* Coverage: 18 collection caps, 31 array methods.
|
|
316
316
|
*/
|
|
317
317
|
var COLLECTION_ARRAY_METHODS = Object.freeze({
|
|
318
318
|
"addon-pages-source": ["listPages"],
|
|
@@ -333,6 +333,7 @@ var COLLECTION_ARRAY_METHODS = Object.freeze({
|
|
|
333
333
|
"listProfiles",
|
|
334
334
|
"listRuntimeNodes"
|
|
335
335
|
],
|
|
336
|
+
"log-channels": ["list"],
|
|
336
337
|
"log-destination": ["query"],
|
|
337
338
|
"login-method": ["getLoginMethods"],
|
|
338
339
|
"mqtt-broker": ["listBrokers"],
|
package/dist/addon.mjs
CHANGED
|
@@ -311,7 +311,7 @@ function materialise(defaults) {
|
|
|
311
311
|
* barrel (`ALL_CAPABILITY_DEFINITIONS`), which would cost ~144MB RSS per
|
|
312
312
|
* forked runner. See docs/decisions/adr-0028.md.
|
|
313
313
|
*
|
|
314
|
-
* Coverage:
|
|
314
|
+
* Coverage: 18 collection caps, 31 array methods.
|
|
315
315
|
*/
|
|
316
316
|
var COLLECTION_ARRAY_METHODS = Object.freeze({
|
|
317
317
|
"addon-pages-source": ["listPages"],
|
|
@@ -332,6 +332,7 @@ var COLLECTION_ARRAY_METHODS = Object.freeze({
|
|
|
332
332
|
"listProfiles",
|
|
333
333
|
"listRuntimeNodes"
|
|
334
334
|
],
|
|
335
|
+
"log-channels": ["list"],
|
|
335
336
|
"log-destination": ["query"],
|
|
336
337
|
"login-method": ["getLoginMethods"],
|
|
337
338
|
"mqtt-broker": ["listBrokers"],
|
|
@@ -177,6 +177,40 @@ export declare const dataStoreProviderCapability: {
|
|
|
177
177
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
178
178
|
}, z.core.$strip>>;
|
|
179
179
|
}, z.core.$strip>, z.ZodNumber, import("./capability-definition.js").CapabilityMethodKind>;
|
|
180
|
+
/** `COUNT(*)` plus one SUM/MIN/MAX per field, in one statement. Mirror of
|
|
181
|
+
* `settings-store.aggregate` — see it for why an unresolvable field is
|
|
182
|
+
* refused rather than dropped. */
|
|
183
|
+
readonly aggregate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
184
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
185
|
+
collection: z.ZodString;
|
|
186
|
+
fields: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
187
|
+
as: z.ZodString;
|
|
188
|
+
field: z.ZodString;
|
|
189
|
+
op: z.ZodEnum<{
|
|
190
|
+
min: "min";
|
|
191
|
+
max: "max";
|
|
192
|
+
sum: "sum";
|
|
193
|
+
}>;
|
|
194
|
+
}, z.core.$strip>>>;
|
|
195
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
196
|
+
where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
197
|
+
whereIn: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown>>>;
|
|
198
|
+
whereBetween: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodTuple<[z.ZodUnknown, z.ZodUnknown], null>>>;
|
|
199
|
+
whereNot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
200
|
+
orderBy: z.ZodOptional<z.ZodObject<{
|
|
201
|
+
field: z.ZodString;
|
|
202
|
+
direction: z.ZodEnum<{
|
|
203
|
+
asc: "asc";
|
|
204
|
+
desc: "desc";
|
|
205
|
+
}>;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
208
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
}, z.core.$strip>>;
|
|
210
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
211
|
+
count: z.ZodNumber;
|
|
212
|
+
values: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodNumber>>;
|
|
213
|
+
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
180
214
|
/** Grouped counts per ((field-origin)/bucketSize) bucket, filtered. */
|
|
181
215
|
readonly histogram: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
182
216
|
namespace: z.ZodOptional<z.ZodString>;
|
|
@@ -19,6 +19,28 @@
|
|
|
19
19
|
import { z } from 'zod';
|
|
20
20
|
import { DeviceType } from '../device/device-type.js';
|
|
21
21
|
import { StreamSourceEntrySchema } from './schemas/streaming-shared.js';
|
|
22
|
+
/**
|
|
23
|
+
* Most parents one `getChildrenBatch` may name.
|
|
24
|
+
*
|
|
25
|
+
* Every parent in the set becomes one bound `?` in the `parentDeviceId IN (…)`
|
|
26
|
+
* the store compiles ({@link DeviceRowStore.listByParentMany} →
|
|
27
|
+
* `filter-compiler.ts`), so the set size IS the SQL variable count. Two bounds
|
|
28
|
+
* meet here and 256 clears both:
|
|
29
|
+
*
|
|
30
|
+
* - `SQLITE_MAX_VARIABLE_NUMBER` is 32 766 on SQLite ≥ 3.32 but **999** on
|
|
31
|
+
* anything older, and better-sqlite3 links whatever amalgamation it was
|
|
32
|
+
* built against on the host. A fleet-sized set (1 017 parents today) sits
|
|
33
|
+
* ON that older limit; 256 stays a factor of four below it, so the batch
|
|
34
|
+
* can never turn a boot into `too many SQL variables` on a host nobody
|
|
35
|
+
* checked the build of.
|
|
36
|
+
* - One call's answer is the children of those parents, and the answer
|
|
37
|
+
* crosses a process boundary. Capping the ask caps the message.
|
|
38
|
+
*
|
|
39
|
+
* A caller with more parents sends ⌈n/256⌉ calls — four for today's fleet,
|
|
40
|
+
* against 1 024 today. The cap is on the SCHEMA, not only on the caller: an
|
|
41
|
+
* over-eager caller is refused, not silently truncated to a wrong answer.
|
|
42
|
+
*/
|
|
43
|
+
export declare const DEVICE_CHILDREN_BATCH_MAX = 256;
|
|
22
44
|
/** Cap-wire shape of a per-cap display refinement — mirrors
|
|
23
45
|
* `DeviceCapDisplayOverride` in `device-management.ts`. */
|
|
24
46
|
export declare const DeviceCapDisplayOverrideSchema: z.ZodObject<{
|
|
@@ -675,6 +697,83 @@ export declare const deviceManagerCapability: {
|
|
|
675
697
|
}, z.core.$strip>>>;
|
|
676
698
|
}, z.core.$strip>>;
|
|
677
699
|
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
700
|
+
/**
|
|
701
|
+
* `getChildren` for a NAMED SET of parents, in one call.
|
|
702
|
+
*
|
|
703
|
+
* The accessory reconcile in `device-cap-proxy.ts` asks this question once
|
|
704
|
+
* per registered device — every `BaseDevice` inherits a
|
|
705
|
+
* `getAccessoryChildren()` that returns `[]`, so even a leaf accessory
|
|
706
|
+
* pays a round-trip to learn it has nothing to prune. Measured on the live
|
|
707
|
+
* hub 2026-08-27 over a 120-second boot window, fleet of 1 017 devices:
|
|
708
|
+
* `DeviceRowStore.list < DeviceRowStore.listByParent < getChildren` at
|
|
709
|
+
* **1 024 calls** returning **919 rows in total** — 1 024 RPCs and 1 024
|
|
710
|
+
* indexed scans to move less than one row each. `listByParentMany`
|
|
711
|
+
* collapses the scans; this collapses the RPCs.
|
|
712
|
+
*
|
|
713
|
+
* Keyed by parent id as a STRING — a JSON object cannot key by number
|
|
714
|
+
* (same reason as `getDeviceStatusAggregateBatch`). The per-parent value
|
|
715
|
+
* is exactly what `getChildren` returns for that parent.
|
|
716
|
+
*
|
|
717
|
+
* A parent with no children — or one the fleet does not know — is ABSENT
|
|
718
|
+
* from the record, never an invented empty row: the same contract as
|
|
719
|
+
* `DeviceRowStore.getMany`/`listByParentMany`. An EMPTY `parentDeviceIds`
|
|
720
|
+
* reads nothing at all rather than degrading to "every device".
|
|
721
|
+
*
|
|
722
|
+
* `parentDeviceIds` is capped at {@link DEVICE_CHILDREN_BATCH_MAX} — see
|
|
723
|
+
* that constant for why. A caller with more parents than that sends more
|
|
724
|
+
* than one call; it never sends one pathological one.
|
|
725
|
+
*
|
|
726
|
+
* Version skew: this is a NEW method, not a new field on `getChildren`, so
|
|
727
|
+
* a hub that predates it answers NOT_FOUND rather than silently stripping
|
|
728
|
+
* an unknown input key and answering a DIFFERENT question. The kernel-side
|
|
729
|
+
* loader degrades to per-parent `getChildren` on that error — see
|
|
730
|
+
* `children-batch-loader.ts`.
|
|
731
|
+
*/
|
|
732
|
+
readonly getChildrenBatch: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
733
|
+
parentDeviceIds: z.ZodArray<z.ZodNumber>;
|
|
734
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
735
|
+
id: z.ZodNumber;
|
|
736
|
+
stableId: z.ZodString;
|
|
737
|
+
addonId: z.ZodString;
|
|
738
|
+
type: z.ZodEnum<typeof DeviceType>;
|
|
739
|
+
name: z.ZodString;
|
|
740
|
+
location: z.ZodNullable<z.ZodString>;
|
|
741
|
+
disabled: z.ZodBoolean;
|
|
742
|
+
parentDeviceId: z.ZodNullable<z.ZodNumber>;
|
|
743
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
744
|
+
online: z.ZodBoolean;
|
|
745
|
+
probed: z.ZodOptional<z.ZodBoolean>;
|
|
746
|
+
features: z.ZodArray<z.ZodString>;
|
|
747
|
+
isCamera: z.ZodBoolean;
|
|
748
|
+
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
749
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
750
|
+
sourceInfo: z.ZodOptional<z.ZodObject<{
|
|
751
|
+
id: z.ZodString;
|
|
752
|
+
system: z.ZodString;
|
|
753
|
+
uniqueId: z.ZodOptional<z.ZodString>;
|
|
754
|
+
raw: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
755
|
+
}, z.core.$strip>>;
|
|
756
|
+
integrationId: z.ZodOptional<z.ZodString>;
|
|
757
|
+
linkDeviceId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
758
|
+
primaryChildEntityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
759
|
+
childLayout: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
760
|
+
childKey: z.ZodString;
|
|
761
|
+
section: z.ZodString;
|
|
762
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
763
|
+
collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
764
|
+
}, z.core.$strip>>>>;
|
|
765
|
+
display: z.ZodOptional<z.ZodObject<{
|
|
766
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
767
|
+
label: z.ZodOptional<z.ZodString>;
|
|
768
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
769
|
+
precision: z.ZodOptional<z.ZodNumber>;
|
|
770
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
771
|
+
perCap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
772
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
773
|
+
precision: z.ZodOptional<z.ZodNumber>;
|
|
774
|
+
}, z.core.$strip>>>;
|
|
775
|
+
}, z.core.$strip>>;
|
|
776
|
+
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
678
777
|
/**
|
|
679
778
|
* Resolve the devices LINKED to a camera — the single policy authority
|
|
680
779
|
* both consumers call (viewer devices panel + pipeline-analytics event
|
|
@@ -50,7 +50,7 @@ export { AdoptInputSchema as AdoptionAdoptInputSchema, type AdoptionFilter, Adop
|
|
|
50
50
|
export type { IDeviceExportProvider } from './device-export.cap.js';
|
|
51
51
|
export { DeviceExportStatusSchema, deviceExportCapability, ExportSetupFieldSchema, ExportSetupSchema, ExposedDeviceSchema, ExposeInputSchema as DeviceExportExposeInputSchema, UnexposeInputSchema as DeviceExportUnexposeInputSchema, } from './device-export.cap.js';
|
|
52
52
|
export type { DeviceInfo, DeviceManagerApplyInitialMetaInput } from './device-manager.cap.js';
|
|
53
|
-
export { ConfigEntrySchema, DeviceInfoSchema, deviceManagerCapability, type IDeviceManagerProvider, type LinkedDevice, LinkedDeviceSchema, type LinkedDevicesMode, LinkedDevicesModeSchema, } from './device-manager.cap.js';
|
|
53
|
+
export { ConfigEntrySchema, DEVICE_CHILDREN_BATCH_MAX, DeviceInfoSchema, deviceManagerCapability, type IDeviceManagerProvider, type LinkedDevice, LinkedDeviceSchema, type LinkedDevicesMode, LinkedDevicesModeSchema, } from './device-manager.cap.js';
|
|
54
54
|
export { DiscoveredDeviceSchema, deviceProviderCapability, ProviderStatusSchema, } from './device-provider.cap.js';
|
|
55
55
|
export { deviceStateCapability } from './device-state.cap.js';
|
|
56
56
|
export type { IEmbeddingEncoderProvider } from './embedding-encoder.cap.js';
|
|
@@ -59,6 +59,8 @@ export { filesystemBrowseCapability, type IFilesystemBrowseProvider, } from './f
|
|
|
59
59
|
export { type HfModelResolution, HfModelResolutionSchema, type ILlmProvider, type LlmDefault, LlmDefaultSchema, type LlmDefaultSelector, LlmDefaultSelectorSchema, type LlmProfile, type LlmProfileKind, type LlmProfileKindDescriptor, LlmProfileKindDescriptorSchema, LlmProfileKindSchema, LlmProfileSchema, type LlmRuntimeNode, LlmRuntimeNodeSchema, type LlmUsageRollup, LlmUsageRollupSchema, llmCapability, type ManagedModelCatalogEntry, ManagedModelCatalogEntrySchema, } from './llm.cap.js';
|
|
60
60
|
export { type ILlmRuntimeProvider, type LlmDownloadProgress, LlmDownloadProgressSchema, type LlmNodeModel, LlmNodeModelSchema, type LlmRuntimeCompleteInput, LlmRuntimeCompleteInputSchema, type LlmRuntimeDiskUsage, LlmRuntimeDiskUsageSchema, type LlmRuntimeStatus, LlmRuntimeStatusSchema, llmRuntimeCapability, type ManagedModelExtraFile, ManagedModelExtraFileSchema, type ManagedModelRef, ManagedModelRefSchema, type ManagedRuntimeConfig, ManagedRuntimeConfigSchema, } from './llm-runtime.cap.js';
|
|
61
61
|
export { type LlmErrorCode, LlmErrorCodeSchema, type LlmGenerateBaseInput, LlmGenerateBaseInputSchema, type LlmGenerateErr, LlmGenerateErrSchema, type LlmGenerateOk, LlmGenerateOkSchema, type LlmGenerateResult, LlmGenerateResultSchema, type LlmImage, LlmImageSchema, type LlmRetryPolicy, LlmRetryPolicySchema, LlmTimeoutDefaults, type LlmUsage, LlmUsageSchema, } from './llm-shared.js';
|
|
62
|
+
export type { ILogChannelsProvider, LogChannelApplyResult } from './log-channels.cap.js';
|
|
63
|
+
export { LogChannelApplyResultSchema, logChannelsCapability } from './log-channels.cap.js';
|
|
62
64
|
export { LogEntrySchema, LogLevelSchema, logDestinationCapability } from './log-destination.cap.js';
|
|
63
65
|
export type { ILoginMethodProvider, LoginMethodContribution, LoginStage, PasskeyLoginMethod, RedirectLoginMethod, WidgetLoginMethod, } from './login-method.cap.js';
|
|
64
66
|
export { LoginMethodContributionSchema, LoginStageEnum, loginMethodCapability, PasskeyLoginMethodSchema, RedirectLoginMethodSchema, WidgetLoginMethodSchema, } from './login-method.cap.js';
|
|
@@ -189,7 +191,7 @@ export { type CamStreamDescriptor, CamStreamDescriptorSchema, type IStreamCatalo
|
|
|
189
191
|
export { type IStreamParamsProvider, type StreamParamsOptions, StreamParamsOptionsSchema, type StreamParamsStatus, StreamParamsStatusSchema, type StreamProfile, StreamProfileConfigSchema, StreamProfileOptionsSchema, type StreamProfilePatch, StreamProfilePatchSchema, StreamProfileSchema, streamParamsCapability, } from './stream-params.cap.js';
|
|
190
192
|
export { buildStreamParamsConfigSchema, parseStreamParamsFormPatch, STREAM_PROFILE_META, type StreamProfileMeta, } from './stream-params-config-schema.js';
|
|
191
193
|
export { type ISwitchProvider, type SwitchStatus, SwitchStatusSchema, switchCapability, } from './switch.cap.js';
|
|
192
|
-
export { type DiagnosticId, DiagnosticIdSchema, type DiagnosticWindow, type DiagnosticWindowPatch, DiagnosticWindowPatchSchema, DiagnosticWindowSchema, FeatureManifestSchema, type GetLoggingSettingsInput, GetLoggingSettingsInputSchema, HealthStatusSchema, type ISystemProvider, type LoggingEffective, LoggingEffectiveSchema, type LoggingExplicit, LoggingExplicitSchema, type LoggingLevelLayer, LoggingLevelLayerSchema, type LoggingLevelSource, LoggingLevelSourceSchema, type LoggingScopeKind, LoggingScopeKindSchema, type LoggingSettingsPatch, LoggingSettingsPatchSchema, type LoggingSettingsState, LoggingSettingsStateSchema, NetworkAddressSchema, type RequestCensusGroup, RequestCensusGroupSchema, type RequestCensusProcedure, RequestCensusProcedureSchema, type RequestCensusSnapshot, RequestCensusSnapshotSchema, type RequestCensusStatus, RequestCensusStatusSchema, type SetLoggingSettingsInput, SetLoggingSettingsInputSchema, type SetSiteLocationInput, SetSiteLocationInputSchema, type SiteLocation, SiteLocationSchema, type SiteLocationSource, SiteLocationSourceSchema, type SiteLocationStatus, SiteLocationStatusSchema, systemCapability, } from './system.cap.js';
|
|
194
|
+
export { type DiagnosticId, DiagnosticIdSchema, type DiagnosticWindow, type DiagnosticWindowPatch, DiagnosticWindowPatchSchema, DiagnosticWindowSchema, FeatureManifestSchema, type GetLoggingSettingsInput, GetLoggingSettingsInputSchema, HealthStatusSchema, type ISystemProvider, type LogChannelWindowPatch, LogChannelWindowPatchSchema, type LogChannelWindowState, LogChannelWindowStateSchema, type LoggingEffective, LoggingEffectiveSchema, type LoggingExplicit, LoggingExplicitSchema, type LoggingLevelLayer, LoggingLevelLayerSchema, type LoggingLevelSource, LoggingLevelSourceSchema, type LoggingScopeKind, LoggingScopeKindSchema, type LoggingSettingsPatch, LoggingSettingsPatchSchema, type LoggingSettingsState, LoggingSettingsStateSchema, NetworkAddressSchema, type RequestCensusGroup, RequestCensusGroupSchema, type RequestCensusProcedure, RequestCensusProcedureSchema, type RequestCensusSnapshot, RequestCensusSnapshotSchema, type RequestCensusStatus, RequestCensusStatusSchema, type SetLoggingSettingsInput, SetLoggingSettingsInputSchema, type SetSiteLocationInput, SetSiteLocationInputSchema, type SiteLocation, SiteLocationSchema, type SiteLocationSource, SiteLocationSourceSchema, type SiteLocationStatus, SiteLocationStatusSchema, systemCapability, type TransportPlane, type TransportPlaneCounts, TransportPlaneCountsSchema, TransportPlaneSchema, } from './system.cap.js';
|
|
193
195
|
export { type ITamperProvider, type TamperStatus, TamperStatusSchema, tamperCapability, } from './tamper.cap.js';
|
|
194
196
|
export { type ITemperatureSensorProvider, type TemperatureSensorStatus, TemperatureSensorStatusSchema, temperatureSensorCapability, } from './temperature-sensor.cap.js';
|
|
195
197
|
export { type IToastProvider, ToastSchema, toastCapability } from './toast.cap.js';
|
|
@@ -277,6 +279,7 @@ import type { llmCapability } from './llm.cap.js';
|
|
|
277
279
|
import type { llmRuntimeCapability } from './llm-runtime.cap.js';
|
|
278
280
|
import type { localNetworkCapability } from './local-network.cap.js';
|
|
279
281
|
import type { lockControlCapability } from './lock-control.cap.js';
|
|
282
|
+
import type { logChannelsCapability } from './log-channels.cap.js';
|
|
280
283
|
import type { logDestinationCapability } from './log-destination.cap.js';
|
|
281
284
|
import type { loginMethodCapability } from './login-method.cap.js';
|
|
282
285
|
import type { mediaPlayerCapability } from './media-player.cap.js';
|
|
@@ -353,6 +356,6 @@ import type { webrtcSessionCapability } from './webrtc-session.cap.js';
|
|
|
353
356
|
import type { zoneAnalyticsCapability } from './zone-analytics.cap.js';
|
|
354
357
|
import type { zoneRulesCapability } from './zone-rules.cap.js';
|
|
355
358
|
import type { zonesCapability } from './zones.cap.js';
|
|
356
|
-
type AnyCapability = typeof addonSettingsCapability | typeof alertsCapability | typeof storageCapability | typeof storageMigrationCapability | typeof storageProviderCapability | typeof storageEvictableCapability | typeof filesystemBrowseCapability | typeof backupCapability | typeof terminalSessionCapability | typeof settingsStoreCapability | typeof dataStoreProviderCapability | typeof logDestinationCapability | typeof adminUiCapability | typeof viewerUiCapability | typeof ssoBridgeCapability | typeof userPasskeysCapability | typeof smtpProviderCapability | typeof mqttBrokerCapability | typeof brokerCapability | typeof deviceAdoptionCapability | typeof deviceExportCapability | typeof addonPagesCapability | typeof addonPagesSourceCapability | typeof addonWidgetsCapability | typeof addonWidgetsSourceCapability | typeof customModelRegistryCapability | typeof modelDistributorCapability | typeof modelConvertCapability | typeof addonRoutesCapability | typeof streamBrokerCapability | typeof decoderCapability | typeof webrtcSessionCapability | typeof cameraStreamsCapability | typeof motionDetectionCapability | typeof pipelineExecutorCapability | typeof detectionPipelineCapability | typeof cameraPipelineConfigCapability | typeof pipelineRunnerCapability | typeof pipelineOrchestratorCapability | typeof audioAnalyzerCapability | typeof audioAnalysisCapability | typeof audioCodecCapability | typeof embeddingEncoderCapability | typeof vectorStoreCapability | typeof deviceProviderCapability | typeof deviceManagerCapability | typeof deviceStateCapability | typeof authProviderCapability | typeof loginMethodCapability | typeof networkAccessCapability | typeof turnProviderCapability | typeof snapshotCapability | typeof llmCapability | typeof llmRuntimeCapability | typeof notificationOutputCapability | typeof coreBlocksCapability | typeof notificationRulesCapability | typeof pipelineAnalyticsCapability | typeof metricsProviderCapability | typeof ptzCapability | typeof ptzAutotrackCapability | typeof consumablesCapability | typeof connectionTestCapability | typeof rebootCapability | typeof deviceDiscoveryCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof imageCapability | typeof lockControlCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof automationControlCapability | typeof motionTriggerCapability | typeof eventsCapability | typeof zonesCapability | typeof zoneRulesCapability | typeof zoneAnalyticsCapability | typeof audioMetricsCapability | typeof motionCapability | typeof contactCapability | typeof floodCapability | typeof smokeCapability | typeof carbonMonoxideCapability | typeof gasCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof humiditySensorCapability | typeof ambientLightSensorCapability | typeof pressureSensorCapability | typeof powerMeterCapability | typeof airQualitySensorCapability | typeof numericSensorCapability | typeof enumSensorCapability | typeof recordingCapability | typeof recordingExportCapability | typeof deviceOpsCapability | typeof platformProbeCapability | typeof localNetworkCapability | typeof meshNetworkCapability | typeof userManagementCapability | typeof systemCapability | typeof networkQualityCapability | typeof toastCapability | typeof nodesCapability | typeof serverManagementCapability | typeof integrationsCapability | typeof addonsCapability | typeof oauthIntegrationCapability | typeof streamParamsCapability | typeof streamCatalogCapability | typeof motionZonesCapability | typeof sceneMonitorCapability | typeof privacyMaskCapability | typeof dayNightCapability | typeof imageSettingsCapability | typeof osdCapability | typeof osdManagerCapability | typeof accessoriesCapability | typeof batteryCapability | typeof buttonCapability | typeof cameraCredentialsCapability | typeof deviceStatusCapability | typeof doorbellCapability | typeof eventEmitterCapability | typeof faceGalleryCapability | typeof featureProbeCapability | typeof intercomCapability | typeof nativeObjectDetectionCapability | typeof plateGalleryCapability | typeof switchCapability | typeof updateCapability | typeof videoclipsCapability;
|
|
359
|
+
type AnyCapability = typeof addonSettingsCapability | typeof alertsCapability | typeof storageCapability | typeof storageMigrationCapability | typeof storageProviderCapability | typeof storageEvictableCapability | typeof filesystemBrowseCapability | typeof backupCapability | typeof terminalSessionCapability | typeof settingsStoreCapability | typeof dataStoreProviderCapability | typeof logChannelsCapability | typeof logDestinationCapability | typeof adminUiCapability | typeof viewerUiCapability | typeof ssoBridgeCapability | typeof userPasskeysCapability | typeof smtpProviderCapability | typeof mqttBrokerCapability | typeof brokerCapability | typeof deviceAdoptionCapability | typeof deviceExportCapability | typeof addonPagesCapability | typeof addonPagesSourceCapability | typeof addonWidgetsCapability | typeof addonWidgetsSourceCapability | typeof customModelRegistryCapability | typeof modelDistributorCapability | typeof modelConvertCapability | typeof addonRoutesCapability | typeof streamBrokerCapability | typeof decoderCapability | typeof webrtcSessionCapability | typeof cameraStreamsCapability | typeof motionDetectionCapability | typeof pipelineExecutorCapability | typeof detectionPipelineCapability | typeof cameraPipelineConfigCapability | typeof pipelineRunnerCapability | typeof pipelineOrchestratorCapability | typeof audioAnalyzerCapability | typeof audioAnalysisCapability | typeof audioCodecCapability | typeof embeddingEncoderCapability | typeof vectorStoreCapability | typeof deviceProviderCapability | typeof deviceManagerCapability | typeof deviceStateCapability | typeof authProviderCapability | typeof loginMethodCapability | typeof networkAccessCapability | typeof turnProviderCapability | typeof snapshotCapability | typeof llmCapability | typeof llmRuntimeCapability | typeof notificationOutputCapability | typeof coreBlocksCapability | typeof notificationRulesCapability | typeof pipelineAnalyticsCapability | typeof metricsProviderCapability | typeof ptzCapability | typeof ptzAutotrackCapability | typeof consumablesCapability | typeof connectionTestCapability | typeof rebootCapability | typeof deviceDiscoveryCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof imageCapability | typeof lockControlCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof automationControlCapability | typeof motionTriggerCapability | typeof eventsCapability | typeof zonesCapability | typeof zoneRulesCapability | typeof zoneAnalyticsCapability | typeof audioMetricsCapability | typeof motionCapability | typeof contactCapability | typeof floodCapability | typeof smokeCapability | typeof carbonMonoxideCapability | typeof gasCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof humiditySensorCapability | typeof ambientLightSensorCapability | typeof pressureSensorCapability | typeof powerMeterCapability | typeof airQualitySensorCapability | typeof numericSensorCapability | typeof enumSensorCapability | typeof recordingCapability | typeof recordingExportCapability | typeof deviceOpsCapability | typeof platformProbeCapability | typeof localNetworkCapability | typeof meshNetworkCapability | typeof userManagementCapability | typeof systemCapability | typeof networkQualityCapability | typeof toastCapability | typeof nodesCapability | typeof serverManagementCapability | typeof integrationsCapability | typeof addonsCapability | typeof oauthIntegrationCapability | typeof streamParamsCapability | typeof streamCatalogCapability | typeof motionZonesCapability | typeof sceneMonitorCapability | typeof privacyMaskCapability | typeof dayNightCapability | typeof imageSettingsCapability | typeof osdCapability | typeof osdManagerCapability | typeof accessoriesCapability | typeof batteryCapability | typeof buttonCapability | typeof cameraCredentialsCapability | typeof deviceStatusCapability | typeof doorbellCapability | typeof eventEmitterCapability | typeof faceGalleryCapability | typeof featureProbeCapability | typeof intercomCapability | typeof nativeObjectDetectionCapability | typeof plateGalleryCapability | typeof switchCapability | typeof updateCapability | typeof videoclipsCapability;
|
|
357
360
|
export type CapabilityName = AnyCapability['name'];
|
|
358
361
|
export type ITypedReadinessRegistry = IReadinessRegistry<CapabilityName>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
3
|
+
* through. It stores nothing.
|
|
4
|
+
*
|
|
5
|
+
* ## Why a capability at all, and why this shape
|
|
6
|
+
*
|
|
7
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
8
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
9
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
10
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
11
|
+
* is assembled from declarations at runtime.
|
|
12
|
+
*
|
|
13
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
14
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
15
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
16
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
17
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
18
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
19
|
+
* No new UDS message, no second registry.
|
|
20
|
+
*
|
|
21
|
+
* ## What it deliberately does NOT own
|
|
22
|
+
*
|
|
23
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
24
|
+
* ONE place: the logging settings document on the `system` cap
|
|
25
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
26
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
27
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
28
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
29
|
+
* setter for a window and no persistence of any kind.
|
|
30
|
+
*
|
|
31
|
+
* ## Why `apply` is here even so
|
|
32
|
+
*
|
|
33
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
34
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
35
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
36
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
37
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
38
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
39
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
40
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
41
|
+
*/
|
|
42
|
+
import { z } from 'zod';
|
|
43
|
+
import { type InferProvider } from './capability-definition.js';
|
|
44
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
45
|
+
declare const LogChannelApplyResultSchema: z.ZodObject<{
|
|
46
|
+
armed: z.ZodNumber;
|
|
47
|
+
unknown: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const logChannelsCapability: {
|
|
50
|
+
readonly name: "log-channels";
|
|
51
|
+
readonly scope: "system";
|
|
52
|
+
readonly mode: "collection";
|
|
53
|
+
readonly internal: true;
|
|
54
|
+
readonly methods: {
|
|
55
|
+
/** The channels this addon declares. Inert: no value, no state. */
|
|
56
|
+
readonly list: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
description: z.ZodString;
|
|
59
|
+
defaultLevel: z.ZodEnum<{
|
|
60
|
+
error: "error";
|
|
61
|
+
info: "info";
|
|
62
|
+
warn: "warn";
|
|
63
|
+
}>;
|
|
64
|
+
perDevice: z.ZodBoolean;
|
|
65
|
+
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
66
|
+
/**
|
|
67
|
+
* Refresh this process's mirror from the document's FULL set of armed
|
|
68
|
+
* windows.
|
|
69
|
+
*
|
|
70
|
+
* Full and not incremental on purpose: the document is the authority, so a
|
|
71
|
+
* channel it does not name is disarmed here. An incremental apply would
|
|
72
|
+
* let a disarm get lost in transit and leave a channel running that
|
|
73
|
+
* nobody can see is running.
|
|
74
|
+
*/
|
|
75
|
+
readonly apply: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
76
|
+
windows: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
77
|
+
channel: z.ZodString;
|
|
78
|
+
armedUntilMs: z.ZodNumber;
|
|
79
|
+
deviceIds: z.ZodNullable<z.ZodReadonly<z.ZodArray<z.ZodNumber>>>;
|
|
80
|
+
}, z.core.$strip>>>;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
armed: z.ZodNumber;
|
|
83
|
+
unknown: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
84
|
+
}, z.core.$strip>, "mutation">;
|
|
85
|
+
};
|
|
86
|
+
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
87
|
+
readonly mount: {
|
|
88
|
+
readonly kind: "skip";
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export type ILogChannelsProvider = InferProvider<typeof logChannelsCapability>;
|
|
92
|
+
export type LogChannelApplyResult = z.infer<typeof LogChannelApplyResultSchema>;
|
|
93
|
+
export { LogChannelApplyResultSchema };
|
|
@@ -33,6 +33,33 @@ declare const MutationFilterSchema: z.ZodObject<{
|
|
|
33
33
|
whereBetween: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodTuple<[z.ZodUnknown, z.ZodUnknown], null>>>;
|
|
34
34
|
whereNot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
35
35
|
}, z.core.$strip>;
|
|
36
|
+
/**
|
|
37
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
38
|
+
*
|
|
39
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
40
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
41
|
+
* a `Record<column, op>` shape could not express.
|
|
42
|
+
*/
|
|
43
|
+
declare const AggregateFieldSchema: z.ZodObject<{
|
|
44
|
+
as: z.ZodString;
|
|
45
|
+
field: z.ZodString;
|
|
46
|
+
op: z.ZodEnum<{
|
|
47
|
+
min: "min";
|
|
48
|
+
max: "max";
|
|
49
|
+
sum: "sum";
|
|
50
|
+
}>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
/**
|
|
53
|
+
* `COUNT(*)` plus one number per requested field.
|
|
54
|
+
*
|
|
55
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
56
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
57
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
58
|
+
*/
|
|
59
|
+
declare const AggregateResultSchema: z.ZodObject<{
|
|
60
|
+
count: z.ZodNumber;
|
|
61
|
+
values: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodNumber>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
36
63
|
/** A single stored record: `{ id, data }`. */
|
|
37
64
|
declare const SettingsRecordSchema: z.ZodObject<{
|
|
38
65
|
id: z.ZodString;
|
|
@@ -238,6 +265,57 @@ export declare const settingsStoreCapability: {
|
|
|
238
265
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
239
266
|
}, z.core.$strip>>;
|
|
240
267
|
}, z.core.$strip>, z.ZodNumber, import("./capability-definition.js").CapabilityMethodKind>;
|
|
268
|
+
/**
|
|
269
|
+
* `COUNT(*)` and one `SUM` / `MIN` / `MAX` per requested field, in ONE
|
|
270
|
+
* statement, over the rows `filter` selects.
|
|
271
|
+
*
|
|
272
|
+
* Exists because "how much is there" was being answered by materialising
|
|
273
|
+
* "what is there". The recorder's storage-pressure sweep asked its in-RAM
|
|
274
|
+
* footage index for bytes/count/oldest/newest across a set of storage
|
|
275
|
+
* locations twice a minute, and the only way to answer that from a map is
|
|
276
|
+
* to visit every row — 7.1 M of them on the live hub, ~15 M row visits a
|
|
277
|
+
* minute on the main thread, which is also why the whole archive had to
|
|
278
|
+
* stay resident to be visited. The question is a sum; nothing needs to be
|
|
279
|
+
* materialised to answer it.
|
|
280
|
+
*
|
|
281
|
+
* **The engine REFUSES a field it cannot serve**, exactly as
|
|
282
|
+
* `query.columns` does and unlike a PREDICATE, which is skipped when
|
|
283
|
+
* unresolvable. A dropped predicate over-matches and the caller sees extra
|
|
284
|
+
* rows; a dropped aggregate returns a NUMBER that is wrong and looks
|
|
285
|
+
* exactly like a real one. That asymmetry is what this repo has already
|
|
286
|
+
* paid for once in `count`.
|
|
287
|
+
*/
|
|
288
|
+
readonly aggregate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
289
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
290
|
+
collection: z.ZodString;
|
|
291
|
+
fields: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
292
|
+
as: z.ZodString;
|
|
293
|
+
field: z.ZodString;
|
|
294
|
+
op: z.ZodEnum<{
|
|
295
|
+
min: "min";
|
|
296
|
+
max: "max";
|
|
297
|
+
sum: "sum";
|
|
298
|
+
}>;
|
|
299
|
+
}, z.core.$strip>>>;
|
|
300
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
301
|
+
where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
302
|
+
whereIn: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnknown>>>;
|
|
303
|
+
whereBetween: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodTuple<[z.ZodUnknown, z.ZodUnknown], null>>>;
|
|
304
|
+
whereNot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
305
|
+
orderBy: z.ZodOptional<z.ZodObject<{
|
|
306
|
+
field: z.ZodString;
|
|
307
|
+
direction: z.ZodEnum<{
|
|
308
|
+
asc: "asc";
|
|
309
|
+
desc: "desc";
|
|
310
|
+
}>;
|
|
311
|
+
}, z.core.$strip>>;
|
|
312
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
313
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
314
|
+
}, z.core.$strip>>;
|
|
315
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
316
|
+
count: z.ZodNumber;
|
|
317
|
+
values: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodNumber>>;
|
|
318
|
+
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
241
319
|
/** Grouped counts per ((field-origin)/bucketSize) bucket, filtered. */
|
|
242
320
|
readonly histogram: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
243
321
|
namespace: z.ZodOptional<z.ZodString>;
|
|
@@ -316,7 +394,9 @@ export type ISettingsStoreProvider = InferProvider<typeof settingsStoreCapabilit
|
|
|
316
394
|
* Methods are accessed as `client.get.query(input)`, `client.set.mutate(input)`, etc.
|
|
317
395
|
*/
|
|
318
396
|
export type SettingsStoreClient = import('../generated/addon-api.js').AddonApi['settingsStore'];
|
|
319
|
-
export { CollectionColumnSchema, CollectionIndexSchema, MutationFilterSchema, QueryFilterSchema, SettingsRecordSchema, };
|
|
397
|
+
export { AggregateFieldSchema, AggregateResultSchema, CollectionColumnSchema, CollectionIndexSchema, MutationFilterSchema, QueryFilterSchema, SettingsRecordSchema, };
|
|
398
|
+
export type AggregateField = z.infer<typeof AggregateFieldSchema>;
|
|
399
|
+
export type AggregateResult = z.infer<typeof AggregateResultSchema>;
|
|
320
400
|
export type MutationFilter = z.infer<typeof MutationFilterSchema>;
|
|
321
401
|
export type CollectionColumn = z.infer<typeof CollectionColumnSchema>;
|
|
322
402
|
export type CollectionIndex = z.infer<typeof CollectionIndexSchema>;
|