From ea45b61722c32ea3889d01a6a1db3b825036d7bb Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Sun, 15 Nov 2026 12:43:02 -0500 Subject: [PATCH 01/21] =?UTF-8?q?=E2=9C=A8=20Inbox:=20Webex=20recordings?= =?UTF-8?q?=20and=20transcripts=20as=20a=20knowledge=20integration=20(#183?= =?UTF-8?q?01)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * โœจ Inbox: Webex recordings and transcripts as a knowledge integration Add a webex connector that reads Webex Meetings through a Webex integration (OAuth authorization code with the hosted paste flow; tokens in the connector token store, rotated refresh tokens written back). Recordings (GET /recordings) and transcripts (GET /meetingTranscripts) are listed in explicit 30-day from/to windows with max=100, following Link rel=next, and grouped per ended meeting instance: topic, host, duration, participants (GET /meetingParticipants), the AI Assistant summary and action items (GET /meetingSummaries, HTML converted), and the newest transcript downloaded as VTT and rendered as [mm:ss] Speaker: text lines. Meetings with a recording but no text are pending and re-read on later syncs. Inbox playback asks GET /recordings/{id} for its temporaryDirectDownloadLinks per click (audio, else MP4; no token in the link, valid 3 hours) and never stores it. 401 and a dead refresh token read as not connected with the card hint, 403 keeps Webex's reason, 429 honours Retry-After, and the bearer token is only sent to webexapis.com. webex joins the default inbox.sources; the Integrations card shares the Connect / Check / Sync now controls, the paste fallback and the integration form. Docs, OpenAPI descriptions, Go and node tests. Signed-off-by: Andy Anderson * ๐ŸŒฑ Webex test follows the HTML converter and the recording-page line Signed-off-by: Andy Anderson * ๐ŸŒฑ Cover the Webex sign-in, grouping and truncation edges Signed-off-by: Andy Anderson --- changelog.d/added-inbox-webex.md | 1 + dashboard/openapi.json | 8 +- src/cmd/hive/boot_inbox.go | 2 +- src/docs/api-reference/knowledge.md | 6 +- src/docs/inbox-voice-sources.md | 23 +- src/docs/knowledge-connectors.md | 82 +- src/pkg/config/inbox_config.go | 2 +- src/pkg/dashboard/api_inbox.go | 2 +- .../knowledge_integrations_modal_test.go | 41 +- .../dashboard/knowledge_webex_card.test.js | 88 ++ .../dashboard/static-src/js/config-tabs.js | 5 +- src/pkg/dashboard/static-src/js/inbox.js | 4 +- src/pkg/dashboard/static-src/js/knowledge.js | 24 +- src/pkg/dashboard/static/index.html | 33 +- src/pkg/inbox/meetingsource.go | 7 +- src/pkg/knowledge/connector/connector.go | 3 +- src/pkg/knowledge/connector/connector_test.go | 2 +- src/pkg/knowledge/connector/webex.go | 880 ++++++++++++++++++ src/pkg/knowledge/connector/webex_test.go | 596 ++++++++++++ 19 files changed, 1777 insertions(+), 32 deletions(-) create mode 100644 changelog.d/added-inbox-webex.md create mode 100644 src/pkg/dashboard/knowledge_webex_card.test.js create mode 100644 src/pkg/knowledge/connector/webex.go create mode 100644 src/pkg/knowledge/connector/webex_test.go diff --git a/changelog.d/added-inbox-webex.md b/changelog.d/added-inbox-webex.md new file mode 100644 index 0000000000..8187d6b0a1 --- /dev/null +++ b/changelog.d/added-inbox-webex.md @@ -0,0 +1 @@ +- Inbox: Webex meetings as a knowledge integration โ€” a `webex` connector (a Webex integration with the hosted paste flow) that syncs ended meetings with a recording or transcript into one fact each, with topic, host, participants, the AI Assistant summary and action items, and the VTT transcript as `[mm:ss] Speaker: text` lines; โ–ถ Play uses Webex's temporary direct download link minted per click; a default `inbox.sources` entry with a Connect / Check / Sync now card. diff --git a/dashboard/openapi.json b/dashboard/openapi.json index 3f7581665f..4161e3d54a 100644 --- a/dashboard/openapi.json +++ b/dashboard/openapi.json @@ -37560,7 +37560,7 @@ "Knowledge" ], "summary": "List inbox items (voice recordings and dictations) with their triage state", - "description": "Items are the facts written by voice and meeting knowledge connectors (`plaud`, `wisprflow`, `zoom`, `teams`, `discord`, `google-meet`), newest first, keyed by `(source, id)`, with per-destination routing state, source connection status, candidate repositories and the auto-routing settings.", + "description": "Items are the facts written by voice and meeting knowledge connectors (`plaud`, `wisprflow`, `zoom`, `teams`, `discord`, `google-meet`, `webex`), newest first, keyed by `(source, id)`, with per-destination routing state, source connection status, candidate repositories and the auto-routing settings.", "responses": { "200": { "description": "Inbox listing", @@ -38088,7 +38088,7 @@ "schema": { "type": "string" }, - "description": "Upstream item id (Plaud: file id; Zoom: meeting instance UUID; Teams: callRecording id; Discord: `m::` or `e:`; Google Meet: conference record id)" + "description": "Upstream item id (Plaud: file id; Zoom: meeting instance UUID; Teams: callRecording id; Discord: `m::` or `e:`; Google Meet: conference record id; Webex: meeting instance id)" } ], "responses": { @@ -38170,7 +38170,7 @@ "Knowledge" ], "summary": "Mint a fresh audio link for one inbox item", - "description": "Owner or read-write. Asks the item's connector for a short-lived audio/video URL (Plaud: `get_file`, valid 24h; Zoom: the audio-only or video `download_url` with a one-hour download token appended as `access_token`; Teams: 404, Graph serves recordings behind a bearer token; Google Meet: 404, Drive serves the recording behind a bearer token; Discord: the freshly signed CDN URL of the audio attachment, re-read from the message, expiring at its `ex` time) and returns it once with `Cache-Control: no-store`; the hive never stores the link in facts or state. Playback does not depend on the connector's `include_audio` option, which only decides whether a sync also writes a link into the fact. Audited as `inbox_audio`.", + "description": "Owner or read-write. Asks the item's connector for a short-lived audio/video URL (Plaud: `get_file`, valid 24h; Zoom: the audio-only or video `download_url` with a one-hour download token appended as `access_token`; Teams: 404, Graph serves recordings behind a bearer token; Google Meet: 404, Drive serves the recording behind a bearer token; Webex: the temporary direct audio (else MP4) download link, valid 3 hours; Discord: the freshly signed CDN URL of the audio attachment, re-read from the message, expiring at its `ex` time) and returns it once with `Cache-Control: no-store`; the hive never stores the link in facts or state. Playback does not depend on the connector's `include_audio` option, which only decides whether a sync also writes a link into the fact. Audited as `inbox_audio`.", "parameters": [ { "name": "source", @@ -38188,7 +38188,7 @@ "schema": { "type": "string" }, - "description": "Upstream item id (Plaud: file id; Zoom: meeting instance UUID; Teams: callRecording id; Discord: `m::` or `e:`; Google Meet: conference record id)" + "description": "Upstream item id (Plaud: file id; Zoom: meeting instance UUID; Teams: callRecording id; Discord: `m::` or `e:`; Google Meet: conference record id; Webex: meeting instance id)" } ], "responses": { diff --git a/src/cmd/hive/boot_inbox.go b/src/cmd/hive/boot_inbox.go index f5273ce38c..78c1f53ba1 100644 --- a/src/cmd/hive/boot_inbox.go +++ b/src/cmd/hive/boot_inbox.go @@ -93,7 +93,7 @@ func (b *boot) refreshInboxSources(entries []config.KnowledgeConnector, syncer * } // inboxSource returns the fact-backed source for typ. For Plaud and the -// meeting platforms (zoom, teams, discord, google-meet) it prefers reading recordings directly +// meeting platforms (zoom, teams, discord, google-meet, webex) it prefers reading recordings directly // from the connector while it is signed in. func (b *boot) inboxSource(baseDir, typ string, entries []config.KnowledgeConnector, syncer *connector.Syncer) inbox.Source { facts := &inbox.FactSource{ConnectorsDir: filepath.Join(baseDir, "connectors"), SourceType: typ} diff --git a/src/docs/api-reference/knowledge.md b/src/docs/api-reference/knowledge.md index 9cc3ee8750..a8c20cb26c 100644 --- a/src/docs/api-reference/knowledge.md +++ b/src/docs/api-reference/knowledge.md @@ -62,10 +62,10 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f | `GET` | `/api/knowledge/connectors` | Dashboard auth/session | Knowledge connector statuses, each with a live `progress` block while a sync runs, and publish mirror status (`{"connectors": [...], "publish": {...}\|null}`, see [knowledge-connectors.md](../knowledge-connectors.md)) | `pkg/dashboard/api_knowledge_connectors.go:24` | | `POST` | `/api/knowledge/connectors/{name}/sync` | Owner only | Start one connector sync now (202; 404 unknown, 409 running) | `pkg/dashboard/api_knowledge_connectors.go:25` | | `POST` | `/api/knowledge/publish/sync` | Owner only | Run a publish mirror batch now (202 with publish status; 503 mirror not running, 409 batch in progress) | `pkg/dashboard/api_knowledge_connectors.go:26` | -| `GET` | `/api/knowledge/connectors/{name}/auth` | Dashboard auth/session | Interactive sign-in state for a connector (Plaud OAuth, Zoom OAuth app, Teams Graph application permissions, Google Meet OAuth client or service account, Discord bot token): connected, account, pending, auth_url; `?refresh=1` re-checks upstream; for `teams` a missing admin consent is reported in `message` with the Entra consent page in `auth_url` (400 for connector types without interactive sign-in) | `pkg/dashboard/api_knowledge_connector_auth.go:25` | +| `GET` | `/api/knowledge/connectors/{name}/auth` | Dashboard auth/session | Interactive sign-in state for a connector (Plaud OAuth, Zoom OAuth app, Teams Graph application permissions, Google Meet OAuth client or service account, Webex integration, Discord bot token): connected, account, pending, auth_url; `?refresh=1` re-checks upstream; for `teams` a missing admin consent is reported in `message` with the Entra consent page in `auth_url` (400 for connector types without interactive sign-in) | `pkg/dashboard/api_knowledge_connector_auth.go:25` | | `POST` | `/api/knowledge/connectors/{name}/auth/connect` | Owner only | Start the connector's sign-in flow (202 with state incl. `auth_url`; Zoom user-level: the app's authorization URL, pending until the redirect URL is pasted; Zoom Server-to-Server and Teams: token fetched at once, outcome in the state) | `pkg/dashboard/api_knowledge_connector_auth.go:26` | | `POST` | `/api/knowledge/connectors/{name}/auth/disconnect` | Owner only | Sign out and revoke the connector's credential upstream (Zoom: revoke + token store cleared; Teams: cached token dropped) | `pkg/dashboard/api_knowledge_connector_auth.go:27` | -| `POST` | `/api/knowledge/connectors/{name}/auth/complete` | Owner only | Finish a sign-in from pasted material on a hosted hive: `{redirect_url}` (Plaud: the `localhost:8199/auth/callback?โ€ฆ` URL the browser landed on, forwarded in-pod while the login is pending; Zoom and Google Meet: the registered redirect URL with `code` and `state`, exchanged for tokens kept in the connector token store) or `{tokens}` (Plaud only: contents of `~/.plaud/tokens-mcp.json`); see [inbox-voice-sources.md](../inbox-voice-sources.md) | `pkg/dashboard/api_inbox.go:31` | +| `POST` | `/api/knowledge/connectors/{name}/auth/complete` | Owner only | Finish a sign-in from pasted material on a hosted hive: `{redirect_url}` (Plaud: the `localhost:8199/auth/callback?โ€ฆ` URL the browser landed on, forwarded in-pod while the login is pending; Zoom, Google Meet and Webex: the registered redirect URL with `code` and `state`, exchanged for tokens kept in the connector token store) or `{tokens}` (Plaud only: contents of `~/.plaud/tokens-mcp.json`); see [inbox-voice-sources.md](../inbox-voice-sources.md) | `pkg/dashboard/api_inbox.go:31` | | `GET` | `/api/inbox` | Dashboard auth/session | Inbox items (voice recordings, dictations and meeting recordings keyed by `(source, id)`) with per-destination route state, source connection status, candidate repos and auto-routing settings; see [inbox-voice-sources.md](../inbox-voice-sources.md) | `pkg/dashboard/api_inbox.go:24` | | `POST` | `/api/inbox/route` | Owner only | Route one item: `{source, item_id, destination: spek_rfc\|dibs\|dismiss, repo?}` (202 queued; 400 unconfigured destination, 404 unknown item, 409 already queued/running) | `pkg/dashboard/api_inbox.go:25` | | `POST` | `/api/inbox/dismiss` | Owner only | Bulk "Knowledge only": `{items: [{source, item_id}], undo?}` | `pkg/dashboard/api_inbox.go:26` | @@ -73,4 +73,4 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f | `POST` | `/api/inbox/settings` | Owner only | Update `inbox.rules` / `inbox.spek.repo` / `inbox.dibs.url` in the runtime config (omitted fields unchanged) | `pkg/dashboard/api_inbox.go:28` | | `GET` | `/api/inbox/{source}/{id}/content` | Dashboard auth/session | Full text of one item: `{title, summary, transcript, highlights, markdown, pending, provenance}`, from the fact or live from the source while the fact has no text yet (404 unknown item, 502 source unreachable) | `pkg/dashboard/api_inbox.go:29` | | `POST` | `/api/inbox/{source}/{id}/transcribe` | Owner or read-write | Queue a machine transcription of one pending item with the owner's own Deepgram key (202 `{source, item_id, state}`; 200 when skipped up front: no audio, too long, budget); audited per run as `inbox_transcribe` (403 role, 404 unknown item, 409 queued/running/already transcribed/has text, 412 disabled or not consented); see [inbox-transcription.md](../inbox-transcription.md) | `pkg/dashboard/api_inbox.go:32` | -| `GET` | `/api/inbox/{source}/{id}/audio` | Owner or read-write | Mint a fresh short-lived audio/video link for one item (`{url, expires_at}`; Plaud: presigned, 24h; Zoom: audio-only or video `download_url` with a one-hour download token; Teams and Google Meet: 404, no browser-playable link); never stored by the hive, replied with `Cache-Control: no-store`, audited as `inbox_audio` (403 role, 404 unknown item or no audio, 502 source unreachable) | `pkg/dashboard/api_inbox.go:30` | +| `GET` | `/api/inbox/{source}/{id}/audio` | Owner or read-write | Mint a fresh short-lived audio/video link for one item (`{url, expires_at}`; Plaud: presigned, 24h; Zoom: audio-only or video `download_url` with a one-hour download token; Webex: the recording's temporary direct audio (else MP4) download link, valid 3 hours; Teams and Google Meet: 404, no browser-playable link); never stored by the hive, replied with `Cache-Control: no-store`, audited as `inbox_audio` (403 role, 404 unknown item or no audio, 502 source unreachable) | `pkg/dashboard/api_inbox.go:30` | diff --git a/src/docs/inbox-voice-sources.md b/src/docs/inbox-voice-sources.md index 66e4c3576a..95103baae9 100644 --- a/src/docs/inbox-voice-sources.md +++ b/src/docs/inbox-voice-sources.md @@ -6,8 +6,8 @@ leaving the dashboard. It is source-agnostic: Plaud is the first source, Wispr Flow (`type: wisprflow`) plugs in with the same model, Zoom and Microsoft Teams meeting recordings (`type: zoom`, `type: teams`, see [design/meeting-recordings.md](design/meeting-recordings.md)), Discord -meetings (`type: discord`) and Google Meet meetings (`type: google-meet`) -are its siblings, and later sources (file drop, webhook, โ€ฆ) add nothing to the UI. +meetings (`type: discord`), Google Meet meetings (`type: google-meet`) +and Webex meetings (`type: webex`) are its siblings, and later sources (file drop, webhook, โ€ฆ) add nothing to the UI. Tracker RFC: *Voice recorders as first-class input sources (Inbox)* โ€” see the issue linked from the changelog entry. @@ -15,7 +15,7 @@ see the issue linked from the changelog entry. ## Model - **Source** โ€” a knowledge connector whose facts are recordings (`plaud`, - `wisprflow`, `zoom`, `teams`, `discord`, `google-meet`). Connecting a source happens in **Knowledge โ†’ + `wisprflow`, `zoom`, `teams`, `discord`, `google-meet`, `webex`). Connecting a source happens in **Knowledge โ†’ ๐Ÿ”Œ Integrations**; that card shows only the connection state and an **Open Inbox** button. - **Item** โ€” one recording, keyed `(source, item_id)` (for Plaud, the @@ -23,7 +23,8 @@ see the issue linked from the changelog entry. `attr_zoom_recording_id`; for Teams the callRecording id in `attr_teams_recording_id`; for Discord `m::` or `e:` in `attr_discord_recording_id`; for Google Meet the conference - record id in `attr_google_meet_recording_id`). When the source is connected the Inbox lists + record id in `attr_google_meet_recording_id`; for Webex the meeting + instance id in `attr_webex_recording_id`). When the source is connected the Inbox lists recordings directly from it, so an item may appear before the sync has written its Knowledge fact; the Inbox only tracks what you did with it. "๐Ÿ“š Fact" opens the fact in Knowledge once that fact exists. @@ -145,11 +146,23 @@ syncs. Like every item, the text reaches spek inside the untrusted-data envelope. Setup is in [knowledge-connectors.md](knowledge-connectors.md#google-meet-recordings-type-google-meet). +## Webex meetings + +Webex items follow the Zoom shape: the title is the meeting topic, the +summary slot shows the Webex AI Assistant notes and action items when the +site has AI Assistant, and the transcript comes from Webex's VTT. **โ–ถ Play +recording** goes through the same audio endpoint: the hive asks Webex for the +recording's temporary direct download link (audio, else MP4; valid 3 hours, +no token in it) at the moment of the click and never stores it. A recording +without transcript or summary is `attr_meeting_content: pending` and re-read +on later syncs. Setup is in +[knowledge-connectors.md](knowledge-connectors.md#webex-recordings-type-webex). + ## Configuration ```yaml inbox: - sources: [plaud, wisprflow, zoom, teams, discord, google-meet] # default: every configured voice/meeting connector + sources: [plaud, wisprflow, zoom, teams, discord, google-meet, webex] # default: every configured voice/meeting connector spek: repo: hivecommons/hive # default RFC target binary: spektacular # or an absolute path; empty = look on PATH diff --git a/src/docs/knowledge-connectors.md b/src/docs/knowledge-connectors.md index 5a0b3a7b18..20951884a2 100644 --- a/src/docs/knowledge-connectors.md +++ b/src/docs/knowledge-connectors.md @@ -10,7 +10,7 @@ For the shared configuration fields, the fact format and how connectors relate t knowledge: connectors: - name: team-wiki # lowercase letters, digits, dashes - type: github-wiki # confluence | context7 | notion | git | document | github-wiki | google-drive | sharepoint | plaud | wisprflow | zoom | teams | discord | google-meet + type: github-wiki # confluence | context7 | notion | git | document | github-wiki | google-drive | sharepoint | plaud | wisprflow | zoom | teams | discord | google-meet | webex enabled: true interval: 15m # minimum 1m; blank = 15m layer: project # personal | project | org | community @@ -21,7 +21,7 @@ knowledge: # file: /run/secrets/wiki-token # an absolute secret file path ``` -Only one of `auth.env` / `auth.file` may be set. Inline secrets (an `auth.token`, or secret-looking scope keys such as `api_key`) are rejected everywhere, including by the dashboard. Connectors that talk to an OAuth app the operator registered (`zoom`, `teams`, `google-meet`) name that registration the same way, through `auth.client_id_env`, `auth.client_secret_env` and `auth.account_id_env` / `auth.tenant_id_env`: environment variable **names**, never values, plus `auth.mode` (`user_oauth` or `server_to_server`). +Only one of `auth.env` / `auth.file` may be set. Inline secrets (an `auth.token`, or secret-looking scope keys such as `api_key`) are rejected everywhere, including by the dashboard. Connectors that talk to an OAuth app the operator registered (`zoom`, `teams`, `google-meet`, `webex`) name that registration the same way, through `auth.client_id_env`, `auth.client_secret_env` and `auth.account_id_env` / `auth.tenant_id_env`: environment variable **names**, never values, plus `auth.mode` (`user_oauth` or `server_to_server`). ## How it works @@ -676,6 +676,84 @@ knowledge: retried honouring `Retry-After`. The bearer token is only sent to the Meet and Drive API hosts. +## Webex recordings (`type: webex`) + +The Webex connector reads Webex Meetings through a Webex **integration** +(OAuth as the signed-in user): one fact per ended meeting instance that has +a recording or a transcript, with the topic, start time, duration, host, +participants, the Webex AI Assistant summary (notes and action items, when +the site has AI Assistant) and the transcript rendered as `[mm:ss] Speaker: +text` lines from Webex's VTT. Meetings land in the **๐Ÿ“ฅ Inbox** with inline +playback. + +```yaml +knowledge: + connectors: + - name: webex + type: webex + layer: personal + interval: 15m + auth: + client_id_env: WEBEX_CLIENT_ID # environment variable NAMES, never values + client_secret_env: WEBEX_CLIENT_SECRET + scope: + since_days: "30" + max_recordings: "200" + include_summary: "true" # GET /meetingSummaries (meeting:summaries_read, AI Assistant) + include_participants: "true" # GET /meetingParticipants (host only) + include_video_link: "false" # also store the Webex playback link in the fact + # site_url: acme.webex.com # default: every site of the user + redirect_uri: http://localhost:8199/webex/callback + # oauth_scopes: meeting:recordings_read meeting:transcripts_read # narrow the request + tags: "meetings" +``` + +### Setup + +1. On [developer.webex.com](https://developer.webex.com/my-apps) create an + **Integration** with the redirect URI (default + `http://localhost:8199/webex/callback`) and the scopes + `meeting:recordings_read`, `meeting:transcripts_read`, + `meeting:summaries_read` (Webex AI Assistant), `meeting:participants_read` + and `spark:people_read`. If the integration has fewer scopes, list the ones + it has in `scope.oauth_scopes`: Webex rejects an authorization request for + scopes the integration was not registered with. +2. Put the client id and secret in the hive's environment and add the + connector from **Knowledge โ†’ ๐Ÿ”Œ Integrations โ†’ Webex recordings**. +3. Click **Connect Webex**, approve, and paste the + `โ€ฆ/webex/callback?code=โ€ฆ&state=โ€ฆ` URL the browser lands on into **Finish + Webex sign-in by pasting** within 10 minutes. The hive exchanges the code + and keeps the tokens at + `/data/knowledge/connector-state//home/.webex/tokens.json` (mode + 0600); access tokens last 14 days and refresh tokens 90 days, and a + rotated refresh token is written back on every refresh. + +### Behaviour + +- Each sync lists [`GET /recordings`](https://developer.webex.com/docs/api/v1/recordings/list-recordings) + and [`GET /meetingTranscripts`](https://developer.webex.com/docs/api/v1/meeting-transcripts/list-meeting-transcripts) + in explicit 30-day `from`/`to` windows (the API defaults a missing bound to + 7 days), `max=100`, following the `Link: rel="next"` header, and groups + both by meeting instance id (`meetingId`, the Inbox item id). Deleted + recordings and transcripts are skipped. Per meeting it downloads the newest + transcript as VTT (`/meetingTranscripts/{id}/download?format=vtt`), asks + [`/meetingSummaries`](https://developer.webex.com/docs/api/v1/meeting-summaries) + for the AI Assistant notes (HTML, converted) and action items, and lists + the participants; a missing scope or feature only drops that section. +- Meetings with a recording but no transcript or summary are + `attr_meeting_content: pending` and re-read on later syncs (25 at most). +- Facts carry `source: webex`, `attr_webex_recording_id` and + `attr_webex_meeting_id` (both the meeting instance id), `attr_recorded_at`, + `attr_duration_ms`, `attr_host`, `attr_participants`. +- Playback: โ–ถ Play asks [`GET /recordings/{id}`](https://developer.webex.com/docs/api/v1/recordings/get-recording-details) + for its `temporaryDirectDownloadLinks` and returns the audio link (else the + MP4), which needs no token and expires 3 hours after the request; nothing + is stored. With *Prevent downloading* on, Webex returns no link and the + error names the playback page. +- A `401` or a dead refresh token reads as *not connected* with a pointer to + the card; a `403` keeps Webex's reason. `429` and `5xx` are retried + honouring `Retry-After`. The bearer token is only sent to `webexapis.com`. + ## Wispr Flow (dictation, `type: wisprflow`) [Wispr Flow](https://wisprflow.ai) is dictation into whatever field has focus: diff --git a/src/pkg/config/inbox_config.go b/src/pkg/config/inbox_config.go index e6936b3f94..17b57eab10 100644 --- a/src/pkg/config/inbox_config.go +++ b/src/pkg/config/inbox_config.go @@ -17,7 +17,7 @@ const ( // DefaultInboxSources are the connector types whose facts surface as Inbox // items when inbox.sources is empty. -var DefaultInboxSources = []string{"plaud", "wisprflow", "zoom", "teams", "discord", "google-meet"} +var DefaultInboxSources = []string{"plaud", "wisprflow", "zoom", "teams", "discord", "google-meet", "webex"} // InboxConfig is the `inbox:` block: which connector types feed the Inbox, // how items are auto-routed, and how each destination is reached. diff --git a/src/pkg/dashboard/api_inbox.go b/src/pkg/dashboard/api_inbox.go index 8da68bb01a..674b35d3b8 100644 --- a/src/pkg/dashboard/api_inbox.go +++ b/src/pkg/dashboard/api_inbox.go @@ -216,7 +216,7 @@ type InboxListResponse struct { func (s *Server) inboxService(w http.ResponseWriter) (*inbox.Service, bool) { if s == nil || s.deps == nil || s.deps.Inbox == nil { - jsonError(w, "inbox is not available: configure a voice or meeting knowledge connector (plaud, wisprflow, zoom, teams, discord, google-meet)", http.StatusNotFound) + jsonError(w, "inbox is not available: configure a voice or meeting knowledge connector (plaud, wisprflow, zoom, teams, discord, google-meet, webex)", http.StatusNotFound) return nil, false } return s.deps.Inbox, true diff --git a/src/pkg/dashboard/knowledge_integrations_modal_test.go b/src/pkg/dashboard/knowledge_integrations_modal_test.go index 4638e4295e..360253b3d6 100644 --- a/src/pkg/dashboard/knowledge_integrations_modal_test.go +++ b/src/pkg/dashboard/knowledge_integrations_modal_test.go @@ -203,7 +203,7 @@ func TestKnowledgeIntegrationsModalMeetingCards(t *testing.T) { `'teams': { label: 'Microsoft Teams recordings'`, `'zoom': [['users', 'Recording owners (me, or user ids/emails for Server-to-Server)', 'me']`, `'teams': [['users', 'Meeting organizers (object ids or UPNs, comma-separated)'`, - `const KB_AUTH_TYPES = { plaud: 'Plaud', zoom: 'Zoom', teams: 'Teams', discord: 'Discord', 'google-meet': 'Google Meet' };`, + `const KB_AUTH_TYPES = { plaud: 'Plaud', zoom: 'Zoom', teams: 'Teams', discord: 'Discord', 'google-meet': 'Google Meet', webex: 'Webex' };`, `else if (type === 'zoom') html += kbPlaudAuthLine(c.name, type) + kbZoomPasteHtml(c.name, c);`, `else if (type === 'teams') html += kbPlaudAuthLine(c.name, type) + kbTeamsConsentHtml(c.name, c);`, `if (type === 'zoom' || type === 'teams') html += kbMeetingAuthFormHTML(type, c);`, @@ -321,6 +321,43 @@ func TestKnowledgeIntegrationsModalGoogleMeetCard(t *testing.T) { } } +// TestKnowledgeIntegrationsModalWebexCard guards the Webex entry: it shares +// the sign-in line and buttons, offers the pasted-redirect fallback, carries +// the integration form, and uses no browser-native dialog. +func TestKnowledgeIntegrationsModalWebexCard(t *testing.T) { + b, err := staticFS.ReadFile("static/index.html") + if err != nil { + t.Fatalf("reading embedded static/index.html: %v", err) + } + html := string(b) + for _, want := range []string{ + `'webex': { label: 'Webex recordings'`, + `'webex': [['since_days', 'Days back on first sync', '30']`, + `else if (type === 'webex') html += kbPlaudAuthLine(c.name, type) + kbWebexPasteHtml(c.name, c);`, + `if (type === 'webex') html += kbMeetingAuthFormHTML(type, c);`, + `} else if (type === 'webex') {`, + `function kbWebexPasteHtml(name, c)`, + `function kbOpenWebexIntegration()`, + `data-kb-webex-paste`, + `data-kb-webex-note`, + `webex: '๐ŸŽฌ'`, + } { + if !strings.Contains(html, want) { + t.Errorf("index.html missing Webex card snippet %q", want) + } + } + start := strings.Index(html, "function kbWebexPasteHtml(name, c)") + end := strings.Index(html, "async function kbPlaudAuthLoad(name, refresh)") + if start < 0 || end < start { + t.Fatal("Webex card block not found") + } + for _, native := range []string{"window.confirm(", "window.alert(", " confirm(", " alert(", "prompt("} { + if strings.Contains(html[start:end], native) { + t.Errorf("Webex card block uses a browser-native dialog %q", native) + } + } +} + // TestKnowledgeIntegrationsModalWisprFlowCard guards the Wispr Flow entry: // it is a plain local-file connector (no sign-in buttons), the card shows // the configured path, the Knowledge pane links to it and documents the @@ -347,7 +384,7 @@ func TestKnowledgeIntegrationsModalWisprFlowCard(t *testing.T) { t.Errorf("index.html missing Wispr Flow card snippet %q", want) } } - if !strings.Contains(html, `'sharepoint', 'teams', 'wisprflow', 'zoom']`) { + if !strings.Contains(html, `'sharepoint', 'teams', 'webex', 'wisprflow', 'zoom']`) { t.Error("wisprflow missing from KB_CONNECTOR_TYPE_ORDER") } start := strings.Index(html, "function kbWisprFlowSourceLine(c)") diff --git a/src/pkg/dashboard/knowledge_webex_card.test.js b/src/pkg/dashboard/knowledge_webex_card.test.js new file mode 100644 index 0000000000..78bfc7ca4d --- /dev/null +++ b/src/pkg/dashboard/knowledge_webex_card.test.js @@ -0,0 +1,88 @@ +// Knowledge Integrations card for the Webex connector: the shared sign-in +// line and buttons carry the Webex label, the card offers the +// pasted-redirect fallback until connected, the connected card points at +// the Inbox, and the integration form references environment variable +// names only. +// Run: node --test src/pkg/dashboard/*.test.js +const test = require('node:test'); +const assert = require('node:assert'); +const fs = require('node:fs'); +const path = require('node:path'); + +const html = fs.readFileSync(path.join(__dirname, 'static', 'index.html'), 'utf8'); +const fnSrc = name => { + const start = html.indexOf('function ' + name + '('); + assert.ok(start >= 0, name + ' not found'); + let depth = 0; + for (let i = html.indexOf('{', start); i < html.length; i++) { + if (html[i] === '{') depth++; + else if (html[i] === '}' && --depth === 0) return html.slice(start, i + 1); + } + throw new Error('unbalanced ' + name); +}; +const declSrc = name => { + const m = html.match(new RegExp('const ' + name + ' = [^\\n]+;')); + assert.ok(m, name + ' not found'); + return m[0]; +}; +const blockDecl = name => { + const start = html.indexOf('const ' + name + ' = {'); + assert.ok(start >= 0, name + ' not found'); + return html.slice(start, html.indexOf('};', start) + 2); +}; + +const escapeHtml = s => String(s == null ? '' : s).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); + +// Every helper the card calls is injected (KB_AUTH_TYPES, kbAuthLabel, the +// settings-key table), or the sandbox throws ReferenceError. +const load = (connectors, auth) => new Function('_kcState', '_kbPlaudAuth', 'escapeHtml', 'setTimeout', 'kbPlaudAuthLoad', + declSrc('KB_AUTH_TYPES') + '\n' + blockDecl('KB_MEETING_AUTH_SETTING_KEYS') + '\n' + + ['kbAuthLabel', 'kbPlaudAuthLine', 'kbPlaudAuthButtons', 'kbWebexPasteHtml', 'kbMeetingAuthFormHTML'].map(fnSrc).join('\n') + + '\nreturn { kbAuthLabel, kbPlaudAuthLine, kbPlaudAuthButtons, kbWebexPasteHtml, kbMeetingAuthFormHTML };')( + { connectors }, auth || {}, escapeHtml, () => {}, () => {}); + +const webex = { name: 'wbx', type: 'webex', scope: {}, auth: { client_id_env: 'WEBEX_CLIENT_ID', client_secret_env: 'WEBEX_CLIENT_SECRET' } }; + +test('webex sign-in line and buttons carry the Webex label', () => { + const h = load([webex], { wbx: { pending: true, auth_url: 'https://webexapis.com/v1/authorize?client_id=cid&state=s' } }); + assert.strictEqual(h.kbAuthLabel('wbx'), 'Webex'); + const line = h.kbPlaudAuthLine('wbx', 'webex'); + assert.match(line, /Webex: waiting for authorization/); + assert.match(line, /open the Webex authorization page/); + assert.match(line, /href="https:\/\/webexapis\.com\/v1\/authorize\?client_id=cid&state=s"/); + const buttons = h.kbPlaudAuthButtons('wbx', '', 'webex'); + assert.match(buttons, /Connect Webex/); + assert.match(buttons, /Re-check sign-in with Webex/); +}); + +test('webex card offers the pasted-redirect fallback until connected', () => { + const h = load([webex], { wbx: { connected: false } }); + const card = h.kbWebexPasteHtml('wbx', webex); + assert.match(card, /data-kb-webex-paste/); + assert.match(card, /http:\/\/localhost:8199\/webex\/callback/); + assert.match(card, /meeting:recordings_read/); + assert.match(card, /meeting:transcripts_read/); + assert.match(card, /id="kb-plaud-paste-wbx"/); + assert.match(card, /data-action="kbPlaudPasteComplete" data-arg0="wbx"/); + const custom = Object.assign({}, webex, { scope: { redirect_uri: 'https://hive.example/webex' } }); + assert.match(h.kbWebexPasteHtml('wbx', custom), /https:\/\/hive\.example\/webex/); + + const connected = load([webex], { wbx: { connected: true, account: 'andy@example.com' } }); + const done = connected.kbWebexPasteHtml('wbx', webex); + assert.doesNotMatch(done, /data-kb-webex-paste/); + assert.match(done, /Open Inbox/); + assert.match(done, /data-kb-webex-playback/); +}); + +test('webex form references env var names only and carries settings keys', () => { + const h = load([webex]); + const form = h.kbMeetingAuthFormHTML('webex', webex); + for (const key of ['client_id_env', 'client_secret_env']) { + assert.match(form, new RegExp('data-kb-kc-auth-field="' + key + '"'), key + ' field'); + assert.match(form, new RegExp('data-setting-key="knowledge\\.connectors\\[\\]\\.auth\\.' + key + '"'), key + ' settings key'); + } + assert.match(form, /value="WEBEX_CLIENT_ID"/); + assert.doesNotMatch(form, /tenant_id_env|account_id_env|data-kb-kc-auth-field="mode"/); + assert.match(form, /data-kb-webex-note/); + assert.match(form, /\.webex\/tokens\.json/); +}); diff --git a/src/pkg/dashboard/static-src/js/config-tabs.js b/src/pkg/dashboard/static-src/js/config-tabs.js index f63cd1c691..7a17bef058 100644 --- a/src/pkg/dashboard/static-src/js/config-tabs.js +++ b/src/pkg/dashboard/static-src/js/config-tabs.js @@ -291,7 +291,7 @@ } // ---- Settings โ†’ Knowledge โ†’ Connectors (#11075) ---- - const KB_CONNECTOR_TYPE_ORDER = ['confluence', 'context7', 'discord', 'document', 'git', 'github-wiki', 'google-drive', 'google-meet', 'notion', 'plaud', 'repo-wiki', 'sharepoint', 'teams', 'wisprflow', 'zoom']; + const KB_CONNECTOR_TYPE_ORDER = ['confluence', 'context7', 'discord', 'document', 'git', 'github-wiki', 'google-drive', 'google-meet', 'notion', 'plaud', 'repo-wiki', 'sharepoint', 'teams', 'webex', 'wisprflow', 'zoom']; const KC_TYPE_INFO = { 'confluence': { label: 'Confluence', description: 'Sync Confluence Cloud or Data Center pages into knowledge facts.' }, 'context7': { label: 'Context7', description: 'Sync documentation for default Context7 libraries. The API key is a reference to an environment variable or secret file; the value is never shown.' }, @@ -305,6 +305,7 @@ 'repo-wiki': { label: 'Repo wiki', description: 'Sync .hive/wiki (or another directory) from one or more GitHub repositories.' }, 'sharepoint': { label: 'SharePoint / OneDrive', description: 'Sync markdown, text, and HTML files from SharePoint document libraries or OneDrive drives.' }, 'google-meet': { label: 'Google Meet recordings', description: 'Sync Google Meet meetings that produced a recording, transcript or Gemini notes through the Meet REST API: user-level OAuth for your own meetings or a service account with domain-wide delegation for Workspace users. One fact per meeting; items land in the Inbox.' }, + 'webex': { label: 'Webex recordings', description: 'Sync Webex Meetings recordings, transcripts and AI Assistant summaries through a Webex integration (OAuth) you register. One fact per meeting; items land in the Inbox with playback.' }, 'teams': { label: 'Microsoft Teams recordings', description: 'Sync Teams meeting recordings and transcripts for the organizers you list, through Microsoft Graph application permissions (Entra app registration + admin consent). One fact per recorded meeting; items land in the Inbox.' }, 'zoom': { label: 'Zoom recordings', description: 'Sync Zoom cloud recordings (topic, participants, AI summary, transcript) through a Zoom OAuth app you register: user-level OAuth for your own recordings or Server-to-Server for the account. One fact per recorded meeting; items land in the Inbox with playback.' }, 'wisprflow': { label: 'Wispr Flow dictation', description: 'Sync your Wispr Flow dictation history (what you spoke, when, into which app) from the desktop app\'s local flow.sqlite or an export folder. Read-only, no sign-in, $0 beyond your Wispr Flow plan.' } @@ -327,6 +328,7 @@ 'zoom': 'M3 6a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v3.2l4.2-2.8a.8.8 0 0 1 1.3.7v9.8a.8.8 0 0 1-1.3.7L16 14.8V18a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm2 0v12h9V6z', 'discord': 'M12 3a8 8 0 0 0-8 8v5a3 3 0 0 0 3 3h1v-7H6v-1a6 6 0 0 1 12 0v1h-2v7h1a3 3 0 0 0 3-3v-5a8 8 0 0 0-8-8z', 'google-meet': 'M4 5h12a2 2 0 0 1 2 2v2.5l3.2-2.2a.8.8 0 0 1 1.3.6v8.2a.8.8 0 0 1-1.3.6L18 14.5V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2zm4 4v6l5-3z', + 'webex': 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zm0 2a7 7 0 1 1 0 14 7 7 0 0 1 0-14zm-1 3v8l6-4z', 'teams': 'M9 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm8 1a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM3 19a6 6 0 0 1 12 0v1H3zm13.5 1v-1c0-1.6-.5-3-1.3-4.2.5-.2 1.1-.3 1.8-.3a4 4 0 0 1 4 4v1.5z', 'repo-wiki': 'M4 3h7.2c1.1 0 2 .55 2.8 1.3.8-.75 1.7-1.3 2.8-1.3H20v16h-3.2c-1 0-1.95.4-2.8 1.1V22h-4v-1.9c-.85-.7-1.8-1.1-2.8-1.1H4zm2 2v12h1.2c1.3 0 2.5.4 3.6 1.1V6.2C10.4 5.55 9.6 5 8.8 5zm12 0h-1.2c-.8 0-1.6.55-2 1.2v12.1c1.1-.7 2.3-1.1 3.6-1.1H18z' }; @@ -348,6 +350,7 @@ 'sharepoint': [['drive_ids', 'Drive IDs', 'b!drive-id'], ['site_ids', 'Site IDs', 'contoso.sharepoint.com,site-id,web-id'], ['folder_path', 'Folder path', '/Docs/Sub'], ['include_files', 'Include file extensions', '.md,.txt,.html']], 'discord': [['guild', 'Server (guild) id, for scheduled events', '111111111111111111'], ['channels', 'Recording channel ids (comma-separated; where recordings are posted)', '222222222222222222'], ['recorder_bots', 'Only messages from these user ids (optional, e.g. the recording bot)', ''], ['since_days', 'Days back on first sync', '30'], ['max_recordings', 'Max items per sync', '200'], ['include_events', 'Scheduled events as meeting items', 'true'], ['include_chat', 'Include the event channel chat', 'true'], ['include_participants', 'List interested users', 'true'], ['include_video_link', 'Also store the recording-bot download link in the fact', 'false'], ['link_hosts', 'Recording-bot link hosts (comma-separated)', 'craig.horse, craig.chat'], ['tags', 'Extra tags (comma-separated)', 'meetings']], 'google-meet': [['users', 'Users to read (service account only: Workspace addresses, comma-separated)', 'alice@example.com, bob@example.com'], ['since_days', 'Days back on first sync', '30'], ['max_recordings', 'Max meetings per sync', '200'], ['include_summary', 'Fetch Gemini "Take notes for me" notes as the summary', 'true'], ['include_participants', 'Fetch the participant list', 'true'], ['include_video_link', 'Also store the Drive recording link in the fact', 'false'], ['redirect_uri', 'OAuth redirect URL registered on the client (user-level)', 'http://localhost:8199/google-meet/callback'], ['tags', 'Extra tags (comma-separated)', 'meetings']], + 'webex': [['since_days', 'Days back on first sync', '30'], ['max_recordings', 'Max meetings per sync', '200'], ['include_summary', 'Fetch the AI Assistant summary (meeting:summaries_read)', 'true'], ['include_participants', 'Fetch the participant list (host only)', 'true'], ['include_video_link', 'Also store the Webex playback link in the fact', 'false'], ['site_url', 'Webex site (optional; default: all your sites)', 'acme.webex.com'], ['redirect_uri', 'OAuth redirect URL registered on the integration', 'http://localhost:8199/webex/callback'], ['oauth_scopes', 'OAuth scopes to request (optional override)', 'meeting:recordings_read meeting:transcripts_read'], ['tags', 'Extra tags (comma-separated)', 'meetings']], 'teams': [['users', 'Meeting organizers (object ids or UPNs, comma-separated)', '8b081ef6-4792-4def-b2c9-c363a1bf41d5, someone@contoso.example'], ['group', 'Or an Entra group object id (members are the organizers)', ''], ['since_days', 'Days back on first sync', '30'], ['max_recordings', 'Max recordings per sync', '200'], ['include_video_link', 'Also store the Teams meeting link in the fact', 'false'], ['tags', 'Extra tags (comma-separated)', 'meetings']], 'zoom': [['users', 'Recording owners (me, or user ids/emails for Server-to-Server)', 'me'], ['since_days', 'Days back on first sync', '30'], ['max_recordings', 'Max recordings per sync', '200'], ['include_summary', 'Fetch the Zoom AI meeting summary (meeting_summary:read)', 'true'], ['include_participants', 'Fetch the participant list (meeting:read past participants)', 'true'], ['include_video_link', 'Also store the Zoom play link in the fact (Inbox playback never needs it)', 'false'], ['redirect_uri', 'OAuth redirect URL registered on the Zoom app (user-level)', 'http://localhost:8199/zoom/callback'], ['tags', 'Extra tags (comma-separated)', 'meetings']], 'wisprflow': [['path', 'flow.sqlite or export folder (empty = app default)', '/Users/me/Library/Application Support/Wispr Flow/flow.sqlite'], ['since_days', 'Days back on first sync', '30'], ['max_items', 'Max dictations per sync', '500'], ['min_words', 'Skip dictations shorter than (words)', '3'], ['group', 'Fact per dictation or day', 'dictation'], ['apps', 'Only these apps (comma-separated, optional)', 'slack, obsidian, vscode'], ['include_raw', 'Include raw ASR text', 'false'], ['tags', 'Extra tags (comma-separated)', 'voice, ideas'], ['sqlite3', 'sqlite3 command (optional)', 'sqlite3']] diff --git a/src/pkg/dashboard/static-src/js/inbox.js b/src/pkg/dashboard/static-src/js/inbox.js index 44e5cb32c8..33d6c15113 100644 --- a/src/pkg/dashboard/static-src/js/inbox.js +++ b/src/pkg/dashboard/static-src/js/inbox.js @@ -4,7 +4,7 @@ // dibs happens inside the hive via POST /api/inbox/route. const INBOX_POLL_MS = 60000; const INBOX_BUSY_POLL_MS = 5000; - const INBOX_SOURCE_ICONS = { plaud: '๐ŸŽ™๏ธ', wisprflow: '๐Ÿ—ฃ๏ธ', zoom: '๐Ÿ“น', teams: '๐Ÿ‘ฅ', discord: '๐ŸŽง', 'google-meet': '๐ŸŽฅ', 'file-drop': '๐Ÿ“Ž', webhook: '๐Ÿ”—' }; + const INBOX_SOURCE_ICONS = { plaud: '๐ŸŽ™๏ธ', wisprflow: '๐Ÿ—ฃ๏ธ', zoom: '๐Ÿ“น', teams: '๐Ÿ‘ฅ', discord: '๐ŸŽง', 'google-meet': '๐ŸŽฅ', webex: '๐ŸŽฌ', 'file-drop': '๐Ÿ“Ž', webhook: '๐Ÿ”—' }; const INBOX_DEST_LABELS = { spek_rfc: 'RFC', dibs: 'dibs' }; // Summaries longer than this many characters start collapsed. const INBOX_SUMMARY_COLLAPSE_CHARS = 280; @@ -88,7 +88,7 @@ const tx = it.transcribable ? ' Or click ๐ŸŽง Transcribe to have this hive transcribe it with Deepgram.' : ''; // Meeting platforms whose pending items read "