Skip to content

feat(connector-microsoft): vendor in-tree as workspace package#64

Open
AnishRane wants to merge 5 commits into
hebbs-ai:mainfrom
AnishRane:feat/vendor-connector-microsoft
Open

feat(connector-microsoft): vendor in-tree as workspace package#64
AnishRane wants to merge 5 commits into
hebbs-ai:mainfrom
AnishRane:feat/vendor-connector-microsoft

Conversation

@AnishRane

Copy link
Copy Markdown
Contributor

Summary

Brings @boringos/connector-microsoft into the monorepo as a first-party workspace package, mirroring the in-tree placement of @boringos/connector-google. The connector previously lived as a standalone sibling repo depending on the published @boringos/module-sdk@^0.13.0.

This PR is vendoring only — no agent-facing tools yet. Surface is unchanged: ConnectorDefinition + typed clients for Outlook Mail, Calendar, Contacts, and OneDrive (Microsoft Graph). A follow-up will add createMicrosoftModule in @boringos/core (the Google factory's counterpart).

What changed

  • New package at packages/@boringos/connector-microsoft/ — 4 services (Mail / Calendar / Contacts / Files), 29 unit tests.
  • package.json: SDK dep switched from ^0.13.0workspace:*; added repository field for parity with connector-google.
  • tsconfig.json: extends ../../../tsconfig.base.json with rootDir / outDir / composite: true, matching connector-google's setup.
  • pnpm-lock.yaml regenerated.

No changes to existing packages.

Out of scope (follow-ups)

  • createMicrosoftModule factory in @boringos/core/src/modules/microsoft.ts (mirrors google.ts) — wires outlook.* / ms_calendar.* / outlook_contacts.* / onedrive.* tools.
  • Static registration in the dev-host boot list.
  • Webhooks / delta / events (deferred in the connector itself).

Test plan

  • pnpm install — clean
  • pnpm -r build — all packages green, including connector-microsoft
  • pnpm -r typecheck — all packages green
  • pnpm -F @boringos/connector-microsoft test — 29/29 pass
  • pnpm test:run — 542 pass, 1 skipped. The 1 failure (tests/phase3-golden.test.ts) fails identically on main (pre-existing, environment-dependent CLI-subprocess test).
  • Reviewer: spot-check that the vendored package matches the standalone repo's last green build (commit 23b5cbe in the sibling repo).

🤖 Generated with Claude Code

AnishRane and others added 3 commits May 30, 2026 18:33
Bring @boringos/connector-microsoft into the monorepo, mirroring the
in-tree placement of @boringos/connector-google. The connector
previously lived as a standalone sibling repo depending on the
published @boringos/module-sdk@^0.13.0.

Changes vs. the standalone repo:
- package.json: SDK dep switched from "^0.13.0" to "workspace:*";
  added repository field for parity with connector-google.
- tsconfig.json: extends ../../../tsconfig.base.json with
  rootDir/outDir/composite, matching connector-google's setup.

Surface unchanged: ConnectorDefinition + typed clients for Outlook
Mail, Calendar, Contacts, OneDrive. No agent-facing tools yet — those
land in a follow-up createMicrosoftModule factory in @boringos/core.

pnpm -r build, pnpm -r typecheck, and the 29 connector-microsoft tests
are green. The pre-existing phase3-golden CLI-subprocess test fails
identically on main (environment-dependent).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add the built-in Microsoft 365 module — a thin wrapper exposing
mail.*, calendar.*, contacts.* and files.* tools over the vendored
@boringos/connector-microsoft SDK, mirroring the built-in Google module.

- core: new modules/microsoft.ts factory + tests; export
  createMicrosoftModule from src/index.ts
- core: add @boringos/connector-microsoft as a workspace dependency
  and tsconfig project reference
- dev-server: register createMicrosoftModule alongside the other
  built-in connectors
- connector-microsoft: tidy package.json field order; README layout note

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The host auto-discovers connectors by scanning
<cwd>/node_modules/@boringos/connector-* at boot (discoverConnectors).
pnpm only links a workspace package into the root node_modules when the
root package depends on it. @boringos/core declared the dependency but
the workspace root did not, so connector-google and connector-slack were
discovered while connector-microsoft was silently skipped — its OAuth
ConnectorDefinition never registered with the AuthManager.

Add the root devDependency so the Microsoft connector is discovered and
its OAuth flow works on a fresh clone. Verified end-to-end: both Google
and Microsoft accounts connect and persist.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AnishRane

Copy link
Copy Markdown
Contributor Author

Manually tested the connector end-to-end on a live host — found and fixed one wiring gap.

Pushed 017f858 to this branch.

The fix: the workspace root package.json was missing @boringos/connector-microsoft (it had connector-google and connector-slack). The host discovers connectors by scanning <cwd>/node_modules/@boringos/connector-* at boot, and pnpm only links a workspace package into the root node_modules when the root depends on it. @boringos/core declared the dep, but the root didn't — so on a fresh clone the Microsoft OAuth definition never registered (the module's tools loaded, but discoverConnectors() skipped it). Boot log before vs after:

# before: only google, slack
# after:  [connector-discovery] registered microsoft from @boringos/connector-microsoft

Evidence (dev host on :3030):

  • /api/connectors/oauth/microsoft/authorize → correct 302 to login.microsoftonline.com with the right client_id, framework-derived redirect_uri (/api/connectors/oauth/microsoft/callback), all four service scopes + offline_access, signed state, prompt=consent.
  • Full OAuth round-trip completed: an Outlook account connects and persists to connector_accounts (status active, encrypted credentials, granted scopes). Google verified the same way as a control.
  • tests/microsoft.test.ts 6/6 green; tsc clean for connector-microsoft + core.

Heads-up (separate, env-only): connecting also requires BORINGOS_ENCRYPTION_KEY to be set (tokens are AES-256-GCM encrypted before storage) and MICROSOFT_CLIENT_ID/MICROSOFT_CLIENT_SECRET. Neither is in the .env.example from #25 yet — noted there.

AnishRane and others added 2 commits June 2, 2026 11:42
google and slack had display name + description entries; microsoft fell
back to the connector's displayName with an empty description, so the
Connectors screen showed "Microsoft 365" with no subtitle. Add the entry
for parity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the single-letter tile on each connector card with the official
brand glyph (Google, Microsoft, Slack) via a new ConnectorIcon keyed off
the provider id. Unknown providers keep the lettered-tile fallback, so
new connectors still render cleanly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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