Repository navigation
docs(llm): name the two response shapes and export Provider so the API tier renders them - #170
Conversation
…I tier renders them
Type-only and comment-only. No runtime statement changes; tsc emits the same JavaScript.
- `InvokeClient.send` now resolves to a named `InvokeResult` interface and `ProxyFetch` to a
named `ProxyFetchResponse` interface, both exported. typedoc-plugin-markdown renders an
inline object literal inside `Promise<...>` as escaped `\{ ... \}` prose, which the docs
site's MDX brace probe (`apps/docs/tests/figures.test.ts`) rejects; a named interface
renders as a linked declaration. The structural shapes are unchanged, so every existing
fake and the platform `Response` still satisfy them.
- `thinkingFor`'s inline return literal gains a member doc comment, which makes the plugin
emit a fenced type-literal block instead of escaped prose.
- `Provider` is re-exported from `index.ts`: `ModelInfo.provider` references it and TypeDoc
warned that it was referenced but not included.
- Three `{@link}` tags pointing at module-private symbols (`closingTagsFor`, `PROXY_BACKOFF`,
`unwrapDoubleEncoded`) become code spans; TypeDoc cannot link a symbol the package does
not export and warned on each.
Measured with the typedoc CLI over `packages/llm/src/index.ts`: 4 warnings and 3 brace hits
before, 0 and 0 after. Prepares the `@memhtml/llm` slice of the generated API tier, which
follows in a separate docs-only PR stacked on this one.
There was a problem hiding this comment.
🟢 Approval recommended
The changes are confined to exported type names and documentation/link formatting with no runtime logic changes, and the updated types preserve the existing structural shapes.
Pull request overview
This PR makes type-only and doc/comment-only updates in @memhtml/llm so the generated API docs render cleanly (avoiding inline object-literal brace rendering issues) and TypeDoc can include all referenced public types. It keeps runtime behavior unchanged while introducing named, exported interfaces for previously inline structural return types and re-exporting Provider to satisfy TypeDoc’s public-surface requirements.
Changes:
- Replace inline structural return types with named exported interfaces (
InvokeResult,ProxyFetchResponse) to improve TypeDoc rendering/linking. - Re-export
Providerfrompackages/llm/src/index.tssoModelInfo.provider’s type is included in generated docs. - Convert broken
{@link}references to code spans for module-private symbols, and add a doc comment tothinkingFor’s return member to trigger TypeDoc fencing.
File summaries
| File | Description |
|---|---|
| packages/llm/src/structured.ts | Replace a {@link} to a module-private symbol with a code span to avoid broken TypeDoc links. |
| packages/llm/src/proxy.ts | Introduce exported ProxyFetchResponse and update ProxyFetch to return it; adjust docs to avoid private-symbol links. |
| packages/llm/src/models.ts | Add a member doc comment inside thinkingFor’s return type to influence TypeDoc rendering. |
| packages/llm/src/model-client.ts | Replace {@link} to a module-private helper with a code span. |
| packages/llm/src/index.ts | Re-export InvokeResult, ProxyFetchResponse, and Provider (type-only) so the public API slice is fully documentable. |
| packages/llm/src/client.ts | Introduce exported InvokeResult and update InvokeClient.send to return it (shape unchanged). |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Local gate on this head ( Left open for Laith under the maintenance rules: it adds two exported names to |
What
Type-only and comment-only changes in
packages/llm/src, made so the@memhtml/llmslice of the generated API tier can render. No runtime statement changes:tscemits the same JavaScript.InvokeClient.sendnow resolves to a named, exportedInvokeResultinterface andProxyFetchto a named, exportedProxyFetchResponseinterface. The structural shapes are unchanged ({ readonly body?: Uint8Array | undefined }and{ ok, status, text() }), so the recording fakes intests/and the platformResponsesatisfy them as before.thinkingFor's inline return literal gains a member doc comment.Provideris re-exported fromindex.ts, becauseModelInfo.providerreferences it and TypeDoc warned that it was referenced but not included.{@link}tags that pointed at module-private symbols (closingTagsFor,PROXY_BACKOFF,unwrapDoubleEncoded) become code spans.Why
typedoc-plugin-markdown renders an object literal that sits inside a type argument (
Promise<{ ... }>) as escaped\{ ... \}prose.apps/docs/tests/figures.test.tswalks the generated pages with the authored ones and reads that as an MDX expression, so the slice cannot merge while those two signatures are inline. The plugin fences a literal only when it is the direct return type and one of its members carries a doc comment (that is thethinkingForfix); for a type argument the only brace-free rendering is a named declaration, which the page then links.Measured with the typedoc CLI over
packages/llm/src/index.ts: 4 warnings and 3 brace hits before this commit, 0 and 0 after.Boundary
This PR is open-only under the maintenance authority: it adds two exported names to a workspace package's public surface and edits files under
packages/llm/src, which is Laith's side of the line even though the change is type-level. Local gate (mise run check) result and CI are recorded below once they finish. The docs-only slice that depends on this is stacked on top in a second PR.