Skip to content

feat: extract @libscope/connectors — third-party sync adapters #493

@RobertLD

Description

@RobertLD

Summary

Part of #488. Extract src/connectors/ into a standalone @libscope/connectors package, and fix the inward coupling where src/core/scheduler.ts currently imports connector modules directly.

Problem / Motivation

Connector code (Notion, Slack, Confluence, OneNote, Obsidian) has no circular dependencies with core — but src/core/scheduler.ts imports connectors directly, creating an inward dep that prevents core from being independent. This coupling needs to be inverted before connectors can be a separate package.

Proposed Solution

  1. Move src/connectors/ into packages/connectors/
  2. Move src/core/scheduler.ts into packages/connectors/ (it's logically a connectors concern — scheduling syncs)
  3. Update scheduler to accept connector functions as injected dependencies rather than importing them directly
  4. @libscope/connectors depends on @libscope/core for indexing; @libscope/core has zero imports from connectors

Acceptance Criteria

  • @libscope/connectors builds independently; zero imports from @libscope/connectors exist in @libscope/core
  • src/core/scheduler.ts is moved to packages/connectors/ and no longer lives in the core package
  • The scheduler's connector dependencies are injected (passed in) rather than statically imported
  • All connector sync functions (notion, slack, confluence, onenote, obsidian, docs) work correctly end-to-end
  • Existing CLI connector commands (libscope connect, libscope sync) pass integration tests

Out of Scope

  • Adding new connectors
  • Changing connector authentication flows

Technical Notes

  • Connectors: notion.ts, slack.ts, confluence.ts, onenote.ts, obsidian.ts, docs.ts
  • The only inward dep to fix is src/core/scheduler.ts → connectors. All other connector deps are outward (connectors → core/indexing)
  • src/connectors/index.ts currently exports connector config functions and some DB helpers — review what belongs in connectors vs core

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrefactorCode refactoring

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions