Skip to content

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.

ModuleExports
client-sinksClientSinks
eventsAgentEventMap, AgentEvent, AgentSink
host/agent-hostAgentHostOptions, AgentHost
host/environmentCliEnvironmentPolicy, cliEnvironment
host/handlersAgentRequestMap, AgentHandler, AgentHandlers, ChatRequestType, chatHandlers, accountHandlers, usageHandlers
host/memory-portmemoryPortPair
host/wiringAgentWiringOptions, AgentWiring, wireAgents

Chats ​

The core, a session per chat, the thread and what is written of it.

ModuleExports
chat/attachment-storeextensionFor, AttachmentStore, migrateInlineAttachments
chat/backendBackendLaunch, TurnInput, ApprovalDecision, BackendEvent, BackendHost, ChatBackend
chat/background-workBackgroundWork, isBackgroundWork, runsInBackground, runningInBackground, BACKGROUND_COMMAND_LIMIT_MS, commandLabel, reportsOnBackgroundWork
chat/bookmark-storebookmarkFileName, isBookmarkFileName, BookmarkListener, BookmarkStore
chat/chat-coreInterruptedRun, ChatCoreOptions, ChatCore
chat/chat-logChatLogLine, COMPACT_ABOVE_BYTES, parseLog, ChatLogState, ChatLog
chat/chat-processChatProcess, ChatSpawnOptions, SpawnChatProcess, spawnChatProcess, StreamTail, ChatChildOptions, ChatChild
chat/chat-sessionTurnCheckpoints, PromptNotes, ChatReferences, ChatSessionOptions, LimitResumeHooks, ChatSendExtras, ResumeWords, ChatSession, ResumeDecision
chat/chat-storeChatRecordExtras, ChatRecord, ChatSeq, ChatStoreOptions, ChatStore
chat/chat-titleChatTitleInput, buildTitlePrompt, parseTitle, suggestChatTitle
chat/composer-preferencesComposerPreference, ComposerPreferences
chat/context-breakdownestimateContextBreakdown
chat/delta-coalescerDELTA_TICK_MS, DeltaCoalescer
chat/errorsChatErrorCode, ChatError
chat/inputlastSkillToken, splitSkillPrompt, attachmentNote, buildUserMessage
chat/limit-resumeLIMIT_RETRY_DELAYS_MS, limitedTurn, limitResumeAt, limitResumeWake
chat/projectorisMainAgentOutput, summaryLine, stripAgentFooter, ThreadProjector
chat/request-summaryapprovalSummary, requestSummaries
chat/subagent-projectionreadingThread, settledReading
chat/subagent-readerSubagentChat, SubagentReaderOptions, SubagentReader
chat/subagent-settlementSubagentSettlement, settlementOf, readSubagentSettlement
chat/threadChatThread
chat/visual-storevisualFileName, isVisualFileName, VisualInput, VisualStoreOptions, VisualListener, VisualStore
chat/wake-chatWakeChat, ChatOpenerDeps, loadChat, chatOpener

Claude Code and Codex ​

The two backends and their protocols.

ModuleExports
chat/claude-backendClaudeBackendOptions, ClaudeBackend
chat/claude-protocolClaudeProtocol
chat/claude-titleClaudeTitleReader
chat/claude-transcriptSubagentMeta, claudeProjectSlug, findSubagentsDir, readSubagentMetas, findWorkflowAgent, TranscriptProjection
chat/codex-backendparseSkillsList, CodexBackendOptions, CodexBackend
chat/codex-protocolunwrapCommand, CodexProtocol
chat/codex-threadThreadItemsParams, parseThreadItemsPage, projectCodexItems, CodexProcessSpec, listThreadItemsOnce, ThreadForkParams, forkThreadOnce
chat/codex-transportCodexFrame, CodexClientInfo, DEFAULT_CODEX_CLIENT, CodexTransport
providers/claudeclaudeRuntimeMode, claudeArgs, claudeEnv, CLAUDE_CAPABILITIES, CLAUDE_RESUME_COMMAND, promptPrefix
providers/claude-providercreateClaudeProvider, claudeProvider
providers/codexCODEX_CHAT_ARGS, codexThreadOptions, codexRuntimeMode, codexServiceTier, CODEX_CAPABILITIES, CODEX_RESUME_COMMAND
providers/codex-providercreateCodexProvider, codexProvider
providers/codex-rulesCodexRules, CodexRulesResult, codexRulesText, codexRulesPathIn, defaultCodexHome, installCodexRules

Fakes ​

CLIs and clocks for tests.

ModuleExports
chat/fake-claudefakeClaude, claudeStoppingOnResume
chat/fake-cliFakeIo, FakeProgram, FakeCli, StartedFake, InProcessCli, inProcess, runOverStdio
chat/fake-codexFAKE_CHILD_STEPS, fakeCodexForks, FakeCodexOptions, fakeCodexWith, fakeCodex
outbox/manual-clockManualClock
providers/accounts/test-accountsmemorySecrets, testAccounts
watch-test-helpersFakeDirectoryWatcher, FakeWatch, EventLog

Providers and accounts ​

The registry, catalogs and the accounts of each CLI.

ModuleExports
providers/accounts/accountsEnv, isKnownKind, isDefaultAccount, expandHome, accountProblem, folderVariablesOf, withDefaults, defaultFolder, accountFolder, transcriptFolder, accountEnv, NamedAccount, canContinue, readAccount
providers/accounts/launchAccountError, AccountLaunches, isDefaultAccountOf, storedAccount, launchEnv, definedEnv
providers/accounts/serviceProviderAccountsOptions, ProviderAccountsService
providers/accounts/shadow-homeShadowHomeReport, ShadowHomeError, prepareShadowHome
providers/accounts/statusAccountReading, AskAccount, readClaudeAuthStatus, readCodexAccount, askAccountAs
providers/accounts/storeaccountsPath, StoredAccounts, readAccounts, writeAccounts, wireAccounts, InvalidAccountError, acceptAccounts
providers/accounts/variablesSecretsUnavailableError, SecretStore, secretKey, AccountsHost, DEFAULT_ACCOUNTS_HOST, ReservedVariables, isReservedName, variablesProblem, redactVariables, keychainService, keychainSecrets, platformSecrets
providers/catalogModelCatalogInput, ModelCatalog
providers/detectCliDetection, detectCli
providers/providerProviderHome, ChatProvider
providers/registryunofferedProvider, providerFor, ProviderRegistryOptions, ProviderRegistry

Usage ​

Transcripts, prices and plan limits.

ModuleExports
usage/accountsmachineAccounts, usageAccountsOf, usageRootsOf, limitAccountsOf, chatSessionAccounts
usage/aggregateAggregation, accountOfRecord, aggregate
usage/exchangeFRANKFURTER_URL, TARGET_CURRENCY, parseRate, ExchangeRates
usage/index-fileIndexedFile, UsageIndex, encodeIndex, decodeIndex
usage/limits/monitorProbeEnv, LimitAccount, LimitAccounts, UsageMonitorOptions, UsageMonitor
usage/limits/normalizeProviderReading, LimitsUpdate, kindOfDuration, readClaudeUsage, readClaudeEvent, readCodexLimits, mergeWindows
usage/limits/probeProbeResult, probeClaude, probeCodex
usage/pricingLITELLM_URL, ModelPrice, PriceTable, PriceLookup, parsePriceTable, lookupPrice, costOf, cacheSavingsOf, PriceBook
usage/projectsKnownProject, ResolvedProject, ProjectResolver
usage/readers/claudeclaudeMightCarryUsage, parseClaudeLine
usage/readers/codexcodexMightCarryUsage, CodexParserState, createCodexState, cloneCodexState, parseCodexLine
usage/recordUsageRecord, int, asObject, asString, foldByKey
usage/rootsUsageRootPath, usageRoots, accountRoots
usage/scannerScanReport, UsageScannerOptions, accountResolver, UsageScanner
usage/usage-serviceUsageServiceOptions, UsageService

Coordination ​

The outbox, tasks, lineage and messages.

ModuleExports
lineageAgentLineageStore
messages/deliver-messageDeliverMessageWorkSchema, DeliverMessageWork, DeliverMessageEntry, DeliverMessageDeps, deliverMessageHandler
messages/deliver-noticeMessageWords, ChatNoticeTargets, ChatDelivery, turnFromMessage, chatNoticeTargets, deliverToChat, NoticeChat, showNotices
messages/notice-notesNoticeNotes, unshownNotes
messages/notice-storeMAX_NOTICES, NOTICE_MAX_AGE_MS, Notice, NoticeStore
modesMODE_ORDER, narrowerMode, ceilingForOpening, modeFlag
outbox/outboxOutboxWorkShape, OutboxEntryFields, OutboxEntryOf, OutboxStoreOptions, OutboxStore
outbox/outbox-workerRETRY_DELAYS_MS, OutboxClock, systemClock, OutboxOutcome, OutboxHandlers, OutboxWorkerOptions, OutboxWorker
tasks/background-limitBackgroundLimitDeps, backgroundLimitHandler, RestartedOutbox, restartBackgroundLimits, backgroundLimits
tasks/end-childrenEndChildrenWorkSchema, EndChildrenWork, EndChildrenEntry, EndChildrenOutbox, EndChildrenDeps, EndChildren, endChildren
tasks/give-tasktaskNote, GiveTaskDeps, giveTaskHandler
tasks/task-coordinatorTaskCoordinatorDeps, resultOfTurn, TaskCoordinator
tasks/task-storeTaskListener, TaskEvent, TaskSink, TaskStore
tasks/task-workBackgroundLimitWorkSchema, WakeParentWorkSchema, GiveTaskWorkSchema, DeliverWaitingWorkSchema, BackgroundLimitWork, WakeParentWork, GiveTaskWork, DeliverWaitingWork, TaskWork, BackgroundLimitEntry, WakeParentEntry, GiveTaskEntry, DeliverWaitingEntry, AnyOutboxEntry, TaskOutbox, isBackgroundLimit, isGiveTask
tasks/waiting-childWaitingRequest, isPendingRequest, ChatRequests, chatRequests, waitingNoteId, WAITING_GRACE_MS, WaitingObserverDeps, WaitingObserver, WaitingWords, waitingTexts, DeliverWaitingDeps, deliverWaitingHandler
tasks/wake-parentRESULT_PREVIEW_BYTES, wakePrompt, wakeLabel, wakeNote, WakeParentDeps, wakeParentHandler, OweWakeDeps, oweWake
tasks/wiringTaskChats, TaskRecord, TaskVerbs, TaskWords, TaskWiringDeps, TaskWiring, wireTasks

Context commands ​

Parsing, help and refusals of a command line.

ModuleExports
context/argvParsedArgv, parseArgv
context/refusalfield, refusalBody, refusalRows, ParsedRefusal, parseRefusalBody
context/verbVerbRefusal, 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.

ModuleExports
asyncwait, withTimeout
coded-errorCodedError
error-textdescribeError, setErrorStacks, errorText
fstempNameFor, WriteAtomicOptions, writeAtomic, replaceSync, writeAtomicSync, isNotFound, fileExists
record-directoryrecordFileName, RecordDirectoryOptions, RecordDirectory
run-processProcessResult, RunProcessOptions, runProcess
serializerSerializer, KeyedSerializer
skillsSkillRoot, SkillRootOptions, parseFrontmatter, pluginSkillRoots, skillRootsFor, scanSkillRoots, discoverSkills, SkillIndex
title-filecleanTitle, readLines
watch-seamDirectoryWatcher, WatchDirectory, Schedule, WatchSeams, supportsRecursive, SYSTEM_WATCH, Settled, settled, PerClientWatches

Licenses and third-party notices are listed in each package.