@switchbot/openapi-cli 3.3.3 → 3.4.0

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.
@@ -78,6 +78,37 @@
78
78
  "rules": {
79
79
  "type": ["array", "null"],
80
80
  "items": { "$ref": "#/$defs/rule" }
81
+ },
82
+ "audit": {
83
+ "type": ["object", "null"],
84
+ "additionalProperties": false,
85
+ "description": "Controls rule-evaluate trace recording.",
86
+ "properties": {
87
+ "evaluate_trace": {
88
+ "enum": ["full", "sampled", "off"],
89
+ "default": "sampled",
90
+ "description": "full=every evaluation; sampled=skip high-freq blocked-by-condition; off=disabled."
91
+ },
92
+ "evaluate_retention_days": {
93
+ "type": "integer",
94
+ "minimum": 1,
95
+ "default": 7,
96
+ "description": "Days to retain rule-evaluate records."
97
+ }
98
+ }
99
+ },
100
+ "llm_budget": {
101
+ "type": ["object", "null"],
102
+ "additionalProperties": false,
103
+ "description": "Global LLM call budget applied across all llm conditions.",
104
+ "properties": {
105
+ "max_calls_per_hour": {
106
+ "type": "integer",
107
+ "minimum": 0,
108
+ "default": 60,
109
+ "description": "Maximum LLM condition calls per hour across all rules."
110
+ }
111
+ }
81
112
  }
82
113
  }
83
114
  },
@@ -299,6 +330,34 @@
299
330
  "description": "Negates the sub-condition."
300
331
  }
301
332
  }
333
+ },
334
+ {
335
+ "type": "object",
336
+ "additionalProperties": false,
337
+ "required": ["llm"],
338
+ "properties": {
339
+ "llm": {
340
+ "type": "object",
341
+ "additionalProperties": false,
342
+ "required": ["prompt"],
343
+ "description": "Evaluate the condition using an LLM decision call.",
344
+ "properties": {
345
+ "prompt": { "type": "string", "minLength": 1, "description": "Prompt template sent to the LLM." },
346
+ "provider": { "enum": ["auto", "openai", "anthropic"], "default": "auto" },
347
+ "timeout_ms": { "type": "integer", "minimum": 500, "maximum": 10000, "default": 5000 },
348
+ "cache_ttl": { "type": "string", "pattern": "^(none|\\d+[smh])$", "default": "5m" },
349
+ "budget": {
350
+ "type": ["object", "null"],
351
+ "additionalProperties": false,
352
+ "properties": {
353
+ "max_calls_per_hour": { "type": "integer", "minimum": 0, "default": 10 }
354
+ }
355
+ },
356
+ "on_error": { "enum": ["fail", "pass", "skip"], "default": "fail" },
357
+ "recent_events": { "type": "integer", "minimum": 0, "maximum": 20, "default": 5 }
358
+ }
359
+ }
360
+ }
302
361
  }
303
362
  ]
304
363
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@switchbot/openapi-cli",
3
- "version": "3.3.3",
3
+ "version": "3.4.0",
4
4
  "description": "SwitchBot smart home CLI — control devices, run scenes, stream real-time events, and integrate AI agents via MCP. Full API v1.1 coverage.",
5
5
  "keywords": [
6
6
  "switchbot",