agent-kit

Introduction

Connection for one Agent, coordination for many, and the public entries.

Packages

@rivus/agent-kit connects to one Agent at a time. It is a universal Agent toolkit: it knows each Agent's id and home directory, lists its sessions, and reads their logs into one transcript model with one usage convention. Claude Code, Codex and Grok are today's built-in Agents, along with the others on Supported Agents.

@rivus/agent-kit-collab coordinates many Agents. It adds fenced leases (/lease), a single-instance process lock (/process-lock) and keyed scheduling lanes (/lanes). The package knows no particular Agent. Collab's entries use agent-kit's public platform and follow the same lockstep release.

Files, processes and the environment come from a Platform object that the caller passes in, so the reading code also runs in a browser. ACP is implemented in /acp. /harness installs an application's hooks and skills into these Agents and removes them again, with a ledger of what it wrote.

Status is 0.x. A minor release may contain breaking changes. Both packages share one lockstep release policy, so they ship the same version.

Entries

The source API has 18 entries in @rivus/agent-kit and three in @rivus/agent-kit-collab (21 in total). The tables describe that source API.

EntryMain exportsRuns in
@rivus/agent-kit/acpconnectAgent, probeAgent, agentEnv, SessionBindingStore and its Layerswith effect and a platform that spawns
@rivus/agent-kit/providersProvider, builtinProvidersanywhere
@rivus/agent-kit/catalogisBuiltinCodingAgentId, Result, ok, err, AgentKitError, isAgentKitErroranywhere
@rivus/agent-kit/costcreatePricing, summarize, priceRecord, Pricinganywhere, no imports
@rivus/agent-kit/cost/priceslitellmPrices, litellmPricesVersion: a LiteLLM price snapshotanywhere, no imports
@rivus/agent-kit/discoverydetectAgents, versionFromOutput, ProbeRecipeanywhere, with a platform
@rivus/agent-kit/harnessEffect: planInstall, applyInstall, verify, uninstall, inventory, doctor, HarnessLive and its portsanywhere, with effect and a platform
@rivus/agent-kit/harness/eventsreadHookEvent, builtinHookDialects, LifecycleEventanywhere, no imports
@rivus/agent-kit/platformPlatform (type only)anywhere
@rivus/agent-kit/redactredact, redactText: hide home path spellings and secret-shaped stringsanywhere, no imports
@rivus/agent-kit/nodecreateNodePlatformNode
@rivus/agent-kit/platform/effectPlatformService: the Platform as an Effect serviceanywhere, with effect
@rivus/agent-kit/node/effectNodePlatformLive: a Layer that provides PlatformService with createNodePlatform()Node, with effect
@rivus/agent-kit/sessionslistSessions, sessionAdapterHome, isSessionHead, SessionAdapteranywhere, with a platform
@rivus/agent-kit/transcriptloadTranscript, summarizeSession, Transcript, TranscriptEventanywhere, with a platform
@rivus/agent-kit/transcript/usagescanUsage, isUsageRecord, noCacheInputTokens, UsageRecordanywhere, with a platform; no imports
@rivus/agent-kit/testingcreateMemoryPlatform, sessionAdapterConformance, hookDialectConformance, probeRecipeConformanceNode
@rivus/agent-kit/testing/effectaggregateRepositoryConformance: the conformance cases every aggregate repository passesanywhere, with effect
EntryMain exportsKind
@rivus/agent-kit-collab/process-lockacquireProcessLock, isProcessLockHeld, ProcessLock, ProcessLockPlatformplain TS
@rivus/agent-kit-collab/leasecreateLeaseManager, LeaseRepository, sqliteLeaseRepository, fileLeaseRepository, memoryLeaseRepositoryEffect
@rivus/agent-kit-collab/lanescreateLanesEffect

builtinProviders from /providers exposes each Agent's identity, discovery, install, sessions, usage and acp services when supported. Select a descriptor by id, then check the optional service before use. The ordinary entries share these service objects. Hook commands keep using builtinHookDialects from /harness/events, whose isolated build imports nothing and owns separate hook objects. /catalog retains AgentKitError and isAgentKitError so callers can recognize errors from shell functions.

The Runs in column marks entries that need effect with "with effect". Plain entries do not load that optional peer.

License

MIT. Source: PerfectPan/agent-kit. @rivus/agent-kit-collab is MIT as well.

To contribute, start from CONTRIBUTING.md.