Documentation
¶
Overview ¶
Package core provides core CLI commands (doctor, completion, alias, enable, status, plugin, mcp, marketplace, trust).
Index ¶
- Variables
- func CheckKillSwitch(switches map[string]bool, model string) bool
- func CheckQuota(quotas map[string]int, model string, used int) bool
- func FormatGatewayStatus(config GatewayConfig) string
- func GetTokmanSourceDir() string
- func ResolveModel(aliases map[string]string, fallbacks map[string][]string, model string) string
- type GatewayConfig
- type MCPBundleResponse
- type MCPReadRequest
- type MCPReadResponse
- type MCPRequest
- type MCPResponse
Constants ¶
This section is empty.
Variables ¶
var CommunityFilters = map[string]string{
"jest": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/jest.toml",
"vitest": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/vitest.toml",
"playwright": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/playwright.toml",
"cypress": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/cypress.toml",
"mocha": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/mocha.toml",
"eslint": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/eslint.toml",
"biome": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/biome.toml",
"swc": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/swc.toml",
"webpack": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/webpack.toml",
"vite": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/vite.toml",
"rollup": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/rollup.toml",
"trivy": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/trivy.toml",
"snyk": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/snyk.toml",
"opentofu": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/opentofu.toml",
"pulumi": "https://raw.githubusercontent.com/GrayCodeAI/tokman/main/filters/pulumi.toml",
}
CommunityFilters is a registry of known community filters.
Functions ¶
func CheckKillSwitch ¶
CheckKillSwitch checks if a model is kill-switched.
func CheckQuota ¶
CheckQuota checks if a model has exceeded its quota.
func FormatGatewayStatus ¶
func FormatGatewayStatus(config GatewayConfig) string
FormatGatewayStatus returns a human-readable status string.
func GetTokmanSourceDir ¶
func GetTokmanSourceDir() string
GetTokmanSourceDir returns the TokMan source directory for locating built-in filters. Returns empty string for installed binaries (filters loaded from embedded filesystem).
Types ¶
type GatewayConfig ¶
type GatewayConfig struct {
KillSwitches map[string]bool
Quotas map[string]int
ModelAliases map[string]string
Fallbacks map[string][]string
}
GatewayConfig holds gateway configuration.
func DefaultGatewayConfig ¶
func DefaultGatewayConfig() GatewayConfig
DefaultGatewayConfig returns default gateway configuration.
type MCPBundleResponse ¶
type MCPBundleResponse struct {
Path string `json:"path"`
RelatedFiles []string `json:"related_files"`
Content string `json:"content"`
OriginalTokens int `json:"original_tokens"`
FinalTokens int `json:"final_tokens"`
SavedTokens int `json:"saved_tokens"`
ReductionPct float64 `json:"reduction_percent"`
}
MCPBundleResponse returns a graph-selected context bundle.
type MCPReadRequest ¶
type MCPReadRequest struct {
Path string `json:"path"`
Mode string `json:"mode,omitempty"`
Level string `json:"level,omitempty"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
MaxLines int `json:"max_lines,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
LineNumbers bool `json:"line_numbers,omitempty"`
SaveSnapshot bool `json:"save_snapshot,omitempty"`
RelatedFiles int `json:"related_files,omitempty"`
}
MCPReadRequest is the request body for /read.
type MCPReadResponse ¶
type MCPReadResponse struct {
Path string `json:"path"`
Mode string `json:"mode"`
Content string `json:"content"`
OriginalTokens int `json:"original_tokens"`
FinalTokens int `json:"final_tokens"`
SavedTokens int `json:"saved_tokens"`
ReductionPct float64 `json:"reduction_percent"`
}
MCPReadResponse is the response body for /read.
type MCPRequest ¶
type MCPRequest struct {
Text string `json:"text"`
Command string `json:"command,omitempty"`
Budget int `json:"budget,omitempty"`
Mode string `json:"mode,omitempty"`
Query string `json:"query,omitempty"`
}
MCPRequest is the request body for /compress.
type MCPResponse ¶
type MCPResponse struct {
Compressed string `json:"compressed"`
OriginalTokens int `json:"original_tokens"`
CompressedTokens int `json:"compressed_tokens"`
SavedTokens int `json:"saved_tokens"`
ReductionPct float64 `json:"reduction_percent"`
Hash string `json:"hash,omitempty"`
}
MCPResponse is the response body.