# Activity watchers (/docs/capabilities/watchers)

The `watcher` capability lets an addon observe activity and suggest time entries from it. For example, an addon can observe a voice call or events from an external service.

Declare `watcher` in the manifest. If the service requires a connected account, also declare `auth` and register its authentication. A data source is not required just to hold credentials. The example below uses both capabilities.

```yaml
id: example-addon
name: Example Addon
version: 0.1.0
author: Example
shortDescription: SDK example
description: Example using the published SDK
capabilities:
  - auth
  - watcher
requiredApiVersion: '>=0.11.0'
```

```ts
import type {
  AddonContext,
  LocalEntryInput,
  LocalOperationIdentity,
} from '@mr-tick/sdk'

export function suggest(
  context: AddonContext,
  workspaceId: string,
  input: LocalEntryInput,
  operation: LocalOperationIdentity,
) {
  return context.core.timeEntries.createSuggestion(
    workspaceId,
    input,
    operation,
  )
}
```

Choose workspace, source connection, task and activity explicitly. `LocalEntryInput` uses seconds and ISO dates. Allocate operation IDs before the write and reuse them only for retries with identical content. Success means a local suggestion, not remote confirmation.

Guaranteed events: `timer:start`, `timer:pause`, `timer:resume`, `timer:stop`, `timer:update`, `workspace:changed`. No idle subscription API is guaranteed. Register listeners and return from activation; close owned resources in deactivation. Workspace changes do not deactivate the addon.

See [authentication](/docs/capabilities/auth), [OAuth PKCE](/docs/apis/oauth-pkce) and [vault and events](/docs/apis/vault-and-events).
