Documentation
¶
Overview ¶
@facet: authoring/guardrails/adr-status-proposal @facet-role: related
@facet: registry/layout/project-conventions @facet-role: primary
@facet: delivery/distribution/core-pin @facet-role: primary
@facet: navigation/documentation/guided-documentation @facet-role: related
@facet: navigation/interfaces/mcp-server @facet-role: related
@facet: registry/layout/source-views @facet-role: related
@facet: authoring/session/hook-dispatch @facet-role: primary @facet: authoring/session/read-context @facet-role: related @facet: authoring/guardrails/write-validation @facet-role: related
@facet: authoring/guardrails/commit-gate @facet-role: related
@facet: authoring/guardrails/large-record-read @facet-role: primary
@facet: navigation/interfaces/language-server @facet-role: primary
Plugin tools, offered to any MCP client through the host's own MCP server, `facet mcp`.
@facet: registry/layout/source-views @facet-role: related
@facet: navigation/interfaces/product-services @facet-role: primary
@facet: navigation/interfaces/product-services @facet-role: primary
@facet: delivery/distribution/product-runtime @facet-role: primary
@facet: navigation/interfaces/product-services @facet-role: primary
@facet: navigation/interfaces/product-services @facet-role: primary
@facet: registry/layout/multi-registry @facet-role: related
Package cli builds the FACET command surface and links no application of its own. An application that embeds this command tree selects optional commands, reader assets and the version.
@facet: registry/integrity/record-validation @facet-role: primary
@facet: delivery/distribution/setup-status @facet-role: related
@facet: delivery/distribution/build-identity @facet-role: primary
Index ¶
- Constants
- func AllRegistriesForCommand(cmd *cobra.Command) ([]facet.Registry, error)
- func ConfigForCommand(cmd *cobra.Command) (*facet.Config, error)
- func MCPToolNames(ctx context.Context, set facet.RegistrySet, pluginsDir, version string) ([]string, error)
- func NewCommand(opts Options) *cobra.Command
- func PluginsDir() string
- func ProductToolName(id, tool string) string
- func RegisterMCPTools(set MCPToolset)
- func RegisterProduct(binding ProductBinding)
- func RegisterSetupCheck(check SetupCheck)
- func RegistrySetForCommand(cmd *cobra.Command) facet.RegistrySet
- func ResolveRoot(cmd *cobra.Command) string
- func Run(root *cobra.Command) int
- type MCPToolset
- type Options
- type ProductBinding
- type SetupCheck
- type SetupResult
Constants ¶
const ( SetupOK = string(stateOK) SetupRed = string(stateRed) SetupUnmeasured = string(stateUnmeasured) SetupNotApplicable = string(stateNotApplicable) )
The four states a setup row can be in.
Variables ¶
This section is empty.
Functions ¶
func AllRegistriesForCommand ¶
AllRegistriesForCommand is every registry of this invocation's configuration, for a command a build adds to the tree.
func ConfigForCommand ¶
ConfigForCommand shares the invocation source view with application commands.
func MCPToolNames ¶
func MCPToolNames(ctx context.Context, set facet.RegistrySet, pluginsDir, version string) ([]string, error)
MCPToolNames asks the server `facet mcp` serves which tools it advertises, over a real in-memory MCP session, and returns their names in sorted order.
@facet: navigation/interfaces/mcp-server @facet-role: related
func NewCommand ¶
NewCommand builds the Core CLI, with optional application commands and reader assets.
func PluginsDir ¶
func PluginsDir() string
PluginsDir resolves shared plugin storage for every host command (CLI and MCP). An explicit override takes precedence over XDG_DATA_HOME and the user's .local/share directory. Storage is not resolved relative to the inspected repository: plugin manifests and grants belong to the host's user data. Configured paths are accepted unchanged. An unavailable home yields no plugin directory rather than a guessed location.
func ProductToolName ¶
ProductToolName is the MCP name a product's tool is served under: the product namespace, unless the product's binding keeps the name for compatibility.
func RegisterMCPTools ¶
func RegisterMCPTools(set MCPToolset)
RegisterMCPTools adds a product's tools to every MCP server this build starts. Builds register from init, so the tools are in place before the command tree is built. It panics on a toolset without Add.
func RegisterProduct ¶
func RegisterProduct(binding ProductBinding)
RegisterProduct adds a binding. Builds register from init, so bindings are in place before the command tree is built. It panics on an empty or repeated id: two bindings for one product would make its placeholder and its opt-in answer twice.
func RegisterSetupCheck ¶
func RegisterSetupCheck(check SetupCheck)
RegisterSetupCheck adds a product's row. Builds register from init. It panics on an empty id, a missing check or a repeated id.
func RegistrySetForCommand ¶
RegistrySetForCommand returns the same frozen source selection as Core commands.
func ResolveRoot ¶
ResolveRoot finds the repository root the same way the shell tooling does.
Types ¶
type MCPToolset ¶
type MCPToolset struct {
// Add registers the tools on a server for the given registries.
Add func(server *mcp.Server, set facet.RegistrySet)
// Help is a paragraph appended to 'facet mcp --help'. Empty means none.
Help string
}
MCPToolset is the set of MCP tools a linked product adds to 'facet mcp'.
type Options ¶
type Options struct {
// Version is the complete Core build stamp. Empty derives a development identity;
// release stamps retain their SemVer prerelease and build metadata.
Version string
// Identity overrides Version when an application supplies build metadata.
Identity *release.Identity
// ReaderAssets selects the application's embedded reader. Nil produces
// the Atlas cache status in the setup report.
ReaderAssets fs.FS
// Commands are fresh application-owned command instances, such as a
// product command `ui`. A command becomes part of this tree and must not
// be reused elsewhere.
Commands []*cobra.Command
}
Options selects the version and the optional additions an embedding application makes to a command tree. Nil ReaderAssets and no extra Commands produce the independent Core CLI.
type ProductBinding ¶
type ProductBinding struct {
// ID is the manifest id of the product the binding describes.
ID string
// Command is the top-level command the product contributes. While the
// product is not installed the command stays visible and says how to
// install it, instead of being an unknown command. Empty means none.
Command string
// CompatibilityTools are tool names the product serves over MCP that keep
// their unprefixed name instead of '<id>__<name>'.
CompatibilityTools []string
// DriftHelp is a paragraph appended to 'facet drift --help'.
DriftHelp string
// Requested reports whether the project explicitly asked for the named
// service from this product. config loads the project configuration once,
// on demand; an error from it is reported as a configuration failure.
Requested func(service string, config func() (*facet.Config, error)) (bool, error)
// Missing is the error when Requested is true and no installed product
// with this id provides the service.
Missing string
}
ProductBinding is what a build knows about one optional product before, or without, its installation. Core holds no product names of its own beyond the bindings registered into it: a build that links a product's binding keeps that product's placeholder command, opt-in check and compatibility names; a build that does not link it has none of them, and an installed package of that product still works through its manifest alone.
type SetupCheck ¶
type SetupCheck struct {
ID string
Check func(reg facet.Registry) SetupResult
}
SetupCheck is a row a product adds to the setup report. Check answers for one registry; with several registries the worst state wins, as for Core's own registry rows.
type SetupResult ¶
type SetupResult struct {
// State is SetupOK, SetupRed, SetupUnmeasured or SetupNotApplicable.
State string
Finding string
Evidence string
}
SetupResult is one registry's answer to a product's setup question.
Source Files
¶
- adr.go
- atlas_ui.go
- backing_cmd.go
- calibrate.go
- clireference.go
- conventions.go
- corepin.go
- defects.go
- deviations.go
- docs_cmd.go
- docs_site.go
- drift.go
- errors.go
- extensions.go
- filter.go
- filter_source_view.go
- glossary_mcp.go
- hook.go
- hook_codex.go
- hook_commitgate.go
- hook_commitgate_sourceview.go
- hook_readcontext.go
- hook_readgate.go
- hook_spec_drift.go
- index.go
- init.go
- lint_cmd.go
- lsp.go
- mcp.go
- mcp_plugins.go
- mcp_rag.go
- mcp_source_view.go
- mcp_tools.go
- plugin.go
- plugin_paths.go
- product_bindings.go
- product_mcp.go
- product_plugin.go
- product_reports.go
- product_services.go
- rag.go
- registries.go
- root.go
- serve.go
- setup.go
- setup_link.go
- setup_precommit.go
- setup_products.go
- setup_status.go
- snapshot.go
- spec_cmd.go
- spec_drift_cmd.go
- spec_update_cmd.go
- split.go
- test.go
- version.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package scaffold writes FACET into a project that does not have it: the record layout, the JSON schemas, the specification, the lint suite with its pinned dispatcher, an empty scan filter and the CI workflow.
|
Package scaffold writes FACET into a project that does not have it: the record layout, the JSON schemas, the specification, the lint suite with its pinned dispatcher, an empty scan filter and the CI workflow. |