Module reference
Every module of the package, by the subpath you import it from: @adecore/agents/<module>, without an extension. A name links to its source, where each export has its full type. There is no root import, and test files are not in the package.
Three modules are JSON: @adecore/agents/providers/claude-models.json and @adecore/agents/providers/codex-models.json, the model catalogs a host ships, and @adecore/agents/usage/prices-snapshot.json, the bundled prices. Import them with with { type: 'json' } where the runtime asks for it.
Nothing here belongs in a page. A window imports @adecore/agent-contracts for the shapes and @adecore/agents-react for the views.
Host
Serving the requests over a port or a wire of your own.
| Module | Exports |
|---|---|
client-sinks | ClientSinks |
events | AgentEventMap, AgentEvent, AgentSink |
host/agent-host | AgentHostOptions, AgentHost |
host/environment | CliEnvironmentPolicy, cliEnvironment |
host/handlers | AgentRequestMap, AgentHandler, AgentHandlers, ChatRequestType, chatHandlers, accountHandlers, usageHandlers |
host/memory-port | memoryPortPair |
host/wiring | AgentWiringOptions, AgentWiring, wireAgents |
Chats
The core, a session per chat, the thread and what is written of it.
| Module | Exports |
|---|---|
chat/attachment-store | extensionFor, AttachmentStore, migrateInlineAttachments |
chat/backend | BackendLaunch, TurnInput, ApprovalDecision, BackendEvent, BackendHost, ChatBackend |
chat/background-work | BackgroundWork, isBackgroundWork, runsInBackground, runningInBackground, BACKGROUND_COMMAND_LIMIT_MS, commandLabel, reportsOnBackgroundWork |
chat/bookmark-store | bookmarkFileName, isBookmarkFileName, BookmarkListener, BookmarkStore |
chat/chat-core | InterruptedRun, ChatCoreOptions, ChatCore |
chat/chat-log | ChatLogLine, COMPACT_ABOVE_BYTES, parseLog, ChatLogState, ChatLog |
chat/chat-process | ChatProcess, ChatSpawnOptions, SpawnChatProcess, spawnChatProcess, StreamTail, ChatChildOptions, ChatChild |
chat/chat-session | TurnCheckpoints, PromptNotes, ChatReferences, ChatSessionOptions, LimitResumeHooks, ChatSendExtras, ResumeWords, ChatSession, ResumeDecision |
chat/chat-store | ChatRecordExtras, ChatRecord, ChatSeq, ChatStoreOptions, ChatStore |
chat/chat-title | ChatTitleInput, buildTitlePrompt, parseTitle, suggestChatTitle |
chat/composer-preferences | ComposerPreference, ComposerPreferences |
chat/context-breakdown | estimateContextBreakdown |
chat/delta-coalescer | DELTA_TICK_MS, DeltaCoalescer |
chat/errors | ChatErrorCode, ChatError |
chat/input | lastSkillToken, splitSkillPrompt, attachmentNote, buildUserMessage |
chat/limit-resume | LIMIT_RETRY_DELAYS_MS, limitedTurn, limitResumeAt, limitResumeWake |
chat/projector | isMainAgentOutput, summaryLine, stripAgentFooter, ThreadProjector |
chat/request-summary | approvalSummary, requestSummaries |
chat/subagent-projection | readingThread, settledReading |
chat/subagent-reader | SubagentChat, SubagentReaderOptions, SubagentReader |
chat/subagent-settlement | SubagentSettlement, settlementOf, readSubagentSettlement |
chat/thread | ChatThread |
chat/visual-store | visualFileName, isVisualFileName, VisualInput, VisualStoreOptions, VisualListener, VisualStore |
chat/wake-chat | WakeChat, ChatOpenerDeps, loadChat, chatOpener |
Claude Code and Codex
The two backends and their protocols.
| Module | Exports |
|---|---|
chat/claude-backend | ClaudeBackendOptions, ClaudeBackend |
chat/claude-protocol | ClaudeProtocol |
chat/claude-title | ClaudeTitleReader |
chat/claude-transcript | SubagentMeta, claudeProjectSlug, findSubagentsDir, readSubagentMetas, findWorkflowAgent, TranscriptProjection |
chat/codex-backend | parseSkillsList, CodexBackendOptions, CodexBackend |
chat/codex-protocol | unwrapCommand, CodexProtocol |
chat/codex-thread | ThreadItemsParams, parseThreadItemsPage, projectCodexItems, CodexProcessSpec, listThreadItemsOnce, ThreadForkParams, forkThreadOnce |
chat/codex-transport | CodexFrame, CodexClientInfo, DEFAULT_CODEX_CLIENT, CodexTransport |
providers/claude | claudeRuntimeMode, claudeArgs, claudeEnv, CLAUDE_CAPABILITIES, CLAUDE_RESUME_COMMAND, promptPrefix |
providers/claude-provider | createClaudeProvider, claudeProvider |
providers/codex | CODEX_CHAT_ARGS, codexThreadOptions, codexRuntimeMode, codexServiceTier, CODEX_CAPABILITIES, CODEX_RESUME_COMMAND |
providers/codex-provider | createCodexProvider, codexProvider |
providers/codex-rules | CodexRules, CodexRulesResult, codexRulesText, codexRulesPathIn, defaultCodexHome, installCodexRules |
Fakes
CLIs and clocks for tests.
| Module | Exports |
|---|---|
chat/fake-claude | fakeClaude, claudeStoppingOnResume |
chat/fake-cli | FakeIo, FakeProgram, FakeCli, StartedFake, InProcessCli, inProcess, runOverStdio |
chat/fake-codex | FAKE_CHILD_STEPS, fakeCodexForks, FakeCodexOptions, fakeCodexWith, fakeCodex |
outbox/manual-clock | ManualClock |
providers/accounts/test-accounts | memorySecrets, testAccounts |
watch-test-helpers | FakeDirectoryWatcher, FakeWatch, EventLog |
Providers and accounts
The registry, catalogs and the accounts of each CLI.
| Module | Exports |
|---|---|
providers/accounts/accounts | Env, isKnownKind, isDefaultAccount, expandHome, accountProblem, folderVariablesOf, withDefaults, defaultFolder, accountFolder, transcriptFolder, accountEnv, NamedAccount, canContinue, readAccount |
providers/accounts/launch | AccountError, AccountLaunches, isDefaultAccountOf, storedAccount, launchEnv, definedEnv |
providers/accounts/service | ProviderAccountsOptions, ProviderAccountsService |
providers/accounts/shadow-home | ShadowHomeReport, ShadowHomeError, prepareShadowHome |
providers/accounts/status | AccountReading, AskAccount, readClaudeAuthStatus, readCodexAccount, askAccountAs |
providers/accounts/store | accountsPath, StoredAccounts, readAccounts, writeAccounts, wireAccounts, InvalidAccountError, acceptAccounts |
providers/accounts/variables | SecretsUnavailableError, SecretStore, secretKey, AccountsHost, DEFAULT_ACCOUNTS_HOST, ReservedVariables, isReservedName, variablesProblem, redactVariables, keychainService, keychainSecrets, platformSecrets |
providers/catalog | ModelCatalogInput, ModelCatalog |
providers/detect | CliDetection, detectCli |
providers/provider | ProviderHome, ChatProvider |
providers/registry | unofferedProvider, providerFor, ProviderRegistryOptions, ProviderRegistry |
Usage
Transcripts, prices and plan limits.
| Module | Exports |
|---|---|
usage/accounts | machineAccounts, usageAccountsOf, usageRootsOf, limitAccountsOf, chatSessionAccounts |
usage/aggregate | Aggregation, accountOfRecord, aggregate |
usage/exchange | FRANKFURTER_URL, TARGET_CURRENCY, parseRate, ExchangeRates |
usage/index-file | IndexedFile, UsageIndex, encodeIndex, decodeIndex |
usage/limits/monitor | ProbeEnv, LimitAccount, LimitAccounts, UsageMonitorOptions, UsageMonitor |
usage/limits/normalize | ProviderReading, LimitsUpdate, kindOfDuration, readClaudeUsage, readClaudeEvent, readCodexLimits, mergeWindows |
usage/limits/probe | ProbeResult, probeClaude, probeCodex |
usage/pricing | LITELLM_URL, ModelPrice, PriceTable, PriceLookup, parsePriceTable, lookupPrice, costOf, cacheSavingsOf, PriceBook |
usage/projects | KnownProject, ResolvedProject, ProjectResolver |
usage/readers/claude | claudeMightCarryUsage, parseClaudeLine |
usage/readers/codex | codexMightCarryUsage, CodexParserState, createCodexState, cloneCodexState, parseCodexLine |
usage/record | UsageRecord, int, asObject, asString, foldByKey |
usage/roots | UsageRootPath, usageRoots, accountRoots |
usage/scanner | ScanReport, UsageScannerOptions, accountResolver, UsageScanner |
usage/usage-service | UsageServiceOptions, UsageService |
Coordination
The outbox, tasks, lineage and messages.
| Module | Exports |
|---|---|
lineage | AgentLineageStore |
messages/deliver-message | DeliverMessageWorkSchema, DeliverMessageWork, DeliverMessageEntry, DeliverMessageDeps, deliverMessageHandler |
messages/deliver-notice | MessageWords, ChatNoticeTargets, ChatDelivery, turnFromMessage, chatNoticeTargets, deliverToChat, NoticeChat, showNotices |
messages/notice-notes | NoticeNotes, unshownNotes |
messages/notice-store | MAX_NOTICES, NOTICE_MAX_AGE_MS, Notice, NoticeStore |
modes | MODE_ORDER, narrowerMode, ceilingForOpening, modeFlag |
outbox/outbox | OutboxWorkShape, OutboxEntryFields, OutboxEntryOf, OutboxStoreOptions, OutboxStore |
outbox/outbox-worker | RETRY_DELAYS_MS, OutboxClock, systemClock, OutboxOutcome, OutboxHandlers, OutboxWorkerOptions, OutboxWorker |
tasks/background-limit | BackgroundLimitDeps, backgroundLimitHandler, RestartedOutbox, restartBackgroundLimits, backgroundLimits |
tasks/end-children | EndChildrenWorkSchema, EndChildrenWork, EndChildrenEntry, EndChildrenOutbox, EndChildrenDeps, EndChildren, endChildren |
tasks/give-task | taskNote, GiveTaskDeps, giveTaskHandler |
tasks/task-coordinator | TaskCoordinatorDeps, resultOfTurn, TaskCoordinator |
tasks/task-store | TaskListener, TaskEvent, TaskSink, TaskStore |
tasks/task-work | BackgroundLimitWorkSchema, WakeParentWorkSchema, GiveTaskWorkSchema, DeliverWaitingWorkSchema, BackgroundLimitWork, WakeParentWork, GiveTaskWork, DeliverWaitingWork, TaskWork, BackgroundLimitEntry, WakeParentEntry, GiveTaskEntry, DeliverWaitingEntry, AnyOutboxEntry, TaskOutbox, isBackgroundLimit, isGiveTask |
tasks/waiting-child | WaitingRequest, isPendingRequest, ChatRequests, chatRequests, waitingNoteId, WAITING_GRACE_MS, WaitingObserverDeps, WaitingObserver, WaitingWords, waitingTexts, DeliverWaitingDeps, deliverWaitingHandler |
tasks/wake-parent | RESULT_PREVIEW_BYTES, wakePrompt, wakeLabel, wakeNote, WakeParentDeps, wakeParentHandler, OweWakeDeps, oweWake |
tasks/wiring | TaskChats, TaskRecord, TaskVerbs, TaskWords, TaskWiringDeps, TaskWiring, wireTasks |
Context commands
Parsing, help and refusals of a command line.
| Module | Exports |
|---|---|
context/argv | ParsedArgv, parseArgv |
context/refusal | field, refusalBody, refusalRows, ParsedRefusal, parseRefusalBody |
context/verb | VerbRefusal, VerbCallBase, VerbHelp, Verb, Action, Noun, ContextVerb, VerbEntry, DRY_RUN_FLAG, REVISION_FLAG, DRY_RUN_PREVIEW, ArgsSpec, VerbSpec, NounSpec, HelpTopic, HelpSpec, VerbRegistry, summaryLines, createVerbRegistry, lengthOf, requiredField, orNote |
Helpers
Files, processes, watching and errors.
| Module | Exports |
|---|---|
async | wait, withTimeout |
coded-error | CodedError |
error-text | describeError, setErrorStacks, errorText |
fs | tempNameFor, WriteAtomicOptions, writeAtomic, replaceSync, writeAtomicSync, isNotFound, fileExists |
record-directory | recordFileName, RecordDirectoryOptions, RecordDirectory |
run-process | ProcessResult, RunProcessOptions, runProcess |
serializer | Serializer, KeyedSerializer |
skills | SkillRoot, SkillRootOptions, parseFrontmatter, pluginSkillRoots, skillRootsFor, scanSkillRoots, discoverSkills, SkillIndex |
title-file | cleanTitle, readLines |
watch-seam | DirectoryWatcher, WatchDirectory, Schedule, WatchSeams, supportsRecursive, SYSTEM_WATCH, Settled, settled, PerClientWatches |