@camstack/addon-provider-unifi 0.2.52 → 0.2.55
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 +82 -7
- package/dist/addon.mjs +82 -7
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7718,7 +7718,8 @@ var OpsLogReasonSchema = _enum([
|
|
|
7718
7718
|
"quota",
|
|
7719
7719
|
"manual",
|
|
7720
7720
|
"operator",
|
|
7721
|
-
"maintenance"
|
|
7721
|
+
"maintenance",
|
|
7722
|
+
"orphaned-device"
|
|
7722
7723
|
]);
|
|
7723
7724
|
/** One audit row, shared verbatim by both domains. */
|
|
7724
7725
|
var OpsLogEntrySchema = object({
|
|
@@ -13013,10 +13014,39 @@ var DevicePersistConfigPayloadSchema = object({
|
|
|
13013
13014
|
deviceId: number(),
|
|
13014
13015
|
data: record(string(), unknown())
|
|
13015
13016
|
});
|
|
13017
|
+
/** What a migration actually did, per switch. `unreachable` is a first-class
|
|
13018
|
+
* answer: a camera that could not be asked is not a camera that was silenced. */
|
|
13019
|
+
var MigrateSwitchOutcomeSchema = _enum([
|
|
13020
|
+
"off",
|
|
13021
|
+
"on",
|
|
13022
|
+
"not-offered",
|
|
13023
|
+
"unreachable"
|
|
13024
|
+
]);
|
|
13025
|
+
var MigrateSwitchReportSchema = object({
|
|
13026
|
+
deviceId: number(),
|
|
13027
|
+
switchId: CameraSwitchIdSchema,
|
|
13028
|
+
outcome: MigrateSwitchOutcomeSchema,
|
|
13029
|
+
detail: string().optional()
|
|
13030
|
+
});
|
|
13031
|
+
var MigrateDeviceResultSchema = object({
|
|
13032
|
+
sourceId: number(),
|
|
13033
|
+
targetId: number(),
|
|
13034
|
+
switches: array(MigrateSwitchReportSchema).readonly(),
|
|
13035
|
+
/** Switches that could NOT be turned off on the source. Empty is the only
|
|
13036
|
+
* value meaning the replaced hardware is quiet. */
|
|
13037
|
+
sourceStillLive: array(CameraSwitchIdSchema).readonly(),
|
|
13038
|
+
swapped: boolean()
|
|
13039
|
+
});
|
|
13016
13040
|
method(object({
|
|
13017
13041
|
addonId: string(),
|
|
13018
13042
|
stableId: string()
|
|
13019
|
-
}), object({ id: number() }), { kind: "mutation" }), method(
|
|
13043
|
+
}), object({ id: number() }), { kind: "mutation" }), method(object({
|
|
13044
|
+
sourceId: number(),
|
|
13045
|
+
targetId: number()
|
|
13046
|
+
}), MigrateDeviceResultSchema, {
|
|
13047
|
+
kind: "mutation",
|
|
13048
|
+
auth: "admin"
|
|
13049
|
+
}), method(DeviceRegisterPayloadSchema, _void(), { kind: "mutation" }), method(DeviceRemovePayloadSchema, _void(), { kind: "mutation" }), method(DevicePersistConfigPayloadSchema, _void(), { kind: "mutation" }), method(object({ deviceId: number() }), record(string(), unknown())), method(object({ deviceId: number() }), record(string(), unknown())), method(object({ deviceId: number() }), DeviceMetaSchema.nullable()), method(object({
|
|
13020
13050
|
deviceId: number(),
|
|
13021
13051
|
name: string()
|
|
13022
13052
|
}), _void(), {
|
|
@@ -13491,6 +13521,35 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
|
|
|
13491
13521
|
auth: "admin"
|
|
13492
13522
|
});
|
|
13493
13523
|
/**
|
|
13524
|
+
* Transport bounds for AI capability methods.
|
|
13525
|
+
*
|
|
13526
|
+
* Its own module because `llm.cap.ts` and `llm-runtime.cap.ts` already import
|
|
13527
|
+
* each other: declaring the constant in either one hands the other `undefined`
|
|
13528
|
+
* at module-init time, and an undefined `timeoutMs` silently falls back to the
|
|
13529
|
+
* kernel's 60 s default — the exact failure this constant exists to prevent,
|
|
13530
|
+
* reintroduced invisibly. Found by the guard, not by review.
|
|
13531
|
+
*/
|
|
13532
|
+
/**
|
|
13533
|
+
* Ceiling for a cap method that runs inference or loads a model.
|
|
13534
|
+
*
|
|
13535
|
+
* Deliberately far above anything the AI layer itself may wait for (a summary
|
|
13536
|
+
* asks 180 s by default, a rule may ask 600 s), because the TRANSPORT must
|
|
13537
|
+
* never be the layer that gives up first: when it does, the failure is
|
|
13538
|
+
* reported as a transport error for a model that was still thinking, naming
|
|
13539
|
+
* the wrong layer and hiding the real one.
|
|
13540
|
+
*
|
|
13541
|
+
* Measured 2026-09-03: a 6-image vision request needs 44.8 s warm and ~20 s
|
|
13542
|
+
* more on a cold model load. With no declaration every digest failed at
|
|
13543
|
+
* exactly 60 s and shipped without its text.
|
|
13544
|
+
*
|
|
13545
|
+
* A ceiling, not a budget. The AI layer's own timeouts (the rule's `timeoutMs`,
|
|
13546
|
+
* the profile's `timeoutMs` / `firstTokenTimeoutMs`) remain the things that
|
|
13547
|
+
* decide when to stop, because only they can say WHY.
|
|
13548
|
+
*/
|
|
13549
|
+
var AI_CAP_TRANSPORT_TIMEOUT_MS = 6e5;
|
|
13550
|
+
/** A multi-gigabyte download. An hour is not generous, it is honest. */
|
|
13551
|
+
var AI_MODEL_INSTALL_TIMEOUT_MS = 60 * 6e4;
|
|
13552
|
+
/**
|
|
13494
13553
|
* Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
|
|
13495
13554
|
* surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
|
|
13496
13555
|
* caps stay wire-compatible without a circular cap→cap import.
|
|
@@ -13762,16 +13821,19 @@ method(LlmGenerateBaseInputSchema.extend({
|
|
|
13762
13821
|
timeoutMs: number().int().positive().optional()
|
|
13763
13822
|
}), LlmGenerateResultSchema, {
|
|
13764
13823
|
kind: "mutation",
|
|
13765
|
-
auth: "admin"
|
|
13824
|
+
auth: "admin",
|
|
13825
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
13766
13826
|
}), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
|
|
13767
13827
|
kind: "mutation",
|
|
13768
|
-
auth: "admin"
|
|
13828
|
+
auth: "admin",
|
|
13829
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
13769
13830
|
}), method(object({}), _void(), {
|
|
13770
13831
|
kind: "mutation",
|
|
13771
13832
|
auth: "admin"
|
|
13772
13833
|
}), method(object({}), LlmRuntimeStatusSchema, { auth: "admin" }), method(object({ model: ManagedModelRefSchema }), _void(), {
|
|
13773
13834
|
kind: "mutation",
|
|
13774
|
-
auth: "admin"
|
|
13835
|
+
auth: "admin",
|
|
13836
|
+
timeoutMs: AI_MODEL_INSTALL_TIMEOUT_MS
|
|
13775
13837
|
}), method(object({ file: string() }), _void(), {
|
|
13776
13838
|
kind: "mutation",
|
|
13777
13839
|
auth: "admin"
|
|
@@ -13939,7 +14001,13 @@ var ProfileRefInputSchema = object({
|
|
|
13939
14001
|
addonId: string(),
|
|
13940
14002
|
profileId: string()
|
|
13941
14003
|
});
|
|
13942
|
-
method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
14004
|
+
method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
14005
|
+
kind: "mutation",
|
|
14006
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
14007
|
+
}), method(GenerateVisionInputSchema, LlmGenerateResultSchema, {
|
|
14008
|
+
kind: "mutation",
|
|
14009
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
14010
|
+
}), method(object({
|
|
13943
14011
|
addonId: string().optional(),
|
|
13944
14012
|
requestId: string()
|
|
13945
14013
|
}), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
|
|
@@ -13950,7 +14018,8 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13950
14018
|
auth: "admin"
|
|
13951
14019
|
}), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
|
|
13952
14020
|
kind: "mutation",
|
|
13953
|
-
auth: "admin"
|
|
14021
|
+
auth: "admin",
|
|
14022
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
13954
14023
|
}), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
|
|
13955
14024
|
selector: LlmDefaultSelectorSchema,
|
|
13956
14025
|
profileId: string().nullable()
|
|
@@ -34028,6 +34097,12 @@ Object.freeze({
|
|
|
34028
34097
|
addonId: null,
|
|
34029
34098
|
access: "view"
|
|
34030
34099
|
},
|
|
34100
|
+
"deviceManager.migrateDevice": {
|
|
34101
|
+
capName: "device-manager",
|
|
34102
|
+
capScope: "system",
|
|
34103
|
+
addonId: null,
|
|
34104
|
+
access: "create"
|
|
34105
|
+
},
|
|
34031
34106
|
"deviceManager.persistConfig": {
|
|
34032
34107
|
capName: "device-manager",
|
|
34033
34108
|
capScope: "system",
|
package/dist/addon.mjs
CHANGED
|
@@ -7717,7 +7717,8 @@ var OpsLogReasonSchema = _enum([
|
|
|
7717
7717
|
"quota",
|
|
7718
7718
|
"manual",
|
|
7719
7719
|
"operator",
|
|
7720
|
-
"maintenance"
|
|
7720
|
+
"maintenance",
|
|
7721
|
+
"orphaned-device"
|
|
7721
7722
|
]);
|
|
7722
7723
|
/** One audit row, shared verbatim by both domains. */
|
|
7723
7724
|
var OpsLogEntrySchema = object({
|
|
@@ -13012,10 +13013,39 @@ var DevicePersistConfigPayloadSchema = object({
|
|
|
13012
13013
|
deviceId: number(),
|
|
13013
13014
|
data: record(string(), unknown())
|
|
13014
13015
|
});
|
|
13016
|
+
/** What a migration actually did, per switch. `unreachable` is a first-class
|
|
13017
|
+
* answer: a camera that could not be asked is not a camera that was silenced. */
|
|
13018
|
+
var MigrateSwitchOutcomeSchema = _enum([
|
|
13019
|
+
"off",
|
|
13020
|
+
"on",
|
|
13021
|
+
"not-offered",
|
|
13022
|
+
"unreachable"
|
|
13023
|
+
]);
|
|
13024
|
+
var MigrateSwitchReportSchema = object({
|
|
13025
|
+
deviceId: number(),
|
|
13026
|
+
switchId: CameraSwitchIdSchema,
|
|
13027
|
+
outcome: MigrateSwitchOutcomeSchema,
|
|
13028
|
+
detail: string().optional()
|
|
13029
|
+
});
|
|
13030
|
+
var MigrateDeviceResultSchema = object({
|
|
13031
|
+
sourceId: number(),
|
|
13032
|
+
targetId: number(),
|
|
13033
|
+
switches: array(MigrateSwitchReportSchema).readonly(),
|
|
13034
|
+
/** Switches that could NOT be turned off on the source. Empty is the only
|
|
13035
|
+
* value meaning the replaced hardware is quiet. */
|
|
13036
|
+
sourceStillLive: array(CameraSwitchIdSchema).readonly(),
|
|
13037
|
+
swapped: boolean()
|
|
13038
|
+
});
|
|
13015
13039
|
method(object({
|
|
13016
13040
|
addonId: string(),
|
|
13017
13041
|
stableId: string()
|
|
13018
|
-
}), object({ id: number() }), { kind: "mutation" }), method(
|
|
13042
|
+
}), object({ id: number() }), { kind: "mutation" }), method(object({
|
|
13043
|
+
sourceId: number(),
|
|
13044
|
+
targetId: number()
|
|
13045
|
+
}), MigrateDeviceResultSchema, {
|
|
13046
|
+
kind: "mutation",
|
|
13047
|
+
auth: "admin"
|
|
13048
|
+
}), method(DeviceRegisterPayloadSchema, _void(), { kind: "mutation" }), method(DeviceRemovePayloadSchema, _void(), { kind: "mutation" }), method(DevicePersistConfigPayloadSchema, _void(), { kind: "mutation" }), method(object({ deviceId: number() }), record(string(), unknown())), method(object({ deviceId: number() }), record(string(), unknown())), method(object({ deviceId: number() }), DeviceMetaSchema.nullable()), method(object({
|
|
13019
13049
|
deviceId: number(),
|
|
13020
13050
|
name: string()
|
|
13021
13051
|
}), _void(), {
|
|
@@ -13490,6 +13520,35 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
|
|
|
13490
13520
|
auth: "admin"
|
|
13491
13521
|
});
|
|
13492
13522
|
/**
|
|
13523
|
+
* Transport bounds for AI capability methods.
|
|
13524
|
+
*
|
|
13525
|
+
* Its own module because `llm.cap.ts` and `llm-runtime.cap.ts` already import
|
|
13526
|
+
* each other: declaring the constant in either one hands the other `undefined`
|
|
13527
|
+
* at module-init time, and an undefined `timeoutMs` silently falls back to the
|
|
13528
|
+
* kernel's 60 s default — the exact failure this constant exists to prevent,
|
|
13529
|
+
* reintroduced invisibly. Found by the guard, not by review.
|
|
13530
|
+
*/
|
|
13531
|
+
/**
|
|
13532
|
+
* Ceiling for a cap method that runs inference or loads a model.
|
|
13533
|
+
*
|
|
13534
|
+
* Deliberately far above anything the AI layer itself may wait for (a summary
|
|
13535
|
+
* asks 180 s by default, a rule may ask 600 s), because the TRANSPORT must
|
|
13536
|
+
* never be the layer that gives up first: when it does, the failure is
|
|
13537
|
+
* reported as a transport error for a model that was still thinking, naming
|
|
13538
|
+
* the wrong layer and hiding the real one.
|
|
13539
|
+
*
|
|
13540
|
+
* Measured 2026-09-03: a 6-image vision request needs 44.8 s warm and ~20 s
|
|
13541
|
+
* more on a cold model load. With no declaration every digest failed at
|
|
13542
|
+
* exactly 60 s and shipped without its text.
|
|
13543
|
+
*
|
|
13544
|
+
* A ceiling, not a budget. The AI layer's own timeouts (the rule's `timeoutMs`,
|
|
13545
|
+
* the profile's `timeoutMs` / `firstTokenTimeoutMs`) remain the things that
|
|
13546
|
+
* decide when to stop, because only they can say WHY.
|
|
13547
|
+
*/
|
|
13548
|
+
var AI_CAP_TRANSPORT_TIMEOUT_MS = 6e5;
|
|
13549
|
+
/** A multi-gigabyte download. An hour is not generous, it is honest. */
|
|
13550
|
+
var AI_MODEL_INSTALL_TIMEOUT_MS = 60 * 6e4;
|
|
13551
|
+
/**
|
|
13493
13552
|
* Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
|
|
13494
13553
|
* surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
|
|
13495
13554
|
* caps stay wire-compatible without a circular cap→cap import.
|
|
@@ -13761,16 +13820,19 @@ method(LlmGenerateBaseInputSchema.extend({
|
|
|
13761
13820
|
timeoutMs: number().int().positive().optional()
|
|
13762
13821
|
}), LlmGenerateResultSchema, {
|
|
13763
13822
|
kind: "mutation",
|
|
13764
|
-
auth: "admin"
|
|
13823
|
+
auth: "admin",
|
|
13824
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
13765
13825
|
}), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
|
|
13766
13826
|
kind: "mutation",
|
|
13767
|
-
auth: "admin"
|
|
13827
|
+
auth: "admin",
|
|
13828
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
13768
13829
|
}), method(object({}), _void(), {
|
|
13769
13830
|
kind: "mutation",
|
|
13770
13831
|
auth: "admin"
|
|
13771
13832
|
}), method(object({}), LlmRuntimeStatusSchema, { auth: "admin" }), method(object({ model: ManagedModelRefSchema }), _void(), {
|
|
13772
13833
|
kind: "mutation",
|
|
13773
|
-
auth: "admin"
|
|
13834
|
+
auth: "admin",
|
|
13835
|
+
timeoutMs: AI_MODEL_INSTALL_TIMEOUT_MS
|
|
13774
13836
|
}), method(object({ file: string() }), _void(), {
|
|
13775
13837
|
kind: "mutation",
|
|
13776
13838
|
auth: "admin"
|
|
@@ -13938,7 +14000,13 @@ var ProfileRefInputSchema = object({
|
|
|
13938
14000
|
addonId: string(),
|
|
13939
14001
|
profileId: string()
|
|
13940
14002
|
});
|
|
13941
|
-
method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
14003
|
+
method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
14004
|
+
kind: "mutation",
|
|
14005
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
14006
|
+
}), method(GenerateVisionInputSchema, LlmGenerateResultSchema, {
|
|
14007
|
+
kind: "mutation",
|
|
14008
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
14009
|
+
}), method(object({
|
|
13942
14010
|
addonId: string().optional(),
|
|
13943
14011
|
requestId: string()
|
|
13944
14012
|
}), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
|
|
@@ -13949,7 +14017,8 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13949
14017
|
auth: "admin"
|
|
13950
14018
|
}), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
|
|
13951
14019
|
kind: "mutation",
|
|
13952
|
-
auth: "admin"
|
|
14020
|
+
auth: "admin",
|
|
14021
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
13953
14022
|
}), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
|
|
13954
14023
|
selector: LlmDefaultSelectorSchema,
|
|
13955
14024
|
profileId: string().nullable()
|
|
@@ -34027,6 +34096,12 @@ Object.freeze({
|
|
|
34027
34096
|
addonId: null,
|
|
34028
34097
|
access: "view"
|
|
34029
34098
|
},
|
|
34099
|
+
"deviceManager.migrateDevice": {
|
|
34100
|
+
capName: "device-manager",
|
|
34101
|
+
capScope: "system",
|
|
34102
|
+
addonId: null,
|
|
34103
|
+
access: "create"
|
|
34104
|
+
},
|
|
34030
34105
|
"deviceManager.persistConfig": {
|
|
34031
34106
|
capName: "device-manager",
|
|
34032
34107
|
capScope: "system",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-unifi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.55",
|
|
4
4
|
"description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|