Skip to content

Core: Data Model, Types & Interfaces - #19

Merged
ggondim merged 3 commits into
meta/17from
claude/issue-2-20260410-2134
Apr 10, 2026
Merged

Core: Data Model, Types & Interfaces#19
ggondim merged 3 commits into
meta/17from
claude/issue-2-20260410-2134

Conversation

@ggondim

Copy link
Copy Markdown
Contributor

Summary

Implements all core TypeScript types, abstract storage interface, abstract channel adapter interface, ID generation utilities, and message classification (duck typing discriminator).

fixes#2

Test plan

  • All types exported from packages/core
  • Storage interface is fully abstract
  • Channel adapter interface is fully abstract
  • ID generation produces correctly prefixed unique IDs
  • Duck-typing discriminator classifies Chat SDK vs A2H messages

🤖 Generated by Claude Task Worker

ggondimand others added 3 commits April 10, 2026 18:33
Add explicit git checkout, branch creation, and PR creation steps
to the comment template. Task agents were not creating PRs because
the instructions were too vague.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…erfaces
Implements issue #2 — all core TypeScript contracts for @openthreads/core:
Data model types:
- Channel, Recipient, Thread, Turn, Route, Envelope
- A2H intent types (INFORM, COLLECT, AUTHORIZE, ESCALATE, RESULT)
- Message union type with duck-typing discriminator (intent field = A2H)
Utilities:
- ID generation for ot_thr_*, ot_turn_*, ot_tk_*, ot_ch_sk_* prefixes
- Message classification helpers (isA2HMessage, classifyMessages, etc.)
Interfaces (fully abstract, no implementation):
- StorageAdapter with CRUD for all entities + token lifecycle
- StorageAdapterFactory for pluggable instantiation
- ChannelAdapter with register, sendMessage, render, captureResponse, capabilities
- ChannelCapabilities type flag set
Tests:
- Unit tests for ID generation (prefix validation, uniqueness, type guards)
- Unit tests for message classification (duck-typing, mixed arrays, helpers)
Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
@ggondim
ggondim merged commit fd7887b into meta/17Apr 10, 2026
@claudeclaudeBot mentioned this pull request Apr 10, 2026
16 tasks
Sign up for freeto 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

@ggondim