Documentation
¶
Overview ¶
Package library keeps what every agent should know, once: the instructions each reads before a conversation, the MCP servers it can call and the skills it can load. magpie writes them into each agent's own files in that agent's own format, and takes back only what it wrote — whatever else is in those files stays as it was.
Index ¶
- Constants
- Variables
- func AsleepIn(id string) string
- func BackupDir() string
- func BiliConfigFile() string
- func BorrowNote(id string) string
- func BorrowedOn() map[string]bool
- func Changed() time.Time
- func CheckChannel(v *RTKView)
- func CheckServers(ctx context.Context, names []string, fresh bool) (map[string]ServerHealth, error)
- func Dir() string
- func GitHubToken() (token, from string)
- func Holds(s *Setup) bool
- func HubLink(app string) (string, error)
- func Icon(u string) ([]byte, string, error)
- func IgnoreNewSkills(ids []string) error
- func InUse() (int, error)
- func KeepLinked(ctx context.Context, interval time.Duration)
- func KeepSkillsCurrent(ctx context.Context)
- func KeyMCPServers() []gateway.HubServer
- func MemoryInInstructions() (bool, []string, error)
- func PluginServers() map[string]PluginServer
- func ProjectAt(dir string) (string, error)
- func ProjectHooksFile(agent string) string
- func ProjectInstrFile(agentID string) string
- func ProjectMCPFile(agent string) string
- func ProjectNoSSE(agent string) bool
- func ProjectOffAgents() []string
- func ProjectPath(dir string) (string, error)
- func ProjectSkillOffAgents() []string
- func ProjectSkillsDir(agent string) string
- func ProjectSubagentsDir(agentID string) string
- func PublicServers() []string
- func RTKLatest() string
- func RTKNewer(a, b string) bool
- func RTKTakes(q string) (string, error)
- func RegroupSkills() (int, error)
- func RemoteMCPOn() map[string]bool
- func RemoveSignIn(name, id string) error
- func ServeRun(w http.ResponseWriter, r *http.Request, name string)
- func SharedSkills() ([]string, error)
- func SignInServer(ctx context.Context, name string) (mcpauth.State, error)
- func SignInServerAccount(ctx context.Context, name, label string) (mcpauth.State, error)
- func SignOutServer(name string) error
- func SkillPath(name string) string
- func SkillsAbout(ids []string) map[string]string
- func Takes(q, kind string) (string, error)
- func UseRemoteLibraries(ctx context.Context)
- func UseSignIn(name, id string) error
- type Account
- type AgentInstructions
- type AgentView
- type Applied
- type BiliAgent
- type BiliChange
- type BiliSaved
- type BiliSettings
- type BiliView
- type BorrowResult
- type Borrowed
- type Bundle
- type Candidate
- type CarriedPlugin
- type CarriedSkill
- type ClaudePluginView
- type ClaudePlugins
- type Command
- type CommandAgentView
- type CommandCandidate
- type CommandProbe
- type CommandView
- type CommandsImported
- type Custom
- type EditedError
- type EnvAgentView
- type EnvEntry
- type EnvVar
- type EnvView
- type ExportHook
- type ExportNeeds
- type ExportSubagent
- type Found
- type FoundHook
- type FoundSkill
- type GoneError
- type HomeEntry
- type Hook
- type HookAgentView
- type HookEntry
- type HookView
- type Input
- type InstrFile
- type InstrSet
- type Instructions
- type InstructionsChange
- type InstructionsView
- type LeftOut
- type Library
- type Limited
- type MarketServer
- type MarketSkill
- type NativePart
- type NativePlugin
- type NewSkill
- type OAuthApp
- type OwnResource
- type PiCopied
- type PiExt
- type PiExtensions
- type PiHere
- type PiInstalled
- type PiMarketPackage
- type PiPackage
- type PiRec
- type Plugin
- type PluginCandidate
- type PluginLeft
- type PluginProbe
- type PluginServer
- type PluginView
- type Probe
- type Problem
- type Project
- type ProjectApplied
- type ProjectExport
- type ProjectInstr
- type ProjectPiView
- type ProjectView
- type RTKAgent
- type RTKDay
- type RTKDistro
- type RTKGain
- type RTKView
- type Result
- func AddNewSkills(ids []string) (*Result, error)
- func AddProject(dir string) (*Result, error)
- func AddServerAccount(name, label string, headers map[string]string) (*Result, error)
- func AutoUpdateTick(now time.Time) (*Result, error)
- func CommandAgentsSet(name string, agents []string) (*Result, error)
- func CreateSkill(name, description string, agents []string) (*Result, error)
- func EnvAgents(name string, agents []string) (*Result, error)
- func EveryServerAgents(agents []string, on bool) (*Result, error)
- func EverySkillAgents(agents []string, on bool) (*Result, error)
- func GroupSkills(old, name string, names []string) (*Result, error)
- func HandBackSkill(name string) (*Result, error)
- func HandOverSkills(names []string) (*Result, error)
- func HookAgents(name string, agents []string) (*Result, error)
- func ImportCommands(paths []string) (*Result, error)
- func ImportHooks(keys []string) (*Result, error)
- func ImportInstructions(id string) (*Result, error)
- func ImportServer(name string) (*Result, error)
- func ImportSkill(name string) (*Result, error)
- func ImportSkills(names []string) (*Result, error)
- func ImportSubagents(input string, paths, agents []string) (*Result, error)
- func InstallMarketSkill(source, id string, agents []string) (*Result, error)
- func InstallPlugins(input string, names, agents []string) (*Result, error)
- func InstallServer(id string, values map[string]string, agents []string) (*Result, error)
- func InstallSkills(input string, paths, agents []string) (*Result, error)
- func KeepAgentSkill(name, agentID string) (*Result, error)
- func KeepAgentSkills(names []string, agentID string) (*Result, error)
- func MemorySkill(id string) (*Result, string, error)
- func PluginAgents(name string, agents []string) (*Result, error)
- func PluginOn(name string, on bool) (*Result, error)
- func PluginServerOn(pluginName string, on bool) (*Result, error)
- func ProjectClaudePlugin(dir, id string, on bool) (*Result, error)
- func ProjectCopy(dir string, copy bool) (*Result, error)
- func ProjectHooks(dir string, names, agents []string) (*Result, error)
- func ProjectInstructions(dir string, c ProjectInstr) (*Result, error)
- func ProjectPi(dir, source, state string) (*Result, error)
- func ProjectPiAdopt(dir, source string) (*Result, error)
- func ProjectPlugin(dir, name string, agents []string) (*Result, error)
- func ProjectServer(dir, name string, agents []string) (*Result, error)
- func ProjectServerOff(dir, name string, agents []string) (*Result, error)
- func ProjectSkill(dir, name string, agents []string) (*Result, error)
- func ProjectSkills(dir string, names, agents []string) (*Result, error)
- func ProjectSkillsOff(dir string, names, agents []string) (*Result, error)
- func ProjectSubagents(dir string, names, agents []string) (*Result, error)
- func PublishMemory(due bool) (*Result, error)
- func Put(b *Bundle) (*Result, error)
- func RemoveCommands(names []string) (*Result, error)
- func RemoveEnv(name string) (*Result, error)
- func RemoveFoundHooks(keys []string) (*Result, error)
- func RemoveFoundServer(name string) (*Result, error)
- func RemoveFoundSkill(name string) (*Result, error)
- func RemoveFoundSkills(names []string) (*Result, error)
- func RemoveFoundSkillsHow(names []string, keep bool) (*Result, error)
- func RemoveGoneSkills(names []string) (*Result, error)
- func RemoveGoneSkillsHow(names []string, keep bool) (*Result, error)
- func RemoveHooks(names []string) (*Result, error)
- func RemovePlugin(name string) (*Result, error)
- func RemoveProject(dir string, keep bool) (*Result, error)
- func RemoveRules(names []string) (*Result, error)
- func RemoveServer(name string) (*Result, error)
- func RemoveServerAccount(name, id string) (*Result, error)
- func RemoveServers(names []string) (*Result, error)
- func RemoveSkill(name string) (*Result, error)
- func RemoveSkills(names []string) (*Result, error)
- func RemoveSkillsHow(names []string, keep bool) (*Result, error)
- func RemoveSubagents(names []string) (*Result, error)
- func Restore(s *Setup) (*Result, error)
- func RuleAgentsSet(name string, agents []string) (*Result, error)
- func SaveCommand(old string, c Command) (*Result, error)
- func SaveEnv(old string, e EnvVar) (*Result, error)
- func SaveHook(old string, h Hook) (*Result, error)
- func SaveInstructions(c InstructionsChange) (*Result, error)
- func SaveRule(old string, r Rule) (*Result, error)
- func SaveServer(old string, s Server) (*Result, error)
- func SaveSkillFile(name, file, text, was string) (*Result, error)
- func SaveSubagent(old string, s Subagent) (*Result, error)
- func ServerAgents(name string, agents []string) (*Result, error)
- func ServerHere(name string, cmd []string) (*Result, error)
- func ServerHub(name string, direct bool) (*Result, error)
- func ServerLocal(name string, on bool) (*Result, error)
- func ServerOn(name string, on bool) (*Result, error)
- func ServerTools(name string, off []string) (*Result, error)
- func SetAutoUpdateSkills(on bool) (*Result, error)
- func SetBorrow(id string, on bool) (*Result, error)
- func SetMCPHub(on bool) (*Result, error)
- func SetMemoryInInstructions(on bool) (*Result, error)
- func SetRemoteMCP(id string, on bool) (*Result, error)
- func SetServer(name string, o ServerOpts) (*Result, error)
- func SetSkillHow(agent, how string) (*Result, error)
- func SetSkillRouter(on bool) (*Result, error)
- func SetSkillsWhere(where string) (*Result, error)
- func SkillAgents(name string, agents []string) (*Result, error)
- func SkillHere(name string, on bool) (*Result, error)
- func SkillNote(name, note string) (*Result, error)
- func SkillRouterHow(name string, direct bool) (*Result, error)
- func SomeHooksAgents(names, agents []string, on bool) (*Result, error)
- func SomeServersAgents(names, agents []string, on bool) (*Result, error)
- func SomeSkillsAgents(names, agents []string, on bool) (*Result, error)
- func SubagentAgentsSet(name string, agents []string) (*Result, error)
- func Sync() (*Result, error)
- func SyncLinked() (*Result, error)
- func UngroupSkills(name string, names []string) (*Result, error)
- func UpdatePlugin(name string) (*Result, error)
- func UpdateSkill(name string, replace bool) (*Result, error)
- func UpdateSkills() (*Result, error)
- func UpdateSomeSkills(names []string) (*Result, error)
- func UseLibrarySkill(name, agentID string) (*Result, error)
- func UseLibrarySkills(names []string, agentID string) (*Result, error)
- func UseServerAccount(name, id string) (*Result, error)
- func Woken() (*Result, error)
- type Rule
- type RuleAgentView
- type RuleView
- type SearchError
- type Server
- type ServerHealth
- type ServerOpts
- type ServerView
- type ServersConfig
- type SetView
- type Setup
- type SetupInstructions
- type Skill
- type SkillCheck
- type SkillFile
- type SkillGroup
- type SkillHome
- type SkillView
- type Source
- type Start
- type Subagent
- type SubagentAgentView
- type SubagentCandidate
- type SubagentFile
- type SubagentLeft
- type SubagentProbe
- type SubagentView
- type SubagentsImported
- type TakenFile
- type Target
- type Tool
- type View
Constants ¶
const ( HowLink = "link" HowCopy = "copy" )
The ways an agent can be given its skills.
const ( SkillsInAgents = "agents" // each agent's own folder, as ticked )
The places SetSkillsWhere takes.
const BiliGrowthDefault = 50000
BiliGrowthDefault is bili's nudge step when none is set.
const BiliURL = "https://github.com/ranxianglei/billion-context"
BiliURL is billion-context's page.
const HubDirect = "direct"
HubDirect is Server.Hub for a server the hub leaves out: each agent given it keeps its own entry, as with the hub off (#4382).
const HubEntry = "magpie"
HubEntry is the name of the one entry the hub is given to an agent by.
const ProjectExportKind = "magpie-project"
ProjectExportKind is what an export file says it is.
const RTKURL = "https://www.rtk-ai.app"
RTKURL is where rtk is installed from.
const RouterSkill = "magpie-skills"
RouterSkill is the name of the one skill the router gives an agent.
const RunPath = "/mcp/run/"
RunPath is where the gateway serves a server magpie runs for Codex.
const SkillCode = "code.js"
SkillCode is the file a skill's code is in.
const SkillDirect = "direct"
SkillDirect is Skill.Router for a skill the router leaves out: each agent given it keeps its own link, as with the router off.
Variables ¶
var CommandAgents = []string{"claude", "codex", "opencode", "pi", "gemini", "qwen", "droid"}
CommandAgents are the agents a slash command can be given, in the order the page lists them.
var GitHubTokenEnv = ghtoken.Env
GitHubTokenEnv names the environment variables a token is taken from when Settings has none, in the order they are looked at.
var HookEvents = []string{"turn-end", "after-tool", "before-tool", "prompt", "session-start"}
HookEvents are the portable events, in the order the page offers them.
var HookStarts = []string{"startup", "resume", "clear", "compact", "fork"}
HookStarts are the starts a portable session-start hook can be narrowed to (#5604, NEKO-CwC), in Claude Code's words for them (its SessionStart source): a new session, one resumed, one after /clear, one after its context was compacted, and a forked one.
var HookTools = []string{"shell", "edit"}
HookTools are the kinds of tools a portable tool event can be narrowed to.
var NoAgentsShown func() bool
NoAgentsShown says the page shows no agent to tick a skill or the shared prompts for (the gui package's gateway mode: a container, a NAS, magpie web --gateway). Unset, a magpie with no agent here has none.
var RuleAgents = []string{"claude", "cline", "kiro-cli"}
RuleAgents are the agents a rule can be given, in the order the page lists them.
var SubagentAgents = []string{"claude", "codex", "opencode", "gemini", "qwen", "droid", "grok", "cursor", "copilot"}
SubagentAgents are the agents a subagent can be given, in the order the page lists them.
Functions ¶
func AsleepIn ¶ added in v0.1.2043
AsleepIn is the WSL distro, not running now, of the agent with id; "" for any other. A change the library makes for it is written there the next time it runs.
func BackupDir ¶
func BackupDir() string
BackupDir is where a file is copied before magpie first changes it in a change: one folder a change, named by when, a folder an agent in it.
func BiliConfigFile ¶
func BiliConfigFile() string
BiliConfigFile is billion-context.json where bili itself looks for it (src/paths.ts): BILI_CONFIG_FILE, else billion-context/ under XDG_CONFIG_HOME, else under ~/.config — on Windows too, where bili's homedir() is %USERPROFILE%.
func BorrowNote ¶
BorrowNote is what the last read of the Remote magpie id's Library said went wrong, and the names it left as the user's.
func BorrowedOn ¶
BorrowedOn are the Remote magpies (provider ids) whose Library is used here. Nil when the library can't be read.
func Changed ¶ added in v0.1.182
Changed is when the library was last changed: library.json, or a file of its own (links not followed), or billion-context.json or Claude Code's plugin records, which a sync carries with it.
func CheckChannel ¶ added in v0.1.1224
func CheckChannel(v *RTKView)
CheckChannel asks the package manager upgrade runs what rtk it has, and keeps the answer for six hours (see rtkChannelLatest), so that the next read of the tab draws with it without waiting. It is asked in the background, after the tab has gone out: it is a question for the package manager, which takes seconds, and it answers nothing anyone needs unless a release newer than the one installed is out (#1025).
func CheckServers ¶ added in v0.1.794
CheckServers checks the library's servers called names (every one when there are none). One checked already this session, as it is now, isn't started again unless fresh.
func Dir ¶
func Dir() string
Dir is where the library's own files are: the instructions and the skills.
func GitHubToken ¶ added in v0.1.662
func GitHubToken() (token, from string)
GitHubToken is the token requests to GitHub's API carry, and where it came from: "settings", the environment variable's name, or "" for none.
func Holds ¶ added in v0.1.1209
Holds reports whether the library is as s has it: Restore would put back nothing that differs. A server or skill s names that the library no longer has isn't compared, as Restore can't give it either, nor one added since s was taken, which Restore leaves as it is.
func HubLink ¶ added in v0.1.1950
HubLink is the link that adds the hub to app, at this computer's gateway (HubMCPAll, which needs no key here), through the install link its vendor documents: Cursor's cursor://anysphere.cursor-deeplink/mcp/install (docs.cursor.com, "MCP install links") and VS Code's vscode:mcp/install (code.visualstudio.com, "Add an MCP server": URL handler). Each app asks its user before it adds the server.
func Icon ¶
Icon is a market icon, fetched once and kept on disk: only an icon the market gave out is fetched, so the page can't have magpie fetch anything else.
func IgnoreNewSkills ¶ added in v0.1.1091
IgnoreNewSkills sets aside the new skills a check found, by their IDs: a later check doesn't offer them again.
func InUse ¶ added in v0.1.1225
InUse counts what the library gives agents: each server, skill, hook and project folder it keeps, and the shared instructions while an agent gets them. The library built-in plugin stays on while it is more than 0. A library.json that can't be read is an error, never 0.
It reads without mu: a sync holds mu for as long as it takes (13s and more with many agents and skills), and boot.js, which the window waits on before it paints, asks this through the built-in plugins (#2774: a white window at start on macOS). library.json is only ever replaced whole (save's edit.WriteAtomic), so a read beside a sync sees the file before or after one of its writes, never half of it.
func KeepLinked ¶ added in v0.1.1227
KeepLinked runs SyncLinked, Woken and a due PublishMemory every interval, until ctx ends: the app's backend, which ends once it has handed the gateway to the new version (gui/handover.go). Before, it ran for as long as the process did, and the copy an update left finishing its requests went on writing the agents' files beside the new one (#4938).
func KeepSkillsCurrent ¶
KeepSkillsCurrent runs AutoUpdateTick while the gateway serves.
func KeyMCPServers ¶ added in v0.1.3195
KeyMCPServers are every MCP server in the library, by name, with its tools but those turned off as it last listed them (none when it never has), for the picker of the servers and tools a gateway key may use (wakaka on Discord): the hub, /mcp/<name> and /mcp/run/<name> reach each, whether or not the hub gives it.
func MemoryInInstructions ¶
MemoryInInstructions is whether the agents ticked for instructions are given memory's digest, and those agents.
func PluginServers ¶ added in v0.1.3245
func PluginServers() map[string]PluginServer
PluginServers are the plugins' servers by plugin (plugin.Name); none when the library can't be read.
func ProjectAt ¶
ProjectAt is the listed folder of the project dir is (ProjectPath's way, or the same folder through a link): "" for a folder that isn't one.
func ProjectHooksFile ¶
ProjectHooksFile is the file in a project an agent reads hooks from: "" for one magpie can't give a project's hooks to.
func ProjectInstrFile ¶
ProjectInstrFile is the file, in a project, an agent reads the project's instructions from when there is none yet: "" for one magpie can't give a project's instructions to.
func ProjectMCPFile ¶ added in v0.1.629
ProjectMCPFile is the file, in a project, an agent reads the project's MCP servers from: "" for one magpie can't give a project's servers to.
func ProjectNoSSE ¶ added in v0.1.635
ProjectNoSSE says whether an agent's project file can't take a server over SSE (Codex's, Pi's), whatever its user-wide one can.
func ProjectOffAgents ¶
func ProjectOffAgents() []string
ProjectOffAgents are the agents a project can turn a global server off for, and ProjectSkillOffAgents a global skill.
func ProjectPath ¶
ProjectPath is a folder as typed on a command line (~, or relative to where magpie runs) made a full path, as AddProject takes it.
func ProjectSkillOffAgents ¶
func ProjectSkillOffAgents() []string
func ProjectSkillsDir ¶ added in v0.1.243
ProjectSkillsDir is the folder, in a project, an agent reads its skills from: "" for one magpie can't give a project's skills to.
func ProjectSubagentsDir ¶
ProjectSubagentsDir is the folder, in a project, an agent reads its subagents from: "" for one magpie can't give a project's subagents to.
func PublicServers ¶
func PublicServers() []string
PublicServers is the library's servers that the market lists from what ships with magpie (the featured ones and the registry's popular ones), each by its market id, given to at least one agent: what the day's report names of the user's MCP servers, for the market's counts of who uses each (internal/stats). A server of the user's own, one found only by a search of the registry, and one no agent is given are never in it, nor is anything of a server but its id: no name, URL, command or key.
func RTKLatest ¶ added in v0.1.328
func RTKLatest() string
RTKLatest is rtk's latest release, from GitHub unless it was read lately; "" when GitHub can't be reached and never could.
func RTKTakes ¶ added in v0.1.124
RTKTakes is the id of the agent q names when rtk can be given to it.
func RegroupSkills ¶ added in v0.1.1213
RegroupSkills traces the library's skills again (the Library page's Group again): each GitHub repository a skill is traced to is fetched, and the skills it has that aren't grouped with it yet are noted as from there, as installing from it again would. It gives how many were grouped; an error only when no repository could be fetched.
func RemoteMCPOn ¶ added in v0.1.3135
RemoteMCPOn are the Remote magpies (provider ids) whose editor's switch is on: switched on, or with a server of their router in the library (one added before the switch was there too). Nil when the library can't be read.
func RemoveSignIn ¶
RemoveSignIn forgets one of magpie's sign-ins to the server.
func ServeRun ¶ added in v0.1.1949
func ServeRun(w http.ResponseWriter, r *http.Request, name string)
ServeRun is the gateway's RunPath<name>: the server called name, run by magpie, over streamable HTTP. The gateway lets only this machine's agents here.
func SharedSkills ¶ added in v0.1.2016
SharedSkills are the names of the library's skills kept in ~/.agents/skills, which HandOverSkills can move into the library.
func SignInServer ¶ added in v0.1.694
SignInServer starts signing magpie in to the library's server called name: the State's URL is the page to open in a browser.
func SignInServerAccount ¶
SignInServerAccount is SignInServer as another account of the server, put in use once signed in.
func SignOutServer ¶ added in v0.1.694
SignOutServer forgets magpie's sign-in to the server called name, and gives the agents the server's own address again.
func SkillsAbout ¶
SkillsAbout is what each skill says of itself, by id (owner/repo/skill), from its SKILL.md; kept on disk once known.
func Takes ¶ added in v0.1.113
Takes is the id of the agent q names (its id, an alias, its name) when the library can give it kind — "instructions", "mcp" or "skills" — or why not: an agent it has no place for isn't recorded as getting it and then given nothing.
func UseRemoteLibraries ¶
UseRemoteLibraries reads the Library of every Remote magpie switched on.
Types ¶
type Account ¶
type Account struct {
ID string `json:"id"`
Name string `json:"name"`
Headers map[string]string `json:"headers,omitempty"`
}
Account is one set of headers a server is asked with.
type AgentInstructions ¶
type AgentInstructions struct {
Agent string `json:"agent"`
Name string `json:"name"`
Icon string `json:"icon"`
Path string `json:"path"`
On bool `json:"on"`
Extra string `json:"extra"` // what this agent gets besides
Own int `json:"own"` // lines of the user's own in the file
Edited bool `json:"edited,omitempty"` // magpie's part was changed in the file
Override string `json:"override,omitempty"` // a file the agent reads instead
Profile bool `json:"profile,omitempty"` // the file is the user's profile to the agent (Target.Profile)
// Asleep is the WSL distro, not running now, the agent is in: its row
// is what magpie last knew of it (asleepInstructions), its file isn't
// read, and a change is written there when the distro next runs.
// Unseen: magpie never saw where it keeps its instructions
Asleep string `json:"asleep,omitempty"`
Unseen bool `json:"unseen,omitempty"`
}
AgentInstructions is one agent's instructions file as the page shows it.
type AgentView ¶
type AgentView struct {
ID string `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
Instructions string `json:"instructions,omitempty"`
MCP string `json:"mcp,omitempty"`
Skills string `json:"skills,omitempty"`
// ProjectSkills is the folder in a project it reads skills from
ProjectSkills string `json:"projectSkills,omitempty"`
// ProjectMCP is the file, in a project, it reads MCP servers from
ProjectMCP string `json:"projectMCP,omitempty"`
// ProjectSubagents is the folder in a project it reads subagents from
ProjectSubagents string `json:"projectSubagents,omitempty"`
// ProjectHooks is the file in a project it reads hooks from, which a
// project's plugins' hooks are written into (project_plugins.go)
ProjectHooks string `json:"projectHooks,omitempty"`
// ProjectInstructions is the file in a project it reads the
// project's instructions from, when there is none yet
ProjectInstructions string `json:"projectInstructions,omitempty"`
// ProjectNoSSE: its project file can't take a server over SSE
ProjectNoSSE bool `json:"projectNoSSE,omitempty"`
// ProjectOff and ProjectSkillOff: a server, or a skill, it has from
// the Library can be turned off for it in one project (project_scope.go)
ProjectOff bool `json:"projectOff,omitempty"`
ProjectSkillOff bool `json:"projectSkillOff,omitempty"`
SkillsAlso []string `json:"skillsAlso,omitempty"`
Note string `json:"note,omitempty"`
NoSSE bool `json:"noSSE,omitempty"`
NoRemote bool `json:"noRemote,omitempty"`
// NoEnvRefs: it reads no ${NAME} from its MCP config, so a server
// whose headers or environment have one isn't given to it (envref.go)
NoEnvRefs bool `json:"noEnvRefs,omitempty"`
// ToolsOff: it can be told to leave out single tools of a server
// (mcp_tools_off.go); the page names those that can't
ToolsOff bool `json:"toolsOff,omitempty"`
// Startup: it is given a server's startup timeout (Codex's
// startup_timeout_sec)
Startup bool `json:"startup,omitempty"`
MCPVia string `json:"mcpVia,omitempty"`
// Hub, with the MCP hub on, is "on" for an agent given magpie's one
// entry in place of its servers, or why it keeps theirs: no-remote
// (it reaches no server over HTTP), taken (a library server is called
// magpie) or own (it has an entry called magpie of its own); "" for one
// given none of the hub's servers
Hub string `json:"hub,omitempty"`
// SkillRouter, with the skill router on, is "on" for an agent whose
// skills folder is given magpie-skills, or why it keeps each skill's
// own link (routerWhy): copies, liveagent, shared, taken or own; or
// "none" for an agent whose folder takes it and has no skill to list
SkillRouter string `json:"skillRouter,omitempty"`
// How is the way it is given its skills, link or copy, and HowOwn its
// own over the library's; MustCopy is one that can only take copies
// (in WSL, Claude Desktop, LiveAgent). CopyWhy is why it gets copies
// without asking for them (copyWhy): desktop, liveagent, wsl,
// junction, or shared with CopyWith, the agents given copies that read
// the very same folder
How string `json:"how,omitempty"`
HowOwn bool `json:"howOwn,omitempty"`
MustCopy bool `json:"mustCopy,omitempty"`
CopyWhy string `json:"copyWhy,omitempty"`
CopyWith []string `json:"copyWith,omitempty"`
// Gone: not installed here any more, and listed only for what magpie
// gave it to be taken out (held); it is given nothing new
Gone bool `json:"gone,omitempty"`
// Asleep is the WSL distro, not running now, the agent is in: it is
// listed by what magpie last knew of it (wsl_asleep.go), and a change
// for it is written there when the distro next runs. Unseen: magpie
// never saw where it keeps its MCP servers or skills, so its ticks
// can't be shown or changed until the distro runs
Asleep string `json:"asleep,omitempty"`
Unseen bool `json:"unseen,omitempty"`
}
AgentView is an agent as the page lists it, with where it keeps each.
type Applied ¶
type Applied struct {
Instructions bool `json:"instructions,omitempty"`
InstrHash string `json:"instrHash,omitempty"` // of the part last written
MCP []string `json:"mcp,omitempty"`
Skills []string `json:"skills,omitempty"`
// ToolsOff are, for each server, the tools magpie put in the list its
// entry has of those the agent leaves out; ToolRules the rules beside
// the servers magpie added to leave tools out (Claude Code's deny
// rules, OpenCode's tools keys). Neither holds one the user had.
ToolsOff map[string][]string `json:"toolsOff,omitempty"`
ToolRules []string `json:"toolRules,omitempty"`
// Hooks are the entries magpie wrote into the agent's hooks, each
// exactly as written: one changed since is the user's (hooks.go)
Hooks []HookEntry `json:"hooks,omitempty"`
// Env are the variables magpie wrote into the agent's settings, with
// their values: one there with another value since is the user's
Env []EnvEntry `json:"env,omitempty"`
// Subagents are the files magpie wrote for the subagents, each with
// the hash of what it wrote: one changed since is the user's
Subagents []SubagentFile `json:"subagents,omitempty"`
// Commands are the files magpie wrote for the slash commands, kept as
// Subagents are
Commands []SubagentFile `json:"commands,omitempty"`
// Rules are the files magpie wrote for the rules, kept as Subagents
// are
Rules []SubagentFile `json:"rules,omitempty"`
// Startup is, for each server, the startup timeout magpie wrote in its
// entry (Codex's startup_timeout_sec): one there other than this is
// the user's
Startup map[string]float64 `json:"startup,omitempty"`
// Picked are the skills magpie picked in the agent's own list of
// those it uses (LiveAgent's skills-settings.json, liveagent.go): one
// the user unpicked since stays unpicked
Picked []string `json:"picked,omitempty"`
// Router: magpie put the skill router's entry, magpie-skills, in the
// agent's skills folder
Router bool `json:"router,omitempty"`
// RouterRules are the rules magpie put in Claude Code's
// permissions.allow so it reads a listed skill without asking.
RouterRules []string `json:"routerRules,omitempty"`
// RouterCommands are the slash commands magpie wrote for the skills
// the router lists (routerCommands), kept as Commands are
RouterCommands []SubagentFile `json:"routerCommands,omitempty"`
}
Applied is what magpie last wrote into one agent.
type BiliAgent ¶
type BiliAgent struct {
ID string `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
On bool `json:"on"`
// Status is what bili plugin list says of it when that isn't simply
// installed or not: partly installed, broken, an error
Status string `json:"status,omitempty"`
}
BiliAgent is one agent bili's plugin can be given to.
type BiliChange ¶
type BiliChange struct {
// Growth 0 takes the setting out, back to bili's default
Growth *int `json:"growth"`
Nudge *bool `json:"nudge"`
// Summary switches the external summary; switched on, it needs a
// target, Target or one the file has
Summary *bool `json:"summary"`
// Target is the summary model, first of the targets: "recipe/model"
// from the file's recipes, or Model
Target *string `json:"target"`
// Model is a model magpie serves, as the target: magpie's recipe sends
// it to this computer's gateway
Model *string `json:"model"`
// Philosophy "" takes it out; one set turns acknowledgePromptsRisk on,
// which bili needs to use it
Philosophy *string `json:"philosophy"`
// Markers false turns compress.visibilityMarkers off; true takes the
// setting out, back to bili's default, which shows them
Markers *bool `json:"markers"`
}
BiliChange is a change to the settings BiliSettings shows; a nil field is left as it is.
type BiliSaved ¶
type BiliSaved struct {
// Net is bili's net savings: what its folds kept out of every later
// request, less the rebuilds after a fold and the summaries' cost
// (netSavedTotal). It can be below zero. Only when HasFolds.
Net int64 `json:"net"`
// Gross is the same before those costs (grossSavedTotal), which bili
// calls a theoretical upper bound.
Gross int64 `json:"gross"`
HasFolds bool `json:"hasFolds"`
Folds int64 `json:"folds"`
Sessions int64 `json:"sessions"`
Requests int64 `json:"requests"`
Input int64 `json:"input"`
// USD is bili's net savings in dollars, when it priced the models
// (hasMoneyData); 0 when it didn't.
USD float64 `json:"usd,omitempty"`
// At is when bili said so (RFC 3339).
At string `json:"at"`
// Live is whether a running bili said so just now; false is the
// last answer magpie kept.
Live bool `json:"live"`
Version string `json:"version,omitempty"`
}
BiliSaved is bili's own count of what it saved.
type BiliSettings ¶
type BiliSettings struct {
Path string `json:"path"`
// Bad is why the file can't be read as bili reads it; nothing is
// changed in it then
Bad string `json:"bad,omitempty"`
// Growth is compress.nudgeGrowthTokens, 0 when unset (bili's 50000)
Growth int `json:"growth"`
// Nudge is compress.requireNudge
Nudge bool `json:"nudge"`
// Summary is compress.externalSummary.enabled, Targets its targets
// ("recipe/model")
Summary bool `json:"summary"`
Targets []string `json:"targets"`
// Recipes are the "recipe/model" a target can be from the file's own
// recipes, magpie's left out
Recipes []string `json:"recipes"`
// Philosophy is compress.prompts.compressPhilosophy, used by bili
// only with compress.acknowledgePromptsRisk (Risk)
Philosophy string `json:"philosophy"`
Risk bool `json:"risk"`
// Markers is compress.visibilityMarkers: the 📦/❌ lines bili adds
// after a compress, decompress or search_context call runs, on unless
// the file turns them off
Markers bool `json:"markers"`
// Reloaded of Running are the bilis that read a change again, of the
// ones running here
Reloaded int `json:"reloaded,omitempty"`
Running int `json:"running,omitempty"`
}
BiliSettings are the settings of billion-context.json the Library's tab shows: compress's nudge step and whether a fold needs a nudge, its external summary (the fast model summaries are written with) and its compression philosophy.
func ReadBiliSettings ¶
func ReadBiliSettings() (*BiliSettings, error)
ReadBiliSettings is billion-context.json's settings the tab shows.
func SetBiliSettings ¶
func SetBiliSettings(c BiliChange) (*BiliSettings, error)
SetBiliSettings changes billion-context.json and has the bilis running here read it again.
type BiliView ¶
type BiliView struct {
Path string `json:"path,omitempty"` // "" when bili isn't installed
Version string `json:"version,omitempty"`
Agents []BiliAgent `json:"agents"`
URL string `json:"url"`
// Install is the command Install runs, "" when there is no npm
Install string `json:"install,omitempty"`
// ListErr is why bili plugin list said nothing magpie could read
ListErr string `json:"listErr,omitempty"`
Restart []string `json:"restart,omitempty"`
Backup string `json:"backup,omitempty"`
// Saved is what bili says it saved (bili_saved.go), nil when no bili
// has answered here yet
Saved *BiliSaved `json:"saved,omitempty"`
}
BiliView is the billion-context part of the Library page.
func InstallBili ¶
InstallBili installs billion-context the way its README says.
type BorrowResult ¶
type BorrowResult struct {
Added []string // skills and sets taken in
Updated []string
Removed []string
Kept []string // the user's own by the same name, left as they are
}
BorrowResult says what a read of a Remote magpie's Library did.
func Borrow ¶
func Borrow(id, name string, b *Bundle) (*BorrowResult, error)
Borrow keeps the Library b of the Remote magpie id (called name) here, as the notes above say.
func UseRemoteLibrary ¶
func UseRemoteLibrary(ctx context.Context, id string) (*BorrowResult, error)
UseRemoteLibrary reads the Library of the Remote magpie id and keeps it here (Borrow).
type Borrowed ¶
type Borrowed struct {
Name string `json:"name,omitempty"`
Skills map[string]string `json:"skills,omitempty"`
Sets map[string]string `json:"sets,omitempty"`
}
Borrowed is what this computer took from one Remote magpie's Library: by name the hash of each skill as taken, and by id that of each set.
type Bundle ¶ added in v0.1.182
type Bundle struct {
Instructions Instructions `json:"instructions"`
Texts map[string]string `json:"texts,omitempty"` // set → its text
Extra map[string]string `json:"extra,omitempty"` // agent → what it gets besides
MCP []*Server `json:"mcp"`
Skills []*CarriedSkill `json:"skills"`
Icons map[string]string `json:"icons,omitempty"`
// Subagents are nil in a bundle from a magpie before they were
// carried, which knew nothing of this computer's: Put keeps them. Collect
// always sets it, empty too, so taking the last one out is carried.
Subagents *[]*Subagent `json:"subagents,omitempty"`
// Commands are nil in a bundle from a magpie before slash commands,
// as Subagents are: Put keeps this computer's.
Commands *[]*Command `json:"commands,omitempty"`
// Rules are nil in a bundle from a magpie before rules, as Subagents
// are: Put keeps this computer's.
Rules *[]*Rule `json:"rules,omitempty"`
// Hooks are nil in a bundle from a magpie before they were carried,
// as Subagents are: Put keeps this computer's. Applied.Hooks, the
// entries magpie wrote into each agent here, stays out.
Hooks *[]*Hook `json:"hooks,omitempty"`
// Env is nil in a bundle from a magpie before variables were carried:
// Put keeps this computer's. Applied.Env stays out. A backup made
// without keys carries the names with empty values (WithoutSecrets).
Env *[]*EnvVar `json:"env,omitempty"`
// Bili is billion-context's own billion-context.json, with magpie's
// recipe at the default gateway address (carriedBili). It is nil when
// this computer has none or it can't be read, and in a bundle from a
// magpie before it was carried: Put keeps this computer's then.
Bili *string `json:"bili,omitempty"`
// ClaudePlugins are the marketplaces and plugins installed in Claude
// Code itself (claude_plugins.go). nil when there are none, or they
// can't be read, and in a bundle from a magpie before them: Put adds
// nothing then. Put only adds, so one computer's never takes away
// another's.
ClaudePlugins *ClaudePlugins `json:"claudePlugins,omitempty"`
// Plugins are the library's own Claude plugins (plugin.go), each as a
// whole: its parts aren't among the skills, servers, hooks and
// subagents above, and each computer makes them again from it
// (plugin_carry.go). nil in a bundle from a magpie before they were
// carried: Put keeps this computer's then.
Plugins *[]*CarriedPlugin `json:"plugins,omitempty"`
// NoAgents says the Library was told by a magpie whose page shows no
// agent (a container, a NAS, gateway mode; Shared): its skills and
// prompts are ticked for none there, and a magpie that takes them
// gives one ticked for none to the agents a new one goes to (Borrow).
NoAgents bool `json:"noAgents,omitempty"`
}
Bundle is the library as a backup carries it to another computer: the instruction sets and the one on, what each agent gets besides, the MCP servers, the skills with their files and the subagents. What magpie wrote into each agent (Applied, the subagents' files among it) is this computer's own and stays out. It is made the same way every time — no times, everything in order — so two computers with the same library carry the same bundle.
func Shared ¶
Shared is the Library as another magpie is told it: the instruction sets with their texts and the skills with their files. The servers, the hooks and what each agent gets besides are this computer's; a skill linked to a folder here comes as its files.
func (*Bundle) WithSecrets ¶ added in v0.1.182
WithSecrets is b with the values WithoutSecrets emptied filled from the servers of the same name in have, so a bundle made without keys doesn't take away the ones kept here.
func (*Bundle) WithoutSecrets ¶ added in v0.1.182
WithoutSecrets empties the values of the servers' environment variables and headers that secret says hold one; their names stay, to be filled in.
type Candidate ¶
type Candidate struct {
Path string `json:"path"` // in the repository or the folder; "" for its root
Name string `json:"name"`
Description string `json:"description"`
Have bool `json:"have"` // the library has this skill (from here, or the very same files)
// As is the name the library has it by, or would add it by, when
// that isn't Name: another skill from elsewhere has that name
As string `json:"as,omitempty"`
// Links is that the library's skill by its name came from a folder
// or an agent, not from anywhere it can be updated from: installing
// this one puts its files and source in that one's place, so it
// updates from here (skill_link.go)
Links bool `json:"links,omitempty"`
}
Candidate is a skill found where the user pointed: in a repository, or in a folder.
type CarriedPlugin ¶
type CarriedPlugin struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
Source string `json:"source,omitempty"`
Pick string `json:"pick,omitempty"`
Agents []string `json:"agents"`
Off bool `json:"off,omitempty"`
// Taken are the parts the user took out one by one (PluginView's
// Missing), taken out on the other computer too
Taken []string `json:"taken,omitempty"`
// Files are a plugin's from a folder, as a skill's are; nil for one
// fetched from its source
Files map[string][]byte `json:"files"`
Exec []string `json:"exec,omitempty"`
Left []string `json:"left,omitempty"`
}
CarriedPlugin is a library plugin as a sync carries it.
type CarriedSkill ¶ added in v0.1.182
type CarriedSkill struct {
Name string `json:"name"`
Source *Source `json:"source,omitempty"`
Agents []string `json:"agents"`
Files map[string][]byte `json:"files"` // by path in the folder, with /
Exec []string `json:"exec,omitempty"` // the files that run
Left []string `json:"left,omitempty"` // files too big to carry
// Called is the name its SKILL.md gives, when that isn't Name
Called string `json:"called,omitempty"`
// Note is the user's note on it (Skill.Note)
Note string `json:"note,omitempty"`
// Router is Skill.Router: direct, kept out of the skill router
Router string `json:"router,omitempty"`
// From is the repository the skill was traced to on the computer that
// made the bundle (Skill.From, skill_from.go), when it isn't a source
// the skill carries itself: the lock, a checkout, CC Switch's record or
// an install-again there. What traced it is that computer's own files,
// so without this the other computer groups the skill under "this
// computer". Bundles from before this have none.
From string `json:"from,omitempty"`
// Fetch is a skill carried as its source (skill_carry.go): the other
// computer fetches it from there, at the version Hash names (Commit
// too, for a git repository's), and Files are only what fit, standing
// in until then. A magpie from before this leaves it out and writes
// the files, as it did.
Fetch bool `json:"fetch,omitempty"`
Hash string `json:"hash,omitempty"`
Commit string `json:"commit,omitempty"`
}
CarriedSkill is a skill with its folder's files.
type ClaudePluginView ¶
ClaudePluginView is a plugin Claude Code has installed, as the project card lists it: whether the user's own settings have it on.
func ReadClaudeInstalled ¶
func ReadClaudeInstalled() []ClaudePluginView
ReadClaudeInstalled lists the plugins Claude Code's own record (plugins/installed_plugins.json) has installed, with whether settings.json turns each on.
type ClaudePlugins ¶
type ClaudePlugins struct {
// Marketplaces are by name, each as extraKnownMarketplaces holds one:
// {"source": {…}} and its autoUpdate when set.
Marketplaces map[string]json.RawMessage `json:"marketplaces,omitempty"`
// Enabled are the plugins turned on for the user, as plugin@marketplace.
Enabled []string `json:"enabled,omitempty"`
}
Claude Code's own plugins, the ones installed in Claude Code through its /plugin marketplaces (AXmake110 on X), go with the library: the marketplaces it knows and the plugins turned on for the user, so a computer that syncs ends up with the same plugins. They are not the library's plugin bundles (plugin.go), which magpie keeps and gives to every agent itself.
Claude Code keeps them in its folder (claudeDir, CLAUDE_CONFIG_DIR too):
plugins/known_marketplaces.json {name: {source: {source: "github", repo}, installLocation, lastUpdated}}
plugins/installed_plugins.json {version: 2, plugins: {"p@m": [{scope, installPath, version, …}]}}
settings.json enabledPlugins: {"p@m": true}, extraKnownMarketplaces: {name: {source}}
What is carried is each marketplace's source and the user's enabled plugin ids. installLocation, installPath and the downloaded code in plugins/marketplaces and plugins/cache are this computer's, and Claude Code fetches them again from the sources. On the other computer they are written where Claude Code reads a declared setup from: settings.json's extraKnownMarketplaces and enabledPlugins. At its next interactive start Claude Code clones the marketplaces and installs the plugins into its own files (tried with Claude Code 2.1.319 in a sandbox CLAUDE_CONFIG_DIR: commit-commands@claude-code-plugins installed from those two settings alone; `claude -p` does not install them).
Only adding: a marketplace or plugin the other computer has under that name, enabled or turned off there, stays as it is there, and a plugin removed on one computer is not removed on the others.
type Command ¶
type Command struct {
Name string `json:"name"`
Description string `json:"description"`
Prompt string `json:"prompt"`
Agents []string `json:"agents"`
// Taken are, by agent, the agent's own files it was imported from
// (command_import.go): this computer's, never carried or shown
Taken map[string]*TakenFile `json:"taken,omitempty"`
}
Command is a slash command the agents ticked for it are given.
type CommandAgentView ¶
type CommandAgentView struct {
ID string `json:"id"`
// Dir is where its commands are; No is why magpie can't give it any
Dir string `json:"dir,omitempty"`
No string `json:"no,omitempty"`
WSL bool `json:"wsl,omitempty"`
// Args: it takes $1, $2…; one without takes only $ARGUMENTS
Args bool `json:"args,omitempty"`
}
CommandAgentView is an agent the Slash commands tab lists.
type CommandCandidate ¶
type CommandCandidate struct {
// Path is its first file's, which names it to the import
Path string `json:"path"`
Name string `json:"name"`
Description string `json:"description"`
Prompt string `json:"prompt"`
// Agents are those it was found in, each with its file
Agents []string `json:"agents"`
Files map[string]string `json:"files"`
// State is, against the library: "" a new one, "same" the library
// has it saying the same (the import gives it to these agents too),
// "taken" the library has another command by the name (not pickable)
State string `json:"state,omitempty"`
// Clash: another one found by this name says something else
Clash bool `json:"clash,omitempty"`
// contains filtered or unexported fields
}
CommandCandidate is one command found, in one agent or several.
type CommandProbe ¶
type CommandProbe struct {
Candidates []CommandCandidate `json:"candidates"`
// Left are the files that can't be a command of the library's, with why
Left []SubagentLeft `json:"left,omitempty"`
}
CommandProbe is the slash commands found in the agents.
func ProbeCommands ¶
func ProbeCommands() (*CommandProbe, error)
ProbeCommands is the slash commands the agents here have of their own; nothing is written.
type CommandView ¶
type CommandView struct {
*Command
// Files are, for each agent it was written to, the file
Files map[string]string `json:"files,omitempty"`
// Problems are the agents it couldn't be given to, and why
Problems map[string]string `json:"problems,omitempty"`
}
CommandView is a library slash command, and where each agent has it.
type CommandsImported ¶
type CommandsImported struct {
Added []string `json:"added,omitempty"`
// Joined are the library's own commands the agents were added to
Joined []string `json:"joined,omitempty"`
}
CommandsImported is what an import did, by name.
type Custom ¶ added in v0.1.800
type Custom struct {
Name string `json:"name"`
Transport string `json:"transport"`
URL string `json:"url,omitempty"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
}
Custom is a server to add by hand at an address nothing the market lists is at: a remote one at an endpoint, or one named for its repository whose command is filled in.
func CustomAt ¶ added in v0.1.800
func CustomAt(q string, found []MarketServer) *Custom
CustomAt is the server to add by hand for a search, when it's an address and none of what was found is at it.
type EditedError ¶ added in v0.1.1151
type EditedError struct{ Name, From string }
EditedError is an update refused because the skill was changed here since it was fetched from GitHub, or From, the git repository it came from.
func (*EditedError) Error ¶ added in v0.1.1151
func (e *EditedError) Error() string
type EnvAgentView ¶
type EnvAgentView struct {
ID string `json:"id"`
File string `json:"file,omitempty"`
No string `json:"no,omitempty"`
WSL bool `json:"wsl,omitempty"`
}
EnvAgentView is an agent the Variables tab lists: File is where its variables are, No why magpie can't give it any.
type EnvVar ¶
type EnvVar struct {
Name string `json:"name"`
Value string `json:"value"`
Agents []string `json:"agents"`
}
EnvVar is a variable the agents ticked for it are given.
type ExportHook ¶
type ExportHook struct {
Name string `json:"name"`
Bundle string `json:"bundle,omitempty"`
Description string `json:"description,omitempty"`
Event string `json:"event,omitempty"`
Matcher string `json:"matcher,omitempty"`
Command string `json:"command,omitempty"`
Timeout int `json:"timeout,omitempty"`
}
ExportHook is a hook as an export carries it: a plugin's names its plugin, which brings it, and nothing else.
type ExportNeeds ¶
type ExportNeeds struct {
// Skills and Plugins are their sources, "" for one kept only here
Skills map[string]string `json:"skills,omitempty"`
Plugins map[string]string `json:"plugins,omitempty"`
// Bundles are the plugins the hooks and subagents named came with,
// which bring them
Hooks []ExportHook `json:"hooks,omitempty"`
Subagents []ExportSubagent `json:"subagents,omitempty"`
}
ExportNeeds are the library's things an export's choices name.
type ExportSubagent ¶
type ExportSubagent struct {
Name string `json:"name"`
Bundle string `json:"bundle,omitempty"`
Description string `json:"description,omitempty"`
Prompt string `json:"prompt,omitempty"`
Model string `json:"model,omitempty"`
Skills []string `json:"skills,omitempty"`
MCP []string `json:"mcp,omitempty"`
}
ExportSubagent is a subagent as an export carries it.
type Found ¶
type Found struct {
Server *Server `json:"server"`
Others []string `json:"others,omitempty"`
Icon string `json:"icon,omitempty"`
// Own: the agent's app puts it there itself, each time it starts
// (Codex's node_repl and cua_repl): it isn't one to bring in, and
// taking it out doesn't last.
Own bool `json:"own,omitempty"`
}
Found is a server an agent has that the library doesn't: the agents that have it as it is, and those that have another by that name.
type FoundHook ¶
type FoundHook struct {
// Key names the entry for ImportHooks and RemoveFoundHooks: the agent,
// its event, the entry's text and which of the same entries it is
Key string `json:"key"`
Agent string `json:"agent"`
// Event is the agent's own name for it ("PostToolUse")
Event string `json:"event"`
Matcher string `json:"matcher,omitempty"`
// Commands are what it runs: a group can hold several, and a handler
// that isn't a command is named by its type, "(prompt)"
Commands []string `json:"commands"`
// Timeout in seconds, when the entry sets one
Timeout int `json:"timeout,omitempty"`
File string `json:"file"`
// Hook is what bringing it in makes it; nil when the library can't
// keep it as it is written (Why: "several", "type" or "shape"), and
// then it can only be removed
Hook *Hook `json:"hook,omitempty"`
Why string `json:"why,omitempty"`
// Joins is the library hook it is the same as, for another agent:
// bringing it in ticks this agent for that hook
Joins string `json:"joins,omitempty"`
// Own: written by a tool magpie runs from another tab ("rtk", RTK's
// installer), which takes it out there; the page doesn't list it
Own string `json:"own,omitempty"`
// contains filtered or unexported fields
}
FoundHook is one entry of an agent's hooks file that magpie didn't write.
type FoundSkill ¶
type FoundSkill struct {
Name string `json:"name"`
Description string `json:"description"`
Agents []string `json:"agents"` // the agents that have this very folder
Others []string `json:"others,omitempty"` // agents with another by that name
// Copies are the agents with another folder by that name holding the
// very same files (CC Switch copies a skill into each agent): brought
// in, they get the library's in its place
Copies []string `json:"copies,omitempty"`
Link string `json:"link,omitempty"` // where it really is, when it's a link
// Manual: its SKILL.md sets disable-model-invocation (meta.Manual)
Manual bool `json:"manual,omitempty"`
// there; the agents that have it are those whose entry is a link (or a
// junction) to the very same folder
Shared string `json:"shared,omitempty"`
// Library is its folder in the library's own skills folder, put there
// by hand (or left by a library.json that lost it): brought in, it is
// listed where it is (#595)
Library string `json:"library,omitempty"`
// contains filtered or unexported fields
}
FoundSkill is a skill an agent has that the library doesn't.
type GoneError ¶ added in v0.1.1326
GoneError is a skill its source was read without: it was removed there.
type HomeEntry ¶
type HomeEntry struct {
Agent string `json:"agent"`
Path string `json:"path"`
Link string `json:"link,omitempty"` // a link, and what it pointed at
Copy bool `json:"copy,omitempty"` // a copy of the very same files
}
HomeEntry is one agent's entry for a skill before it was brought in.
type Hook ¶ added in v0.1.1214
type Hook struct {
Name string `json:"name"`
Bundle string `json:"bundle,omitempty"` // the plugin it came with (plugin.go)
// Description says what the hook is for, in any language (#2011):
// the name is letters, digits, - and _, which says little to someone
// who reads Chinese. Only the library keeps it; no agent is given it.
Description string `json:"description,omitempty"`
// Event is a portable event (HookEvents), or an agent's own,
// "<agent>:<Event>" as that agent names it
Event string `json:"event"`
// Matcher narrows a tool event to some tools: for a portable event
// "shell" or "edit" (each agent's own tool names for them), for an
// agent's own event the agent's own matcher; "" is every tool. A
// session-start hook is narrowed to the starts it runs at instead
// (#5604): one or more of HookStarts joined by "|", "compact"
Matcher string `json:"matcher,omitempty"`
Command string `json:"command"`
Timeout int `json:"timeout,omitempty"` // seconds; 0 is the agent's own
Agents []string `json:"agents"`
}
Hook is a command the agents ticked for it run at Event.
type HookAgentView ¶ added in v0.1.1214
type HookAgentView struct {
ID string `json:"id"`
// File is where its hooks are; No is why magpie can't give it any
File string `json:"file,omitempty"`
No string `json:"no,omitempty"`
// WSL: No is that it runs in WSL, which magpie gives no hooks yet
WSL bool `json:"wsl,omitempty"`
// Off: it has every hook turned off in its settings
Off bool `json:"off,omitempty"`
// Events are its own events, for a hook of its alone
Events []string `json:"events,omitempty"`
// Starts are the session-start matchers it can be given (#5604);
// StartSources the starts it has, to say why it can't be given another
Starts []string `json:"starts,omitempty"`
StartSources []string `json:"startSources,omitempty"`
}
HookAgentView is an agent the Hooks tab lists.
type HookEntry ¶ added in v0.1.1214
type HookEntry struct {
Name string `json:"name"`
Event string `json:"event"`
Entry json.RawMessage `json:"entry"`
}
HookEntry is one entry magpie wrote into an agent's hooks: the hook it is of, the agent's event it is under, and the entry exactly as written.
type HookView ¶ added in v0.1.1214
type HookView struct {
*Hook
// Native is what each agent it can go to calls its event
Native map[string]string `json:"native,omitempty"`
// Problems are the agents it couldn't be given to, and why
Problems map[string]string `json:"problems,omitempty"`
}
HookView is a library hook, and what each agent makes of it.
type Input ¶
type Input struct {
Key string `json:"key"`
Where string `json:"where"` // env, header or arg
Label string `json:"label"`
Description string `json:"description,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
Secret bool `json:"secret,omitempty"`
Required bool `json:"required,omitempty"`
// contains filtered or unexported fields
}
Input is something a server needs from the user before it can start: a key in its environment, a header it sends, or an argument.
type InstrFile ¶
type InstrFile struct {
Path string `json:"path"`
Hash string `json:"hash"`
Made bool `json:"made,omitempty"`
}
InstrFile is a project file magpie wrote the project's instructions into: the hash of the part as written, and whether magpie made the file.
type InstrSet ¶ added in v0.1.181
type InstrSet struct {
ID string `json:"id"`
Name string `json:"name"` // "" for the first, which the page calls Default
// File is a file of the user's own the set's text is kept in instead,
// read each time and written when the set is saved: one shared file
// such as ~/.agents/AGENTS.md, kept by hand or by another tool.
File string `json:"file,omitempty"`
}
InstrSet is one set of shared instructions: its text is in its own file.
type Instructions ¶
type Instructions struct {
Agents []string `json:"agents"` // the agents the shared text is written to
// Sets are the named texts to pick the shared one from; with none kept
// there is the one magpie always had, "default"
Sets []InstrSet `json:"sets,omitempty"`
Active string `json:"active,omitempty"` // the set agents get; "" is "default"
// NoMemory leaves memory's digest (memory.Digest) out of what the
// agents are written; by default it follows the shared text
NoMemory bool `json:"noMemory,omitempty"`
}
Instructions are one shared text, and for each agent whether it gets it and what it gets besides (kept in files beside library.json). The shared text is one of several sets kept to switch between (#106), the one on.
type InstructionsChange ¶
type InstructionsChange struct {
Agents []string `json:"agents,omitempty"`
Extra map[string]*string `json:"extra,omitempty"`
// Rewrite writes magpie's part again into these agents' files, over
// edits made there.
Rewrite []string `json:"rewrite,omitempty"`
// The sets: texts by set, a set to switch the agents to, one to add
// (id and name), one to rename and one to remove. Shared is the text
// of the set on, as it is after Activate.
Texts map[string]*string `json:"texts,omitempty"`
Activate string `json:"activate,omitempty"`
Create *InstrSet `json:"create,omitempty"`
Rename *InstrSet `json:"rename,omitempty"`
Remove string `json:"remove,omitempty"`
}
InstructionsChange is what the page saves: the shared text, which agents get it, and what each gets besides. A nil field is left as it is.
type InstructionsView ¶
type InstructionsView struct {
Sets []SetView `json:"sets"`
Agents []AgentInstructions `json:"agents"`
}
InstructionsView is the Instructions page.
func ReadInstructions ¶
func ReadInstructions() (*InstructionsView, error)
ReadInstructions is the shared text and each agent's file.
type LeftOut ¶ added in v0.1.1231
LeftOut is a skill of a repository too big to install on its own (fetchSkillFiles): where it is, and what its files come to.
type Library ¶
type Library struct {
Instructions Instructions `json:"instructions"`
MCP []*Server `json:"mcp"`
Skills []*Skill `json:"skills"`
// Projects are folders whose agents get some of the skills there
Projects []*Project `json:"projects,omitempty"`
// Hooks are commands the agents ticked for each run at a point of
// their turn (hooks.go, #1790)
Hooks []*Hook `json:"hooks,omitempty"`
// Env are the environment variables the agents ticked for each are
// given in their own settings (env.go)
Env []*EnvVar `json:"env,omitempty"`
// Subagents are agents of their own the agents ticked for each can
// hand a task to (subagents.go, #2283)
Subagents []*Subagent `json:"subagents,omitempty"`
// Commands are slash commands the agents ticked for each are given
// (commands.go)
Commands []*Command `json:"commands,omitempty"`
// Rules are files of guidance given to the agents ticked for each,
// in their own folder of rules (rules.go)
Rules []*Rule `json:"rules,omitempty"`
// Plugins are the Claude Code plugins kept as one item each: its
// skills, servers, hooks and subagents are the items above marked
// with its name (plugin.go)
Plugins []*Plugin `json:"plugins,omitempty"`
// Applied is what magpie wrote into each agent, so that what it takes
// away is only ever its own.
Applied map[string]*Applied `json:"applied,omitempty"`
// Away are other computers' servers by the name of one kept to this
// computer here (Server.Local), as a sync last brought them: never
// given to an agent here, and carried on as they came, so a sync from
// here takes them from nobody (carry.go)
Away []*Server `json:"away,omitempty"`
// Icons are the icons of the servers added from the market, by what
// each runs, for the page to show them by
Icons map[string]string `json:"icons,omitempty"`
// SkillGroups are the groups the user made of some skills on the
// page, each shown as a group of its own (#791)
SkillGroups []*SkillGroup `json:"skillGroups,omitempty"`
// CopySkills gives the agents copies of their skills rather than links
// to the library's, and SkillHow is an agent's own way over it, link or
// copy (#896, skill_how.go)
CopySkills bool `json:"copySkills,omitempty"`
SkillHow map[string]string `json:"skillHow,omitempty"`
// magpie's link to the library's folder, for every agent and tool
// that reads it (usrname1833, skills_shared.go). This computer's
// own: Collect doesn't carry it
SharedSkills bool `json:"sharedSkills,omitempty"`
// AutoUpdateSkills fetches again by itself each skill its GitHub or
// git repository has changed (0xYaCo on X, skill_autoupdate.go). This
// computer's own: Collect doesn't carry it
AutoUpdateSkills bool `json:"autoUpdateSkills,omitempty"`
// MCPHub gives each agent that can reach it magpie's one MCP server,
// which hands each call on to the library's servers ticked for it, in
// place of their own entries (#2679, mcp_hub.go)
MCPHub bool `json:"mcpHub,omitempty"`
// SkillRouter gives each agent that can take it magpie's one skill,
// magpie-skills, listing the library's skills ticked for it, in place
// of a link of each (skill_router.go). This computer's own: Collect
// doesn't carry it
SkillRouter bool `json:"skillRouter,omitempty"`
// PluginsOffered are the plugins (plugin.Name) given a server of their
// tools, for one the user removed not to come back (plugin_tools.go)
PluginsOffered []string `json:"pluginsOffered,omitempty"`
// BridgesOffered are the Remote magpies (provider ids) whose MCP
// router was given a server, for one the user removed not to come
// back (bridge_mcp.go)
BridgesOffered []string `json:"bridgesOffered,omitempty"`
// BridgesOn are the Remote magpies (provider ids) the user asked to
// give their router a server, in the editor's switch (bridge_mcp.go)
BridgesOn []string `json:"bridgesOn,omitempty"`
// BorrowOn are the Remote magpies (provider ids) whose Library's
// skills and prompts this computer uses, and Borrowed what it took
// from each (borrow.go). This computer's own: Collect doesn't carry
// either.
BorrowOn []string `json:"borrowOn,omitempty"`
Borrowed map[string]*Borrowed `json:"borrowed,omitempty"`
// SeenSkills are, by repository and ref ("owner/repo@ref", or a git
// address and ref), or by a folder the user added ("folder:<path>"),
// the folders of skills there the page has offered: picked or not at
// install, or set aside after a check. A check offers only the others
// as new (skillnew.go).
SeenSkills map[string][]string `json:"seenSkills,omitempty"`
// contains filtered or unexported fields
}
Library is library.json: what magpie keeps, and which agents get it.
type Limited ¶ added in v0.1.662
Limited is GitHub's rate limit used up: until when (RFC 3339, "" when GitHub didn't say), and whether the requests carried a GitHub token.
type MarketServer ¶
type MarketServer struct {
ID string `json:"id"`
Name string `json:"name"` // what the library calls it
Title string `json:"title"`
Description string `json:"description"`
Publisher string `json:"publisher,omitempty"`
Icon string `json:"icon,omitempty"`
Homepage string `json:"homepage,omitempty"`
Transport string `json:"transport"`
// Runs is what starts a local one: npx, uvx or docker
Runs string `json:"runs,omitempty"`
// SignIn is a remote one that has the agent sign in, in the browser,
// the first time it's used
SignIn bool `json:"signIn,omitempty"`
Featured bool `json:"featured,omitempty"`
// OptIn is one no agent is given unless it is picked for it
OptIn bool `json:"optIn,omitempty"`
// Unready is why one of magpie's own can't answer yet (nothing it
// needs is set up, or Settings turned it off), from the GUI, which
// knows: its tools still answer, with the same words
Unready string `json:"unready,omitempty"`
Inputs []Input `json:"inputs"`
// Have is the library's server that is this one
Have string `json:"have,omitempty"`
// Match is one found at the address searched for: its repository, page,
// endpoint or package is it
Match bool `json:"match,omitempty"`
// contains filtered or unexported fields
}
MarketServer is a server the market offers.
func MarketServers ¶
func MarketServers(q string) ([]MarketServer, error)
MarketServers is what the market shows for a search: the featured servers that match it, then the registry's, then the popular ones that do; with no search, the featured and every popular one. A search that is an address — a repository, a page, an endpoint, a package — finds the ones at it.
type MarketSkill ¶
type MarketSkill struct {
ID string `json:"id"` // owner/repo/skill
Source string `json:"source"` // owner/repo
SkillID string `json:"skillId"`
Name string `json:"name"`
Installs int `json:"installs"`
Official bool `json:"official,omitempty"`
// Featured is magpie's own, not one skills.sh lists
Featured bool `json:"featured,omitempty"`
Icon string `json:"icon"`
// Description is known once it has been fetched
Description string `json:"description,omitempty"`
Have string `json:"have,omitempty"`
}
MarketSkill is a skill the market offers, from a GitHub repository.
func MarketSkills ¶
func MarketSkills(q string) ([]MarketSkill, error)
MarketSkills is what the market shows for a search: magpie's own skills that match it, the most installed skills that do, then what skills.sh finds for it.
type NativePart ¶
type NativePart struct {
// Kind is skill, mcp, hook or subagent
Kind string `json:"kind"`
Name string `json:"name"`
// Detail is a skill's description, a server's transport, a hook's
// command
Detail string `json:"detail,omitempty"`
// contains filtered or unexported fields
}
NativePart is one thing a native plugin or package declares.
type NativePlugin ¶
type NativePlugin struct {
Agent string `json:"agent"`
AgentName string `json:"agentName"`
Name string `json:"name"`
Version string `json:"version,omitempty"`
// Source is the marketplace it came from (Codex), or the entry in
// settings.json (Pi)
Source string `json:"source,omitempty"`
// Scope is user, or project for one a project's own settings name
Scope string `json:"scope"`
Project string `json:"project,omitempty"`
Dir string `json:"dir"`
// Enabled is what the agent's own settings say; nil when they don't
Enabled *bool `json:"enabled,omitempty"`
// Loaded is always "unknown": only a session shows what was loaded
Loaded string `json:"loaded"`
Parts []NativePart `json:"parts"`
}
NativePlugin is a plugin or package an agent installed itself.
func ReadNative ¶
func ReadNative() []NativePlugin
ReadNative lists what the agents' own plugins and packages declare. It writes nothing and starts nothing.
type NewSkill ¶ added in v0.1.1091
type NewSkill struct {
// ID is the skill's folder (on GitHub, in the git repository, or on
// this machine), what the page adds it from and sets it aside by
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
// Kind is where it is: github, git or folder
Kind string `json:"kind"`
// Repo is the repository (owner/repo, or the address git fetches),
// or the folder the user added
Repo string `json:"repo"`
Ref string `json:"ref,omitempty"`
Path string `json:"path"`
// From is the repository's folder the check found it in, what Add
// installs it from
From string `json:"from"`
// Agents are those that have the repository's other skills: the ones
// an Add gives it to
Agents []string `json:"agents"`
}
NewSkill is a skill a check for updates found where the library has skills from, beside them, that the library doesn't have and that the page hasn't offered before: one a GitHub or git repository, or a folder on this machine, added since its skills were installed (refeccd on Discord). The page offers to add it, or to set it aside.
type OAuthApp ¶ added in v0.1.1217
type OAuthApp struct {
ClientID string `json:"clientId"`
ClientSecret string `json:"clientSecret,omitempty"`
// CallbackPort is the port of the callback URL the app was made with;
// 0 for one made with http://localhost/callback, which takes any
CallbackPort int `json:"callbackPort,omitempty"`
}
OAuthApp is an OAuth app made with a server's vendor, by the names Claude Code gives one (--client-id, --client-secret, --callback-port; "oauth": {"clientId", "callbackPort"}).
type OwnResource ¶
type OwnResource struct {
Name string `json:"name"`
Path string `json:"path"`
Agent string `json:"agent,omitempty"`
Event string `json:"event,omitempty"`
Description string `json:"description,omitempty"`
Transport string `json:"transport,omitempty"`
}
OwnResource is something the project's own files already give an agent, that magpie didn't place (#7245, #7247): shown read-only, never changed or taken away. Credentials never go in it: a server's URL, arguments and environment stay in the project's file, only its transport is read.
type PiCopied ¶ added in v0.1.3375
type PiCopied struct {
*PiExtensions
// Install: the copied extension has dependencies of its own, which
// `npm install` in its folder on the other side fetches
Install string `json:"install,omitempty"`
}
PiCopied is what a copy did, for the page to say.
func CopyPi ¶ added in v0.1.3375
CopyPi gives one of a Pi's extensions or packages to another Pi. A package is its settings.json entry, written into the other's packages; Pi there installs it when it next starts. An extension is its file or folder, copied into the other's extensions folder, without its node_modules (built for the machine it was on).
type PiExt ¶ added in v0.1.3375
type PiExt struct {
// ID names it in a request: "extensions/<name>" for one in the
// extensions folder, the settings.json entry for one listed there
ID string `json:"id"`
Name string `json:"name"`
// Path is where it is, as the Pi's machine names it
Path string `json:"path"`
On bool `json:"on"`
// Listed: settings.json names it, rather than the folder holding it
Listed bool `json:"listed,omitempty"`
// Folder: a folder, not one file
Folder bool `json:"folder,omitempty"`
// contains filtered or unexported fields
}
PiExt is one extension of a Pi's own: in its extensions folder, or listed by path in its settings.json.
type PiExtensions ¶ added in v0.1.3375
type PiExtensions struct {
Pis []PiHere `json:"pis"`
}
PiExtensions is every Pi here, with its extensions and packages.
func ReadPiExtensions ¶ added in v0.1.3375
func ReadPiExtensions() *PiExtensions
ReadPiExtensions lists every Pi here, with its extensions and packages.
func SetPiExtension ¶ added in v0.1.3375
func SetPiExtension(pi, id string, on bool) (*PiExtensions, error)
SetPiExtension switches one of a Pi's own extensions on or off, as `pi config` does: "-<path>" in settings.json's extensions takes it out, and on takes that out again, adding "+<path>" only when a "!" pattern there would still leave it out.
func SetPiPackage ¶ added in v0.1.3375
func SetPiPackage(pi, source string, on bool) (*PiExtensions, error)
SetPiPackage switches a whole package on or off: off is its entry with every filter empty, so Pi keeps it installed and loads none of it; on is its source alone again. One whose entry has other filters is changed in `pi config`, which can pick them one by one.
type PiHere ¶ added in v0.1.3375
type PiHere struct {
ID string `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
WSL string `json:"wsl,omitempty"`
// Asleep: its distro isn't running, and nothing in it is read, as that
// would start it (#3896)
Asleep bool `json:"asleep,omitempty"`
// Dir is its agent folder, as magpie opens it
Dir string `json:"dir,omitempty"`
// Err says why its settings.json can't be read: nothing is listed,
// and nothing is written to it, rather than taking it for empty
Err string `json:"err,omitempty"`
Extensions []PiExt `json:"extensions"`
Packages []PiPackage `json:"packages"`
}
PiHere is one Pi: this machine's, or one in a WSL distro.
type PiInstalled ¶
type PiInstalled struct {
*PiExtensions
// Pending: only settings.json was changed; Pi installs the package
// (or no longer loads it) when it next starts
Pending bool `json:"pending,omitempty"`
}
PiInstalled is what an install or a removal did, for the page to say.
func InstallPiPackage ¶
func InstallPiPackage(pi, source string) (*PiInstalled, error)
InstallPiPackage installs a package from npm or git into a Pi: one from the market, or one the search named (PiDirectAt).
func RemovePiPackage ¶
func RemovePiPackage(pi, source string) (*PiInstalled, error)
RemovePiPackage takes a package out of a Pi, as `pi remove` does.
type PiMarketPackage ¶
type PiMarketPackage struct {
// Source is what Pi installs it by: npm:<name>
Source string `json:"source"`
Name string `json:"name"`
Version string `json:"version,omitempty"`
Description string `json:"description,omitempty"`
Publisher string `json:"publisher,omitempty"`
// Downloads is npm's count for the last month
Downloads int `json:"downloads,omitempty"`
Icon string `json:"icon,omitempty"`
NPM string `json:"npm"`
Repo string `json:"repo,omitempty"`
Homepage string `json:"homepage,omitempty"`
Updated string `json:"updated,omitempty"`
// Kind is npm or git, and ID the package however its source pins it
// (piSourceID): what a Pi's own packages are matched by
Kind string `json:"kind"`
ID string `json:"id"`
}
PiMarketPackage is one package the market offers.
func MarketPiPackages ¶
func MarketPiPackages(q string) ([]PiMarketPackage, error)
MarketPiPackages is what the market shows for a search: the popular packages that match it, then what npm finds for it.
func PiDirectAt ¶
func PiDirectAt(q string, found []PiMarketPackage) *PiMarketPackage
PiDirectAt is the package a search names outright, to install as named, when it's one Pi can install and none of what was found is it; nil otherwise.
type PiPackage ¶ added in v0.1.3375
type PiPackage struct {
Source string `json:"source"`
Name string `json:"name"`
// Kind is npm, git or local
Kind string `json:"kind"`
// ID is the package however its source pins it (piSourceID), for an
// npm or git one: what the market's cards are matched by
ID string `json:"id,omitempty"`
// Pin is the version or ref the source names, if any
Pin string `json:"pin,omitempty"`
On bool `json:"on"`
// Filtered: the entry picks some of the package's resources (filters
// of the user's, or `pi config`'s), which a switch here would lose;
// it is changed in `pi config`
Filtered bool `json:"filtered,omitempty"`
// Installed: Pi has it on disk; one that isn't is installed when Pi
// next starts
Installed bool `json:"installed"`
Version string `json:"version,omitempty"`
// contains filtered or unexported fields
}
PiPackage is one entry of a Pi's settings.json "packages".
type PiRec ¶
type PiRec struct {
Source string `json:"source"`
Entry json.RawMessage `json:"entry"`
Orig json.RawMessage `json:"orig,omitempty"`
}
PiRec is a package entry magpie wrote in a project: Entry as it is now, Orig the user's entry it adopted, nil for one magpie added.
type Plugin ¶
type Plugin struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
// Source is what the user gave to install it (a folder, a repository,
// a marketplace.json's folder), and Pick the plugin's name in it when
// that is a marketplace: an update fetches it again from there
Source string `json:"source,omitempty"`
Pick string `json:"pick,omitempty"`
// Agents are the agents it is given to when it is on
Agents []string `json:"agents"`
// Off is set while it is turned off: none of its parts is given to any
// agent, and Agents are kept for turning it on again
Off bool `json:"off,omitempty"`
// the items it made, by name
Skills []string `json:"skills,omitempty"`
MCP []string `json:"mcp,omitempty"`
Hooks []string `json:"hooks,omitempty"`
Subagents []string `json:"subagents,omitempty"`
// Extensions are the Pi extensions a Pi package declares (package.json
// pi.extensions), as paths in its folder. They are Pi's to load, from
// the package entry a project giving the plugin to Pi gets (#7267), so
// magpie writes nothing for them
Extensions []string `json:"extensions,omitempty"`
// Left are the parts of the plugin magpie doesn't carry, and why
Left []PluginLeft `json:"left,omitempty"`
// Installed is when it was installed or last updated
Installed string `json:"installed,omitempty"`
// Pending is set while a plugin another computer has, by a source
// this one fetches it from, hasn't been fetched here yet: it was
// synced in and the fetch failed (plugin_carry.go). Update tries again
Pending bool `json:"pending,omitempty"`
}
Plugin is a plugin the library keeps.
type PluginCandidate ¶
type PluginCandidate struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
Skills int `json:"skills"`
MCP int `json:"mcp"`
Hooks int `json:"hooks"`
Subagents int `json:"subagents"`
Extensions int `json:"extensions,omitempty"`
// Remote: it is fetched from another repository when installed, so
// its parts aren't counted
Remote bool `json:"remote,omitempty"`
// Have: the library has it already
Have bool `json:"have,omitempty"`
Left []PluginLeft `json:"left,omitempty"`
// contains filtered or unexported fields
}
PluginCandidate is a plugin found at what the user gave.
type PluginLeft ¶
PluginLeft is a part of a plugin that wasn't carried.
type PluginProbe ¶
type PluginProbe struct {
Source string `json:"source"`
Marketplace string `json:"marketplace,omitempty"` // its name, when there are several
Candidates []PluginCandidate `json:"candidates"`
// contains filtered or unexported fields
}
PluginProbe is what was found at an address.
func ProbePlugins ¶
func ProbePlugins(input string) (*PluginProbe, error)
ProbePlugins looks for plugins at what the user typed: a plugin's folder, a marketplace's (its .claude-plugin/marketplace.json), or a repository with either.
type PluginServer ¶ added in v0.1.3245
type PluginServer struct {
Name string `json:"name"`
Plugin string `json:"plugin"` // plugin.Name, which PluginServerOn takes
// On is the Library's switch for it (!Hidden), so the Plugins page's
// Give to agents and Hide from agents say what the Library's row does:
// on with no agent ticked, an app at the MCP router's address has it
On bool `json:"on"`
}
PluginServer is the server of a plugin's tools, as the plugin's row on the Plugins page shows it.
type PluginView ¶
type PluginView struct {
*Plugin
// Missing are parts the user took out one by one since
Missing []string `json:"missing,omitempty"`
Dir string `json:"dir"`
}
PluginView is a plugin as the page shows it.
type Probe ¶
type Probe struct {
Source string `json:"source"`
Kind string `json:"kind"`
Candidates []Candidate `json:"candidates"`
// Left is the skills there too big to install on their own, left out
// of the candidates (#2062)
Left []LeftOut `json:"left,omitempty"`
// contains filtered or unexported fields
}
Probe is what was found at a source.
func ProbeSkills ¶
ProbeSkills looks for skills at what the user typed: a GitHub repository (or a folder in one), any other git repository (GitLab, one on a company's own server; fetched with the user's git), a folder on this machine, or a skills CLI command for one of them.
type Problem ¶
type Problem struct {
Agent string `json:"agent"`
What string `json:"what"` // instructions, mcp:<name>, skill:<name>
Error string `json:"error"`
// Own is a skill the agent has a folder of its own for, not the
// library's: the page offers to use the library's or keep the agent's
Own bool `json:"own,omitempty"`
}
Problem is one thing that couldn't be given to an agent.
type Project ¶ added in v0.1.243
type Project struct {
Dir string `json:"dir"`
// Copy puts copies of the skills there, not links to the library's
// (for Windows, or a folder synced or shared where a link won't do);
// a copy is made again when the library's skill changes
Copy bool `json:"copy,omitempty"`
// Skills are the library's skills the project has, and for which agents
Skills map[string][]string `json:"skills,omitempty"`
// Placed are the entries magpie put in the folder (.claude/skills/pdf),
// the only ones it ever takes away
Placed []string `json:"placed,omitempty"`
// Made are the folders magpie made to place them in, taken away again
// once they're empty; Gitignore is whether it made the .gitignore
Made []string `json:"made,omitempty"`
Gitignore bool `json:"gitignore,omitempty"`
// Servers are the library's MCP servers the project has, and for which
// agents (project_mcp.go)
Servers map[string][]string `json:"servers,omitempty"`
// Wrote are, by the project's file (.mcp.json), the servers magpie
// wrote in it, the only entries it ever takes out
Wrote map[string][]string `json:"wrote,omitempty"`
// Startup are, by the project's file, the startup timeout magpie
// wrote in each server's entry there (Codex's startup_timeout_sec):
// one other than this is the user's
Startup map[string]map[string]float64 `json:"startup,omitempty"`
// MadeFiles are the files magpie made to write servers in, listed in
// the .gitignore and taken away again once nothing's left in them
MadeFiles []string `json:"madeFiles,omitempty"`
// ServersOff and SkillsOff are global servers and skills (given to
// the agents themselves) the project turns off, and for which agents
// (project_scope.go)
ServersOff map[string][]string `json:"serversOff,omitempty"`
SkillsOff map[string][]string `json:"skillsOff,omitempty"`
// Claude is what magpie wrote in Claude Code's own record of the
// project (~/.claude.json): the router's entry, servers turned off
Claude *claudeLocal `json:"claude,omitempty"`
// CodexOff are the servers magpie turned off in the project's
// .codex/config.toml, Overrides the skills it turned off in
// .claude/settings.local.json
CodexOff []string `json:"codexOff,omitempty"`
Overrides []string `json:"overrides,omitempty"`
// Trees are the project's folder in each other worktree of its git
// repository, given the project's set, with what magpie put in each
Trees []*Project `json:"trees,omitempty"`
// Subagents are the library's subagents the project has, and for which
// agents; AgentFiles the files magpie wrote for them, by their hash
// (project_subagents.go)
Subagents map[string][]string `json:"subagents,omitempty"`
AgentFiles []SubagentFile `json:"agentFiles,omitempty"`
// Hooks are the library's hooks the project has on their own, and for
// which agents, written into each agent's project hooks file like
// those of its plugins (HookRecs; project_plugins.go)
Hooks map[string][]string `json:"hooks,omitempty"`
// Instr is the project's own instructions, InstrAgents the agents
// whose project file they're written into, InstrFiles the files
// magpie wrote them in (project_instructions.go)
Instr string `json:"instr,omitempty"`
InstrAgents []string `json:"instrAgents,omitempty"`
InstrFiles []InstrFile `json:"instrFiles,omitempty"`
// Plugins are the library's plugins the project has, and for which
// agents: each part goes to those of them that take it in a project,
// beside the project's own (project_plugins.go). HookRecs are, by
// agent, the hook entries magpie wrote in the project's file for them
Plugins map[string][]string `json:"plugins,omitempty"`
HookRecs map[string][]HookEntry `json:"hookRecs,omitempty"`
// ClaudePlugins are the plugins Claude Code has installed that the
// project turns on for itself, ClaudeWrote the enabledPlugins keys
// magpie wrote for them in .claude/settings.local.json, the only
// ones it takes out (project_claude_plugins.go)
ClaudePlugins []string `json:"claudePlugins,omitempty"`
ClaudeWrote []string `json:"claudeWrote,omitempty"`
// Pi are the Pi packages the project wants in its .pi/settings.json by
// source ("on" or "off"), PiRecs the entries magpie wrote or adopted
// (project_pi.go)
Pi map[string]string `json:"pi,omitempty"`
PiRecs []PiRec `json:"piRecs,omitempty"`
// contains filtered or unexported fields
}
Project is a folder of the user's whose agents get some of the library's skills there, as the project's own: each is placed in the folder the agent reads a project's skills from, and kept out of git.
func (*Project) UnmarshalJSON ¶
A project's claudePlugins and pi read in the shapes another build of magpie wrote them in too (#7282, jinpwng): claudePlugins as a map of plugin id to on (true) or off, pi as a map of source to the agents it is for. One of them used to fail the whole library's read, so nothing could be changed. They're read as magpie's own shapes: a plugin on is in the list, one off is left out, as magpie turns on only and writes nothing for it; a Pi source for some agent is "on", for none "off". The file is untouched until magpie next writes it, and then the bytes it had are kept beside it first, as library.json.before-reshape (reshapedCopy).
type ProjectApplied ¶
ProjectApplied is what ApplyProject did: Saved the hooks and subagents it put in the library from the export, Missing what it left out and why, Res each write's outcome.
func ApplyProject ¶
func ApplyProject(dir string, e *ProjectExport) (*ProjectApplied, error)
ApplyProject gives a folder the choices of an export, adding it as a project first when it isn't one. A choice the folder has already keeps its agents and gains the export's; nothing it has is taken away, so applying again changes nothing.
type ProjectExport ¶
type ProjectExport struct {
Kind string `json:"kind"`
Version int `json:"version"`
// Dir is the folder it was taken from, for the reader alone: apply
// gives the choices to the folder it's told
Dir string `json:"dir,omitempty"`
Copy bool `json:"copy,omitempty"`
Skills map[string][]string `json:"skills,omitempty"`
Servers map[string][]string `json:"servers,omitempty"`
Subagents map[string][]string `json:"subagents,omitempty"`
Hooks map[string][]string `json:"hooks,omitempty"`
Plugins map[string][]string `json:"plugins,omitempty"`
ClaudePlugins []string `json:"claudePlugins,omitempty"`
Pi map[string]string `json:"pi,omitempty"`
ServersOff map[string][]string `json:"serversOff,omitempty"`
SkillsOff map[string][]string `json:"skillsOff,omitempty"`
Instr string `json:"instr,omitempty"`
InstrAgents []string `json:"instrAgents,omitempty"`
Need ExportNeeds `json:"need"`
}
func ExportProject ¶
func ExportProject(dir string) (*ProjectExport, error)
ExportProject is a project's choices and what they need of the library.
type ProjectInstr ¶
ProjectInstr is a change to a project's instructions: its text, the agents it is written for, or both; nil leaves that as it is.
type ProjectPiView ¶
type ProjectPiView struct {
Source string `json:"source"`
Name string `json:"name"`
// State is "on" or "off" (kept, loads nothing)
State string `json:"state"`
// Adopted: the entry was the project's own, which magpie only switches
Adopted bool `json:"adopted,omitempty"`
}
ProjectPiView is a package the project has by magpie, for its card.
type ProjectView ¶ added in v0.1.243
type ProjectView struct {
Dir string `json:"dir"`
Name string `json:"name"`
Copy bool `json:"copy"`
Skills map[string][]string `json:"skills"`
Placed []string `json:"placed"`
Servers map[string][]string `json:"servers"`
// Wrote are, by the project's file, the servers magpie wrote there
Wrote map[string][]string `json:"wrote"`
// ServersOff and SkillsOff are the Library's servers and skills
// turned off in this project, each for the agents named
ServersOff map[string][]string `json:"serversOff"`
SkillsOff map[string][]string `json:"skillsOff"`
// Trees are the project's folder in the repository's other git
// worktrees, which follow it
Trees []string `json:"trees,omitempty"`
// Subagents are the library's subagents the project has, for the
// agents named
Subagents map[string][]string `json:"subagents"`
// AgentFiles are the project's files magpie wrote for them
AgentFiles []string `json:"agentFiles"`
// Instr is the project's own instructions, InstrAgents the agents
// they're for, InstrFiles the project's files magpie wrote them in
Instr string `json:"instr"`
InstrAgents []string `json:"instrAgents"`
InstrFiles []string `json:"instrFiles"`
// Plugins are the library's plugins the project has, for the agents
// named
Plugins map[string][]string `json:"plugins"`
// ClaudePlugins are the plugins Claude Code has installed that the
// project turns on for itself
ClaudePlugins []string `json:"claudePlugins"`
// Pi are the Pi packages the project has by magpie (#7249)
Pi []ProjectPiView `json:"pi"`
// Hooks are the library's hooks the project has on their own, for
// the agents given
Hooks map[string][]string `json:"hooks"`
// Own are, by kind (skills, servers, hooks, subagents), what the
// project's own files already give agents and magpie didn't place:
// read-only (#7245)
Own map[string][]OwnResource `json:"own,omitempty"`
Missing bool `json:"missing,omitempty"` // the folder is gone
// Problems are, by skill ("" for the project's own), what couldn't be done
Problems map[string]string `json:"problems,omitempty"`
}
ProjectView is a project as the page shows it.
type RTKAgent ¶ added in v0.1.124
type RTKAgent struct {
ID string `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
On bool `json:"on"`
// Blocked says why rtk can't be switched on for it here (OpenCode 2);
// one that has it can still be switched off
Blocked string `json:"blocked,omitempty"`
// NoHook: rtk has no hook for it at all (rtkNoHook), and Blocked says why
NoHook bool `json:"noHook,omitempty"`
// WSL is the distro an agent in WSL lives in: its hook runs the rtk
// of that distro (RTKView.WSL), not this machine's
WSL string `json:"wsl,omitempty"`
// Asleep: its distro isn't running, so its files aren't read (that
// would start it) and On isn't known
Asleep bool `json:"asleep,omitempty"`
}
RTKAgent is one agent rtk can be given to, and whether it has it.
type RTKDay ¶ added in v0.1.328
type RTKDay struct {
Date string `json:"date"` // 2006-01-02, local
Commands int `json:"commands"`
Input int64 `json:"input"`
Saved int64 `json:"saved"`
Pct float64 `json:"pct"`
}
RTKDay is what rtk saved on one day it ran commands.
type RTKDistro ¶ added in v0.1.2054
type RTKDistro struct {
Name string `json:"name"`
// Path is rtk's inside the distro, "" when it isn't installed there
Path string `json:"path,omitempty"`
Version string `json:"version,omitempty"`
// OffPath: found where its installer puts it, but not on the PATH of
// the distro's shells, which its hooks run rtk by
OffPath bool `json:"offPath,omitempty"`
// Install is the command Install RTK runs in the distro
Install string `json:"install,omitempty"`
// Asleep: the distro isn't running, and isn't looked in
Asleep bool `json:"asleep,omitempty"`
}
RTKDistro is the rtk of one WSL distro an agent listed lives in.
type RTKGain ¶ added in v0.1.124
type RTKGain struct {
Commands int `json:"commands"`
Input int64 `json:"input"`
Saved int64 `json:"saved"`
Pct float64 `json:"pct"`
}
RTKGain is what rtk says it saved, over every command it has recorded.
type RTKView ¶ added in v0.1.124
type RTKView struct {
Path string `json:"path,omitempty"` // "" when rtk isn't installed
Version string `json:"version,omitempty"`
Gain *RTKGain `json:"gain,omitempty"`
// GainErr is why what rtk saved isn't known: rtk gain failed or
// printed nothing readable
GainErr string `json:"gainErr,omitempty"`
// CodexSandbox is the Windows sandbox Codex runs its commands in,
// when it has rtk: what rtk saves there isn't counted in Gain
CodexSandbox string `json:"codexSandbox,omitempty"`
// Days are what it saved each day it ran commands, oldest first
Days []RTKDay `json:"days,omitempty"`
// Latest is rtk's latest release, "" when it isn't known (see
// CheckLatest); Upgrade the command Upgrade RTK runs, "" when magpie
// doesn't know how this rtk was installed
Latest string `json:"latest,omitempty"`
Upgrade string `json:"upgrade,omitempty"`
// NoUpgrade is why there is no Upgrade when magpie knows: "cargo", an
// rtk cargo installed with no cargo to be found to upgrade it, which
// the page says with Manual, the command to run in a terminal once
// there is (新v学员: its Upgrade button only did nothing)
NoUpgrade string `json:"noUpgrade,omitempty"`
Manual string `json:"manual,omitempty"`
// Admin is the folder rtk is in when only an administrator can change
// it (winget's for every user, under Program Files): Upgrade asks
// Windows for one first
Admin string `json:"admin,omitempty"`
// Waiting is the package manager this rtk was installed with (winget,
// Homebrew) when Latest is out but it has nothing newer than this rtk
// yet, WaitingHas what it has: an upgrade through it would change
// nothing, so the page offers none (#1025)
Waiting string `json:"waiting,omitempty"`
WaitingHas string `json:"waitingHas,omitempty"`
// Note is what an upgrade left to say: Homebrew's rtk behind rtk's
// own release
Note string `json:"note,omitempty"`
// OffPath: rtk isn't on the PATH an agent started now gets, so its
// hooks, which run rtk by name, do nothing (Pi's says "rtk binary not
// found in PATH"). PathDir is where Put RTK on PATH makes it found — a
// link to it made in that folder (PathLink), or (Windows) that folder,
// rtk's own, added to the user's PATH; "" when magpie has nowhere
PathDir string `json:"pathDir,omitempty"`
PathLink bool `json:"pathLink,omitempty"`
OffPath bool `json:"offPath,omitempty"`
Agents []RTKAgent `json:"agents"`
// WSL is the rtk of each WSL distro an agent listed lives in
WSL []RTKDistro `json:"wsl,omitempty"`
URL string `json:"url"`
// Install is the command Install RTK runs, shown before it is clicked
Install string `json:"install,omitempty"`
// Restart are the agents a change reached, to be restarted to see it
Restart []string `json:"restart,omitempty"`
Backup string `json:"backup,omitempty"`
}
RTKView is the RTK part of the Library page.
func InstallRTK ¶ added in v0.1.131
InstallRTK installs rtk, when the user asks for it.
func InstallRTKIn ¶ added in v0.1.2054
InstallRTKIn installs rtk in WSL distro with rtk's own Linux installer, run there, when the user asks for it. A distro that isn't running isn't started for it.
func PathRTK ¶ added in v0.1.681
PathRTK puts the rtk magpie found on the PATH agents get, when the user asks for it (see rtkOnPath).
func ReadRTK ¶ added in v0.1.124
func ReadRTK() *RTKView
ReadRTK says whether rtk is installed, what it saved, and which agents have it.
func SetRTK ¶ added in v0.1.124
SetRTK gives rtk to an agent with rtk's own installer, or takes it away by taking out what that put in — which needs no rtk, so an agent left with the hook of an rtk since removed can be put right.
func UpgradeRTK ¶ added in v0.1.328
UpgradeRTK brings rtk up to its latest release the way it was installed.
func (*RTKView) CheckLatest ¶ added in v0.1.328
func (v *RTKView) CheckLatest()
CheckLatest fills in rtk's latest release (see RTKLatest), and, when it is newer than this rtk, what the package manager that installed it has — but only what that said before, and within its own age (Waiting): asking a package manager is slow (`winget show` refreshes its sources — seconds, on a slow or unreachable network far more), and a read that waits for it holds up the whole tab for a grey tag beside the version. CheckChannel asks in the background instead, and the next read draws with its answer.
type Result ¶
type Result struct {
Changed []string `json:"changed"` // agents whose files were written
Problems []Problem `json:"problems"` // what couldn't be written, and why
Backup string `json:"backup,omitempty"`
// Missing are the servers and skills (mcp:<name>, skill:<name>) a
// profile named that the library no longer has
Missing []string `json:"missing,omitempty"`
// Updated and Unupdated are, for an update of every skill, the ones
// fetched again and the ones that couldn't be (What is skill:<name>)
Updated []string `json:"updated,omitempty"`
Unupdated []Problem `json:"unupdated,omitempty"`
// Current is, for an update of one skill, that skill when what was
// fetched is the files it already had
Current []string `json:"current,omitempty"`
// Gone are, for an update of skills, the ones their sources no longer
// have: removed there, not failed (skill_gone.go)
Gone []string `json:"gone,omitempty"`
// Unimported are, for skills brought in together, the ones that
// couldn't be (What is skill:<name>)
Unimported []Problem `json:"unimported,omitempty"`
// Unremoved are, for skills or servers taken out together, the ones
// that couldn't be (What is skill:<name> or mcp:<name>)
Unremoved []Problem `json:"unremoved,omitempty"`
// Unmoved are, for skills handed over from ~/.agents/skills, the ones
// that couldn't be moved and stay where they were (What is skill:<name>)
Unmoved []Problem `json:"unmoved,omitempty"`
// Installed, Had and Skipped are, for skills installed together, the
// ones added, the ones the library had already from the same source,
// and the ones left out with why: another skill by that name, the
// user's, is never written over (What is skill:<name>)
Installed []string `json:"installed,omitempty"`
Had []string `json:"had,omitempty"`
Skipped []Problem `json:"skipped,omitempty"`
// Linked are, for skills installed from GitHub, the ones the library
// had from a folder by that name that now follow GitHub, with its
// files (skill_link.go); LinkedKept those of them whose own files
// weren't GitHub's, kept with the backups
Linked []string `json:"linked,omitempty"`
LinkedKept []string `json:"linkedKept,omitempty"`
// Subagents is, for subagents imported from a repository, what was
// added, updated, had already, and left as changed here
Subagents *SubagentsImported `json:"subagents,omitempty"`
// Commands is, for slash commands imported from the agents, what was
// added and the library's own given to more agents
Commands *CommandsImported `json:"commands,omitempty"`
// contains filtered or unexported fields
}
Result is what a change did to the agents.
func AddNewSkills ¶ added in v0.1.1091
AddNewSkills adds the new skills a check found, by their IDs, each to the agents that have its repository's other skills. The repository is fetched once for those of it.
func AddProject ¶ added in v0.1.243
AddProject adds a folder whose agents can be given library skills.
func AddServerAccount ¶
AddServerAccount gives the server another account, a set of headers (a key as Authorization), and puts it in use.
func AutoUpdateTick ¶
AutoUpdateTick looks for changed skills and updates them, when the switch is on and no look was made for checkEvery. It returns what the update did, nil when nothing was due or nothing had changed.
func CommandAgentsSet ¶
CommandAgentsSet sets which agents get a slash command.
func CreateSkill ¶
CreateSkill makes a skill of the user's own in the library's folder: a SKILL.md with a name and description in its front matter, listed with no source and given to the agents like any other. The name can't be one the library has, one an agent has of its own, or a folder in the way.
func EveryServerAgents ¶ added in v0.1.611
EveryServerAgents gives every server in the library to the agents named, or takes every one from them, in one write rather than one for each server (#475). An agent not named keeps what it has, as with a server's All chip; on gives an agent only the servers it can reach (no SSE for Codex, no remote one for Claude Desktop), as its chips can't be lit for the others.
func EverySkillAgents ¶ added in v0.1.596
EverySkillAgents gives every skill in the library to the agents named, or takes every one from them, in one write rather than one for each skill (#443). An agent not named keeps what it has, as with a skill's All chip.
func GroupSkills ¶ added in v0.1.896
GroupSkills puts the skills named into the group called name, made when there is none, and takes them out of any other: a skill is in one group at most. old, when given, is a group renamed to name, and its skills are then those named when any are. No names and no old is nothing; a rename to a group there is already is refused.
func HandBackSkill ¶ added in v0.1.2016
HandBackSkill puts a skill handed over (HandOverSkills) back into ~/.agents/skills: its folder moves there, and the library links to it, as it did before. Which agents it's ticked for stays as it is; those that read ~/.agents/skills have it again whatever is ticked.
func HandOverSkills ¶ added in v0.1.2016
HandOverSkills gives skills kept in ~/.agents/skills to the library to manage (tnt1223 on Discord, "统一移入 magpie 的资源库文件夹,交给 magpie 管理"). Several agents read that folder themselves, so a skill there is on for each of them whatever the library ticks, and turning it off for one, or on this computer alone (OffHere), can't work. Handed over:
- a folder kept in ~/.agents/skills moves into the library's own folder (renamed, or copied, checked the same and only then set aside with the backups), and its entry there is gone;
- an entry there that only links to a folder elsewhere is taken away, and the library links to that folder past it;
- the user's own links to it in the agents' folders, which would point at nothing, are taken away too.
Every agent that read it there, or through such a link, is ticked for it, so each goes on having it, now from the library, till it's unticked. A skill not in the library yet (found in ~/.agents/skills) is brought in first. One that can't be handed over stays as it was, in Unmoved, and the others are handed over all the same. It also turns off the setting that keeps every skill in ~/.agents/skills. HandBackSkill undoes it.
func HookAgents ¶ added in v0.1.1214
HookAgents sets which agents get a hook.
func ImportCommands ¶
ImportCommands takes the commands found at those paths (each one's first file, as ProbeCommands lists it) into the library, for the agents they were found in.
func ImportHooks ¶
ImportHooks brings the hooks named into the library: each is the library's from then on, given to the agent it was found in, the entry there left exactly as it is. One the same as a library hook given to other agents ticks this agent for that hook.
func ImportInstructions ¶
ImportInstructions moves the user's own instructions out of an agent's file into the library: they are added to the shared text, taken out of the file (which is kept aside first), and the agent gets the shared text from then on — so what it reads is what it read before.
func ImportServer ¶
ImportServer takes a server the agents have into the library: the agents that have it as it is get the library's from then on, the same entry.
func ImportSkill ¶
ImportSkill takes a skill the agents have of their own into the library: a folder is moved in, a link to a folder elsewhere is linked to from the library, and the agents that had it get the library's from then on.
func ImportSkills ¶ added in v0.1.491
ImportSkills is ImportSkill for several skills at once, written to the agents once. One that can't be brought in is said in Unimported, and the others are brought in all the same.
func ImportSubagents ¶
ImportSubagents adds the subagents at those paths of input (every one with none named) and gives the new ones to the agents; one the library has from there is updated, keeping its name and agents.
func InstallMarketSkill ¶
InstallMarketSkill adds a skill from the market, found in its repository, and gives it to the agents named — to every agent that can have skills when none are.
func InstallPlugins ¶
InstallPlugins installs the plugins named (all of them, of one plugin) from what the user gave, and gives them to the agents. One the library has is replaced by this one, keeping the agents it was given to and whether it is on.
func InstallServer ¶
InstallServer adds a market server to the library, filled in with values (by input key), and gives it to the agents named — to every agent that can have it when none are.
func InstallSkills ¶
InstallSkills adds the skills at those paths of the source to the library and gives them to the agents named. One the library has already, or one whose name is taken, is left as it is and said in the result; the others are installed all the same.
func KeepAgentSkill ¶ added in v0.1.498
KeepAgentSkill settles it the other way: the agent keeps its own, and the library no longer gives it that skill (nor any agent that reads the very same folder).
func KeepAgentSkills ¶ added in v0.1.1224
KeepAgentSkills is KeepAgentSkill for several of one agent's skills at once (#1896).
func MemorySkill ¶
MemorySkill makes the procedure memory with id a skill of the library's own, as Memory's suggestion does once the agents search for it often: a SKILL.md holding its text (and why), named from its words, given to the agents ticked for instructions (the ones memory is published to), or to every agent with skills when none is. The memory is archived then, noted as that skill's (memory.MadeSkill). It answers with the skill's name.
func PluginAgents ¶
PluginAgents sets which agents get a plugin's parts. Each part goes only to the agents that can take it.
func PluginOn ¶
PluginOn turns a plugin on or off: off takes all its parts from every agent and keeps them in the library.
func PluginServerOn ¶ added in v0.1.3245
PluginServerOn hides a plugin's tools from every agent, or shows them again (chengming0v0 on Discord: a plugin's tools no agent should see, the plugin kept for its providers). Hidden, no agent is given the server, nor an app at the MCP router's address, and the agents it had are kept (Paused); shown again, they get it back. With none kept (it was given to none when added, or taken from each agent in the Library), on gives it to the agents the MCP router's entry goes to, or with the router off or given to none, to every agent shown that can take it, as the row's All chip in the Library does.
func ProjectClaudePlugin ¶
ProjectClaudePlugin sets whether a project turns on a plugin Claude Code has installed, in its own settings; off takes the key magpie wrote out.
func ProjectCopy ¶ added in v0.1.243
ProjectCopy sets whether a project gets copies of its skills rather than links; those there are made again the other way.
func ProjectHooks ¶
ProjectHooks sets which agents get each of some library hooks in a project, one at a time, not as part of a plugin (#7253); none takes them out, and with them only the entries magpie wrote.
func ProjectInstructions ¶
func ProjectInstructions(dir string, c ProjectInstr) (*Result, error)
ProjectInstructions sets a project's own instructions, and the agents whose project file they are written into; no agents, or no text, takes them out of the project's files.
func ProjectPi ¶
ProjectPi sets a package of a project's Pi to state: "on", "off" (kept, loads nothing) or "removed". A package the project declares already is refused until it is adopted.
func ProjectPiAdopt ¶
ProjectPiAdopt takes the package the project declares in its .pi/settings.json into magpie's keeping without rewriting it: it can then be turned off and on, and letting it go puts the entry back as it was. An entry that picks some of the package's resources is refused (`pi config` changes those).
func ProjectPlugin ¶
ProjectPlugin sets which agents get a library plugin in a project: each of its parts goes to those of them that take it there. None takes the plugin out of the project, and with it only what magpie wrote for it.
func ProjectServer ¶ added in v0.1.629
ProjectServer sets which agents get a library server in a project; none takes it out of the project.
func ProjectServerOff ¶
ProjectServerOff sets which agents have a global server turned off in a project; none gives it back to the project as the global set has it.
func ProjectSkill ¶ added in v0.1.243
ProjectSkill sets which agents get a library skill in a project; none takes it out of the project.
func ProjectSkills ¶
ProjectSkills sets which agents get each of some library skills in a project, in one write: the skills a project's card picks from its menu (POM_JUMPING on X). The project's other skills stay as they are; none takes these out of it.
func ProjectSkillsOff ¶
ProjectSkillsOff sets which agents have each of some global skills turned off in a project; none gives them back.
func ProjectSubagents ¶
ProjectSubagents sets which agents get each of some library subagents in a project; none takes them out of it.
func PublishMemory ¶
PublishMemory makes what memory holds now the digest the agents are given (memory.Publish) and, when it changed, writes the instructions into them again: a change the user made to memory. due publishes only when the last was a day ago (memory.PublishDue), for what agents saved meanwhile. nil, nil when nothing changed.
func Put ¶ added in v0.1.182
Put makes the library what b says — its instructions, servers and skills in place of the ones here — and writes it into the agents, which keep whatever of theirs isn't magpie's. The skills are written aside first, and only once all of them are there does any go in; a skill replaced or taken out is kept with the backups, and so is an instructions file that changes. A skill that comes linked to a folder this computer has too is linked to it; else it comes as its files. A skill whose files are as they are here is left alone. The subagents replace the ones here too, unless b is from a magpie that didn't carry them.
func RemoveCommands ¶
RemoveCommands takes the slash commands named out of the library, and the files magpie wrote of them, still as it wrote them, out of every agent.
func RemoveEnv ¶
RemoveEnv takes a variable out of the library, and what magpie wrote of it out of every agent.
func RemoveFoundHooks ¶
RemoveFoundHooks takes the hooks named out of their agents' files, each file copied to the backups first: Backups puts one back. The rest of each file stays as it is, and Codex's trust of the hooks after one moves with them.
func RemoveFoundServer ¶ added in v0.1.1191
RemoveFoundServer takes a server the agents have of their own out of every agent that has it as it is (#1618), without bringing it into the library first: its entry goes from each file the agent reads servers from (dsh's other profiles, Claude Desktop's Claude-3p file, Pi's other mcp.json too), each file copied to the backups before it is written, and the rest of each file — the user's other servers, their keys, comments — left as it is. Another server by that name (Others) is another server and stays. One the agent's app puts back each time it starts (Own) is left: taking it out wouldn't last. A file that can't be read now is never written: what it holds is unknown, not nothing.
func RemoveFoundSkill ¶ added in v0.1.1119
RemoveFoundSkill takes a skill the agents have of their own out of every agent that has it (#1303), without bringing it into the library first: each agent's folder, and its copies of the very same files, go to the backups; its links are taken away. Its entry in the shared ~/.agents/skills, or a folder of it left in the library's own, goes to the backups too, as agents read those. A folder elsewhere that the agents only linked to is left where it is, and so is another skill by that name (Others): that is another skill.
func RemoveFoundSkills ¶ added in v0.1.1222
RemoveFoundSkills takes the skills named, of those the agents have of their own, out of every agent in one change, each exactly as RemoveFoundSkill takes one (wongxy on Discord: 批量删除). One that can't be taken out stays, and is said in Unremoved; the others go all the same. Only when none went does the change fail, with the first reason.
func RemoveFoundSkillsHow ¶
RemoveFoundSkillsHow is RemoveFoundSkills, with keep false deleting the skills' folders rather than moving them to the backups. Links are only taken away either way: a folder they lead to stays.
func RemoveGoneSkills ¶ added in v0.1.1326
RemoveGoneSkills takes out of the library, as RemoveSkills does, the skills named that their sources no longer have; with none named, every such skill. One found in its source again since is left, and said in Unremoved.
func RemoveGoneSkillsHow ¶
RemoveGoneSkillsHow is RemoveGoneSkills, with keep false deleting their folders rather than moving them to the backups (RemoveSkillsHow).
func RemoveHooks ¶ added in v0.1.1214
RemoveHooks takes the hooks named out of the library, and what magpie wrote of them out of every agent. A name the library hasn't is said in Unremoved, the others gone all the same.
func RemovePlugin ¶
RemovePlugin takes a plugin out of the library, every part of it out of every agent and its folder out of the library's.
func RemoveProject ¶ added in v0.1.243
RemoveProject takes every skill magpie placed out of a project, and the project off the list; what's left, it couldn't take away and says why. keep takes the project off the list alone (#514: a project given a few skills or servers once, to keep them): everything magpie put in the folder — skills, servers in the agents' files, its lines in the .gitignore — stays as it is, the user's from then on.
func RemoveRules ¶
RemoveRules takes the rules named out of the library, and the files magpie wrote of them, still as it wrote them, out of every agent.
func RemoveServer ¶
RemoveServer takes a server out of the library and out of every agent magpie gave it to.
func RemoveServerAccount ¶
RemoveServerAccount takes an account away from the server; the one in use going puts the server's own headers back in use.
func RemoveServers ¶ added in v0.1.1090
RemoveServers takes the servers named out of the library and every agent in one write (#1027), each as RemoveServer does: only the entries magpie wrote (Applied) leave the agents' files, a server of the agent's own by another name stays, and each one's sign-in goes with it. One that can't be taken out stays, and is said in Unremoved.
func RemoveSkill ¶
RemoveSkill takes a skill out of the library and every agent; its folder is kept aside with the backups, never just deleted.
func RemoveSkills ¶ added in v0.1.599
RemoveSkills takes the skills named out of the library and every agent in one write (#449), each as RemoveSkill does: the folders kept aside together, in one backup, and a folder of the user's only unlinked. One that can't be taken out stays, and is said in Unremoved.
func RemoveSkillsHow ¶
RemoveSkillsHow is RemoveSkills, with keep false deleting the library's folders rather than moving them to the backups (Eternalfate__ on X: a skill removed is to be gone, not kept somewhere on disk). Only the library's own folder is deleted: a folder of the user's it links to (~/.agents/skills, or anywhere else) is only unlinked, as with keep, and one brought in from the agents still goes back to them.
func RemoveSubagents ¶ added in v0.1.1258
RemoveSubagents takes the subagents named out of the library, and the files magpie wrote of them, still as it wrote them, out of every agent.
func Restore ¶ added in v0.1.58
Restore gives the servers and skills to the agents s names and puts the instructions back as they were, then writes the library into the agents. A server or skill s names that the library no longer has is left out and listed in Result.Missing; one added to the library since s was taken is left with the agents it has, as s knows nothing of it. The library's own instructions files that change are kept aside with the agents' files, in the same backup.
func RuleAgentsSet ¶
RuleAgentsSet sets which agents get a rule.
func SaveCommand ¶
SaveCommand adds a slash command, or replaces the one called old (renaming it: the files magpie wrote by the old name go).
func SaveHook ¶ added in v0.1.1214
SaveHook adds a hook, or replaces the one called old (renaming it). An agent it can't be given is left out of it, said in the result.
func SaveInstructions ¶
func SaveInstructions(c InstructionsChange) (*Result, error)
SaveInstructions saves the change and writes it into the agents.
func SaveRule ¶
SaveRule adds a rule, or replaces the one called old (renaming it: the files magpie wrote by the old name go).
func SaveServer ¶
SaveServer adds a server, or replaces the one called old (renaming it).
func SaveSkillFile ¶ added in v0.1.2825
SaveSkillFile writes text into the file of a library skill at file, and gives the skill to its agents again. was is the text the page opened: when the file holds something else now (an agent, an update or the user changed it since), nothing is written, and the error says so.
func SaveSubagent ¶ added in v0.1.1258
SaveSubagent adds a subagent, or replaces the one called old (renaming it: the files magpie wrote by the old name go).
func ServerAgents ¶
ServerAgents sets which agents get a server.
func ServerHere ¶
ServerHere starts a synced command server with cmd (a program and its arguments) on this computer alone, the other computers keeping the synced one; with no cmd it goes back to the synced one.
func ServerHub ¶ added in v0.1.2242
ServerHub shares a server through the hub, or keeps it each agent's own entry (direct); the agents are written again at once, so the entry it had the other way goes.
func ServerLocal ¶ added in v0.1.2102
ServerLocal keeps a server to this computer, or lets a sync carry it again.
func ServerOn ¶
ServerOn turns a server off for everyone, or on again as it was (swang20201 on X: a server in the Library could only be removed). Off, no agent is given it, nor a project's, nor an app at the MCP router's address, and the router ends it; the agents it had are kept (Paused), with its command or address, env, headers, tools turned off and magpie's sign-in to it, which stay in the library. On, those agents get it back, none when it had none (it is the router's alone again). A plugin's server is the same switch as its row on the Plugins page.
func ServerTools ¶ added in v0.1.1183
ServerTools sets the tools of a server its agents leave out (nf1qaz2w on Discord); none turns every tool on again.
func SetAutoUpdateSkills ¶
SetAutoUpdateSkills turns updating the skills by themselves on or off.
func SetBorrow ¶
SetBorrow turns the switch of the Remote magpie id on or off. On, its Library is read at once (UseRemoteLibraries); off, what was taken from it and not changed since is taken out.
func SetMCPHub ¶ added in v0.1.1950
SetMCPHub turns the hub on or off: on, each agent that can reach it is given magpie's one entry in place of its servers; off, their own entries again, and the servers the hub started are ended.
func SetMemoryInInstructions ¶
SetMemoryInInstructions gives the agents ticked for instructions memory's digest, or takes it out of them, at once.
func SetRemoteMCP ¶ added in v0.1.3135
SetRemoteMCP turns the switch of the Remote magpie id on or off. On, it is asked again at its next model list (provider.AskRemoteHub asks at once); off, its server is taken out of the library and the agents.
func SetServer ¶
func SetServer(name string, o ServerOpts) (*Result, error)
SetServer changes settings of a server already in the library, keeping the rest of it as it is.
func SetSkillHow ¶ added in v0.1.1015
SetSkillHow sets the way the library gives its skills to every agent (agent "") or to one ("" for how the library does it); the agents' links and copies are made again the new way.
func SetSkillRouter ¶ added in v0.1.3353
SetSkillRouter turns the router on or off: on, each agent that can take it is given magpie-skills in place of the links of the skills it lists; off, their own links again.
func SetSkillsWhere ¶ added in v0.1.2761
SetSkillsWhere sets where the library's skills go: SkillsInAgents or SkillsInShared. Every skill is put in ~/.agents/skills, or taken out of it, at the sync it runs.
func SkillAgents ¶
SkillAgents sets which agents get a skill.
func SkillHere ¶ added in v0.1.1955
SkillHere turns a skill on or off on this computer alone. Which agents it is ticked for stays as it is, and so does every other computer's.
func SkillRouterHow ¶ added in v0.1.3353
SkillRouterHow lists a skill in the router, or keeps it each agent's own link (direct); the agents are written again at once.
func SomeHooksAgents ¶ added in v0.1.1214
SomeHooksAgents gives the hooks named to the agents, or takes them from them, each to the agents that can take it: an agent's own event stays that agent's alone.
func SomeServersAgents ¶ added in v0.1.1090
SomeServersAgents does as EveryServerAgents for the servers named alone: the ones picked on the page (#1027).
func SomeSkillsAgents ¶ added in v0.1.856
SomeSkillsAgents does as EverySkillAgents for the skills named alone: a repository's skills, from its group's chips (#787).
func SubagentAgentsSet ¶ added in v0.1.1258
SubagentAgentsSet sets which agents get a subagent.
func Sync ¶
Sync writes the library into the agents again: after an agent is installed, or a profile brings another library in. magpie does one at every start, and the Library page waits on the lock for each read and change: held for the whole sync, through every agent's skills, the first operations after opening magpie took seconds (#1624, Hipple). It lets go after each agent's part, for whatever waits to go first.
func SyncLinked ¶ added in v0.1.1227
SyncLinked writes the instructions into the agents again when the set they get is kept in a file of the user's that changed since it was last looked at — edited by hand, or by another tool that keeps it — and not otherwise: nil, nil. The first look at a file only notes it.
func UngroupSkills ¶ added in v0.1.896
UngroupSkills takes the group called name away; its skills go back to the groups by source. With names, only those leave it.
func UpdatePlugin ¶
UpdatePlugin fetches a plugin again from where it came from and replaces its parts, keeping the agents it is given to and whether it is on.
func UpdateSkill ¶
UpdateSkill fetches a skill from GitHub again, in place: the agents' links go on pointing at it. One changed here since it was fetched is an *EditedError unless replace is set, and then the changed version is kept with the backups (#1449).
func UpdateSkills ¶ added in v0.1.151
UpdateSkills fetches again every skill that came from GitHub, each repository once, and writes the agents once. A skill that couldn't be fetched is said in Unupdated, as is one changed here since it was fetched, which is left as it is; the others are updated all the same.
func UpdateSomeSkills ¶ added in v0.1.240
UpdateSomeSkills is UpdateSkills for the skills named only: those a check found GitHub to have changed.
func UseLibrarySkill ¶ added in v0.1.498
UseLibrarySkill settles an agent's own skill that stands in the way of the library's by that name for the library's: the agent's folder is kept aside with the backups, and the library's linked in its place.
func UseLibrarySkills ¶ added in v0.1.1224
UseLibrarySkills is UseLibrarySkill for several of one agent's skills at once, as the Library's warning settles them together (#1896). Claude Desktop's own skills (Anthropic's built in, or made there) aren't put aside: they are listed in its manifest, not only a folder, so only KeepAgentSkills settles those.
func UseServerAccount ¶
UseServerAccount puts an account of the server in use: "" is the server's own headers.
func Woken ¶ added in v0.1.2043
Woken writes the library into the agents of each distro it names that was seen stopped and runs now: what was ticked for them while it was stopped, kept in library.json, reaches them once the user starts it. Asking whether a distro runs (wsl.exe -l --running) doesn't start it. nil, nil when no such distro started.
type Rule ¶
type Rule struct {
Name string `json:"name"`
// Paths are the globs of the files it is about, relative to the
// project; none: it is read in every conversation
Paths []string `json:"paths,omitempty"`
Body string `json:"body"`
Agents []string `json:"agents"`
}
Rule is a file of guidance the agents ticked for it are given.
type RuleAgentView ¶
type RuleAgentView struct {
ID string `json:"id"`
// Dir is where its rules are; No is why magpie can't give it any
Dir string `json:"dir,omitempty"`
No string `json:"no,omitempty"`
WSL bool `json:"wsl,omitempty"`
// Paths: it keeps a rule to the files it names; one without reads
// every rule always
Paths bool `json:"paths,omitempty"`
}
RuleAgentView is an agent the Rules tab lists.
type RuleView ¶
type RuleView struct {
*Rule
// Files are, for each agent it was written to, the file
Files map[string]string `json:"files,omitempty"`
// Problems are the agents it couldn't be given to, and why
Problems map[string]string `json:"problems,omitempty"`
}
RuleView is a library rule, and where each agent has it.
type SearchError ¶ added in v0.1.1188
SearchError is a source the market searches that didn't answer; what the market has of its own is still listed beside it (#1589).
func (*SearchError) Error ¶ added in v0.1.1188
func (e *SearchError) Error() string
func (*SearchError) Unwrap ¶ added in v0.1.1188
func (e *SearchError) Unwrap() error
type Server ¶
type Server struct {
Name string `json:"name"`
Bundle string `json:"bundle,omitempty"` // the Claude Code plugin it came with (plugin.go)
// Transport is stdio for a command, http (streamable) or sse for a URL.
Transport string `json:"transport"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
URL string `json:"url,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Agents []string `json:"agents"`
// DisabledTools are the server's tools its agents leave out, by the
// names the server gives them, written in each agent's own way where
// it has one (mcp_tools_off.go)
DisabledTools []string `json:"disabledTools,omitempty"`
// OAuth is an OAuth app of the user's own that magpie signs in to the
// server as, for one whose sign-in doesn't let magpie register itself
// (GitHub's, 新v学员 on Discord). It is magpie's alone: the agents are
// given the server as before.
OAuth *OAuthApp `json:"oauth,omitempty"`
// Accounts are further sets of headers for the server (Elorynth on X:
// several keys, one in use), each laid over Headers, and Account is the
// one the agents are given ("" for Headers as they are). magpie's own
// OAuth sign-ins to the server have their accounts in mcpauth.
Accounts []Account `json:"accounts,omitempty"`
Account string `json:"account,omitempty"`
// StartupTimeout is the seconds an agent waits for the server to start
// and list its tools: Codex's startup_timeout_sec (#3168), the only
// agent given it. 0 leaves it to the agent (Codex's own is 30s).
StartupTimeout int `json:"startupTimeout,omitempty"`
// Local keeps the server to this computer (huhuy72219405 on X: a
// server of a program or folder only this computer has). A backup or
// a sync never carries it, and one coming in neither takes it away nor
// puts another computer's of that name in its place (carry.go).
Local bool `json:"local,omitempty"`
// Plugin is the plugin (plugin.Name) whose tools the server is: the
// gateway serves them at its URL, and the hub calls the plugin itself
// (plugin_tools.go)
Plugin string `json:"plugin,omitempty"`
// Hidden is a server turned off in the Library (ServerOn), or a
// plugin's whose tools were hidden from every agent on the Plugins
// page (PluginServerOn, chengming0v0 on Discord): no agent is given
// it, nor a project, nor an app at the MCP router's address. Paused are the agents it had, given back when it is shown
// again. Both go once the server has an agent again (save).
Hidden bool `json:"hidden,omitempty"`
Paused []string `json:"paused,omitempty"`
// Bridge is the Remote magpie (its provider id) whose MCP router the
// server is, given a server of its own (bridge_mcp.go)
Bridge string `json:"bridge,omitempty"`
// Hub is how the MCP hub (Library.MCPHub) gives the server: "" shares
// it through the hub's one entry, as every server was before;
// HubDirect keeps it the agents' own entry, written as with the hub
// off, for a server that reads its project from the folder it is
// started in, or keeps a session's state (#4382, cuipengcx90).
Hub string `json:"hub,omitempty"`
// Note is the user's own word on what the server is for (youyo.p on
// Discord: with many of them, which is which). Only the library keeps
// it, and a sync carries it; no agent is given it (TestNoteNeverGiven).
Note string `json:"note,omitempty"`
// (#3836, #6426; jinpwng on X: one server on a Mac and in WSL, each
// with its own path): Command, Args and Env are then this computer's,
// and Shared is what a sync carries and brings for them. Never carried
// itself (mcp_here.go).
Shared *Start `json:"shared,omitempty"`
// contains filtered or unexported fields
}
Server is one MCP server: a command magpie's agents start, or a URL they reach.
func ServerOf ¶ added in v0.1.136
ServerOf is a server as it is typed: a URL, or a command and its arguments.
func (*Server) HasEnvRefs ¶ added in v0.1.1112
HasEnvRefs says whether the server's headers or environment reference a variable.
type ServerHealth ¶ added in v0.1.794
type ServerHealth struct {
// State is ok (it answered, with Tools tools), auth (it asks for a
// sign-in or a key) or error (Why says what went wrong)
State string `json:"state"`
Tools int `json:"tools"`
// ToolList is each tool's name and what it says it does, as tools/list
// gave them, for the page to list (nf1qaz2w on Discord); at most
// maxToolList, while Tools counts every one
ToolList []Tool `json:"toolList,omitempty"`
// Why is the kind of error, for the page to put in its own words:
// notfound, start, exited, timeout, http, refused, unreachable,
// protocol, home (exits in home, works in a project: Project),
// novar (a ${NAME} magpie's environment hasn't: Detail names
// them), wsldown (a command only agents in WSL start, whose distros,
// Detail, aren't running: it wasn't checked), nobrowser (it listed its
// Tools, and starts a Chrome the container it runs in hasn't: Detail
// is its option for one it can reach, mcp_browser.go)
Why string `json:"why,omitempty"`
Code int `json:"code,omitempty"` // the exit code, or the HTTP status
Detail string `json:"detail,omitempty"` // the last line it wrote to stderr, or the error's text
// OAuth is a refusal that named a sign-in (WWW-Authenticate), which
// magpie can do itself for a streamable HTTP server
OAuth bool `json:"oauth,omitempty"`
// SignIn is magpie's sign-in to a streamable HTTP server as the check
// left it: one whose renewed token the server refused has run out
// since, and the page's tag says so (新v学员 on Discord)
SignIn *mcpauth.Status `json:"signIn,omitempty"`
// AgentSignIn are the agents signed in to a server that refused
// magpie's check on their own (Claude Code's /mcp, mcp_agent_signin.go),
// by id: they use it, though the check, without their tokens, was asked
// to sign in (CyberCaius on Discord)
AgentSignIn []string `json:"agentSignIn,omitempty"`
// Step is what a server that timed out was asked and didn't answer
// (initialize, notifications/initialized, tools/list, or connect: an
// SSE server's stream), and Waited how long it was waited for, in ms
Step string `json:"step,omitempty"`
Waited int64 `json:"waited,omitempty"`
// Checked are where a command was started, in order, for one that agents
// in WSL have (mcp_check_wsl.go): "" for this machine, a distro's name
// for its agents there. A failure is the last one's; none for a
// command only this machine's agents start.
Checked []string `json:"checked,omitempty"`
// Project is a command that exited in home and listed its tools in a
// project folder, where the agents given it directly start it
// (inProject); Detail is what it said in home. Why "home" is that
// command run by magpie for its agents, in home (inHome).
Project bool `json:"project,omitempty"`
At int64 `json:"at"` // when it was checked, unix ms
}
ServerHealth is what a check of one server found.
func CheckServer ¶ added in v0.1.794
func CheckServer(ctx context.Context, s *Server) ServerHealth
CheckServer connects to one server and asks it for its tools.
type ServerOpts ¶
type ServerOpts struct {
Headers map[string]string
Env map[string]string
NoHeader []string // header-=K
NoEnv []string // env-=K
Timeout *int
Agents []string // the words of agents=, for the caller to resolve
HasAgent bool
Local *bool
}
ServerOpts are the settings a server takes beside its command or URL, typed as key=value words on the command line (#6111, Abandon332 on X): header=K=V (or K: V), env=K=V, timeout=SECS, agents=a,b, --local. A word the line means as the child's own argument comes after "--".
func SplitServerWords ¶
func SplitServerWords(words []string) (cmd []string, o ServerOpts, err error)
SplitServerWords takes the options out of the words typed after a server's name and leaves its command or URL. Words after a "--" are the command's, however they look. A word that looks like a setting of magpie's but isn't one it knows is refused rather than handed to the program.
func (ServerOpts) Apply ¶
func (o ServerOpts) Apply(s *Server) error
Apply puts the options on s, which is a command or a URL server: a header on a command, or an env on a URL, is an error rather than dropped.
type ServerView ¶
type ServerView struct {
*Server
Icon string `json:"icon,omitempty"`
// Problems are the agents it couldn't be given to, and why
Problems map[string]string `json:"problems,omitempty"`
// SignIn is magpie's sign-in to a streamable HTTP server, which the
// agents then use (#615)
SignIn *mcpauth.Status `json:"signIn,omitempty"`
}
ServerView is a library server, and what each agent it's on made of it.
type ServersConfig ¶ added in v0.1.1160
type ServersConfig struct {
File string `json:"file"`
Text string `json:"text"`
Skipped []string `json:"skipped,omitempty"`
}
ServersConfig is what an agent's project file would hold with the library's servers called names in it, as magpie writes them into a project it has (syncProjectMCP): for the user to paste into a project magpie doesn't keep (#1478, xiaozhu1337: 不建项目、一次性添加项目级 MCP). File is the file in the project, Text the file whole, and Skipped the servers the agent can't reach that way (SSE for Codex or Pi).
func ConfigOfServers ¶ added in v0.1.1160
func ConfigOfServers(agent string, names []string) (*ServersConfig, error)
ConfigOfServers writes the servers into a fresh file in agent's project format, in a folder of its own, and reads it back: the same encoder, the same references to variables, a server magpie is signed in to through the gateway as a project of magpie's is given it.
type SetView ¶ added in v0.1.181
type SetView struct {
ID string `json:"id"`
Name string `json:"name"`
Text string `json:"text"`
Active bool `json:"active,omitempty"`
File string `json:"file,omitempty"` // the user's own file it is kept in
}
SetView is one set of shared instructions as the page shows it.
type Setup ¶ added in v0.1.58
type Setup struct {
Instructions SetupInstructions `json:"instructions"`
MCP map[string][]string `json:"mcp"` // server → the agents that get it
Skills map[string][]string `json:"skills"` // skill → the agents that get it
}
Setup is which agents get what from the library, and the instructions, as a profile keeps them to switch back to. The servers and the skills themselves stay in the library: a setup only names them.
func (*Setup) Empty ¶ added in v0.1.58
Empty reports whether the library had nothing in it when s was taken.
func (*Setup) GivesInstructions ¶ added in v0.1.58
GivesInstructions reports whether any agent gets instructions from it.
type SetupInstructions ¶ added in v0.1.58
type SetupInstructions struct {
Set string `json:"set,omitempty"` // the set it is the text of
Agents []string `json:"agents"`
Extra map[string]string `json:"extra,omitempty"`
}
SetupInstructions is the shared text, the agents it is written to, and what each agent gets besides.
type Skill ¶
type Skill struct {
Name string `json:"name"`
Bundle string `json:"bundle,omitempty"` // the plugin it came with (plugin.go)
Source *Source `json:"source,omitempty"`
Agents []string `json:"agents"`
// Hash is of the skill's files as last fetched from GitHub, and Commit
// the last commit to have touched its folder there, once a check has
// found the two to agree: together they tell whether GitHub has
// changed the skill since. For one from another git repository,
// Commit is the commit of the repository it was fetched at.
Hash string `json:"hash,omitempty"`
Commit string `json:"commit,omitempty"`
// Own is Hash leaving aside what installing the skill's dependencies
// writes (ownHash): set as it is fetched, so a lock file the install
// writes again isn't taken for a change of the user's
Own string `json:"own,omitempty"`
// Pending is a skill a sync brought by its source (skill_carry.go)
// that isn't fetched from there on this computer yet: Hash and Commit
// are the version the other computer has, its folder what came with
// the sync or the older version here. The next sync, or Update, fetches
// it; an update clears it.
Pending bool `json:"pending,omitempty"`
// Missing are the files another computer has of the skill that a sync
// left out as too big to carry (CarriedSkill.Left), which this one
// doesn't have: it carries them on as left out, so its sync never
// takes them from the computer that has them (#5715), and says so.
Missing []string `json:"missing,omitempty"`
// From is the repository one not installed from GitHub was found to
// come from (skill_from.go), only to group it with the rest of it
From string `json:"from,omitempty"`
// Gone is when an update or a check found its source without it: it
// was removed there (skill_gone.go). Kept on this computer only.
Gone string `json:"gone,omitempty"`
// Dangling is a skill linked in from a folder that is gone
// (skill_dangling.go): given to no agent. Set at each sync and read.
Dangling bool `json:"-"`
// OffHere turns the skill off on this computer alone (hanslin1666 on
// Discord): no agent here gets it, whatever Agents says. Agents is
// what a sync carries and stays as the other computers have it; this
// is never carried (Collect leaves it out) and a sync keeps it (Put).
OffHere bool `json:"offHere,omitempty"`
// Called is the name its SKILL.md gives, when the library keeps it
// under another because a skill from elsewhere had that name first
// (skill_beside.go). Its SKILL.md is named as the library names it.
Called string `json:"called,omitempty"`
// Note is the user's own word on what the skill is for or when to
// use it, beside its SKILL.md's description (youyo.p on Discord).
// Only the library keeps it, and a sync carries it; no agent is
// given it: the skill's folder is the agents', and this isn't in it.
Note string `json:"note,omitempty"`
// Router is "direct" for a skill the skill router leaves out: each
// agent keeps its own link of it (skill_router.go). A sync carries it.
Router string `json:"router,omitempty"`
// Home is where the skill was in the agents before it was brought in
// from them (ImportSkill): removed from the library, it goes back there
// as it was (BeiWeiji on X). This computer's own: a sync never carries
// it, and keeps it for the same skill (Put).
Home *SkillHome `json:"home,omitempty"`
}
Skill is a folder with a SKILL.md, kept in the library and linked into the agents that get it.
type SkillCheck ¶ added in v0.1.240
type SkillCheck struct {
Name string `json:"name"`
// Status is current when GitHub has the skill as the library does,
// update when it has changed it since, gone when it was read without
// the skill (removed there, skill_gone.go), and unknown when it
// couldn't be told (Error says why)
Status string `json:"status"`
Commit string `json:"commit,omitempty"` // the last commit to touch the skill's folder
Date string `json:"date,omitempty"` // when it was made
Message string `json:"message,omitempty"` // its first line
// URL shows what changed: the commits since the one installed, or the
// folder's history when which that was isn't known
URL string `json:"url,omitempty"`
Error string `json:"error,omitempty"`
// Limited is set when it couldn't be told because GitHub's rate limit
// was used up, for the page to say so in its own words
Limited *Limited `json:"limited,omitempty"`
}
SkillCheck is what a check for updates found of one skill from GitHub.
func CheckSkills ¶ added in v0.1.240
func CheckSkills() ([]SkillCheck, error)
CheckSkills asks GitHub, for every skill installed from there, for the last commit to touch its folder, and tells whether it's newer than what the library has: by the commit a skill is known to be at, or, while that isn't known yet, by fetching the repository once and comparing the folder's files with the skill's. A skill GitHub couldn't be asked about is unknown, and the others are checked all the same; once GitHub limits requests, the rest aren't asked about. A skill from another git repository is checked with the user's git (checkGitSkill). Each repository, and each folder the user added skills from, is also looked in for skills added beside them since (skillnew.go).
type SkillFile ¶ added in v0.1.2825
type SkillFile struct {
File string `json:"file"` // its place in the skill's folder, with /
Text string `json:"text"` // what it holds
Path string `json:"path"` // the skill's folder
Files []string `json:"files"` // the skill's text files, SKILL.md first
}
SkillFile is one file of a library skill as the page reads it.
func ReadSkillFile ¶ added in v0.1.2825
ReadSkillFile is the file of a library skill at file (SKILL.md when empty), with the skill's other text files listed.
type SkillGroup ¶ added in v0.1.896
SkillGroup is a group the user made of some skills (#791, mintonight: 能不能在选择后自己创建分组呢): the page shows it as a group of its own, above the ones by source, with its skills taken out of theirs. It is only how the page shows them; the agents get each skill as before.
type SkillHome ¶
type SkillHome struct {
// Dir is the folder that was moved into the library, put back there.
// Empty when the library only linked to it where it is.
Dir string `json:"dir,omitempty"`
// Entries are what each agent that had it had in its skills folder
Entries []HomeEntry `json:"entries,omitempty"`
}
SkillHome is where a skill brought in from the agents was (Skill.Home).
type SkillView ¶
type SkillView struct {
Name string `json:"name"`
Bundle string `json:"bundle,omitempty"` // the plugin it came with
Description string `json:"description"`
Source string `json:"source,omitempty"`
Kind string `json:"kind"` // github, git, folder, or "" for one kept in the library
Origin string `json:"origin,omitempty"` // on GitHub, as CC Switch installed it: it can be updated from there
Repo string `json:"repo,omitempty"` // the repository it came from, however it came in, for the page to group by
Icon string `json:"icon,omitempty"`
Agents []string `json:"agents"`
Missing bool `json:"missing,omitempty"` // its folder is gone
Problems map[string]string `json:"problems,omitempty"`
Check *SkillCheck `json:"check,omitempty"` // what the last check for updates found
// Always are the agents that have it whatever the library gives them:
// it is kept in ~/.agents/skills, which they read themselves (#595)
Always []string `json:"always,omitempty"`
// HandOverSkills moves it into the library's own folder
Shared string `json:"shared,omitempty"`
// which stays there when it's handed over; only the link goes
SharedElsewhere bool `json:"sharedElsewhere,omitempty"`
// Behind are the agents given it as a copy whose copy differs from it,
// till the next sync makes it again
Behind []string `json:"behind,omitempty"`
// Edited is set for one from GitHub changed here since it was fetched,
// in the library or in an agent's copy: an update replaces that, so
// the page asks first (#1449)
Edited bool `json:"edited,omitempty"`
// Pending is one a sync brought by its source and not yet fetched
// from there on this computer (Skill.Pending): Update tries again
Pending bool `json:"pending,omitempty"`
// Gone is when its source was found without it: removed there, the
// page offers to take it out (skill_gone.go)
Gone string `json:"gone,omitempty"`
// OffHere is set when it is turned off on this computer alone: Agents
// are still the ones a sync carries to the others
OffHere bool `json:"offHere,omitempty"`
// Note is the user's own note on it (Skill.Note)
Note string `json:"note,omitempty"`
// Manual: its SKILL.md sets disable-model-invocation (meta.Manual)
Manual bool `json:"manual,omitempty"`
// Router is "direct" for one the skill router leaves out (Skill.Router)
Router string `json:"router,omitempty"`
// Back are the agents it was brought in from: Remove gives it back
// to them as they had it (Skill.Home)
Back []string `json:"back,omitempty"`
}
SkillView is a library skill as the page shows it.
type Source ¶
type Source struct {
Kind string `json:"kind"` // github | git | folder
Repo string `json:"repo,omitempty"` // owner/repo for github, the address git fetches for git
Ref string `json:"ref,omitempty"`
Path string `json:"path,omitempty"` // in the repository
Dir string `json:"dir,omitempty"` // the folder, for kind folder
// Via is the app's own steady link a folder skill was linked through
// while that link leads nowhere and Dir is the version folder found in
// its place (skill_moved.go); the library goes back to it once it
// leads to the skill again
Via string `json:"via,omitempty"`
}
Source is where a skill came from: a GitHub repository it can be updated from, another git repository (fetched with the user's own git), or a folder on this machine the library links to, so that editing the folder is editing the skill.
type Start ¶
type Start struct {
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
}
Start is how a command server is started: its program, the program's arguments and its environment.
type Subagent ¶ added in v0.1.1258
type Subagent struct {
Name string `json:"name"`
Bundle string `json:"bundle,omitempty"` // the plugin it came with (plugin.go)
Description string `json:"description"`
Prompt string `json:"prompt"`
// Model is the model or routing group the subagent runs on, as the
// agent names it; "" leaves it to the agent
Model string `json:"model,omitempty"`
Skills []string `json:"skills,omitempty"`
MCP []string `json:"mcp,omitempty"`
Agents []string `json:"agents"`
// From is the file it was imported from, its Path the file's in the
// repository, and FromHash what it said then (subagent_import.go)
From *Source `json:"from,omitempty"`
FromHash string `json:"fromHash,omitempty"`
// File is a file of the user's own it is kept in on this computer,
// "" for the library's; FileHash what the file said when magpie last
// wrote or took it in (subagent_file.go)
File string `json:"file,omitempty"`
FileHash string `json:"fileHash,omitempty"`
}
Subagent is one the agents ticked for it are given.
type SubagentAgentView ¶ added in v0.1.1258
type SubagentAgentView struct {
ID string `json:"id"`
// Dir is where its subagents are; No is why magpie can't give it any
Dir string `json:"dir,omitempty"`
No string `json:"no,omitempty"`
WSL bool `json:"wsl,omitempty"`
// Skills and MCP: its subagents take skills, servers of their own;
// one that doesn't uses all the agent has
Skills bool `json:"skills,omitempty"`
MCP bool `json:"mcp,omitempty"`
// Model: its subagents run on a model of their own when one is set;
// one that doesn't runs them on the model the agent picks
Model bool `json:"model,omitempty"`
}
SubagentAgentView is an agent the Subagents tab lists.
type SubagentCandidate ¶
type SubagentCandidate struct {
Path string `json:"path"` // the file's, in the repository or the folder
Name string `json:"name"`
Description string `json:"description"`
// State is, against the library: "" a new one, "have" it has this one
// as it is there, "update" it has it from here as it was before, to
// be updated, "edited" it has it from here changed since, left alone
State string `json:"state,omitempty"`
// As is the name the library has it by, or adds it by, when not Name
As string `json:"as,omitempty"`
// contains filtered or unexported fields
}
SubagentCandidate is one subagent found.
type SubagentFile ¶ added in v0.1.1258
type SubagentFile struct {
Name string `json:"name"`
Path string `json:"path"`
Hash string `json:"hash"`
}
SubagentFile is a file magpie wrote for a subagent, and the hash of what it wrote there.
type SubagentLeft ¶
SubagentLeft is a file left out.
type SubagentProbe ¶
type SubagentProbe struct {
Source string `json:"source"`
Kind string `json:"kind"`
Candidates []SubagentCandidate `json:"candidates"`
// Left are the files that look like subagents and can't be one, with why
Left []SubagentLeft `json:"left,omitempty"`
// contains filtered or unexported fields
}
SubagentProbe is what was found at an address.
func ProbeSubagents ¶
func ProbeSubagents(input string) (*SubagentProbe, error)
ProbeSubagents is the subagents at input; nothing is written.
type SubagentView ¶ added in v0.1.1258
type SubagentView struct {
*Subagent
// Files are, for each agent it was written to, the file
Files map[string]string `json:"files,omitempty"`
// Path is the file it is kept in on this computer, to edit it in;
// FileError why an edit there wasn't taken in
Path string `json:"path,omitempty"`
FileError string `json:"fileError,omitempty"`
// Problems are the agents it couldn't be given to, and why
Problems map[string]string `json:"problems,omitempty"`
}
SubagentView is a library subagent, and where each agent has it.
type SubagentsImported ¶
type SubagentsImported struct {
Added []string `json:"added,omitempty"`
Updated []string `json:"updated,omitempty"`
Had []string `json:"had,omitempty"`
// Kept are the ones changed here since, left as they are
Kept []string `json:"kept,omitempty"`
}
SubagentsImported is what an import did, by the library's names.
type TakenFile ¶
type TakenFile struct {
Path string `json:"path"`
// Body is the file as it was
Body string `json:"body"`
// Hash is of the description and prompt read from it
Hash string `json:"hash"`
}
TakenFile is an agent's own file a command was imported from.
type Target ¶
type Target struct {
Agent *agent.Agent
// Instructions is the file the agent reads before every conversation;
// Override, when it exists, is read instead of it (Codex's
// AGENTS.override.md), which the page warns of.
Instructions, Override string
// Field, when it is set, says the instructions are not the file itself
// but the string at this key path of the JSON file Instructions names
// (WorkBuddy's personalization.customPrompt): instr_field.go.
Field string
MCP *mcpFile
Skills string // the folder the agent finds skills in
// SkillsAlso are agents whose skills this one reads as well, as
// OpenCode reads Claude Code's.
SkillsAlso []string
// MCPVia is the extension the agent reads its MCP servers through, for
// one that has none of its own.
MCPVia string
// Note is what the page says of the agent's instructions file.
Note string
// Copy is an agent that gets a copy of each skill, made again when
// the library's changes, rather than a link: one in a WSL distro whose
// skills folder is on a Windows drive (wslStored), LiveAgent, and on
// Windows one that skips a junction (skipsJunctions).
Copy bool
// Store, for an agent in a WSL distro, is magpie's folder there
// (wslStoreRel) holding one copy of each skill given to the distro's
// agents, as magpie opens it: each agent gets a link the distro makes
// to that copy, as it can't follow one to a Windows folder
// (wsl_skills.go).
Store string
// Desktop are Claude Desktop's skills-plugin folders, one for each
// account (desktop_skills.go): each gets a copy of the skills and their
// entries in its manifest.json. Skills is the first one's skills.
Desktop []string
// Settings is Claude Code's settings.json, whose permissions.deny
// leaves out the tools of a server turned off (mcp_tools_off.go)
Settings string
// Gone is an agent no longer installed here that still has what magpie
// gave it (held): a sync only takes things out of it, as they are
// unticked, and gives it nothing.
Gone bool
// folder only from some version on (Pi, omp: sharedSince), with that
// version here; the others that always do are in readsShared
SharedToo bool
// Profile says the instructions file is the user's profile to the
// agent, not instructions alone (Alma's USER.md): magpie adds its part
// after the user's, but never moves the user's own lines out of it
// (ImportInstructions), as the agent reads who its owner is there.
Profile bool
// Unreached, for an agent in a WSL distro, is why its folder there
// can't be opened (agent.WSLOpen): a link the distro couldn't
// resolve. Nothing is written to it; each sync says so.
Unreached error
}
Target is where one agent keeps each of the three: an empty path is something it has no user-wide place for.
type Tool ¶ added in v0.1.1179
Tool is one tool a server listed: its name, and the first paragraph of its description, cut short.
type View ¶
type View struct {
Agents []AgentView `json:"agents"`
Servers []ServerView `json:"servers"`
// Hooks are the library's hooks, and HookAgents what each agent on
// this computer can take of them (hooks.go)
Hooks []HookView `json:"hooks"`
HookAgents []HookAgentView `json:"hookAgents"`
// Env are the library's variables, and EnvAgents what each agent on
// this computer can take of them (env.go)
Env []EnvView `json:"env"`
EnvAgents []EnvAgentView `json:"envAgents"`
// Subagents are the library's subagents, and SubagentAgents what
// each agent on this computer makes of them (subagents.go)
Subagents []SubagentView `json:"subagents"`
SubagentAgents []SubagentAgentView `json:"subagentAgents"`
// Commands are the library's slash commands, and CommandAgents what
// the agents that can take them do with them
Commands []CommandView `json:"commands"`
CommandAgents []CommandAgentView `json:"commandAgents"`
// Rules are the library's rules, and RuleAgents what the agents that
// can take them do with them (rules.go)
Rules []RuleView `json:"rules"`
RuleAgents []RuleAgentView `json:"ruleAgents"`
FoundServers []Found `json:"foundServers"`
// FoundHooks are the hooks the agents run that magpie didn't give
// them (hooks_found.go)
FoundHooks []FoundHook `json:"foundHooks"`
// Plugins are the plugins kept as one item each (plugin.go)
Plugins []PluginView `json:"plugins"`
Skills []SkillView `json:"skills"`
FoundSkills []FoundSkill `json:"foundSkills"`
// NewSkills are skills a check found its skills' repositories, or
// the folders they were added from, to have beside them since, to
// add or set aside
NewSkills []NewSkill `json:"newSkills"`
// CheckFolders is whether a check looks in folders the user added
// skills from, which the page then offers with no remote skill
CheckFolders bool `json:"checkFolders,omitempty"`
Projects []ProjectView `json:"projects"`
// ClaudeInstalled are the plugins Claude Code has installed itself,
// which a project can turn on for its folder (project_claude_plugins.go)
ClaudeInstalled []ClaudePluginView `json:"claudeInstalled"`
Instructions *InstructionsView `json:"instructions"`
Dir string `json:"dir"`
Backups string `json:"backups"`
SkillGroups []SkillGroup `json:"skillGroups"`
CopySkills bool `json:"copySkills"` // the library gives skills as copies (#896)
// SharedSkills: every skill on here is in ~/.agents/skills too
// (skills_shared.go), at SharedDir
// AutoUpdateSkills: the skills from GitHub and git repositories are
// updated by themselves (skill_autoupdate.go)
AutoUpdateSkills bool `json:"autoUpdateSkills"`
// MCPHub: the agents are given magpie's one MCP server in place of
// the library's (#2679), at HubPath<agent> on the gateway
MCPHub bool `json:"mcpHub"`
HubPath string `json:"hubPath"`
// SkillRouter: the agents are given magpie's one skill, magpie-skills,
// listing their skills in place of a link of each (skill_router.go)
SkillRouter bool `json:"skillRouter"`
// HubNote is what the router says of itself to the agents (settings'
// RouterNote), and HubName what it says with none: this computer's
// name, to an agent on another computer (gateway.hubWhere)
HubNote string `json:"hubNote"`
HubName string `json:"hubName"`
// HubAllTools: every agent is given the router's tools whole, none on
// demand (settings' RouterAllTools, gateway.hubOnDemand)
HubAllTools bool `json:"hubAllTools"`
// HubCode: the router gives every agent run_code beside its tools
// (settings' RouterNoCode, gateway.hubCodeOn)
HubCode bool `json:"hubCode"`
// HubFindsItself names the agents given every tool whole, as they
// search their tools themselves, and HubOnDemandOver how many tools an
// agent is given whole at most (gateway.HubFindsItself,
// gateway.HubOnDemandOver): the Tools on demand row says them
HubFindsItself []string `json:"hubFindsItself"`
HubOnDemandOver int `json:"hubOnDemandOver"`
// HubOnDemandQuery is the query the address for other apps takes to
// give its tools on demand (gateway.HubOnDemandQuery): Connect's
// Other apps tab gives that address too
HubOnDemandQuery string `json:"hubOnDemandQuery"`
// CheckDue is set when the skills from GitHub weren't checked for
// updates since magpie started, or not for a while: the page checks
// them as it shows them (#1449)
CheckDue bool `json:"checkDue,omitempty"`
// Partial is a glance (Glance): FoundSkills and each skill's Behind
// aren't read yet
Partial bool `json:"partial,omitempty"`
}
View is the Library page.
func Glance ¶ added in v0.1.1163
Glance is the page but for what takes reading the agents' skill folders through: the skills the agents have of their own, and which copies are out of date (Partial). The page shows it at once, and Read's after it (0day404, #541): on a machine with many big skills in many agents, that part can take minutes the first time.
Source Files
¶
- backup.go
- bili.go
- bili_config.go
- bili_saved.go
- bili_url.go
- borrow.go
- bridge_mcp.go
- carry.go
- ccswitch.go
- claude_plugins.go
- cmdvars.go
- command_import.go
- commands.go
- desktop_skills.go
- desktop_twin.go
- dirlink_other.go
- dsh.go
- dsh_hooks.go
- env.go
- env_pi.go
- envref.go
- github.go
- hooks.go
- hooks_found.go
- instr_field.go
- instructions.go
- library.go
- linkmemo.go
- liveagent.go
- market.go
- market_addr.go
- market_docker.go
- market_launch.go
- market_public.go
- market_repo.go
- mcp.go
- mcp_accounts.go
- mcp_agent_signin.go
- mcp_browser.go
- mcp_check.go
- mcp_check_net_other.go
- mcp_check_wsl.go
- mcp_copy.go
- mcp_here.go
- mcp_hub.go
- mcp_hub_cards.go
- mcp_local.go
- mcp_npx.go
- mcp_on.go
- mcp_options.go
- mcp_reap.go
- mcp_run.go
- mcp_signin.go
- mcp_tools_off.go
- mcp_wsl.go
- memory_skill.go
- native.go
- piext.go
- pimarket.go
- pimcp.go
- plugin.go
- plugin_carry.go
- plugin_env.go
- plugin_tools.go
- project_claude_plugins.go
- project_export.go
- project_git.go
- project_instructions.go
- project_mcp.go
- project_own.go
- project_pi.go
- project_plugins.go
- project_scope.go
- project_shapes.go
- project_subagents.go
- projects.go
- rtk.go
- rtk_admin.go
- rtk_path.go
- rtk_path_other.go
- rtk_upgrade.go
- rtk_winget_other.go
- rtk_wsl.go
- rules.go
- self_here.go
- setup.go
- skill_autoupdate.go
- skill_beside.go
- skill_carry.go
- skill_changed.go
- skill_code.go
- skill_dangling.go
- skill_edits.go
- skill_file.go
- skill_from.go
- skill_gone.go
- skill_groups.go
- skill_handover.go
- skill_how.go
- skill_link.go
- skill_moved.go
- skill_router.go
- skillcheck.go
- skillgit.go
- skillnew.go
- skills.go
- skills_shared.go
- skilltree.go
- subagent_file.go
- subagent_import.go
- subagents.go
- sync.go
- targets.go
- treememo.go
- wsl_asleep.go
- wsl_skills.go