You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
extension types: derive tools from RegisterExtension, and stop hand-writing the augmentation #238
RegisterExtension reads the name and the config schema off the builder. It also already captures the extension's tools type in the same conditional — and discards it, as an underscore-prefixed inferred parameter. Projecting it instead is the whole change: an extension's tools become known to the typed client, so calling one is checked and autocompleted rather than a missing property.
The second thing to fix is a duplicate. A different registry interface is augmented by hand elsewhere in the tree, restating a shape the builder already knows. Two augmentation targets exist and only one of them derives. Converge on the derived one; do not add a third.
Independent of the registry work — the pieces this needs are already shipped — so it can start immediately and land in parallel.
Acceptance criteria
RegisterExtension projects an extension's tools and context alongside its config, all derived from the builder
An extension that declares itself in one derived line gets typed, autocompleted tool calls with no cast
No declaration restates a schema or a signature the builder already carries
The hand-written augmentation in the widget's own extension is replaced by the derived form
The two augmentation targets become one, or the remaining split is documented with a reason
A type test asserts all of the above, in the style of the existing config registry type test
Library references — read the resolved source under node_modules/.pnpm/, not the docs alone. Earlier drafts of the design took doc statements at face value and were wrong three times; every claim that depends on library behaviour now carries a version and a path. The canonical table is in the spec under "Libraries: the exact versions, and where to read them". Versions assume the 0.43-line upgrade in #239.
For this ticket the reference is in-repo, not a third party: packages/extension/src/define-extension.ts for RegisterExtension and the ExtensionBuilder type parameters it already captures, and packages/extension/test/config-registry.test-d.ts for the derived-augmentation pattern and the type-test style to copy. The type-generation limits that make schema pre-resolution necessary are in @tanstack/ai-code-mode@0.3.9src/type-generator/json-schema-to-ts.ts.
Activity
omridevk commentedon Aug 4, 2026
Library references — read the resolved source under
node_modules/.pnpm/, not the docs alone. Earlier drafts of the design took doc statements at face value and were wrong three times; every claim that depends on library behaviour now carries a version and a path. The canonical table is in the spec under "Libraries: the exact versions, and where to read them". Versions assume the 0.43-line upgrade in #239.For this ticket the reference is in-repo, not a third party:
packages/extension/src/define-extension.tsforRegisterExtensionand theExtensionBuildertype parameters it already captures, andpackages/extension/test/config-registry.test-d.tsfor the derived-augmentation pattern and the type-test style to copy. The type-generation limits that make schema pre-resolution necessary are in@tanstack/ai-code-mode@0.3.9src/type-generator/json-schema-to-ts.ts.