Watch watch.watch@1
Generated at from
openvibe-contracts v0.107.0 and
openvibe-sdk v0.26.0.
- Version
- 1.0.0
- Owner
- watch
- Visibility
- first-party
- Status
- planned
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/watch/watch.v1.json
watch.watch@1: a user-defined persistent observation (plan T18). It names a source (a push event, a webhook, a conditional HTTP URL, a feed or API, a local Node probe, or an expensive Run check), how a value is extracted, how it is compared with the last observation, the condition that fires, the actions it wakes, its budget and its retention. Carrier preference is binding: an event or webhook source is used when one exists, then ETag/Last-Modified, then a feed, then an API, and browser polling through Run only when none works. A price or stock is 'as of' the observation, null when it stated none.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes |
| |
project_id | string | null |
| ||
owner | string | yes | The acting person or agent the watch belongs to: usr_…, agt_… or svc:…. | |
name | string |
| ||
labels | object | |||
status | enum | yes |
| |
source | https://openvibe.network/contracts/watch/watch.v1.json#/$defs/source | yes | ||
cadence | https://openvibe.network/contracts/watch/watch.v1.json#/$defs/cadence | |||
extraction | https://openvibe.network/contracts/watch/watch.v1.json#/$defs/extraction | yes | ||
comparison | https://openvibe.network/contracts/watch/watch.v1.json#/$defs/comparison | |||
condition | https://openvibe.network/contracts/watch/watch.v1.json#/$defs/condition | yes | ||
action | https://openvibe.network/contracts/watch/watch.v1.json#/$defs/action | yes |
| |
budget | https://openvibe.network/contracts/watch/watch.v1.json#/$defs/budget | |||
retention | https://openvibe.network/contracts/watch/watch.v1.json#/$defs/retention | |||
health | object | null | |||
created_at | string | yes |
| |
updated_at | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: price-threshold
{
"id": "wch_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"project_id": null,
"owner": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
"name": "Steam Deck OLED price",
"labels": {
"topic": "hardware"
},
"status": "active",
"source": {
"kind": "api",
"url": "https://openvibe.deals/api/offers/steam-deck-oled",
"method": "GET",
"format": "json",
"items_path": "offers",
"fields": {
"price": "price",
"currency": "currency"
},
"auth": {
"mode": "none"
},
"headers": {},
"conditional": true
},
"cadence": {
"every_sec": 3600,
"jitter_sec": 60,
"timezone": null
},
"extraction": {
"kind": "jsonpath",
"selector": null,
"fields": null,
"value_path": "$.offers[0].price",
"ai": null
},
"comparison": {
"mode": "threshold",
"tolerance": 0.01,
"percent": null
},
"condition": {
"op": "lt",
"value": 199,
"for_sec": null
},
"action": [
{
"kind": "notification",
"category": "service",
"priority": "high"
}
],
"budget": {
"checks_per_day": 100,
"usd_per_month": 0,
"max_runtime_ms": 20000,
"max_bytes": 5242880
},
"retention": {
"observations_days": 90,
"keep_snapshots": false
},
"health": null,
"created_at": "2026-10-05T08:00:00.000Z",
"updated_at": "2026-10-05T08:00:00.000Z"
}Rejected: missing-owner
{
"id": "wch_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"name": "Steam Deck OLED price",
"status": "active",
"source": {
"kind": "api",
"url": "https://openvibe.deals/api/offers/steam-deck-oled"
},
"extraction": {
"kind": "jsonpath",
"value_path": "$.price"
},
"condition": {
"op": "lt",
"value": 199
},
"action": [
{
"kind": "notification"
}
],
"created_at": "2026-10-05T08:00:00.000Z",
"updated_at": "2026-10-05T08:00:00.000Z"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('watch.watch@1', value); // { valid, errors: [{ path, message }] }