30 lines
1.2 KiB
Go
30 lines
1.2 KiB
Go
// Package server provides the 9P namespace and process state for toolsrv.
|
|
//
|
|
// The namespace is declared using virtfs and exposes tool execution,
|
|
// process management, and bypass request handling.
|
|
//
|
|
// # Namespace Structure
|
|
//
|
|
// /ctl - control commands (load, unload, clear)
|
|
// /tools - tool listing (rdwr: write agent ID, read JSON)
|
|
// /all - all available tools on disk
|
|
// /info - host info (platform, arch)
|
|
// /bypass/ - bypass request handling
|
|
// /proc/ - process management
|
|
// /proc/new - execute tool (blocking rdwr)
|
|
// /proc/new.bg - execute in background (returns PID)
|
|
// /proc/{pid}/ - per-process files (out, wait, stat, ctl)
|
|
//
|
|
// # Process Execution
|
|
//
|
|
// Tools are executed via /proc/new (foreground) or /proc/new.bg (background).
|
|
// The request includes token, tool name, and arguments. Foreground calls
|
|
// block until completion; background calls return immediately with a PID.
|
|
//
|
|
// # Path Locking
|
|
//
|
|
// Write-scope tools acquire path-based locks to prevent concurrent writes
|
|
// to the same file. Global-scope tools acquire a global lock that serializes
|
|
// with everything. Read-scope tools never lock.
|
|
package server
|