Goal
Deliver a Dart/Flutter Morph API Client with functional parity to the existing TypeScript implementation (packages/core, packages/oauth2, packages/browser-storage, packages/logger): same JSON configuration schema, same OAuth2 / multi-context token lifecycle, HTTP pipeline behavior (auth resolution, retry, trace, 401 recovery), and plugin composition (provides / requires, provideAuth / provideStorage, logger chaining).
Foundation: Phase 1 scaffold in packages/dart/morph_core (#1, base branch f/plugin).
References:
Scope (parity targets)
| TS package |
Dart target (name TBD in PRs; split like TS) |
Feature parity checklist |
@morph/core |
morph_core (expand scaffold) |
MorphClient, MorphRuntime-equivalent, MorphConfig validation/interpolation, HostPipeline, HostClient, AuthHandle, errors, HTTP trace events, plugin topo-sort + MorphPluginContext |
@morph/oauth2 |
e.g. morph_oauth2 |
AuthPlugin, TokenLifecycle, TokenVault, OAuth helpers, refresh / exchange / 401 recovery behavior aligned with token-lifecycle.md |
@morph/browser-storage |
e.g. morph_secure_storage or VM-first |
StorageProvider; Flutter: secure storage / memory paths per platform-adapters.md |
@morph/logger |
packaged or nested |
Optional logger plugin chaining onLog / onHttpTrace like TS |
Non-functional: idiomatic Dart (snake_case public APIs, Future/streams where async), deterministic tests mirroring TS test intent where configs align.
Out of scope (unless explicitly expanded)
- Changing the canonical JSON schema consumed by TS (Dart must validate against the same semantics; schema evolution stays coordinated).
- UI samples (optional follow-up PoC); this issue tracks SDK parity first.
Acceptance criteria
Suggested sequencing (milestones inside this issue)
- Typed
MorphConfig / MorphOptions + validators + interpolate variables (Dart).
- Runtime + plugins equivalent to TS
MorphRuntime, runtime.ts.
- OAuth2 package parity (
TokenLifecycle, vault, OAuth URL/callback helpers).
- Storage plugins (VM then Flutter secure storage adapters).
- Logger plugin parity.
- Integration / gold tests against same sample config files as TS (where practical).
Blocked by / related: #1 (scaffold + CI entry point).
Branch policy: Deliver against f/plugin unless release policy moves default branch.
Goal
Deliver a Dart/Flutter Morph API Client with functional parity to the existing TypeScript implementation (
packages/core,packages/oauth2,packages/browser-storage,packages/logger): same JSON configuration schema, same OAuth2 / multi-context token lifecycle, HTTP pipeline behavior (auth resolution, retry, trace, 401 recovery), and plugin composition (provides/requires,provideAuth/provideStorage, logger chaining).Foundation: Phase 1 scaffold in
packages/dart/morph_core(#1, base branchf/plugin).References:
Scope (parity targets)
@morph/coremorph_core(expand scaffold)MorphClient,MorphRuntime-equivalent,MorphConfigvalidation/interpolation,HostPipeline,HostClient,AuthHandle, errors, HTTP trace events, plugin topo-sort +MorphPluginContext@morph/oauth2morph_oauth2AuthPlugin,TokenLifecycle,TokenVault, OAuth helpers, refresh / exchange / 401 recovery behavior aligned with token-lifecycle.md@morph/browser-storagemorph_secure_storageor VM-firstStorageProvider; Flutter: secure storage / memory paths per platform-adapters.md@morph/loggeronLog/onHttpTracelike TSNon-functional: idiomatic Dart (
snake_casepublic APIs,Future/streams where async), deterministic tests mirroring TS test intent where configs align.Out of scope (unless explicitly expanded)
Acceptance criteria
dart analyzeanddart testpass for every shipped Dart package in CI (extend.github/workflows/dart.ymlor split jobs per package).MorphClient.initwith real config +@morph/oauth2-parity + storage plugin can obtain tokens and execute authenticated host requests (VM or Flutter test harness), behavior consistent with documented TS flows.Suggested sequencing (milestones inside this issue)
MorphConfig/MorphOptions+ validators + interpolate variables (Dart).MorphRuntime,runtime.ts.TokenLifecycle, vault, OAuth URL/callback helpers).Blocked by / related: #1 (scaffold + CI entry point).
Branch policy: Deliver against
f/pluginunless release policy moves default branch.