@codeam/ide-core
v0.13.0
Published
Headless types, adapter interfaces, and pure helpers shared by @codeam/ide-web and @codeam/ide-native. Zero runtime dependencies on any UI framework — the package any backend implementing the IDE adapter contract can depend on.
Maintainers
Readme
@codeam/ide-core
Headless types, adapter interfaces, and pure helpers shared by
@codeam/ide-web and
@codeam/ide-native.
Zero runtime dependencies on any UI framework. If you only need to wire a
backend up to the IDE's adapter contract, depend on this package and nothing
else — your bundle will pick up just the types + the detectLanguage helper.
Install
npm install @codeam/ide-coreWhat's in here
Adapter contracts —
FileFetcher,GitProvider,FileTreeProvider,SearchProvider,TerminalProvider. Implementations on the consumer side decide whether they talk to the CodeAgent CLI, a Codespaces workspace, a local filesystem bridge, or anything else.detectLanguage(path)— maps a file path to the Monaco language id the editor needs to enable syntax highlighting. Same table the web / native packages use internally, exposed here so tabs and breadcrumbs in consumer code can avoid duplicating it.Shared payload types —
FileReadResult,GitStatusEntry,SearchHit,TerminalEvent. The wire shapes the UI surfaces consume from any adapter.runCancellable(effect)— runs an async effect and returns the teardown that cancels it, so a component that unmounts (or moves to a different file, query, or provider) mid-fetch never writes the stale result. Framework- agnostic; pair it with theuseAsyncAdapterhook that@codeam/ide-weband@codeam/ide-nativeexport.useEffect( () => runCancellable(async (isCancelled) => { const payload = await provider.list(); if (isCancelled()) return; setFiles(payload.files); }), [provider, reloadCount], );Cancelling only stops the write-back — it doesn't abort work already in flight. Adapters that can truly abort should also take an
AbortSignal.
See the top-level README.md for the full architectural
overview and roadmap.
License
MIT
