@makaio/framework 1.0.0-dev-1779046984397 → 1.0.0-dev-1779048017991

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +32 -315
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,125 +1,31 @@
1
1
  <div align="center">
2
- <img src="../../docs/assets/logo.svg" alt="Makaio Logo" width="120" />
3
- <h1>Makaio Framework</h1>
2
+ <img src="https://raw.githubusercontent.com/makaio-ai/makaio-framework/main/docs/assets/logo.svg" alt="Makaio Logo" width="120" />
3
+ <h1>@makaio/framework</h1>
4
4
  <p><strong>A typed, bus-centric runtime for orchestrating AI agents, tools, and sessions across providers.</strong></p>
5
5
 
6
- [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](../../LICENSE)
6
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/makaio-ai/makaio-framework/blob/main/LICENSE)
7
7
  [![CI](https://github.com/makaio-ai/makaio-framework/actions/workflows/ci.yml/badge.svg)](https://github.com/makaio-ai/makaio-framework/actions/workflows/ci.yml)
8
-
9
- [Website](https://makaio.ai) · [Getting Started](https://makaio.ai/guides/getting-started/) · [Why Makaio](https://makaio.ai/why/)
10
8
  </div>
11
9
 
12
10
  ---
13
11
 
14
- > [!TIP]
15
- > **Give your AI agent full context.** Point it at [`makaio.ai/llms.txt`](https://makaio.ai/llms.txt) — everything it needs to answer questions, write extensions, or explore the architecture with you.
16
-
17
- ---
18
-
19
-
20
- Most AI tooling today solves one layer: call an LLM, stream a response, maybe loop on tool calls. That works until you need multiple providers in one system, agents that communicate across processes, storage you can swap without rewriting services, or extensions that load at runtime without forking the host.
21
-
22
- Makaio Framework is a typed runtime for building and hosting AI agent systems. It gives you a bus-centric architecture where agents, services, tools, and storage communicate through typed events and RPC — across threads, processes, or machines.
23
-
24
- ---
25
-
26
- ### Connect your AI tools
27
-
28
- > [!NOTE]
29
- > Makaio normalizes the infrastructure beneath your AI tools — adapters, credentials, streaming, storage. Build a usage tracker, session viewer, or approval workflow once, and it works across Claude Code, Codex, Gemini, and more. Already built something for one provider? Move it to Makaio and it works with all of them.
30
- >
31
- > → [Connect your tooling](../../docs/connect.md) · [Shipped extensions](../../extensions/index.md)
12
+ ## What is this?
32
13
 
33
- ### Extend the ecosystem
14
+ Makaio Framework is runtime infrastructure for AI agent systems. It provides a typed event bus where agents, services, tools, and storage communicate through events and RPC — across threads, processes, or machines.
34
15
 
35
- > [!NOTE]
36
- > Scaffold an extension in one command, contribute CLI commands, background services, tools, or UI surfaces. The framework provides adapters for 8 providers, bus-mediated storage, and a full runtime — you focus on what your extension does.
37
- >
38
- > [Create an extension](../../docs/creating-extensions.md) · [Extension model](../../docs/architecture/extensions/index.md)
39
-
40
- ### Compose, intercept, extend
41
-
42
- > [!NOTE]
43
- > Everything flows through a typed bus — tool calls, agent events, storage requests. Intercept tool inputs for redaction, route sensitive analysis to local models, chain handlers with priority middleware. Build sophisticated automations without forking the framework.
44
- >
45
- > → [Bus architecture](../../docs/architecture/bus/index.md) · [Writing an adapter](../../docs/creating-adapters.md)
46
-
47
- ### Evaluating agent frameworks?
48
-
49
- > [!NOTE]
50
- > Makaio is not another LangChain wrapper. It's runtime infrastructure: a typed event bus with cross-process transports, a 3-layer adapter contract with conformance tests, and an extension system where capabilities load at runtime. Compare it to the orchestration layer beneath your agents, not the agents themselves.
51
- >
52
- > → [How this differs](#how-this-differs) · [Architecture](#architecture)
53
-
54
- ---
16
+ - **8 provider adapters** (Anthropic, OpenAI, Gemini, Codex, Qwen, GitHub Copilot, and more)
17
+ - **Typed event bus** with pub/sub, RPC, namespaces, and cross-process transports
18
+ - **Extension system** — capabilities load at runtime, not compile time
19
+ - **Bus-mediated storage** swap backends without touching service code
20
+ - **Conformance-tested** — every adapter passes a shared test suite
55
21
 
56
22
  ## Install
57
23
 
58
- Makaio Framework is currently source-first. From a source checkout:
59
-
60
24
  ```bash
61
- yarn install
62
- yarn dev
25
+ npm install @makaio/framework
63
26
  ```
64
27
 
65
- The development script starts the framework runtime and web host. Verify the
66
- CLI directly from source:
67
-
68
- ```bash
69
- yarn tsx apps/cli/src/cli-entry.ts --help
70
- ```
71
-
72
- ## Quick Start
73
-
74
- Start the runtime and manage extensions — no code required:
75
-
76
- ```bash
77
- # Start the Makaio runtime (bus + services + adapters)
78
- makaio serve
79
-
80
- # In another terminal — install extensions
81
- makaio extension install ./extensions/account-manager # Local source checkout
82
- makaio extension install ./my-local-extension # Your local extension
83
-
84
- # See what's installed
85
- makaio extension list
86
- ```
87
-
88
- Extensions contribute CLI commands, background services, tools, UI surfaces, and more — all discovered at runtime via `descriptor.json`. During the pre-release phase, framework-shipped extensions are installed from local paths; published npm package names will be documented once those packages are public.
89
-
90
- The [account-manager](../../extensions/account-manager/README.md) extension adds credential management across AI tools. The [prompt](../../extensions/prompt/README.md) extension adds `makaio prompt send` — a provider-agnostic CLI for sending prompts, useful as a drop-in replacement for `claude -p` in scripts and CI pipelines.
91
-
92
- ## Why a Shared Framework
93
-
94
- Everyone building AI-powered applications ends up writing the same infrastructure: provider adapters that break every SDK update, streaming pipelines, tool execution loops, session management, storage layers. Then the model landscape shifts — a new provider launches, an API version bumps, a protocol like ACP emerges — and every project maintains its own copy of the same adapter fixes.
95
-
96
- This is that shared copy. One set of adapters with conformance tests, one extension model, one typed bus. You build your application, workflow, or agent system on top. When Anthropic ships a new API version or OpenAI changes their streaming format, the fix lands here once — not in every project independently.
97
-
98
- ## How This Differs
99
-
100
- Existing solutions occupy specific layers:
101
-
102
- | Layer | Examples | What they solve |
103
- |-------|----------|-----------------|
104
- | Provider abstraction | Vercel AI SDK, LiteLLM | Unified interface to call any LLM |
105
- | Agent orchestration | LangGraph, AutoGen, CrewAI | Build and run multi-agent workflows |
106
- | Coding assistants | Claude Code, Cursor, Copilot | AI-powered development in a single tool |
107
-
108
- Makaio Framework operates below and across these layers. It provides the runtime infrastructure that agent systems need regardless of which provider, orchestration pattern, or host surface they use:
109
-
110
- - A **typed event bus** with pub/sub, RPC, namespaces, and cross-process transports
111
- - A **3-layer adapter contract** (Adapter → Agent → Connector) with conformance tests
112
- - An **extension system** where capabilities load at runtime, not compile time
113
- - **Bus-mediated storage** so backends are swappable without touching service code
114
- - **Host composition** — CLI and desktop share the same boot pipeline
115
-
116
- The bus isn't a notification layer added to a procedural core. It's the architectural backbone: services subscribe, adapters publish, storage handlers respond to requests, and transports bridge it all across process boundaries.
117
-
118
- ## Build on Makaio
119
-
120
- Start any provider's agent with a bus request. Control tool access. React to events. All typed, all provider-agnostic:
121
-
122
- > `@makaio/framework` is the intended public aggregate package. Until that package is published, these imports describe the release surface rather than an installable npm package.
28
+ ## Usage
123
29
 
124
30
  ```ts
125
31
  import { MakaioBus } from '@makaio/framework/bus';
@@ -127,237 +33,48 @@ import { AgentSubjects, SessionSubjects } from '@makaio/framework/contracts';
127
33
 
128
34
  const sessionId = crypto.randomUUID();
129
35
 
130
- // Start a session-backed turn — same shape regardless of provider
131
36
  const { messageId } = await MakaioBus.request(SessionSubjects.sendMessage, {
132
37
  sessionId,
133
38
  agent: {
134
39
  kind: 'adapter',
135
- adapterName: 'anthropic-sdk', // swap to 'openai-node', 'gemini-sdk', etc.
40
+ adapterName: 'anthropic-sdk', // or 'openai-node', 'gemini-sdk', etc.
136
41
  systemPrompt: 'You are a security reviewer. Be concise.',
137
- // Omit model to use the provider default, or pass an adapter-specific ID from the model registry.
138
42
  },
139
43
  message: 'Review the changes in src/ for security issues',
140
44
  });
141
45
 
142
- // Control what the agent can do — approve, deny, or abort
143
- const unsub = MakaioBus.on(
144
- AgentSubjects.toolApprove,
145
- (ctx) => {
146
- if (ctx.payload.toolName === 'write_file') {
147
- ctx.setResult({ action: 'deny', message: 'Read-only review.', shouldAbort: false });
148
- } else {
149
- ctx.setResult({ action: 'allow' });
150
- }
151
- },
152
- { filter: { sessionId } },
153
- );
154
-
155
- // Wait for completion — typed result
156
46
  const completed = await MakaioBus.once(AgentSubjects.complete, {
157
47
  filter: { sessionId, messageId },
158
48
  timeoutMs: 120_000,
159
49
  });
160
50
 
161
51
  console.info(completed.payload.message);
162
- unsub();
163
- ```
164
-
165
- Switch `adapterName` and the same session orchestration code runs against Claude, Codex, Gemini, or Qwen. Keep `model` omitted for provider defaults unless you have resolved a concrete adapter-specific model ID from the model registry. The [adapter conformance test suite](../../adapters/implementations/__tests__/) guarantees consistent behavior across all of them.
166
-
167
- ### Architecture
168
-
169
- ```text
170
- ┌─────────────────────────────────────────────────────────┐
171
- │ Your Application / Host │
172
- │ CLI, Electron, or custom host │
173
- └────────────────────────┬────────────────────────────────┘
174
-
175
- ┌────────────────────────▼────────────────────────────────┐
176
- │ Runtime + Extension Coordinator │
177
- │ Dependency ordering · Lifecycle · Surfaces │
178
- └────────────────────────┬────────────────────────────────┘
179
-
180
- ┌────────────────────────▼────────────────────────────────┐
181
- │ Makaio Bus │
182
- │ Typed pub/sub + RPC · Namespaces · Scoped/Filtered │
183
- │ Transport registry (WebSocket, loopback, custom) │
184
- └───────┬────────────────┼───────────────────┬────────────┘
185
- │ │ │
186
- ┌───────▼──────┐ ┌──────▼───────┐ ┌────────▼─────────┐
187
- │ Services │ │ Storage │ │ Tools │
188
- │ Session, │ │ Bus-backed │ │ Typed schemas, │
189
- │ Orchestrator│ │ handlers │ │ registry, │
190
- │ Registry │ │ (swappable) │ │ approval flow │
191
- └──────────────┘ └──────────────┘ └──────────────────┘
192
-
193
- ┌───────▼─────────────────────────────────────────────────┐
194
- │ Adapter Layer (3-part) │
195
- │ AIAdapter → lifecycle, session management │
196
- │ AIAgent → turn execution, tool orchestration │
197
- │ AIAgentConnector → provider SDK / CLI / ACP bridge │
198
- └─────────────────────────────────────────────────────────┘
199
52
  ```
200
53
 
201
- Everything communicates through the [bus](../../docs/architecture/bus/index.md). The transport registry means the bus spans process boundaries — a VS Code extension, a mobile app, or a CI pipeline can participate as a bus client over WebSocket without importing the framework.
54
+ Switch `adapterName` and the same code runs against any supported provider.
202
55
 
203
- ### Adapters
56
+ ## Subpath Exports
204
57
 
205
- Each adapter implements the 3-layer contract (Adapter → Agent → Connector) and passes a shared [conformance test suite](../../adapters/implementations/__tests__/) that verifies lifecycle, streaming, tool approval, and error handling.
206
-
207
- | Adapter | Provider | Protocol | Status |
208
- |---------|----------|----------|--------|
209
- | `anthropic-sdk` | Anthropic (Claude) | API SDK | Stable |
210
- | `openai-node` | OpenAI (GPT) | API SDK | Stable |
211
- | `gemini-sdk` | Google (Gemini) | API SDK | Stable |
212
- | `claude-code-cli` | Anthropic (Claude Code) | CLI subprocess | Stable |
213
- | `claude-code` | Anthropic (Claude Agent SDK implementation) | API SDK | Stable |
214
- | `codex-app-server` | OpenAI (Codex) | ACP | Experimental |
215
- | `qwen-acp` | Alibaba (Qwen) | ACP | Experimental |
216
- | `github-copilot-sdk` | GitHub (Copilot) | API SDK | [ABANDONED](https://github.blog/news-insights/company-news/github-copilot-is-moving-to-usage-based-billing/) |
217
-
218
- **Status definitions:**
219
-
220
- - **Stable** — Actively maintained, conformance tests pass, used in production
221
- - **Experimental** — Working implementation, API surface may change
222
- - **Community** — Maintained by contributors, not the core team
223
-
224
- Writing a new adapter means implementing `AIAgentConnector` (the provider bridge), wrapping it in an `AIAgent` and `AIAdapter`, and running the conformance suite. See [Creating Adapters](../../docs/creating-adapters.md).
225
-
226
- ### SDKs
227
-
228
- The bus protocol is language-neutral. SDKs let any process participate — subscribe to events, handle requests, emit — without importing the TypeScript framework:
229
-
230
- | SDK | Language | Transport | Status |
231
- |-----|----------|-----------|--------|
232
- | [`@makaio/sdk`](../../sdks/typescript/) | TypeScript | Framework-native facade | Pre-release, unpublished package |
233
- | [`makaio-sdk`](../../sdks/python/) | Python | WebSocket + stdio (asyncio) | Pre-release, unpublished package |
234
- | [`makaio-sdk`](../../sdks/rust/) | Rust | WebSocket + stdio (tokio) | Unpublished crate (`publish = false`) |
235
-
236
- All SDKs expose the same logical surface:
237
-
238
- ```
239
- connect(url, options?) // WebSocket connection with optional HMAC auth and dispatch mode
240
- subscribe(subject, handler) // event subscription (local + remote dispatch)
241
- onRequest/on_request(...) // request handler with middleware chaining (TypeScript uses onRequest; Python/Rust use on_request)
242
- request(subject, payload) // typed RPC (local-first dispatch by default)
243
- emit(subject, payload) // fire-and-forget (dispatches to local + remote subscribers)
244
- close() // clean shutdown
245
- ```
246
-
247
- All three SDKs support HMAC authentication (auto-probed from `/health`), local-first request dispatch with middleware chaining via `RequestContext.next()`, typed subject descriptors generated from the protocol manifest, and WebSocket transport. Python and Rust additionally support stdio transport for detached extension processes.
248
-
249
- Subscription cleanup is language-shaped: TypeScript returns unsubscribe functions, Python subscription handles expose `close()`, and Rust uses `unsubscribe()` for event subscriptions and `unregister()` for request handlers.
250
-
251
- Cross-language SDKs are generated from a [shared protocol manifest](../../sdks/manifest/) derived from `@makaio/contracts`, validated against a [shared conformance suite](../../sdks/conformance/). The TypeScript SDK is a thin facade over the framework's bus packages.
58
+ | Import | Description |
59
+ |--------|-------------|
60
+ | `@makaio/framework/bus` | Typed event bus pub/sub, RPC, namespaces |
61
+ | `@makaio/framework/contracts` | Zod schemas, subject taxonomy, wire format |
62
+ | `@makaio/framework/core` | Foundational types, errors, OptionalResult |
63
+ | `@makaio/framework/kernel` | Extension coordinator, service lifecycle |
64
+ | `@makaio/framework/services` | Session, orchestrator, tool registry, model registry |
65
+ | `@makaio/framework/adapters` | Adapter layer lifecycle, session management |
66
+ | `@makaio/framework/storage` | Bus-mediated storage contracts and handlers |
67
+ | `@makaio/framework/tools` | Tool contract, defineTool(), defineToolset() |
68
+ | `@makaio/framework/testing` | Test helpers, bus fixtures, SQLite harness |
252
69
 
253
70
  ## Documentation
254
71
 
255
- **Use Makaio:**
256
-
257
- | Topic | Link |
258
- |-------|------|
259
- | Getting started | [docs/getting-started.md](../../docs/getting-started.md) |
260
- | CLI reference | [apps/cli/README.md](../../apps/cli/README.md) |
261
- | Configuration | [docs/configuration.md](../../docs/configuration.md) |
262
-
263
- **Build on Makaio:**
264
-
265
- | Topic | Link |
266
- |-------|------|
267
- | Writing an extension | [docs/creating-extensions.md](../../docs/creating-extensions.md) |
268
- | Writing an adapter | [docs/creating-adapters.md](../../docs/creating-adapters.md) |
269
- | Extension model | [docs/architecture/extensions/index.md](../../docs/architecture/extensions/index.md) |
270
- | Bus architecture | [docs/architecture/bus/](../../docs/architecture/bus/index.md) |
271
- | Transport (WebSocket, cross-process) | [docs/architecture/transport.md](../../docs/architecture/transport.md) |
272
-
273
- **Host and deploy:**
274
-
275
- | Topic | Link |
276
- |-------|------|
277
- | Host applications | [docs/architecture/apps.md](../../docs/architecture/apps.md) |
278
-
279
- ## Repository Layout
280
-
281
- Representative high-level tree for the framework distribution. It lists the main workspace groups and notable packages; individual provider, extension, and test packages may change as the framework evolves.
282
-
283
- ```text
284
- ├── adapters/
285
- │ ├── core/ Adapter contracts, conformance test suite
286
- │ ├── shared/ Shared ACP, Claude, and stream-session helpers
287
- │ └── implementations/ One directory per provider adapter
288
- ├── apps/
289
- │ ├── cli/ Headless CLI server + bus client
290
- │ ├── electron/ Electron desktop host
291
- │ ├── electrobun/ Electrobun desktop host (experimental)
292
- │ ├── host-shared/ Shared desktop host boot/rendering logic
293
- │ └── mcp-server/ MCP server bridge
294
- ├── build-tooling/ Shared Vite/tsdown configs for packages and extensions
295
- ├── clients/ External tool client integrations (Claude Code, Codex, Gemini, Copilot, Qwen)
296
- ├── docs/ Framework documentation
297
- ├── extensions/ Framework-shipped extensions
298
- ├── packages/
299
- │ ├── adapter-subsystem/ Adapter contribution loading, runtime registry, identity
300
- │ ├── bus-core/ Typed event bus — pub/sub, RPC, namespaces, scoped/filtered buses
301
- │ ├── bus-server/ HTTP + WebSocket server lifecycle
302
- │ ├── bus-server-vite/ Vite dev-server bus integration
303
- │ ├── clients-core/ Managed client/runtime/binary services
304
- │ ├── contracts/ Zod schemas, subject taxonomy, wire format
305
- │ ├── expression/ Expression evaluator over contracts
306
- │ ├── file-watcher/ File watching abstraction
307
- │ ├── hooks/ Bus-event hook system
308
- │ ├── machine-identity/ Stable machine ID (keypair)
309
- │ ├── makaio-core/ Foundational types, errors, OptionalResult
310
- │ ├── mcp-http-server/ MCP-over-HTTP bridge
311
- │ ├── native-session-supervisor/ Native client session observation
312
- │ ├── kernel/ ExtensionCoordinator, service lifecycle, boot observability
313
- │ ├── services/base/ BaseService lifecycle primitive
314
- │ ├── services/core/ Core services: session, orchestrator, tool registry, model registry
315
- │ ├── services/log-import/ Session log import service
316
- │ ├── services/package-manager/ Package discovery and management service
317
- │ ├── storage/core/ Storage namespace contracts
318
- │ ├── storage/drizzle/ Drizzle/SQLite client helpers, FTS, transactions
319
- │ ├── storage/handlers/ Bus-backed CRUD + list handler factories
320
- │ ├── storage-migrations/ Migration runner + schema discovery
321
- │ ├── preferences/ User preferences storage
322
- │ ├── providers/ Config/provider runtime helpers
323
- │ ├── rules/ Runtime rule helpers
324
- │ ├── test-utils/ Test helpers, bus fixtures, SQLite test harness
325
- │ └── utils/ Shared utilities
326
- ├── providers/ Provider metadata packages (model catalogs, capability tags)
327
- ├── runtimes/
328
- │ ├── bun/ Bun host assembly helpers
329
- │ └── node/ Node host assembly: bootMakaioRuntime(), discovery, DB init
330
- ├── sdks/
331
- │ ├── typescript/ @makaio/sdk — TypeScript facade
332
- │ ├── python/ Python SDK (asyncio, WebSocket + stdio)
333
- │ ├── rust/ Rust SDK (tokio, WebSocket + stdio)
334
- │ ├── manifest/ Language-neutral protocol definition (generated)
335
- │ └── conformance/ Shared wire-level conformance fixtures
336
- ├── tools/
337
- │ ├── core/ Tool contract, defineTool(), defineToolset(), executor
338
- │ ├── filesystem/ File read/write/search tools
339
- │ ├── shell/ Shell execution tool
340
- │ └── subagent/ Sub-agent spawning tool
341
- ├── transports/
342
- │ ├── ws/ WebSocket transport (HMAC auth, E2E encryption, relay)
343
- │ └── message-channel/ MessageChannel transport (SharedWorker, iframe)
344
- └── ui/
345
- ├── kernel/ UI contracts, registries (widgets, pages, navigation)
346
- ├── theme/ SCSS design system: tokens, themes, mixins
347
- ├── components/ Pure UI components (no hooks, no bus)
348
- ├── hooks/ React hooks, stores, providers (BusProvider, useBus)
349
- └── views/ Composed views and shell components
350
- ```
351
-
352
- ## Contributing
353
-
354
- We welcome contributions — adapters, extensions, tools, bug fixes, and documentation. See [CONTRIBUTING.md](../../CONTRIBUTING.md) for development setup, contribution surfaces, and PR guidelines.
355
-
356
- ## Community
357
-
358
- - [Code of Conduct](../../CODE_OF_CONDUCT.md)
359
- - [Security Policy](../../SECURITY.md)
72
+ - [Getting Started](https://github.com/makaio-ai/makaio-framework/blob/main/docs/getting-started.md)
73
+ - [Writing an Extension](https://github.com/makaio-ai/makaio-framework/blob/main/docs/creating-extensions.md)
74
+ - [Writing an Adapter](https://github.com/makaio-ai/makaio-framework/blob/main/docs/creating-adapters.md)
75
+ - [Bus Architecture](https://github.com/makaio-ai/makaio-framework/blob/main/docs/architecture/bus/index.md)
76
+ - [Full README](https://github.com/makaio-ai/makaio-framework)
360
77
 
361
78
  ## License
362
79
 
363
- [MIT](../../LICENSE)
80
+ [MIT](https://github.com/makaio-ai/makaio-framework/blob/main/LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makaio/framework",
3
- "version": "1.0.0-dev-1779046984397",
3
+ "version": "1.0.0-dev-1779048017991",
4
4
  "description": "Typed, bus-centric framework for building and orchestrating AI agents with tools, sessions, and events",
5
5
  "license": "MIT",
6
6
  "type": "module",