Skip to content

[CYPACK-726] Extract IActivitySink interface and LinearActivitySink implementation#767

Merged
cyrusagent merged 2 commits intocypack-724from
cypack-726
Jan 16, 2026
Merged

[CYPACK-726] Extract IActivitySink interface and LinearActivitySink implementation#767
cyrusagent merged 2 commits intocypack-724from
cypack-726

Conversation

@cyrusagent
Copy link
Copy Markdown
Contributor

@cyrusagent cyrusagent commented Jan 16, 2026

Summary

This PR implements Phase 2 of the activity sink extraction, creating the IActivitySink interface and LinearActivitySink implementation to decouple activity posting from IIssueTrackerService. This enables multiple activity sinks (Linear workspaces, GitHub, etc.) to receive session activities based on session context.

Changes

New Files

  • packages/edge-worker/src/sinks/IActivitySink.ts - Interface defining activity sink contract
  • packages/edge-worker/src/sinks/LinearActivitySink.ts - Linear-specific implementation wrapping IIssueTrackerService
  • packages/edge-worker/src/sinks/index.ts - Barrel export for sinks
  • packages/edge-worker/test/LinearActivitySink.test.ts - Comprehensive unit tests (20 tests)

Modified Files

  • packages/edge-worker/src/index.ts - Exported IActivitySink and LinearActivitySink
  • CHANGELOG.internal.md - Added entry documenting the changes

Implementation Details

IActivitySink Interface:

  • readonly id: string - Unique identifier for the sink (workspace ID)
  • postActivity(sessionId, activity) - Post activities to agent sessions
  • createAgentSession(issueId) - Create new agent sessions on issues

LinearActivitySink:

  • Wraps IIssueTrackerService to provide activity sink functionality
  • Delegates to createAgentActivity() for posting activities
  • Delegates to createAgentSessionOnIssue() for session creation
  • Properly handles Promise-based agentSession responses

Testing

20 new unit tests covering:

  • Constructor validation
  • Activity posting (thought, action, response, error, elicitation)
  • Session creation
  • Error handling
  • Multiple operations
  • Workspace ID management
  • Edge cases

All tests passing: 410 tests in edge-worker package
Build: All packages build successfully
Type checking: Clean across all packages
Linting: Clean (formatting auto-fixed)

Dependencies

Linear Issue

CYPACK-726: Extract IActivitySink interface and LinearActivitySink implementation

cyrusagent and others added 2 commits January 15, 2026 22:33
…tation (CYPACK-726)

- Create IActivitySink interface for decoupling activity posting
- Implement LinearActivitySink wrapping IIssueTrackerService
- Add comprehensive unit tests (20 tests, all passing)
- Export from edge-worker package

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…726)

Add changelog entry documenting the extraction of IActivitySink interface
and LinearActivitySink implementation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@cyrusagent cyrusagent marked this pull request as ready for review January 16, 2026 06:36
@cyrusagent cyrusagent merged commit bd39940 into cypack-724 Jan 16, 2026
6 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