~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
main
59 lines · 3.4 KB Raw History
// Which modules the page loads, and which lib's actions make up which MCP server: the one place to change.
// Every module is a published record (atlibs.lock.json; scripts/stage.sh stages them and their sessions
// beside the page: modules/<name>.wasm + .json, stage.json). A new one: `atlibs add <handle>/<name>`, then
// name it here.
// vm-mcp's hook defaults (requester, process-mcp) and the requester's (policy-requester-tangled-vouch; user-data and its
// iroh-user-data) are staged beside them; the page runs the requester itself too (the webrtc transport's signals)
export const SOURCES = ['asyncai', 'ingress', 'knotless', 'marque', 'fedproxy', 'cocore-inference', 'cocore-keys', 'requester', 'vm-mcp']

// One MCP server per lib. readOnly: the entries that change none of the user's data ('*': all of them),
// beside those module.json marks readOnly;
// every other entry is a write, which the user confirms before it runs, and which the ingress publishes
// only when the user opts that tool in. budget: runModule's, for that lib's runs.
export const LIBS = [
	{ name: 'knotless', modules: ['knotless'], readOnly: {}, budget: { ioBytes: 16 << 20 } },
	{ name: 'marque', modules: ['marque'], readOnly: { marque: ['list_domains', 'list_records'] } },
	{ name: 'fedproxy', modules: ['fedproxy'], readOnly: { fedproxy: ['list_keys'] } },
	{
		name: 'cocore',
		modules: ['cocore-inference', 'cocore-keys'],
		readOnly: { 'cocore-inference': ['models'], 'cocore-keys': ['list_keys'] },
		// a chat streams for up to a minute or so
		budget: { wallMs: 180_000 },
		// cocore-inference's chat and models: plain HTTP to co/core, with service auth the host mints
		http: 'cocore',
	},
	{
		// socialweb.computer VMs as vm-mcp's tools (vm_create, vm_list, vm_exec, vm_release, vm_forget; vm_list reads). It
		// rents through the requester and runs commands through process-mcp, its hook defaults (`hooks`: they run on
		// this lib's host options). A vm_create waits up to 5 minutes for each of the bid, the receipt, the guest.
		name: 'vm',
		modules: ['vm-mcp'],
		hooks: ['requester', 'process-mcp'],
		readOnly: {},
		budget: { wallMs: 1_200_000, calls: Infinity, events: Infinity },
		// its host options carry the attestation key, the webrtc transport (calls and the webrtc: fetcher) and the
		// managed_records ledger (a release deletes only what this host saw the requester create)
		vm: true,
		// this page reaches a VM's shell over WebRTC
		defaults: { vm_create: { via: 'webrtc' } },
	},
]

// The libs the model gets as MCP tool servers (beside code mode). The rest (cocore: the inference behind asyncai)
// stay action forms on the page, never the model's tools.
export const TOOLS = ['knotless', 'marque', 'fedproxy', 'vm']

export const DEFAULTS = { provider: 'cocore', model: 'claude-opus-5-5', maxSteps: 12 }

// The agent may connect MCP servers mid-run (asyncai mcp_connect) at these URL prefixes: a VM's guest agent
// over WebRTC, as vm_create's shell names it. The host allows the scheme and fetches it.
export const DYNAMIC_MCP = ['webrtc:///']

// Inference providers. co/core (the default) is OpenAI-compatible and needs no key: the host mints a
// service-auth token for each request from the user's own session. The sign-in already asks for that
// scope: it is cocore-inference's session (rpc:dev.cocore.inference.dispatch?aud=*).
export const COCORE = {
	endpoint: 'https://cocore.dev/api/v1',
	serviceAuth: { aud: 'did:web:cocore.dev', lxm: 'dev.cocore.inference.dispatch' },
}