Expand description
Package discovery over the standard library, plus the prelude built-in
catalog (builtins / builtin_docs).
In MVP the resolvable set is the stdlib — there is no registry yet. Each
module’s exported declarations render to .d.subm-style text directly from
its PackageDeclaration (the public symbol model). Shared by the MCP
packages.* / builtins.docs tools, the server’s REST surface, and the
submilli docs / search / builtins CLI commands.
Structs§
- Builtins
- The language built-ins always in scope without an
import: headline prelude types (Array,Map,String, …) and the namespace globals (Math,Temporal, and theJSONcompiler intrinsic). Backs the{builtins}prompt placeholder and thebuiltins.docstool. - Catalog
- A bounded available-package listing.
- Catalog
Entry - A summary-only entry in the “here is what exists” listing a zero-hit discovery response carries. Never declarations — this is a pointer, not a payload.
- Module
Doc - A module’s full documentation: its one-line description and
.d.submdeclarations. - Module
Summary - A search result — name + one-line description.
Enums§
- Builtin
Lookup - Why resolving a built-in name succeeded or failed. The distinction matters to callers: an unresolvable member can name the members that do exist, which turns a dead end into a one-edit repair.
- Resolution
- How a discovery surface should answer one name, once the stdlib and built-in catalogs have both been consulted.
Constants§
- CATALOG_
LIMIT - Upper bound on listed entries; the remainder is reported as a count.
- SOURCE_
STDLIB - Source tag for the stdlib modules this crate can see.
Functions§
- builtin_
docs .d.submdeclarations for a single built-in (Array,Temporal,JSON, …), orNoneifnameisn’t one. Accepts a dotted member path (Temporal.Instant) as well as a plain name — seebuiltin_lookup.- builtin_
lookup - Resolve a built-in name, which may be a dotted path into a namespace
(
Temporal.Instant,Temporal.Now.instant,Math.max,Array.isArray). - builtin_
no_ import_ note - Prose to accompany a built-in served through a package-shaped surface. A
sourcetag is a machine field; an agent reading the message still has to be told not to write animport. - builtins
- The catalog of built-ins an agent can reference — see
Builtins. - builtins_
pointer - Where the language globals live. A zero-hit package search says this rather
than folding built-ins into its results, which would teach an agent to
write an
importfor a global. - catalog
- The stdlib catalog plus whatever
extrasources the caller can see, capped. - catalog_
filtered - Filter before applying the catalog limit so omitted counts reflect visibility.
- docs
- Documentation for a stdlib module, or
Noneifnameisn’t one (callers handle@mcp/*and unknown names). Every module resolves, opt-in ones such assubmilli:gitincluded; what a caller’s scope shows is its own decision. - package_
correcting_ message - A package name asked of a built-ins surface. The forgiveness here is
asymmetric on purpose: a built-in asked of
packages.docsis simply served, because it needs noimport, while a package needs animportthe caller still has to write — so this names the call to make rather than hiding that step behind the declarations. - render_
declarations - Render a module’s exports as
.d.subm-style declarations. Public so an embedder can render dynamically-built packages (e.g.@mcp/<server>) the same way the stdlib docs render. - render_
lib_ submilli_ d_ ts - Render editor-facing TypeScript ambient declarations for always-in-scope built-ins.
- render_
packages_ d_ ts - Render editor-facing TypeScript declarations for
packages, onedeclare moduleblock each, in the order given. - render_
stdlib_ d_ ts - Render editor-facing TypeScript declarations for every stdlib module a
package project can import. Each package gets a separate
declare moduleblock.submilli:testis included even though onlybuild testmakes it importable, andsubmilli:securityeven though only packages may import it — the editor should complete both;build checkremains the gate against importing them elsewhere. - resolve
- Try
nameas a stdlib module, then as a built-in. Every discovery surface runs this same ladder so MCP, REST, and the CLI reach the same answer. - search
- Modules whose name, description, or an exported symbol contains
query(case-insensitive). An empty query lists every module. - suggest
- suggest_
filtered - Suggest only names visible to the caller, retaining built-in corrections.
- unknown_
member_ message - Name the head, then list what it actually has, so the repair is one edit.