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

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^wch_[0-9A-HJKMNP-TV-Z]{26}$
project_idstring | null
  • pattern ^prj_[0-9A-HJKMNP-TV-Z]{26}$
ownerstringyesThe acting person or agent the watch belongs to: usr_…, agt_… or svc:….
namestring
  • minLength 1
  • maxLength 120
labelsobject
statusenumyes
  • one of "active", "paused", "disabled", "failed"
sourcehttps://openvibe.network/contracts/watch/watch.v1.json#/$defs/sourceyes
cadencehttps://openvibe.network/contracts/watch/watch.v1.json#/$defs/cadence
extractionhttps://openvibe.network/contracts/watch/watch.v1.json#/$defs/extractionyes
comparisonhttps://openvibe.network/contracts/watch/watch.v1.json#/$defs/comparison
conditionhttps://openvibe.network/contracts/watch/watch.v1.json#/$defs/conditionyes
actionhttps://openvibe.network/contracts/watch/watch.v1.json#/$defs/actionyes
  • minItems 1
  • maxItems 8
budgethttps://openvibe.network/contracts/watch/watch.v1.json#/$defs/budget
retentionhttps://openvibe.network/contracts/watch/watch.v1.json#/$defs/retention
healthobject | null
created_atstringyes
  • format date-time
updated_atstringyes
  • format date-time

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 }] }