Documentation
¶
Overview ¶
Package scriptdocs embeds the documentation an AI assistant reads to write scripts for the run_script tool: an OKF 0.2 bundle (okf/knot-scripting) holding the guide (writing-scripts.md) and one page per knot.* library a script may import (libraries/<module>.md). The script_docs MCP tool and docs() inside a script serve it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NotForScripts = map[string]string{
"knot.ai": "calls the AI model",
"knot.mcp": "calls other MCP tools",
"knot.event": "event sink accessors, and imports requests",
"knot.secret": "reads secret values",
"knot.token": "manages API tokens",
"knot.mcp_server": "MCP server configurations hold credentials, and listing tools reaches the remote server",
}
NotForScripts are the knot.* modules AI-written scripts may not import, and so have no page in the bundle. Keep in step with aiScriptLibraries in internal/service/ai_script.go; the drift test checks every module under internal/scriptling/lib/knot is documented or listed here.
Functions ¶
func Guide ¶
func Guide() string
Guide returns the guide to writing scripts, followed by the list of libraries with their descriptions.
func Library ¶
Library returns the page of one library, named with or without the "knot." prefix. An unknown name is an error listing the valid names.
func Lookup ¶
Lookup serves the script_docs tool: spec is empty (the guide) or one or more comma-separated names, each a library ("space", "knot.pool") or "guide". The pages are returned in the order named, separated by rules.
func ModuleName ¶
ModuleName normalises a library name to its module ("pool", "knot.pool" and " Knot.Pool " are all "knot.pool"); "" for a blank name.
Types ¶
type LibraryInfo ¶
type LibraryInfo struct {
Name string // full module name, e.g. "knot.space"
Description string // the page's frontmatter description
}
LibraryInfo names one documented library and what it is for.
func Libraries ¶
func Libraries() []LibraryInfo
Libraries lists the documented libraries, sorted by name, with the description from each page's frontmatter.