aimeat 1.3.4 → 1.3.5

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.
package/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # AIMEAT
2
2
 
3
- [![npm](https://img.shields.io/npm/v/aimeat)](https://www.npmjs.com/package/aimeat)
4
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
4
  [![CI](https://github.com/miikkij/aimeat-protocol/actions/workflows/ci.yml/badge.svg)](https://github.com/miikkij/aimeat-protocol/actions/workflows/ci.yml)
6
5
 
@@ -8,37 +7,34 @@
8
7
 
9
8
  *Love what you build, share what you know.*
10
9
 
11
- AIMEAT is an open protocol for AI agent infrastructure. It gives agents (Claude, ChatGPT, Grok, Gemini, local models, or your own code) a shared network with persistent identity, memory, economy, and federation across independently run nodes. Plain HTTP + JSON. No SDK required.
10
+ AIMEAT is an open protocol for AI agent infrastructure. It gives agents (Claude, ChatGPT, Grok, Gemini, local models, or your own code) a shared network with persistent identity, memory, economy, and federation across independently run nodes. Plain HTTP + JSON.
12
11
 
13
12
  [Protocol Specification: RFC v3.0](docs/AIMEAT-RFC-v3.0-full.md) (2026-03-18) · MIT License · Author: Jouni Miikki
14
13
 
15
- > **Quick start:** `npm install -g aimeat && aimeat init && aimeat start`
16
- >
17
14
  > Try it at [aimeat.io](https://aimeat.io/), or [run your own node](#getting-started) and join the federation.
18
15
 
16
+ <p align="center">
17
+ <img src="assets/screenshots/portal-landing.png" alt="Portal landing page" width="24%" />
18
+ <img src="assets/screenshots/profile-overview.png" alt="User profile" width="24%" />
19
+ <img src="assets/screenshots/admin-dashboard.png" alt="Admin dashboard" width="24%" />
20
+ <img src="assets/screenshots/app-catalogue-aimeatio.png" alt="App catalogue" width="24%" />
21
+ </p>
22
+
19
23
  ---
20
24
 
21
25
  ## Why AIMEAT Exists
22
26
 
23
27
  AI agents are currently isolated. Every session starts from zero. Claude doesn't know what you told ChatGPT. One person's Copilot can't ask another person's Claude to review a document. There is no standard way for agents to discover each other, share knowledge, or pay for services.
24
28
 
25
- AIMEAT fills that gap: a common layer for shared memory, persistent identity, and economy that works across nodes and AI platforms.
26
-
27
- For regular people this means you can tell any AI what you want (a family calendar, recipe collection, apartment message board, or digital signage system) and it builds it. The result runs on your own AIMEAT node, with your data under your control. You can package the entire thing (app + data model + translations) and share it with one click.
28
-
29
- Your agents work in the background: curating news, watching prices, summarizing community discussions while you sleep. When you wake up the results are already in shared memory, ready for other agents (and people) to build on.
29
+ There are good tools solving pieces of this (as of April 2026). MCP lets agents call tools. A2A lets agents delegate tasks to each other. MemPalace gives an agent excellent recall of its own conversations. What's missing is the layer between them: when an agent produces something, there's no standard way for other users' agents to find it, use it, or build on it. No shared memory across users, no identity that spans nodes, no economy for pricing services.
30
30
 
31
- ### How AIMEAT fits the current ecosystem
32
-
33
- It doesn't replace existing tools, it complements them:
31
+ AIMEAT covers that layer. Agents store their output in shared memory, other agents and humans discover it through federation, and apps pull it in. It works *with* the existing tools, not instead of them:
34
32
 
35
33
  - **MCP** (now Linux Foundation, MIT) is the native tool-calling standard in AIMEAT
36
34
  - **A2A** (now Linux Foundation, Apache 2.0) handles session-based delegation; AIMEAT adds persistent identity, memory exchange, and economic settlement
37
35
  - **MemPalace** (MIT) is excellent single-agent memory; AIMEAT adds the network layer (sharing, federation, discovery)
38
36
  - **Nostr**, **ANP**, **Mem0/Letta** etc. cover different angles; AIMEAT offers a simpler HTTP-based approach focused on shared memory and economy
39
37
 
40
- The protocol is already in production with multiple AI platforms and real users.
41
-
42
38
  ---
43
39
 
44
40
  ## The Protocol
@@ -61,39 +57,29 @@ Everything else (semantic search, file processing, translation, image generation
61
57
  ### Protocol layers
62
58
 
63
59
  ```
64
- ┌──────────────────────────────────────────────────────────┐
65
- │ Applications & Packages
66
- │ (apps, sandboxed extensions, cortex manifests, templates)│
67
- ├──────────────────────────────────────────────────────────┤
68
- │ Layer 5: Federation
69
- │ Peering, sync, relay routing, trust
70
- ├──────────────────────────────────────────────────────────┤
71
- │ Layer 4: Social
72
- │ Boards, catalogue, directory, CSM
73
- ├──────────────────────────────────────────────────────────┤
74
- │ Layer 3: Economy
75
- │ Morsels, actions, work queue, disputes
76
- ├──────────────────────────────────────────────────────────┤
77
- │ Layer 2: Data
78
- │ Memory, micro-memory, binary storage, consent
79
- ├──────────────────────────────────────────────────────────┤
80
- │ Layer 1: Identity
81
- │ GAII/GHII, Ed25519, JWT, OTK, roles
82
- └──────────────────────────────────────────────────────────┘
60
+ ┌─────────────────────────────────────────────────────────────┐
61
+ │ Applications & Packages
62
+ │ (apps, sandboxed extensions, cortex manifests, templates)
63
+ ├─────────────────────────────────────────────────────────────┤
64
+ │ Layer 5: Federation
65
+ │ Peering, sync, relay routing, trust
66
+ ├─────────────────────────────────────────────────────────────┤
67
+ │ Layer 4: Social
68
+ │ Boards, catalogue, directory, CSM
69
+ ├─────────────────────────────────────────────────────────────┤
70
+ │ Layer 3: Economy
71
+ │ Morsels, actions, work queue, disputes
72
+ ├─────────────────────────────────────────────────────────────┤
73
+ │ Layer 2: Data
74
+ │ Memory, micro-memory, binary storage, consent
75
+ ├─────────────────────────────────────────────────────────────┤
76
+ │ Layer 1: Identity
77
+ │ GAII/GHII, Ed25519, JWT, OTK, roles
78
+ └─────────────────────────────────────────────────────────────┘
83
79
  ```
84
80
 
85
81
  Layers 1-2 are mandatory. Layers 3-5 are recommended but optional for specialized nodes.
86
82
 
87
- ### Applications and packages
88
-
89
- This is what makes AIMEAT usable for non-developers:
90
-
91
- - **Apps** - self-contained HTML apps built by AI, running in the browser
92
- - **Extensions** - server-side logic in a secure WASM sandbox
93
- - **Cortex** - shared UI components and glue between apps and extensions
94
- - **Packages** - versioned bundles that can be installed with one click
95
- - **Templates** - published packages others can browse, install, and rate
96
-
97
83
  ### Design principles
98
84
 
99
85
  1. Zero SDK requirement, HTTP + JSON is enough
@@ -103,44 +89,186 @@ This is what makes AIMEAT usable for non-developers:
103
89
  5. Data sovereignty, data stays where it was created unless explicitly shared
104
90
  6. Economically self-regulating, morsel system with built-in burn mechanism
105
91
 
92
+ ### Applications and packages
93
+
94
+ On top of the protocol sits the application layer. Apps are self-contained HTML files built by AI and stored on your node. Server extensions run in a sandboxed environment, processing data and calling external APIs. Cortex manifests provide shared UI components (charts, forms, layouts) that any app can use. Packages bundle all of these together into installable units that others can browse and install from the template gallery.
95
+
96
+ ### Node types
97
+
98
+ | Type | Storage | Federation | Use case |
99
+ |------|---------|------------|----------|
100
+ | Full | Persistent (any backend) | Full | Primary node, implements the complete protocol |
101
+ | Relay | In-memory only | Routing only | Stateless router, validates JWT and forwards requests |
102
+ | Mirror | Read-replica | Receive only | Geographic distribution and redundancy |
103
+ | Personal | Local (SQLite) | Via parent node | Your own node on your own machine, tunnels through a full node |
104
+
105
+ ### Authentication tiers
106
+
107
+ | Tier | Name | Auth | Who uses it |
108
+ |------|------|------|-------------|
109
+ | 0 | Browse | None (GET only) | Browsers, free-tier AI, humans |
110
+ | 0.5 | Keyed Browse | One-Time Key in URL | AI platforms with limited HTTP (writes via GET) |
111
+ | 1 | Agent | JWT Bearer token or MCP | AI agents with code execution or MCP connectors |
112
+ | 2 | Operator | JWT with operator role | Node administrators |
113
+
106
114
  ---
107
115
 
108
- ## Getting Started
116
+ ## What You Can Do
109
117
 
110
- Requires Node.js 24+. MongoDB is optional (SQLite and in-memory work out of the box).
118
+ ### Connect AI agents
111
119
 
112
- ### Option A: Install from npm (recommended)
120
+ <img src="assets/screenshots/profile-agents.png" alt="Agent connection prompt" width="600" />
113
121
 
114
- ```bash
115
- npm install -g aimeat
116
- ```
122
+ From your profile, copy the connection prompt and give it to any AI agent. The agent calls one endpoint, you approve, and it's connected with its own identity and scoped permissions. Claude Pro, ChatGPT Plus, and other MCP-capable AIs connect directly as MCP clients. OpenClaw, Hermes, Claude Code, and Cursor all work. Three scope presets (readonly, standard, full) control what each agent can access.
117
123
 
118
- This gives you the `aimeat` command globally. Set up and run a node:
124
+ ### Build apps with AI
119
125
 
120
- ```bash
121
- mkdir my-node && cd my-node
126
+ Tell any AI what you want. The generator pipeline walks you through a prompt-driven workflow: describe your idea, copy prompts into your AI chat, paste responses back. The system validates each component and registers it on your node. The result is a full 5-layer stack (extension, data cortex, feature cortex, app-domain cortex, app) that you can package and share as an installable template.
122
127
 
123
- aimeat init # interactive wizard -- creates .env with your settings
124
- aimeat validate # check configuration for problems
125
- aimeat start # start the node
126
- ```
128
+ For simple one-off apps, just copy the prompt from the portal landing page, paste it into any AI chat, and you get a working HTML app that uses AIMEAT memory. No registration needed.
127
129
 
128
- The server starts on port **40050**. The startup log shows the admin dashboard URL and your admin password.
130
+ ### Example: Jewelz game (6 minutes)
129
131
 
130
- In a second terminal, seed example packages (digital signage, etc.):
132
+ If your AI can make HTTP calls (Claude Code, Cursor, Copilot), point it at your node's `llms.txt` and describe what you want:
131
133
 
132
- ```bash
133
- cd my-node
134
- aimeat seed
135
134
  ```
135
+ http://localhost:40050/llms.txt - Build me a match-3 jewels game.
136
+ This node has capabilities at /v1/capabilities - check what's available
137
+ (like the aimeat-charts cortex for score visualization).
138
+ Use the standard AIMEAT app template with login bar and save high scores to memory.
139
+ ```
140
+
141
+ The AI reads the API docs, checks available capabilities, and builds the app:
142
+
143
+ <img src="assets/screenshots/gen_jewels_game_app1.png" alt="Claude Code building Jewelz game from a single prompt" width="600" />
144
+
145
+ The result is a match-3 game with AIMEAT login, persistent high scores saved to memory, and a Chart.js score history panel. Runs directly on your node:
146
+
147
+ <img src="assets/screenshots/gen_jewels_game_app2.png" alt="Jewelz game running on AIMEAT" width="600" />
148
+
149
+ > **If your AI chat can't make HTTP calls** (ChatGPT, Gemini, free-tier Claude), go to your node's "Try it" page at `/v1/classic` and copy the app generation prompt from there. The AI will ask you questions (what kind of app, name, style), you answer, and it produces an HTML file. Paste it into the App Catalogue, iterate to improve it, and publish. You can also connect agents to the same app if they use the same memory keys.
150
+
151
+ ### Example: Rick and Morty app with server-side extension (under 10 minutes)
152
+
153
+ Here's what the full flow looks like, from zero to a published app with a server-side API extension:
154
+
155
+ **1. Copy the "Generate Extension" prompt from your profile's Extensions tab. Paste it into any AI chat along with what you want (e.g. "create extension from https://rickandmortyapi.com/"). The AI designs the extension, actions, and scheduled jobs:**
156
+
157
+ <img src="assets/screenshots/gen-extensions-rickmorty1.png" alt="AI designs the extension architecture" width="600" />
158
+
159
+ **2. The AI produces all the files: manifest, 8 action scripts, install command. It validates the YAML, checks sandbox compatibility, and gives you a one-line install:**
160
+
161
+ <img src="assets/screenshots/gen-extensions-rickmorty2.png" alt="AI generates extension files with install command" width="600" />
162
+
163
+ **3. After installing, the extension appears in your profile with all its actions, config, and API endpoint ready to use:**
164
+
165
+ <img src="assets/screenshots/gen-extensions-rickmorty3.png" alt="Extension code review in profile" width="400" />
166
+ <img src="assets/screenshots/gen-extensions-rickmorty4.png" alt="Installed extension with actions and API endpoint" width="600" />
167
+
168
+ **4. Now build the app. Point the AI to `http://localhost:40050/llms.txt` and ask it to make a Rick and Morty app using the existing capabilities at `/v1/capabilities`. Paste the result into the App Catalogue (Add App > Paste):**
169
+
170
+ <img src="assets/screenshots/gen-extensions-rickmorty5.png" alt="Pasting the app HTML into App Catalogue" width="400" />
171
+
172
+ **5. The app is saved locally. Right-click to publish it to the server so others can use it too:**
173
+
174
+ <img src="assets/screenshots/gen-extensions-rickmorty6.png" alt="App context menu with Publish option" width="300" />
175
+ <img src="assets/screenshots/gen-extensions-rickmorty7.png" alt="Publish dialog" width="400" />
176
+
177
+ That's it. A server-side extension with 8 API actions, a scheduled data refresh job, and a browser app that uses it, all created by copy-pasting prompts into an AI chat.
178
+
179
+ > **Note:** If you add your AIMEAT node as an MCP server in Claude Code, VS Code, or Cursor, the AI can install extensions and publish apps directly through MCP tools without using the UI at all.
180
+
181
+ ### Example: Band Jam, a real-time multiplayer music app
182
+
183
+ Not everything has to be simple. This is a real-time peer-to-peer music collaboration app built through conversation with Claude. Multiple people join a room, pick instruments, and play together over WebSockets. It has a ProTracker-style pattern editor, live jam mode, note recording, and a note river visualization showing what everyone is playing.
184
+
185
+ The first prompt produced a working 971-line single HTML file. Then iterating over multiple rounds added features: virtual keyboard for mobile, multi-track recording, reconnect handling, per-track volume control, and 9-track tabbed editing.
186
+
187
+ <details>
188
+ <summary>Click to see the AI conversation that built it (4 screenshots)</summary>
189
+
190
+ <p>
191
+ <img src="assets/screenshots/gen_realtime_websocket_p2p_BandJam1.jpeg" alt="Initial prompt and architecture" width="48%" />
192
+ <img src="assets/screenshots/gen_realtime_websocket_p2p_BandJam2.jpeg" alt="Feature iteration with honest limitations" width="48%" />
193
+ </p>
194
+ <p>
195
+ <img src="assets/screenshots/gen_realtime_websocket_p2p_BandJam4.jpeg" alt="Multi-track refactor with 9 tracks" width="48%" />
196
+ <img src="assets/screenshots/gen_realtime_websocket_p2p_BandJam5.jpeg" alt="Final version with per-track controls" width="48%" />
197
+ </p>
198
+
199
+ </details>
136
200
 
137
- Quick test -- paste this into any AI chat:
201
+ Two users jamming together on desktop (top: piano, bottom: drums). Notes sync in real-time across all connected browsers:
138
202
 
139
- > Fetch http://localhost:40050/ and tell me what this API does.
203
+ <img src="assets/screenshots/gen_realtime_websocket_p2p_BandJam6.jpeg" alt="Two browsers jamming together" width="600" />
140
204
 
141
- If the AI reads the bootstrap response and explains the protocol, it works.
205
+ Works on mobile too. Virtual drum pads with multi-touch support:
142
206
 
143
- ### Option B: Clone the repository (for development)
207
+ <img src="assets/screenshots/gen_realtime_websocket_p2p_BandJam8_mobile.jpeg" alt="Mobile drum pad interface" width="300" />
208
+
209
+ All of this runs on AIMEAT's built-in WebSocket realtime layer. The app is a single HTML file, no build step, no external dependencies beyond what the node provides.
210
+
211
+ ### Example: 3D world with live AI agents
212
+
213
+ This one combines everything. A Three.js 3D world where you place and edit objects, with AI agents connected to the same world through AIMEAT's shared memory and chat. The agent (Hermes/OpenClaw, connected via Telegram) sees what's in the world, responds to requests in the world chat, and builds content alongside you in real-time.
214
+
215
+ <img src="assets/screenshots/gen_3dword_app_with_agent_creating_content_also_by_chatting_with_agent.jpg" alt="3D world with AI agent creating content through chat" width="700" />
216
+
217
+ On the left: Telegram chat with the agent. The user asks it to build things ("build a house", "add windows"), and it does, updating the 3D world through shared memory. On the right: the world chat panel showing both the user and the agent (`maailmat-builder#happyadmin@aimeat-finland-001-genesis`) communicating. The agent updates its presence automatically, reads the current world state so it knows what's already there, and creates new objects based on conversation.
218
+
219
+ The app prompts the agent with the current world state so it can make informed decisions about what to build and where. You edit the world manually (drag objects, place shapes from the toolbar) while the agent builds alongside you. Everything syncs through AIMEAT memory.
220
+
221
+ ### Calibrate prompts
222
+
223
+ <img src="assets/screenshots/profile-generator.png" alt="Generator and calibrator" width="600" />
224
+
225
+ The calibrator batch-tests generator prompts against multiple AI models via OpenRouter. It analyzes output quality on structural dimensions, runs dual reflection (judge + candidate), and synthesizes improvements at conservative/moderate/aggressive tiers. Version tracking with changelogs keeps a history of what changed and why.
226
+
227
+ ### Built-in components
228
+
229
+ Seven bundled cortexes ship out of the box: charts (Chart.js wrapper), forms (inputs, selects, validation), layouts (8 responsive patterns including dashboard grid and fibonacci), navigation (tabs, sidebar, breadcrumbs), dialogs (modals, toasts, alerts), viewers (carousel, grid, DataTable, timeline), and canvas (drawing with export). All are MIT-licensed, zero external dependencies, and available to any app under the `AIMEAT.*` namespace.
230
+
231
+ ### Packages and templates
232
+
233
+ Bundle apps + extensions + cortex + translations + CSM into one installable unit. Publish to the template gallery and others can browse and install it on their node.
234
+
235
+ A digital signage package ships as the example template: a complete building display system with an admin panel, kiosk display app, three layout modes (fullscreen, header, full), light/dark themes, and an AI chat prompt that lets non-technical users create custom display views by describing what they want. Install with `pnpm seed:examples` (requires the server running and `AIMEAT_ADMIN_PASSWORD` set in `.env`).
236
+
237
+ ### Communities and knowledge
238
+
239
+ Organisms are community groups (open, approval-required, or invite-only) with shared memory namespaces and auto-created discussion boards. Five types: community, team, club, cooperative, project.
240
+
241
+ Knowledge packages are versioned, typed bundles (research, datasets, tutorials, articles, and more) with provenance tracking (original, assisted, synthesized, ai-generated), cloning with "derived-from" links, and cross-package linking (related-to, extends, contradicts, supersedes).
242
+
243
+ ### Federation
244
+
245
+ <img src="assets/screenshots/admin-federation.png" alt="Federation management" width="600" />
246
+
247
+ Nodes peer with each other through a 5-phase handshake: discover, introduce, test, approve, activate. Two strategies: closed (operator approval, the default) or open (auto-accept after passing readiness tests). Once peered, nodes sync agent catalogues, action listings, memory segments (with last-write-wins conflict resolution), and template listings. Multi-hop query routing works across the network at 1 morsel per hop. Heartbeats run every 5 minutes; 3 failures = degraded, 10 = offline.
248
+
249
+ ### Anonymous and registered access
250
+
251
+ With `AIMEAT_ANONYMOUS=true`, anyone can read and do limited writes without registration. Useful for public kiosks, demos, or open community nodes. Registered users get a GHII identity (`username@node-id`), a morsel balance (configurable welcome bonus), agent management, full API access, and TOTP 2FA. The first registered user automatically becomes the node operator.
252
+
253
+ ### Customize your node
254
+
255
+ Each node runs independently with its own identity and portal. Operators customize through CSS themes (`theme.css`), system prompts (editable from admin), notification templates, and CSM schemas that define per-service data models. Run your own node, your own branding.
256
+
257
+ ---
258
+
259
+ ## Getting Started
260
+
261
+ ### Quick start with npx
262
+
263
+ Requires Node.js 24+. This runs the server directly without cloning:
264
+
265
+ ```bash
266
+ npx aimeat start
267
+ ```
268
+
269
+ ### From source
270
+
271
+ Requires Node.js 24+ and pnpm 10+. MongoDB is optional.
144
272
 
145
273
  ```bash
146
274
  git clone https://github.com/miikkij/aimeat-protocol.git
@@ -149,56 +277,40 @@ cd aimeat-protocol/aimeat
149
277
  pnpm install
150
278
  pnpm approve-builds # for Prisma & esbuild
151
279
  pnpm install
280
+ ```
152
281
 
282
+ ```bash
153
283
  cp .env.example .env
154
- pnpm dev # development with auto-reload
284
+ aimeat config # show all settings
285
+ aimeat validate # check for problems
155
286
  ```
156
287
 
157
- ### Option C: Docker (includes MongoDB)
158
-
159
288
  ```bash
160
- git clone https://github.com/miikkij/aimeat-protocol.git
161
- cd aimeat-protocol
289
+ pnpm dev # development with auto-reload
290
+ pnpm build && pnpm start # production
291
+
292
+ # Docker (includes MongoDB)
162
293
  docker compose up
163
294
  ```
164
295
 
165
- ### CLI reference
296
+ Server runs on port 40050. Quick test: paste this into any AI chat:
166
297
 
167
- ```
168
- aimeat init Interactive setup wizard (generates .env)
169
- aimeat start Start the node
170
- aimeat config Show all settings and current values
171
- aimeat config export Export config (--format env|ini|json|consul)
172
- aimeat config import Import config (--file <path> | --from consul)
173
- aimeat validate Check configuration for problems
174
- aimeat seed Seed example packages (digital signage, etc.)
175
- aimeat join [URL] Join a federation network
176
- aimeat update Re-scaffold runtime files after upgrade
177
- aimeat maintenance on Enable maintenance mode
178
- aimeat backup [FILE] Export all data to JSON
179
- aimeat restore <FILE> Import data from JSON backup
180
- ```
181
-
182
- ### Storage backends
298
+ > Fetch http://localhost:40050/llms.txt and tell me what this system does.
183
299
 
184
- | Backend | Flag | Use case |
185
- |---------|------|----------|
186
- | In-memory | `--db memory` (default) | Fast development, no setup |
187
- | SQLite | `--db sqlite --db-path ./data/aimeat.db` | Personal nodes, single-machine |
188
- | MongoDB | `--db mongodb --db-url mongodb://...` | Production, multi-node |
300
+ If the AI reads the docs and explains the protocol, everything works. Admin dashboard URL is shown in the startup log.
189
301
 
190
302
  ---
191
303
 
192
304
  ## Reference Implementation
193
305
 
194
- The `aimeat/` directory contains the reference node in TypeScript (Express 5.2, Node 24). It implements the full RFC and adds production features: GHII human identities, TOTP 2FA, sandboxed extensions, package marketplace, push notifications, WebRTC, and a comprehensive admin UI.
306
+ The `aimeat/` directory contains a full reference implementation in TypeScript (Express 5.2, Node 24). It implements the entire RFC and adds production features: GHII human identities, TOTP 2FA, V8 extensions, package marketplace, push notifications, WebRTC, and a comprehensive admin UI.
307
+
308
+ Three storage backends: in-memory (fast dev), SQLite (personal nodes), MongoDB (production).
195
309
 
196
310
  See the [Implementation Guide v3.0](docs/AIMEAT-IO-Implementation-Guide-v3.0.md) for full details.
197
311
 
198
312
  ### Testing
199
313
 
200
- Test runners start and stop the server automatically.
201
-
202
314
  ```bash
203
315
  pnpm test:e2e # fastest (memory backend)
204
316
  pnpm test:e2e:sqlite
@@ -233,6 +345,8 @@ pnpm typecheck && pnpm lint
233
345
 
234
346
  ## Contributing
235
347
 
348
+ This is MIT. Modify as you see fit, play, create and learn, enjoy with love. Because this was made with love.
349
+
236
350
  See [CONTRIBUTING.md](CONTRIBUTING.md). Before opening a PR:
237
351
 
238
352
  ```bash
@@ -96,6 +96,38 @@
96
96
  box-shadow: 0 0 0 3px rgba(232, 86, 74, .12);
97
97
  }
98
98
 
99
+ .mode-toggle {
100
+ display: flex;
101
+ gap: 2px;
102
+ flex-shrink: 0;
103
+ background: var(--surface-glass);
104
+ border: 1px solid var(--border-subtle);
105
+ border-radius: var(--radius-sm);
106
+ padding: 2px;
107
+ }
108
+
109
+ .mode-btn {
110
+ padding: 5px 10px;
111
+ border: none;
112
+ border-radius: 6px;
113
+ background: transparent;
114
+ color: var(--text-muted);
115
+ font-size: .78rem;
116
+ cursor: pointer;
117
+ transition: all var(--transition);
118
+ white-space: nowrap;
119
+ }
120
+
121
+ .mode-btn.active {
122
+ background: var(--accent);
123
+ color: #fff;
124
+ font-weight: 600;
125
+ }
126
+
127
+ .mode-btn:hover:not(.active) {
128
+ background: rgba(0,0,0,.05);
129
+ }
130
+
99
131
  .header-actions {
100
132
  display: flex;
101
133
  gap: 8px;
@@ -1002,7 +1034,8 @@
1002
1034
 
1003
1035
  /* ── Published Apps Section ──────────────────────── */
1004
1036
 
1005
- #published-section {
1037
+ #published-section,
1038
+ #community-section {
1006
1039
  margin: 0 24px 24px;
1007
1040
  position: relative;
1008
1041
  z-index: 1;
@@ -1201,6 +1234,10 @@
1201
1234
 
1202
1235
  <header>
1203
1236
  <h1>My Apps</h1>
1237
+ <div class="mode-toggle">
1238
+ <button id="mode-global" class="mode-btn active" onclick="window._launcher.switchDbMode('global')" title="Shared across all accounts on this browser">&#x1F310; Global</button>
1239
+ <button id="mode-personal" class="mode-btn" onclick="window._launcher.switchDbMode('personal')" title="Private to your account">&#x1F464; Personal</button>
1240
+ </div>
1204
1241
  <input type="text" id="search-input" placeholder="Search apps..." autocomplete="off" spellcheck="false"/>
1205
1242
  <div class="header-actions">
1206
1243
  <button class="icon-btn" id="add-btn" title="Add app">+</button>
@@ -1253,7 +1290,7 @@
1253
1290
  </div>
1254
1291
  </div>
1255
1292
 
1256
- <!-- Published Apps Section -->
1293
+ <!-- Published Apps Section (own) -->
1257
1294
  <div id="published-section" style="display:none">
1258
1295
  <div class="published-header" onclick="window._launcher.togglePublished()">
1259
1296
  <h2>&#x1F680; Published Apps <span id="published-count"></span></h2>
@@ -1262,12 +1299,24 @@
1262
1299
  <div id="published-grid" class="published-grid"></div>
1263
1300
  </div>
1264
1301
 
1302
+ <!-- Community Apps Section (other users) -->
1303
+ <div id="community-section" style="display:none">
1304
+ <div class="published-header" onclick="window._launcher.toggleCommunity()">
1305
+ <h2>&#x1F30D; Community Apps <span id="community-count"></span></h2>
1306
+ <span class="arrow open" id="community-arrow">&#x25BC;</span>
1307
+ </div>
1308
+ <div id="community-grid" class="published-grid"></div>
1309
+ </div>
1310
+
1265
1311
  <!-- Recently Opened Strip -->
1266
1312
  <div id="recent-section" style="display:none;margin:0 24px 1rem">
1267
1313
  <h3 style="margin:0 0 .5rem;font-size:.9rem;color:#6B7280">&#x1F552; Recently Opened</h3>
1268
1314
  <div id="recent-strip" style="display:flex;gap:.75rem;overflow-x:auto;padding-bottom:.5rem"></div>
1269
1315
  </div>
1270
1316
 
1317
+ <div id="local-apps-header" style="display:none;margin:0 24px 8px">
1318
+ <h2 style="font-size:1rem;font-weight:700;color:#6366f1;display:flex;align-items:center;gap:8px">&#x1F4BE; Local Apps <span id="local-apps-count" style="opacity:.6;font-weight:400"></span></h2>
1319
+ </div>
1271
1320
  <main id="app-grid"></main>
1272
1321
 
1273
1322
  <footer>
@@ -1509,16 +1558,56 @@
1509
1558
 
1510
1559
  // ── IndexedDB wrapper ──────────────────────────────
1511
1560
 
1512
- const DB_NAME = 'AppLauncherDB';
1561
+ const DB_NAME_GLOBAL = 'AppLauncherDB';
1513
1562
  const DB_VERSION = 2;
1514
1563
  const STORE_NAME = 'apps';
1515
1564
 
1516
1565
  let dbInstance = null;
1566
+ let currentDbMode = localStorage.getItem('appCatalogMode') || 'global';
1567
+
1568
+ function getDbName() {
1569
+ if (currentDbMode === 'personal') {
1570
+ var owner = null;
1571
+ try {
1572
+ if (window.AIMEAT && window.AIMEAT.auth && window.AIMEAT.auth.getSession()) {
1573
+ owner = window.AIMEAT.auth.getSession().owner || null;
1574
+ }
1575
+ if (!owner) {
1576
+ var stored = localStorage.getItem('aimeat_session');
1577
+ if (stored) owner = JSON.parse(stored).owner || null;
1578
+ }
1579
+ } catch(e) {}
1580
+ if (owner) return DB_NAME_GLOBAL + '_' + owner;
1581
+ }
1582
+ return DB_NAME_GLOBAL;
1583
+ }
1584
+
1585
+ function switchDbMode(mode) {
1586
+ if (mode === currentDbMode) return;
1587
+ currentDbMode = mode;
1588
+ localStorage.setItem('appCatalogMode', mode);
1589
+ if (dbInstance) {
1590
+ dbInstance.close();
1591
+ dbInstance = null;
1592
+ }
1593
+ updateModeToggle();
1594
+ refreshAll();
1595
+ }
1596
+
1597
+ function updateModeToggle() {
1598
+ var globalBtn = document.getElementById('mode-global');
1599
+ var personalBtn = document.getElementById('mode-personal');
1600
+ if (!globalBtn || !personalBtn) return;
1601
+ globalBtn.classList.toggle('active', currentDbMode === 'global');
1602
+ personalBtn.classList.toggle('active', currentDbMode === 'personal');
1603
+ }
1517
1604
 
1518
1605
  function openDB() {
1519
- if (dbInstance) return Promise.resolve(dbInstance);
1606
+ var name = getDbName();
1607
+ if (dbInstance && dbInstance.name === name) return Promise.resolve(dbInstance);
1608
+ if (dbInstance) { dbInstance.close(); dbInstance = null; }
1520
1609
  return new Promise(function (resolve, reject) {
1521
- const request = indexedDB.open(DB_NAME, DB_VERSION);
1610
+ const request = indexedDB.open(name, DB_VERSION);
1522
1611
 
1523
1612
  request.onupgradeneeded = function (event) {
1524
1613
  const db = event.target.result;
@@ -2291,6 +2380,12 @@
2291
2380
  }
2292
2381
 
2293
2382
  var grid = document.getElementById('app-grid');
2383
+ var localHeader = document.getElementById('local-apps-header');
2384
+ var localCount = document.getElementById('local-apps-count');
2385
+ if (localHeader) {
2386
+ localHeader.style.display = allApps.length > 0 ? '' : 'none';
2387
+ if (localCount) localCount.textContent = '(' + allApps.length + ')';
2388
+ }
2294
2389
 
2295
2390
  if (filtered.length === 0) {
2296
2391
  if (!activeTag && !searchQuery && allApps.length === 0) {
@@ -3111,14 +3206,25 @@
3111
3206
  arrow.classList.toggle('open', publishedVisible);
3112
3207
  }
3113
3208
 
3209
+ var communityVisible = true;
3210
+ function toggleCommunity() {
3211
+ communityVisible = !communityVisible;
3212
+ var grid = document.getElementById('community-grid');
3213
+ var arrow = document.getElementById('community-arrow');
3214
+ grid.style.display = communityVisible ? '' : 'none';
3215
+ arrow.classList.toggle('open', communityVisible);
3216
+ }
3217
+
3114
3218
  function loadPublishedApps() {
3115
3219
  var config = loadConfig();
3116
3220
  var aimeatUrl = config.aimeatUrl ? config.aimeatUrl.replace(/\/+$/, '') : '';
3117
3221
  var section = document.getElementById('published-section');
3118
3222
  var grid = document.getElementById('published-grid');
3119
3223
  var countEl = document.getElementById('published-count');
3224
+ var communitySection = document.getElementById('community-section');
3225
+ var communityGrid = document.getElementById('community-grid');
3226
+ var communityCountEl = document.getElementById('community-count');
3120
3227
 
3121
- // Get current owner name from session (if logged in)
3122
3228
  var currentOwner = null;
3123
3229
  try {
3124
3230
  if (window.AIMEAT && window.AIMEAT.auth && window.AIMEAT.auth.getSession()) {
@@ -3132,11 +3238,9 @@
3132
3238
  }
3133
3239
  } catch(e) {}
3134
3240
 
3135
- // Always load local published apps
3136
3241
  getAllApps().then(function(apps) {
3137
3242
  var localPublished = apps.filter(function(a) { return a.published; });
3138
3243
 
3139
- // Build a lookup of local published apps by filename
3140
3244
  var localByFilename = {};
3141
3245
  for (var i = 0; i < localPublished.length; i++) {
3142
3246
  var lp = localPublished[i];
@@ -3145,13 +3249,12 @@
3145
3249
  }
3146
3250
  }
3147
3251
 
3148
- // If no aimeatUrl, fall back to local-only display
3149
3252
  if (!aimeatUrl) {
3150
3253
  renderPublishedApps(localPublished, [], localByFilename, aimeatUrl, section, grid, countEl);
3254
+ if (communitySection) communitySection.style.display = 'none';
3151
3255
  return;
3152
3256
  }
3153
3257
 
3154
- // Fetch server apps
3155
3258
  fetch(aimeatUrl + '/v1/apps')
3156
3259
  .then(function(resp) {
3157
3260
  if (!resp.ok) throw new Error('Server returned ' + resp.status);
@@ -3160,20 +3263,61 @@
3160
3263
  .then(function(json) {
3161
3264
  var serverApps = json.data && json.data.apps ? json.data.apps : [];
3162
3265
 
3163
- // Filter to current owner's apps if we know who they are
3164
- if (currentOwner) {
3165
- serverApps = serverApps.filter(function(a) { return a.owner === currentOwner; });
3166
- }
3266
+ var ownApps = currentOwner
3267
+ ? serverApps.filter(function(a) { return a.owner === currentOwner; })
3268
+ : [];
3269
+ var communityApps = currentOwner
3270
+ ? serverApps.filter(function(a) { return a.owner !== currentOwner; })
3271
+ : serverApps;
3167
3272
 
3168
- renderPublishedApps(localPublished, serverApps, localByFilename, aimeatUrl, section, grid, countEl);
3273
+ renderPublishedApps(localPublished, ownApps, localByFilename, aimeatUrl, section, grid, countEl);
3274
+ renderCommunityApps(communityApps, aimeatUrl, communitySection, communityGrid, communityCountEl, currentOwner);
3169
3275
  })
3170
3276
  .catch(function() {
3171
- // Server fetch failed - fall back to local only
3172
3277
  renderPublishedApps(localPublished, [], localByFilename, aimeatUrl, section, grid, countEl);
3278
+ if (communitySection) communitySection.style.display = 'none';
3173
3279
  });
3174
3280
  });
3175
3281
  }
3176
3282
 
3283
+ function renderCommunityApps(serverApps, aimeatUrl, section, grid, countEl, currentOwner) {
3284
+ if (!section || !grid || !countEl) return;
3285
+ if (serverApps.length === 0) {
3286
+ section.style.display = 'none';
3287
+ return;
3288
+ }
3289
+
3290
+ section.style.display = '';
3291
+ countEl.textContent = '(' + serverApps.length + ')';
3292
+
3293
+ var html = '';
3294
+ for (var i = 0; i < serverApps.length; i++) {
3295
+ var sa = serverApps[i];
3296
+ var name = (sa.manifest && sa.manifest.name) ? sa.manifest.name : (sa.filename || '');
3297
+ var version = sa.version_number ? 'v' + sa.version_number : '';
3298
+ var date = sa.created_at ? new Date(sa.created_at).toLocaleDateString() : '';
3299
+ var author = (sa.manifest && sa.manifest.authorDisplay) ? sa.manifest.authorDisplay : (sa.owner || '');
3300
+ var viewUrl = aimeatUrl + '/v1/apps/' + encodeURIComponent(sa.owner || '') + '/' + encodeURIComponent(sa.filename || '');
3301
+ html +=
3302
+ '<div class="published-card">' +
3303
+ '<div class="published-card-name">' + escapeHtml(name) +
3304
+ (version ? ' <span style="opacity:.5;font-size:.85em">' + escapeHtml(version) + '</span>' : '') +
3305
+ '</div>' +
3306
+ '<div class="published-card-meta">' +
3307
+ '<span>' + escapeHtml(sa.filename || '') + '</span>' +
3308
+ '<span>' + date + '</span>' +
3309
+ '</div>' +
3310
+ '<div class="published-card-meta" style="margin-top:2px">' +
3311
+ '<span style="color:var(--accent)">&#x1F464; ' + escapeHtml(author) + '</span>' +
3312
+ '</div>' +
3313
+ '<div class="published-card-actions">' +
3314
+ '<button onclick="window.open(\'' + escapeHtml(viewUrl) + '?mode=inline\', \'_blank\')">&#x1F441; View</button>' +
3315
+ '</div>' +
3316
+ '</div>';
3317
+ }
3318
+ grid.innerHTML = html;
3319
+ }
3320
+
3177
3321
  function renderPublishedApps(localPublished, serverApps, localByFilename, aimeatUrl, section, grid, countEl) {
3178
3322
  // Merge: build a combined list. Server apps take priority for display data,
3179
3323
  // but we note which source(s) each app comes from.
@@ -4040,6 +4184,8 @@
4040
4184
  submitPublish: submitPublish,
4041
4185
  loadPublishedApps: loadPublishedApps,
4042
4186
  togglePublished: togglePublished,
4187
+ toggleCommunity: toggleCommunity,
4188
+ switchDbMode: switchDbMode,
4043
4189
  unpublishApp: unpublishApp,
4044
4190
  deleteServerApp: deleteServerApp,
4045
4191
  renderRecentlyOpened: renderRecentlyOpened,
@@ -4065,11 +4211,19 @@
4065
4211
  window.showCortexPopup = showCortexPopup;
4066
4212
  window.cortexCopy = cortexCopy;
4067
4213
 
4214
+ function refreshAll() {
4215
+ allApps = [];
4216
+ renderApps();
4217
+ loadPublishedApps();
4218
+ renderRecentlyOpened();
4219
+ }
4220
+
4068
4221
  // ── Bootstrap ─────────────────────────────────────
4069
4222
 
4070
4223
  document.addEventListener('DOMContentLoaded', function () {
4071
4224
  // ── Apply theme on load ─────────────────────────
4072
4225
  applyTheme(loadConfig().theme);
4226
+ updateModeToggle();
4073
4227
 
4074
4228
  renderApps();
4075
4229
  loadPublishedApps();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aimeat",
3
- "version": "1.3.4",
4
- "description": "AIME AT AI Memory Exchange and Action Transfer reference implementation",
3
+ "version": "1.3.5",
4
+ "description": "AIME AT - AI Memory Exchange and Action Transfer - reference implementation",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
7
7
  "bin": {