Skip to content

[refactor] tcloud client.ts is 1,840 lines — split by service group, zero API change #72

Open

Description

@drewstone

The SDK client accumulates every service in one class: core chat/streaming, keys/projects, media (images/video/audio/fine-tuning), search/research/RAG, and now the decision surfaces. Public API is fine (index.ts re-exports); the file is the problem — 1,840 lines where every service PR reads all services.

Cut plan (internal modules, client.ts becomes composition + shared helpers, ZERO public-API change):

  1. src/client-keys.ts — key/project management + the budget-derived mint
  2. src/client-media.ts — images/video/audio/fine-tuning/batch
  3. src/client-decisions.ts — decisions + systemone + key scope (the 0.8.3 surface)
  4. src/client-search.ts — search/research/research/RAG/vector stores
  5. client.ts keeps: config, _doFetch/_request/_fetch/_requestWithResponse, chat/ask/models — and mixes the groups in (trait-style partials or delegation), with index.ts re-exporting exactly today's surface

Gate: the 297-test suite + prepublishOnly cohort check; consumers see nothing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions