@switchbot/openapi-cli 3.6.1 → 3.6.2
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/README.md +15 -6
- package/dist/index.js +1737 -514
- package/dist/policy/schema/v0.2.json +33 -1
- package/package.json +1 -1
|
@@ -107,6 +107,16 @@
|
|
|
107
107
|
"minimum": 0,
|
|
108
108
|
"default": 60,
|
|
109
109
|
"description": "Maximum LLM condition calls per hour across all rules."
|
|
110
|
+
},
|
|
111
|
+
"max_tokens_per_hour": {
|
|
112
|
+
"type": "integer",
|
|
113
|
+
"minimum": 0,
|
|
114
|
+
"description": "Maximum total LLM tokens (input + output) per hour across all rules. Omit to leave unbounded."
|
|
115
|
+
},
|
|
116
|
+
"max_cost_per_day_usd": {
|
|
117
|
+
"type": "number",
|
|
118
|
+
"minimum": 0,
|
|
119
|
+
"description": "Maximum cumulative USD cost per day across all rules. Skipped for models not in the pricing table."
|
|
110
120
|
}
|
|
111
121
|
}
|
|
112
122
|
}
|
|
@@ -331,6 +341,26 @@
|
|
|
331
341
|
}
|
|
332
342
|
}
|
|
333
343
|
},
|
|
344
|
+
{
|
|
345
|
+
"type": "object",
|
|
346
|
+
"additionalProperties": false,
|
|
347
|
+
"required": ["event_count"],
|
|
348
|
+
"properties": {
|
|
349
|
+
"event_count": {
|
|
350
|
+
"type": "object",
|
|
351
|
+
"additionalProperties": false,
|
|
352
|
+
"required": ["device", "window", "min"],
|
|
353
|
+
"description": "Cross-event aggregation: count events from a device within a rolling window and assert against [min, max].",
|
|
354
|
+
"properties": {
|
|
355
|
+
"device": { "type": "string", "description": "deviceId or alias" },
|
|
356
|
+
"event": { "type": "string", "description": "Optional canonical event filter (e.g. motion.detected). Matched against the classified event of each history record." },
|
|
357
|
+
"window": { "type": "string", "pattern": "^\\d+(ms|s|m|h|d)$", "description": "Rolling window measured back from now, e.g. \"5m\", \"1h\"." },
|
|
358
|
+
"min": { "type": "integer", "minimum": 0, "description": "Inclusive minimum count required for the condition to match." },
|
|
359
|
+
"max": { "type": "integer", "minimum": 0, "description": "Optional inclusive maximum. Omit for \"at least min\"." }
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
334
364
|
{
|
|
335
365
|
"type": "object",
|
|
336
366
|
"additionalProperties": false,
|
|
@@ -350,7 +380,9 @@
|
|
|
350
380
|
"type": ["object", "null"],
|
|
351
381
|
"additionalProperties": false,
|
|
352
382
|
"properties": {
|
|
353
|
-
"max_calls_per_hour": { "type": "integer", "minimum": 0, "default": 10 }
|
|
383
|
+
"max_calls_per_hour": { "type": "integer", "minimum": 0, "default": 10 },
|
|
384
|
+
"max_tokens_per_hour": { "type": "integer", "minimum": 0, "description": "Hourly token cap (input + output combined). Omit to leave unbounded." },
|
|
385
|
+
"max_cost_per_day_usd": { "type": "number", "minimum": 0, "description": "Daily USD cap. Skipped for models not in the pricing table." }
|
|
354
386
|
}
|
|
355
387
|
},
|
|
356
388
|
"on_error": { "enum": ["fail", "pass", "skip"], "default": "fail" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@switchbot/openapi-cli",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.2",
|
|
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",
|