Repository navigation
docs: add Custom Sources concept guide - #354
Merged
Merged
Conversation
Sources (registerSource, the createAskable*Source factories, useAskableSource) are a major feature with no conceptual page — only scattered per-framework hook mentions. Documents the source model: registration + handle, the AskableContextSource shape, resolve modes (summary/state/visible/selected/all), async serialization (toPromptContextAsync/toContextPacketAsync with sources), the prebuilt factory/hook table, createAskableCollectionSource, sanitization, and SSR behavior. Wires it into the Concepts sidebar.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a dedicated Custom Sources concept guide. Sources —
registerSource, the 30+createAskable*Sourcefactories, anduseAskableSource— are a major capability with no conceptual page; they were only mentioned piecemeal inside the per-framework hook lists.What's included
site/docs/guide/sources.md:ctx.registerSource(id, source)+ the handle (notifyChanged/unregister)AskableContextSourceshape (kind/describe/getState/resolve/modes/sanitize)summary/state/visible/selected/all/ custom) and the resolve-request budgetstoPromptContextAsync/toContextPacketAsync({ sources }),resolveSource,listSources,subscribeAsynccreateAskableCollectionSourceexampleuseAskableSourceframework-hook usage, sanitization, and SSR behaviorNotes
packages/core/src/types.tsandsources.ts. Docs-only; no code changes.Test plan
vitepress buildclean (no dead links)🤖 Generated with Claude Code
Generated by Claude Code