Skip to content

feat(integrations): agentbox doctor reports each connector + Notion docs (T3)#75

Merged
madarco merged 2 commits into
add-ticketing-integrationsfrom
agentbox/notion-t3
Jun 6, 2026
Merged

feat(integrations): agentbox doctor reports each connector + Notion docs (T3)#75
madarco merged 2 commits into
add-ticketing-integrationsfrom
agentbox/notion-t3

Conversation

@madarco
Copy link
Copy Markdown
Owner

@madarco madarco commented Jun 6, 2026

Summary

  • agentbox doctor integration detection. Adds a registry-driven integrations: group (driven off ALL_CONNECTORS, so Linear/Trello/ClickUp will light up automatically when they ship) reporting each connector's enabled state, host-binary presence, and login status with descriptor-sourced hints. A new info CheckStatus rolls up like ok so a disabled-but-correctly-configured integration never flips the overall status to "warn". The host probe deliberately skips NOTION_KEYRING=0 (commented in the code).
  • -p <provider> includes integrations too. Without this, scoping doctor to one provider hid the new group entirely.
  • Docs — the bulk of T3. New docs/integrations.md (internal design ref), new apps/web/content/docs/integrations-notion.mdx (user-facing Fumadocs page; nav under a new ---Services--- section), ## integrations config section + agentbox doctor sentence on the published config/CLI pages, new RPC method-family bullet in docs/host-relay.md, Notion bullet in docs/features.md, T3 marked done in docs/notion_backlog.md.
  • IntegrationConnector.detect gained two optional fields — installHint, loginHint — filled for the Notion connector (canonical install URL + ntn login).

This is T3 of the Notion stack (T1 #73, T2 #74). T4 (nested-box e2e + carry-based file-auth verification) is the remaining task.

What works

  • agentbox doctor (unscoped) and agentbox doctor -p hetzner both show:
    integrations:
      [info] notion             disabled  (enable with `agentbox config set --project integrations.notion.enabled true`)
    
  • After agentbox config set --project integrations.notion.enabled true, the same row flips to [warn] ntn not installed (install ntn: https://developers.notion.com/reference/notion-cli) in this box (the box has no real ntn). On the host (where ntn is installed and authed), the row will read [ ok ] notion ntn version X.Y.Z · authed.

Code-review pass

Ran /code-review high then /simplify, applying:

  1. afterEach restoration uses a conditional delete so an unset PATH doesn't get coerced to the literal string "undefined".
  2. doctor -p <provider> now includes the integrations group (was a silent discoverability gap).
  3. integrationsChecks walks ALL_CONNECTORS via Promise.all — keeps latency flat as more connectors land.
  4. Removed the dead cwd parameter from integrationsChecks's signature.

Test plan

  • pnpm typecheck && pnpm test && pnpm build && pnpm lint — all 25/25 + 13/13 + 14/14 + 25/25 green.
  • New apps/cli/test/doctor-integrations.test.ts (5 tests) stubs a fake ntn on PATH and asserts the four status transitions (disabled / missing / unauthed / authed) plus loader-rejects-fail-closed.
  • node apps/cli/dist/index.js doctor and ... doctor -p hetzner both render the new group in this box; toggling integrations.notion.enabled flips info→warn as expected.
  • pnpm --filter @agentbox/web build includes the new MDX page in the prerender.
  • Live host probe of agentbox doctor's Notion row against a real macOS-keychain-authed ntn (post-merge, orchestrator).

Out of scope (deferred to T4 / later)

  • Nested-box e2e + carry-based file-auth verification (T4).
  • comment.add op — deferred to a focused follow-up after a payload-translator design.
  • Linear / Trello / ClickUp connectors — separate sessions per docs/integrations_backlog.md.
  • Recapturing a <Figure> for the Notion docs page — flagged for a follow-up capture pass per apps/web/images.md (can't capture from inside a box).

Note

Low Risk
Read-only local doctor probes and documentation; no changes to relay auth or integration RPC behavior in this PR.

Overview
agentbox doctor now includes a registry-driven integrations: group (from ALL_CONNECTORS) that reports each connector’s enabled flag, host CLI install, and login state, with hints from the connector descriptor. A new info status marks disabled integrations and rolls up like ok so they don’t turn the overall doctor run into a warn. Scoped doctor -p <provider> also shows integrations (host-side, not provider-side).

IntegrationConnector.detect gains optional installHint / loginHint (set on Notion). The CLI adds @agentbox/integrations as a dev dependency and doctor-integrations.test.ts stubs ntn on PATH for the main status transitions.

Docs (T3): new user page integrations-notion.mdx and internal docs/integrations.md, ## integrations in configuration docs, doctor mention in CLI docs, nav ---Services---, plus updates to host-relay.md, features.md, and notion_backlog.md (T3 marked done).

Reviewed by Cursor Bugbot for commit 404a23f. Configure here.

…ocs (T3)

Doctor now renders a registry-driven `integrations:` group alongside the
provider groups (no hardcoded 'notion' — Linear/Trello will light up
automatically when their descriptors ship). Per connector: probe the host
binary (`<hostBin> --version`) and auth (`<hostBin> <authArgs>`), surface
install/login hints from two new optional descriptor fields. A new `info`
CheckStatus rolls up like ok so a disabled-but-correctly-configured
integration never flips the overall doctor status to "warn".

The `-p <provider>` scoped path now includes the integrations group too —
otherwise users who scope doctor to one provider couldn't see whether
their Notion is enabled/installed/authed. The host probe deliberately does
NOT set NOTION_KEYRING=0 (a comment in doctor-checks.ts records why).

Docs (the bulk of T3, per the same-change rule):
- new docs/integrations.md — internal design/reference (descriptor model,
  relay dispatch flow, op surface, enable flag, doctor wiring, carry-based
  file-auth for nested boxes, open follow-ups).
- new apps/web/content/docs/integrations-notion.mdx — user-facing Fumadocs
  page; meta.json wired under a new ---Services--- section.
- apps/web/content/docs/configuration.mdx — new `## integrations` section
  documenting `integrations.notion.enabled`.
- apps/web/content/docs/cli.mdx — `agentbox doctor` sentence updated.
- docs/host-relay.md — new RPC method-family bullet for
  `integration.<service>.<op>`.
- docs/features.md — Notion integration bullet; `/rpc` line updated.
- docs/notion_backlog.md — T3 marked done with status log.

Unit test stubs a fake `ntn` on PATH and asserts the four status
transitions (disabled / missing / unauthed / authed). The live host probe
runs post-merge on the host.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentbox-web Ready Ready Preview, Comment Jun 6, 2026 7:20pm

Request Review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 404a23f. Configure here.

return { label: svc, status: 'ok', detail: versionLine };
}

const auth = await probeIntegrationBin(connector.hostBin, connector.detect.authArgs);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auth probe lacks timeout

Medium Severity

When Notion is enabled, checkOneIntegration runs probeIntegrationBin for authArgs (ntn api v1/users/me) with no execa timeout, so a slow or stuck network call can leave agentbox doctor hanging unlike relay integration RPCs, which cap host CLI time.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 404a23f. Configure here.

…shim)

The in-box ntn-shim accepts 'ntn pages {create,update}' (plural) — that's
the real ntn CLI's subcommand name and what the shim's allowlist matches.
The docs incorrectly showed singular 'ntn page create' / 'ntn page update'
in 5 places; a user following them would be rejected by the shim.

Internal op names (page.create, page.update) and the wire method
(integration.notion.page.create) stay unchanged — they're the descriptor
keys, not the user-facing command form.
@madarco madarco merged commit e9c1c02 into add-ticketing-integrations Jun 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant