@camstack/addon-provider-tuya 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 CHANGED
@@ -8538,7 +8538,8 @@ var OpsLogReasonSchema = _enum([
8538
8538
  "quota",
8539
8539
  "manual",
8540
8540
  "operator",
8541
- "maintenance"
8541
+ "maintenance",
8542
+ "orphaned-device"
8542
8543
  ]);
8543
8544
  /** One audit row, shared verbatim by both domains. */
8544
8545
  var OpsLogEntrySchema = object({
@@ -13850,10 +13851,39 @@ var DevicePersistConfigPayloadSchema = object({
13850
13851
  deviceId: number(),
13851
13852
  data: record(string(), unknown())
13852
13853
  });
13854
+ /** What a migration actually did, per switch. `unreachable` is a first-class
13855
+ * answer: a camera that could not be asked is not a camera that was silenced. */
13856
+ var MigrateSwitchOutcomeSchema = _enum([
13857
+ "off",
13858
+ "on",
13859
+ "not-offered",
13860
+ "unreachable"
13861
+ ]);
13862
+ var MigrateSwitchReportSchema = object({
13863
+ deviceId: number(),
13864
+ switchId: CameraSwitchIdSchema,
13865
+ outcome: MigrateSwitchOutcomeSchema,
13866
+ detail: string().optional()
13867
+ });
13868
+ var MigrateDeviceResultSchema = object({
13869
+ sourceId: number(),
13870
+ targetId: number(),
13871
+ switches: array(MigrateSwitchReportSchema).readonly(),
13872
+ /** Switches that could NOT be turned off on the source. Empty is the only
13873
+ * value meaning the replaced hardware is quiet. */
13874
+ sourceStillLive: array(CameraSwitchIdSchema).readonly(),
13875
+ swapped: boolean()
13876
+ });
13853
13877
  method(object({
13854
13878
  addonId: string(),
13855
13879
  stableId: string()
13856
- }), object({ id: number() }), { kind: "mutation" }), 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({
13880
+ }), object({ id: number() }), { kind: "mutation" }), method(object({
13881
+ sourceId: number(),
13882
+ targetId: number()
13883
+ }), MigrateDeviceResultSchema, {
13884
+ kind: "mutation",
13885
+ auth: "admin"
13886
+ }), 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({
13857
13887
  deviceId: number(),
13858
13888
  name: string()
13859
13889
  }), _void(), {
@@ -14328,6 +14358,35 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
14328
14358
  auth: "admin"
14329
14359
  });
14330
14360
  /**
14361
+ * Transport bounds for AI capability methods.
14362
+ *
14363
+ * Its own module because `llm.cap.ts` and `llm-runtime.cap.ts` already import
14364
+ * each other: declaring the constant in either one hands the other `undefined`
14365
+ * at module-init time, and an undefined `timeoutMs` silently falls back to the
14366
+ * kernel's 60 s default — the exact failure this constant exists to prevent,
14367
+ * reintroduced invisibly. Found by the guard, not by review.
14368
+ */
14369
+ /**
14370
+ * Ceiling for a cap method that runs inference or loads a model.
14371
+ *
14372
+ * Deliberately far above anything the AI layer itself may wait for (a summary
14373
+ * asks 180 s by default, a rule may ask 600 s), because the TRANSPORT must
14374
+ * never be the layer that gives up first: when it does, the failure is
14375
+ * reported as a transport error for a model that was still thinking, naming
14376
+ * the wrong layer and hiding the real one.
14377
+ *
14378
+ * Measured 2026-09-03: a 6-image vision request needs 44.8 s warm and ~20 s
14379
+ * more on a cold model load. With no declaration every digest failed at
14380
+ * exactly 60 s and shipped without its text.
14381
+ *
14382
+ * A ceiling, not a budget. The AI layer's own timeouts (the rule's `timeoutMs`,
14383
+ * the profile's `timeoutMs` / `firstTokenTimeoutMs`) remain the things that
14384
+ * decide when to stop, because only they can say WHY.
14385
+ */
14386
+ var AI_CAP_TRANSPORT_TIMEOUT_MS = 6e5;
14387
+ /** A multi-gigabyte download. An hour is not generous, it is honest. */
14388
+ var AI_MODEL_INSTALL_TIMEOUT_MS = 60 * 6e4;
14389
+ /**
14331
14390
  * Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
14332
14391
  * surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
14333
14392
  * caps stay wire-compatible without a circular cap→cap import.
@@ -14599,16 +14658,19 @@ method(LlmGenerateBaseInputSchema.extend({
14599
14658
  timeoutMs: number().int().positive().optional()
14600
14659
  }), LlmGenerateResultSchema, {
14601
14660
  kind: "mutation",
14602
- auth: "admin"
14661
+ auth: "admin",
14662
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14603
14663
  }), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
14604
14664
  kind: "mutation",
14605
- auth: "admin"
14665
+ auth: "admin",
14666
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14606
14667
  }), method(object({}), _void(), {
14607
14668
  kind: "mutation",
14608
14669
  auth: "admin"
14609
14670
  }), method(object({}), LlmRuntimeStatusSchema, { auth: "admin" }), method(object({ model: ManagedModelRefSchema }), _void(), {
14610
14671
  kind: "mutation",
14611
- auth: "admin"
14672
+ auth: "admin",
14673
+ timeoutMs: AI_MODEL_INSTALL_TIMEOUT_MS
14612
14674
  }), method(object({ file: string() }), _void(), {
14613
14675
  kind: "mutation",
14614
14676
  auth: "admin"
@@ -14776,7 +14838,13 @@ var ProfileRefInputSchema = object({
14776
14838
  addonId: string(),
14777
14839
  profileId: string()
14778
14840
  });
14779
- method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(object({
14841
+ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
14842
+ kind: "mutation",
14843
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14844
+ }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, {
14845
+ kind: "mutation",
14846
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14847
+ }), method(object({
14780
14848
  addonId: string().optional(),
14781
14849
  requestId: string()
14782
14850
  }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
@@ -14787,7 +14855,8 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
14787
14855
  auth: "admin"
14788
14856
  }), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
14789
14857
  kind: "mutation",
14790
- auth: "admin"
14858
+ auth: "admin",
14859
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14791
14860
  }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
14792
14861
  selector: LlmDefaultSelectorSchema,
14793
14862
  profileId: string().nullable()
@@ -34856,6 +34925,12 @@ Object.freeze({
34856
34925
  addonId: null,
34857
34926
  access: "view"
34858
34927
  },
34928
+ "deviceManager.migrateDevice": {
34929
+ capName: "device-manager",
34930
+ capScope: "system",
34931
+ addonId: null,
34932
+ access: "create"
34933
+ },
34859
34934
  "deviceManager.persistConfig": {
34860
34935
  capName: "device-manager",
34861
34936
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -8537,7 +8537,8 @@ var OpsLogReasonSchema = _enum([
8537
8537
  "quota",
8538
8538
  "manual",
8539
8539
  "operator",
8540
- "maintenance"
8540
+ "maintenance",
8541
+ "orphaned-device"
8541
8542
  ]);
8542
8543
  /** One audit row, shared verbatim by both domains. */
8543
8544
  var OpsLogEntrySchema = object({
@@ -13849,10 +13850,39 @@ var DevicePersistConfigPayloadSchema = object({
13849
13850
  deviceId: number(),
13850
13851
  data: record(string(), unknown())
13851
13852
  });
13853
+ /** What a migration actually did, per switch. `unreachable` is a first-class
13854
+ * answer: a camera that could not be asked is not a camera that was silenced. */
13855
+ var MigrateSwitchOutcomeSchema = _enum([
13856
+ "off",
13857
+ "on",
13858
+ "not-offered",
13859
+ "unreachable"
13860
+ ]);
13861
+ var MigrateSwitchReportSchema = object({
13862
+ deviceId: number(),
13863
+ switchId: CameraSwitchIdSchema,
13864
+ outcome: MigrateSwitchOutcomeSchema,
13865
+ detail: string().optional()
13866
+ });
13867
+ var MigrateDeviceResultSchema = object({
13868
+ sourceId: number(),
13869
+ targetId: number(),
13870
+ switches: array(MigrateSwitchReportSchema).readonly(),
13871
+ /** Switches that could NOT be turned off on the source. Empty is the only
13872
+ * value meaning the replaced hardware is quiet. */
13873
+ sourceStillLive: array(CameraSwitchIdSchema).readonly(),
13874
+ swapped: boolean()
13875
+ });
13852
13876
  method(object({
13853
13877
  addonId: string(),
13854
13878
  stableId: string()
13855
- }), object({ id: number() }), { kind: "mutation" }), 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({
13879
+ }), object({ id: number() }), { kind: "mutation" }), method(object({
13880
+ sourceId: number(),
13881
+ targetId: number()
13882
+ }), MigrateDeviceResultSchema, {
13883
+ kind: "mutation",
13884
+ auth: "admin"
13885
+ }), 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({
13856
13886
  deviceId: number(),
13857
13887
  name: string()
13858
13888
  }), _void(), {
@@ -14327,6 +14357,35 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
14327
14357
  auth: "admin"
14328
14358
  });
14329
14359
  /**
14360
+ * Transport bounds for AI capability methods.
14361
+ *
14362
+ * Its own module because `llm.cap.ts` and `llm-runtime.cap.ts` already import
14363
+ * each other: declaring the constant in either one hands the other `undefined`
14364
+ * at module-init time, and an undefined `timeoutMs` silently falls back to the
14365
+ * kernel's 60 s default — the exact failure this constant exists to prevent,
14366
+ * reintroduced invisibly. Found by the guard, not by review.
14367
+ */
14368
+ /**
14369
+ * Ceiling for a cap method that runs inference or loads a model.
14370
+ *
14371
+ * Deliberately far above anything the AI layer itself may wait for (a summary
14372
+ * asks 180 s by default, a rule may ask 600 s), because the TRANSPORT must
14373
+ * never be the layer that gives up first: when it does, the failure is
14374
+ * reported as a transport error for a model that was still thinking, naming
14375
+ * the wrong layer and hiding the real one.
14376
+ *
14377
+ * Measured 2026-09-03: a 6-image vision request needs 44.8 s warm and ~20 s
14378
+ * more on a cold model load. With no declaration every digest failed at
14379
+ * exactly 60 s and shipped without its text.
14380
+ *
14381
+ * A ceiling, not a budget. The AI layer's own timeouts (the rule's `timeoutMs`,
14382
+ * the profile's `timeoutMs` / `firstTokenTimeoutMs`) remain the things that
14383
+ * decide when to stop, because only they can say WHY.
14384
+ */
14385
+ var AI_CAP_TRANSPORT_TIMEOUT_MS = 6e5;
14386
+ /** A multi-gigabyte download. An hour is not generous, it is honest. */
14387
+ var AI_MODEL_INSTALL_TIMEOUT_MS = 60 * 6e4;
14388
+ /**
14330
14389
  * Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
14331
14390
  * surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
14332
14391
  * caps stay wire-compatible without a circular cap→cap import.
@@ -14598,16 +14657,19 @@ method(LlmGenerateBaseInputSchema.extend({
14598
14657
  timeoutMs: number().int().positive().optional()
14599
14658
  }), LlmGenerateResultSchema, {
14600
14659
  kind: "mutation",
14601
- auth: "admin"
14660
+ auth: "admin",
14661
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14602
14662
  }), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
14603
14663
  kind: "mutation",
14604
- auth: "admin"
14664
+ auth: "admin",
14665
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14605
14666
  }), method(object({}), _void(), {
14606
14667
  kind: "mutation",
14607
14668
  auth: "admin"
14608
14669
  }), method(object({}), LlmRuntimeStatusSchema, { auth: "admin" }), method(object({ model: ManagedModelRefSchema }), _void(), {
14609
14670
  kind: "mutation",
14610
- auth: "admin"
14671
+ auth: "admin",
14672
+ timeoutMs: AI_MODEL_INSTALL_TIMEOUT_MS
14611
14673
  }), method(object({ file: string() }), _void(), {
14612
14674
  kind: "mutation",
14613
14675
  auth: "admin"
@@ -14775,7 +14837,13 @@ var ProfileRefInputSchema = object({
14775
14837
  addonId: string(),
14776
14838
  profileId: string()
14777
14839
  });
14778
- method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(object({
14840
+ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
14841
+ kind: "mutation",
14842
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14843
+ }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, {
14844
+ kind: "mutation",
14845
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14846
+ }), method(object({
14779
14847
  addonId: string().optional(),
14780
14848
  requestId: string()
14781
14849
  }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
@@ -14786,7 +14854,8 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
14786
14854
  auth: "admin"
14787
14855
  }), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
14788
14856
  kind: "mutation",
14789
- auth: "admin"
14857
+ auth: "admin",
14858
+ timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
14790
14859
  }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
14791
14860
  selector: LlmDefaultSelectorSchema,
14792
14861
  profileId: string().nullable()
@@ -34855,6 +34924,12 @@ Object.freeze({
34855
34924
  addonId: null,
34856
34925
  access: "view"
34857
34926
  },
34927
+ "deviceManager.migrateDevice": {
34928
+ capName: "device-manager",
34929
+ capScope: "system",
34930
+ addonId: null,
34931
+ access: "create"
34932
+ },
34858
34933
  "deviceManager.persistConfig": {
34859
34934
  capName: "device-manager",
34860
34935
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.52",
3
+ "version": "0.2.55",
4
4
  "description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
5
5
  "keywords": [
6
6
  "camstack",