memoryblock 0.1.3 → 0.1.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.
Files changed (111) hide show
  1. package/README.md +77 -123
  2. package/bin/mblk.js +85 -0
  3. package/dist/commands/create.d.ts +2 -0
  4. package/dist/commands/create.d.ts.map +1 -0
  5. package/dist/commands/create.js +48 -0
  6. package/dist/commands/create.js.map +1 -0
  7. package/dist/commands/delete.d.ts +5 -0
  8. package/dist/commands/delete.d.ts.map +1 -0
  9. package/dist/commands/delete.js +147 -0
  10. package/dist/commands/delete.js.map +1 -0
  11. package/dist/commands/init.d.ts +9 -0
  12. package/dist/commands/init.d.ts.map +1 -0
  13. package/dist/commands/init.js +209 -0
  14. package/dist/commands/init.js.map +1 -0
  15. package/dist/commands/permissions.d.ts +13 -0
  16. package/dist/commands/permissions.d.ts.map +1 -0
  17. package/dist/commands/permissions.js +60 -0
  18. package/dist/commands/permissions.js.map +1 -0
  19. package/dist/commands/plugin-settings.d.ts +6 -0
  20. package/dist/commands/plugin-settings.d.ts.map +1 -0
  21. package/dist/commands/plugin-settings.js +118 -0
  22. package/dist/commands/plugin-settings.js.map +1 -0
  23. package/dist/commands/plugins.d.ts +3 -0
  24. package/dist/commands/plugins.d.ts.map +1 -0
  25. package/dist/commands/plugins.js +83 -0
  26. package/dist/commands/plugins.js.map +1 -0
  27. package/dist/commands/reset.d.ts +8 -0
  28. package/dist/commands/reset.d.ts.map +1 -0
  29. package/dist/commands/reset.js +96 -0
  30. package/dist/commands/reset.js.map +1 -0
  31. package/dist/commands/server.d.ts +25 -0
  32. package/dist/commands/server.d.ts.map +1 -0
  33. package/dist/commands/server.js +295 -0
  34. package/dist/commands/server.js.map +1 -0
  35. package/dist/commands/service.d.ts +18 -0
  36. package/dist/commands/service.d.ts.map +1 -0
  37. package/dist/commands/service.js +309 -0
  38. package/dist/commands/service.js.map +1 -0
  39. package/dist/commands/start.d.ts +11 -0
  40. package/dist/commands/start.d.ts.map +1 -0
  41. package/dist/commands/start.js +794 -0
  42. package/dist/commands/start.js.map +1 -0
  43. package/dist/commands/status.d.ts +2 -0
  44. package/dist/commands/status.d.ts.map +1 -0
  45. package/dist/commands/status.js +78 -0
  46. package/dist/commands/status.js.map +1 -0
  47. package/dist/commands/stop.d.ts +9 -0
  48. package/dist/commands/stop.d.ts.map +1 -0
  49. package/dist/commands/stop.js +83 -0
  50. package/dist/commands/stop.js.map +1 -0
  51. package/dist/commands/web.d.ts +5 -0
  52. package/dist/commands/web.d.ts.map +1 -0
  53. package/dist/commands/web.js +63 -0
  54. package/dist/commands/web.js.map +1 -0
  55. package/dist/commands.d.ts +7 -0
  56. package/dist/commands.d.ts.map +1 -0
  57. package/dist/commands.js +7 -0
  58. package/dist/commands.js.map +1 -0
  59. package/dist/constants.d.ts +41 -0
  60. package/dist/constants.d.ts.map +1 -0
  61. package/dist/constants.js +81 -0
  62. package/dist/constants.js.map +1 -0
  63. package/dist/entry.d.ts +9 -0
  64. package/dist/entry.d.ts.map +1 -0
  65. package/dist/entry.js +345 -0
  66. package/dist/entry.js.map +1 -0
  67. package/package.json +37 -12
  68. package/dist/engine/agent.d.ts +0 -15
  69. package/dist/engine/agent.d.ts.map +0 -1
  70. package/dist/engine/agent.js +0 -19
  71. package/dist/engine/agent.js.map +0 -1
  72. package/dist/engine/conversation-log.d.ts +0 -35
  73. package/dist/engine/conversation-log.d.ts.map +0 -1
  74. package/dist/engine/conversation-log.js +0 -83
  75. package/dist/engine/conversation-log.js.map +0 -1
  76. package/dist/engine/cost-tracker.d.ts +0 -52
  77. package/dist/engine/cost-tracker.d.ts.map +0 -1
  78. package/dist/engine/cost-tracker.js +0 -110
  79. package/dist/engine/cost-tracker.js.map +0 -1
  80. package/dist/engine/gatekeeper.d.ts +0 -20
  81. package/dist/engine/gatekeeper.d.ts.map +0 -1
  82. package/dist/engine/gatekeeper.js +0 -43
  83. package/dist/engine/gatekeeper.js.map +0 -1
  84. package/dist/engine/memory.d.ts +0 -28
  85. package/dist/engine/memory.d.ts.map +0 -1
  86. package/dist/engine/memory.js +0 -69
  87. package/dist/engine/memory.js.map +0 -1
  88. package/dist/engine/monitor.d.ts +0 -81
  89. package/dist/engine/monitor.d.ts.map +0 -1
  90. package/dist/engine/monitor.js +0 -610
  91. package/dist/engine/monitor.js.map +0 -1
  92. package/dist/engine/prompts.d.ts +0 -31
  93. package/dist/engine/prompts.d.ts.map +0 -1
  94. package/dist/engine/prompts.js +0 -93
  95. package/dist/engine/prompts.js.map +0 -1
  96. package/dist/index.d.ts +0 -10
  97. package/dist/index.d.ts.map +0 -1
  98. package/dist/index.js +0 -14
  99. package/dist/index.js.map +0 -1
  100. package/dist/utils/config.d.ts +0 -24
  101. package/dist/utils/config.d.ts.map +0 -1
  102. package/dist/utils/config.js +0 -86
  103. package/dist/utils/config.js.map +0 -1
  104. package/dist/utils/fs.d.ts +0 -18
  105. package/dist/utils/fs.d.ts.map +0 -1
  106. package/dist/utils/fs.js +0 -65
  107. package/dist/utils/fs.js.map +0 -1
  108. package/dist/utils/logger.d.ts +0 -12
  109. package/dist/utils/logger.d.ts.map +0 -1
  110. package/dist/utils/logger.js +0 -40
  111. package/dist/utils/logger.js.map +0 -1
package/README.md CHANGED
@@ -37,157 +37,110 @@
37
37
 
38
38
  </div>
39
39
 
40
- Memoryblock lets you deploy AI agents as isolated **blocks** - independent workspaces, each with their own memory, tools, and personality. Think of a block as a private office for an AI. Give it a job, point it at a channel, and let it run.
40
+ `memoryblock` is a lightweight framework for orchestrating isolated AI background workers. Instead of building monolithic chatbots, we provision local workspaces called **blocks**. Each block acts as a dedicated environment equipped with its own continuous memory, toolset, and execution loop.
41
41
 
42
- One block can be your personal assistant. Another can monitor your infrastructure. A third can research topics and write summaries. They don't interfere with each other, they don't share memory, and they don't waste tokens re-learning what they already know.
42
+ Spawn a devops block to watch your infrastructure, a research block to scrape web data, and your primary home block to coordinate tasks. No state pollution, no crossed context boundaries.
43
43
 
44
- Need them to collaborate? A block can spawn sub-agents, the temporary workers in sandboxed environments to handle specific tasks and report back. No shared state pollution, no context confusion.
45
-
46
- ```
47
- you ─── terminal ──── block "home" (your daily assistant)
48
- ├── channel ───── block "devops" (monitors + alerts)
49
- └── web ui ────── block "research" (deep dives + summaries)
50
- ```
51
-
52
- ## ✨ What Makes This Different
53
-
54
- ### It's cheap to run. Seriously.
55
-
56
- Most AI tools send the entire tool schema. Thousands of tokens. On *every single message*. For a background agent running all day, that's money on fire.
57
-
58
- Memoryblock was engineered around this problem:
59
-
60
- - **On-demand schema loading** - tool definitions are injected only when needed, then dropped. Payload sizes go from ~2,600 tokens to ~1,200 tokens per turn.
61
- - **History trimming** - large tool outputs (log dumps, file contents) are read once, then truncated in memory to 500 characters. The LLM already saw it. No need to pay for it again.
62
- - **Smart context recovery** - when context fills up, the engine summarizes everything into clean, actionable notes and starts fresh. No crash, no data loss, no compact context error loops.
63
-
64
- > In testing, these optimizations reduce token growth between turns from 4.2× to under 2×, resulting in over 50% cost reduction on sustained sessions.
65
-
66
- ### It runs on Bun. Nothing else.
67
-
68
- No Node.js. No Electron. No heavy frameworks. The entire core, HTTP server, WebSocket streaming, static file serving, is built on native APIs. Cold starts are fast. Memory usage is small.
69
-
70
- ### Every block is its own world.
71
-
72
- Each block gets its own `config.json`, `memory.md`, `monitor.md`, `costs.json`, and log directory. Move a block between machines by copying its folder. Back it up by zipping it. There's no shared database, no centralized state, no magic.
73
-
74
- ### Talk to it from anywhere.
75
-
76
- Your blocks are accessible through the **CLI** (a simple interactive terminal), different **Channels** (including Telegram, Discord, Slack, and more), and a **Web Dashboard** (with live WebSocket updates). Same block, same memory, different surfaces.
77
-
78
- ### Use any model you want.
79
-
80
- Memoryblock doesn't lock you into one provider. Swap models per-block, per-task, or per-agent:
81
-
82
- | Adapter | Auth |
83
- |:---|:---|
84
- | **AWS Bedrock** | AWS credentials |
85
- | **OpenAI** | API key |
86
- | **Google Gemini** | API key |
87
- | **Anthropic** | API key |
88
-
89
- Adding a new adapter is one file. See [adapter docs](https://docs.memoryblock.io/adapters/) for examples.
44
+ * **Absolute Isolation**: Every agent lives inside a dedicated filesystem directory (`config.json`, `memory.md`, `logs/`). To move an agent to a new server, you just copy its folder. No centralized databases to manage.
45
+ * **Token Pruning**: Running background agents is historically expensive. `memoryblock` mitigates this by lazy-loading tool schemas only when invoked, and proactively truncating long tool outputs once analyzed. This typically halves the cost of sustained sessions.
46
+ * **Native & Lean**: Zero dependency on heavy Node.js runtimes or Electron ecosystems. The core engine, HTTP server, and WebSocket router rely purely on [Bun's](https://bun.sh) native primitives for maximal I/O speed and minimal RAM overhead.
47
+ * **Model Agnostic**: Provision blocks dynamically utilizing native definitions for OpenAI, Anthropic, AWS Bedrock, or Google Gemini.
90
48
 
91
49
  ## Quick Start
92
50
 
93
- **Requirements:** [Bun](https://bun.sh) 1.0 and an API key from any supported provider.
51
+ `memoryblock` leverages Bun under the hood for native execution speed. If you use npm, we automatically manage the local Bun environment for you.
94
52
 
53
+ **Install the framework globally:**
95
54
  ```bash
96
- # clone and set up
97
- git clone https://github.com/memoryblock-io/memoryblock.git
98
- cd memoryblock
99
- pnpm dev:onboard -gl
55
+ bun install -g memoryblock # Option A: Fastest
56
+ npm install -g memoryblock # Option B: Managed internally
57
+ ```
100
58
 
101
- # run the setup wizard
59
+ **Initialize your environment:**
60
+ ```bash
102
61
  mblk init
62
+ ```
63
+ *This interactive wizard verifies your local environment and configures your initial LLM provider credentials.*
103
64
 
104
- # start your first block
105
- mblk start home
65
+ **Start your default block:**
66
+ ```bash
67
+ mblk start [block-name]
106
68
  ```
69
+ *Your autonomous assistant is now running in the background.*
107
70
 
108
- That's it. The wizard handles credentials, verification, and creating your first block.
71
+ ## Working with Channels
109
72
 
110
- ### Web Dashboard
73
+ Your blocks are decoupled from the UI. Communicate with them via the terminal, secure web dashboard, or standard chat clients.
111
74
 
75
+ **Launch the Web Dashboard:**
112
76
  ```bash
113
77
  mblk web
114
78
  ```
79
+ *Access real-time stream logs, cost tracking, and memory management at `localhost:8420`.*
115
80
 
116
- Opens a live dashboard at `localhost:8420` with real-time block monitoring, cost tracking, and memory inspection.
117
-
118
- ### Channels
119
-
81
+ **Route a block to social channels:**
120
82
  ```bash
121
83
  mblk start home --channel telegram
122
84
  ```
85
+ *Securely interact with your existing agent state from anywhere without losing active history.*
123
86
 
124
- Your block is now live on the channel you chose. Same memory, same tools, accessible from anywhere.
125
-
126
- ## Commands
87
+ ## Command Reference
127
88
 
128
- Everything you can do from the terminal, you can do from chat (and soon, the web UI too):
129
-
130
- | CLI | In-Chat | What it does |
131
- |:---|:---|:---|
132
- | `mblk create <name>` | `/create-block <name>` | Create a new block |
133
- | `mblk start <block>` | | Start a block's monitor |
134
- | `mblk stop <block>` | | Stop a running monitor |
135
- | `mblk status` | `/status` | Show all blocks and their state |
136
- | `mblk delete <block>` | | Archive a block safely |
137
- | `mblk restore <archive>` | | Restore from archive |
138
- | `mblk reset <block>` | | Reset memory and costs |
139
- | `mblk add <plugin>` | | Install a plugin |
140
-
141
- Full reference: [command docs](https://docs.memoryblock.io/commands.md)
89
+ | Command | Description |
90
+ |:---|:---|
91
+ | `mblk init` | Interactive setup - configure credentials and create your first block |
92
+ | `mblk create <name>` | Create a new block (isolated AI workspace) |
93
+ | `mblk start [block]` | Start a block's monitor loop (or all blocks) |
94
+ | `mblk stop [block]` | Stop a running block monitor (or all blocks) |
95
+ | `mblk status` | Show all blocks and their state |
96
+ | `mblk delete <block>` | Archive a block safely (use `--hard` to permanently delete) |
97
+ | `mblk restore <name>` | Restore an archived block |
98
+ | `mblk reset <block>` | Reset memory, costs, and session (use `--hard` to wipe identity) |
99
+ | `mblk permissions <block>` | View or update block permissions |
100
+ | `mblk settings [plugin]` | View or edit plugin settings |
101
+ | `mblk add [plugin]` | Install a plugin (no args lists available) |
102
+ | `mblk remove <plugin>` | Remove an installed plugin |
103
+ | `mblk server start` | Start the web UI and API server |
104
+ | `mblk server stop` | Stop the running server |
105
+ | `mblk server status` | Show server status |
106
+ | `mblk server token` | View or regenerate the API auth token |
107
+ | `mblk service install` | Register memoryblock to start on boot/login |
108
+ | `mblk shutdown` | Stop all blocks and the server |
109
+ | `mblk restart` | Full restart — shutdown then start everything as daemons |
110
+
111
+ Full reference: [command docs](https://docs.memoryblock.io/commands/)
142
112
 
143
113
  ## Plugins
144
114
 
145
115
  Blocks come with a core set of tools. Need more? Add them:
146
116
 
147
117
  ```bash
148
- mblk add web-search # search the web
149
- mblk add fetch-webpage # extract text from any URL
150
- mblk add agents # multi-agent orchestration
118
+ mblk add web-search # Enables high-fidelity SERP querying
119
+ mblk add fetch-webpage # Extracts and chunks text from structured URLs
120
+ mblk add agents # Allows blocks to spawn ephemeral sub-agents
151
121
  ```
152
122
 
153
- Plugins are just npm packages. The installer resolves, downloads, and wires them in automatically.
154
-
155
- | Plugin | What it does |
156
- |:---|:---|
157
- | `web-search` | Search the web with your configured provider |
158
- | `fetch-webpage` | Extract clean text from URLs |
159
- | `agents` | Spawn sub-agents for delegated tasks |
160
- | `aws` | Cloud SDK code generation tools |
123
+ Adapters for **OpenAI, Anthropic, Google Gemini, and AWS Bedrock** are natively supported out-of-the-box. Adding a custom provider adapter requires implementing a single unified payload interface.
161
124
 
162
- ## Adapters
125
+ ## Monorepo Architecture
163
126
 
164
- Each adapter is a single file that maps Memoryblock's internal message format to a provider's API. They handle authentication, request formatting, and response parsing. Writing a new adapter is straightforward — the interface is small and well-documented.
127
+ `memoryblock` is built as a highly modular TypeScript monorepo utilizing a strict one-way Directed Acyclic Graph (DAG) for dependency management. All sub-packages are independently publishable.
165
128
 
166
- See all supported adapters and how to write your own: [adapters](https://docs.memoryblock.io/adapters/)
167
-
168
- ## Channels
169
-
170
- Channels are how your blocks talk to the outside world. The CLI, messaging platforms, and the web dashboard are all channels — equal citizens, not afterthoughts. Adding a new channel is a single file implementation.
171
-
172
- Supported and upcoming channels are documented in [channels](https://docs.memoryblock.io/channels/).
173
-
174
- ## Architecture
175
-
176
- ```
177
- packages/
178
- ├── core/ # engine, CLI, schemas, monitor loop
179
- ├── adapters/ # LLM provider adapters
180
- ├── channels/ # messaging channel transports
181
- ├── api/ # HTTP + WebSocket server
182
- ├── web/ # static web dashboard
183
- ├── tools/ # base tool registry and schema helpers
184
- ├── daemon/ # background process management
185
- └── plugins/ # extensible capability modules
186
- ```
187
-
188
- It's a pnpm monorepo. Every package builds independently with `tsc`. No bundlers, no magic.
129
+ | Package | Responsibility |
130
+ |:---|:---|
131
+ | `memoryblock` | Global executable wrapper, setup tooling, and CLI orchestration. |
132
+ | `@memoryblock/core` | Extracted engine runtime (Gatekeeper, Memory Manager, Monitor loops). |
133
+ | `@memoryblock/types` | Centralized Zod validation schemas and TypeScript interfaces. |
134
+ | `@memoryblock/daemon` | Low-level OS process spawner and background lifecycle manager. |
135
+ | `@memoryblock/adapters` | Unified REST/SDK implementations for LLM providers. |
136
+ | `@memoryblock/channels` | Transport layer for CLI, WebSockets, and messaging platforms. |
137
+ | `@memoryblock/tools` | Core functional schemas (File I/O, OS interactions). |
138
+ | `@memoryblock/api` | Fast, dependency-injected HTTP web server integration. |
139
+ | `@memoryblock/locale` | Formatting tools and centralized translation strings. |
140
+ | `@memoryblock/web` | Standalone UI distribution package. |
189
141
 
190
142
  ## Community & Support
143
+
191
144
  - **Contributing**: We welcome PRs! See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
192
145
  - **Support**: If you find `memoryblock` useful, please consider [sponsoring the project](https://github.com/sponsors/mgks) or giving it a star ⭐.
193
146
 
@@ -196,17 +149,18 @@ It's a pnpm monorepo. Every package builds independently with `tsc`. No bundlers
196
149
  **memoryblock** is a highly modular system. Here are the official packages:
197
150
 
198
151
  **The Core**
199
- * [**memoryblock**](https://www.npmjs.com/package/memoryblock) - The core engine interface and types.
200
- * [**@memoryblock/daemon**](https://www.npmjs.com/package/@memoryblock/daemon) - Background daemon manager.
201
- * [**@memoryblock/api**](https://www.npmjs.com/package/@memoryblock/api) - Core REST and WebSocket API server.
202
- * [**@memoryblock/cli**](https://www.npmjs.com/package/@memoryblock/cli) - Command-line interface.
152
+ * [**memoryblock**](https://www.npmjs.com/package/memoryblock) - CLI orchestrator and command routing.
153
+ * [**@memoryblock/core**](https://www.npmjs.com/package/@memoryblock/core) - Engine runtime, memory manager, gatekeeper.
154
+ * [**@memoryblock/types**](https://www.npmjs.com/package/@memoryblock/types) - Shared TypeScript definitions and schemas.
155
+ * [**@memoryblock/locale**](https://www.npmjs.com/package/@memoryblock/locale) - Localization strings and utilities.
203
156
 
204
157
  **Integrations & Tooling**
205
- * [**@memoryblock/adapters**](https://www.npmjs.com/package/@memoryblock/adapters) - LLM adapters (OpenAI, Anthropic, Bedrock, etc).
158
+ * [**@memoryblock/adapters**](https://www.npmjs.com/package/@memoryblock/adapters) - LLM provider adapters (OpenAI, Anthropic, Bedrock, etc).
206
159
  * [**@memoryblock/channels**](https://www.npmjs.com/package/@memoryblock/channels) - Communication channels (CLI, Telegram, Web).
207
- * [**@memoryblock/tools**](https://www.npmjs.com/package/@memoryblock/tools) - Standard tool definitions and schemas.
208
- * [**@memoryblock/locale**](https://www.npmjs.com/package/@memoryblock/locale) - Localization strings and formatting.
209
- * [**@memoryblock/web**](https://www.npmjs.com/package/@memoryblock/web) - Front-end dashboard and Web UI.
160
+ * [**@memoryblock/tools**](https://www.npmjs.com/package/@memoryblock/tools) - Tool registry and built-in definitions.
161
+ * [**@memoryblock/daemon**](https://www.npmjs.com/package/@memoryblock/daemon) - Background process spawner and manager.
162
+ * [**@memoryblock/api**](https://www.npmjs.com/package/@memoryblock/api) - HTTP/WebSocket API server.
163
+ * [**@memoryblock/web**](https://www.npmjs.com/package/@memoryblock/web) - Front-end dashboard static files.
210
164
 
211
165
  **Plugins**
212
166
  * [**@memoryblock/plugin-installer**](https://www.npmjs.com/package/@memoryblock/plugin-installer) - Plugin installer and registry manager.
package/bin/mblk.js ADDED
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * memoryblock CLI — Universal Entry Point
5
+ *
6
+ * This is the bin proxy installed by `npm install -g memoryblock`.
7
+ * It ensures Bun is available (auto-installing if needed), then re-executes
8
+ * itself under Bun for optimal performance.
9
+ *
10
+ * If Bun is already the runtime, we skip the proxy and run the CLI directly.
11
+ *
12
+ * Design:
13
+ * npm install -g memoryblock → symlinks `mblk` to this file
14
+ * User runs `mblk start` → this script detects Node, installs bun, re-execs via bun
15
+ * Subsequent runs → bun is found immediately, re-exec is instant
16
+ */
17
+
18
+ import { execSync, spawnSync } from 'node:child_process';
19
+ import { existsSync } from 'node:fs';
20
+ import { join, dirname } from 'node:path';
21
+ import { homedir } from 'node:os';
22
+ import { fileURLToPath } from 'node:url';
23
+
24
+ const __filename = fileURLToPath(import.meta.url);
25
+ const __dirname = dirname(__filename);
26
+
27
+ // ─── Step 0: Are we already running under Bun? ──────────────────────
28
+ // If yes, skip the proxy and run the CLI entry point directly.
29
+ const isBun = typeof globalThis.Bun !== 'undefined';
30
+
31
+ if (isBun) {
32
+ // Running under Bun — load the compiled CLI entry point
33
+ // This file is at: packages/memoryblock/bin/mblk.js
34
+ // Entry point is at: packages/memoryblock/dist/entry.js
35
+ const entryPath = join(__dirname, '..', 'dist', 'entry.js');
36
+ try {
37
+ await import(entryPath);
38
+ } catch (err) {
39
+ console.error('❌ Failed to load memoryblock CLI.');
40
+ console.error(' This usually means the package was not built correctly.');
41
+ console.error(' Try reinstalling: npm install -g memoryblock');
42
+ if (err && typeof err === 'object' && 'message' in err) {
43
+ console.error(`\n Error: ${err.message}`);
44
+ }
45
+ process.exit(1);
46
+ }
47
+ } else {
48
+ // ─── Step 1: Running under Node.js — find or install Bun ─────────
49
+ const localBun = join(homedir(), '.bun', 'bin', 'bun');
50
+
51
+ const findBun = () => {
52
+ try {
53
+ return execSync('command -v bun', { stdio: 'pipe' }).toString().trim();
54
+ } catch {
55
+ return null;
56
+ }
57
+ };
58
+
59
+ let bunPath = findBun();
60
+
61
+ if (!bunPath && !existsSync(localBun)) {
62
+ console.log('\n⚡ \x1b[1mmemoryblock\x1b[0m is powered by \x1b[33mBun\x1b[0m for extreme performance.');
63
+ console.log(' Installing the lightweight engine automatically...\n');
64
+ try {
65
+ execSync('curl -fsSL https://bun.sh/install | bash', { stdio: 'inherit' });
66
+ bunPath = localBun;
67
+ console.log('\n✅ Bun installed successfully!\n');
68
+ } catch {
69
+ console.error('\n❌ Failed to install Bun automatically.');
70
+ console.error(' Please install manually: curl -fsSL https://bun.sh/install | bash');
71
+ process.exit(1);
72
+ }
73
+ }
74
+
75
+ if (!bunPath) bunPath = localBun;
76
+
77
+ // ─── Step 2: Re-execute this same file under Bun ─────────────────
78
+ // Bun will detect itself as the runtime and take the fast path above.
79
+ const result = spawnSync(bunPath, [__filename, ...process.argv.slice(2)], {
80
+ stdio: 'inherit',
81
+ env: { ...process.env, MEMORYBLOCK_BUN_PROXY: '1' },
82
+ });
83
+
84
+ process.exit(result.status ?? 1);
85
+ }
@@ -0,0 +1,2 @@
1
+ export declare function createCommand(blockName: string): Promise<void>;
2
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAYA,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiDpE"}
@@ -0,0 +1,48 @@
1
+ import { join } from 'node:path';
2
+ import { ensureDir, writeJson, atomicWrite, pathExists } from '@memoryblock/core';
3
+ import { loadGlobalConfig, resolveBlockPath, isInitialized, } from '@memoryblock/core';
4
+ import { BlockConfigSchema, PulseStateSchema } from '@memoryblock/types';
5
+ import { log } from '@memoryblock/core';
6
+ import { FILE_TEMPLATES } from '@memoryblock/core';
7
+ // Templates moved to prompts.ts
8
+ export async function createCommand(blockName) {
9
+ if (!(await isInitialized())) {
10
+ throw new Error('Not initialized. Run `mblk init` first.');
11
+ }
12
+ if (!/^[a-z0-9][a-z0-9-]{0,31}$/.test(blockName)) {
13
+ throw new Error('Block name must start with a letter/number and contain only lowercase letters, numbers, and hyphens (max 32 chars).');
14
+ }
15
+ const globalConfig = await loadGlobalConfig();
16
+ const blockPath = resolveBlockPath(globalConfig, blockName);
17
+ if (await pathExists(blockPath)) {
18
+ throw new Error(`Block "${blockName}" already exists at ${blockPath}`);
19
+ }
20
+ log.brand(`Creating block: ${blockName}\n`);
21
+ // Directory structure
22
+ await ensureDir(blockPath);
23
+ await ensureDir(join(blockPath, 'agents'));
24
+ await ensureDir(join(blockPath, 'logs'));
25
+ // Block config (inherits global defaults)
26
+ const blockConfig = BlockConfigSchema.parse({
27
+ name: blockName,
28
+ adapter: globalConfig.defaults.adapter,
29
+ memory: globalConfig.defaults.memory,
30
+ pulse: globalConfig.defaults.pulse,
31
+ });
32
+ await writeJson(join(blockPath, 'config.json'), blockConfig);
33
+ log.success('Created config.json');
34
+ // Initial pulse state
35
+ const pulse = PulseStateSchema.parse({});
36
+ await writeJson(join(blockPath, 'pulse.json'), pulse);
37
+ log.success('Created pulse.json');
38
+ // Core identity files
39
+ await atomicWrite(join(blockPath, 'memory.md'), FILE_TEMPLATES.MEMORY_MD);
40
+ log.success('Created memory.md');
41
+ await atomicWrite(join(blockPath, 'monitor.md'), FILE_TEMPLATES.MONITOR_MD(blockName));
42
+ log.success('Created monitor.md');
43
+ console.log('');
44
+ log.brand(`Block "${blockName}" is ready.`);
45
+ log.dim(` Path: ${blockPath}`);
46
+ log.dim(` Start: mblk start ${blockName}`);
47
+ }
48
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EACH,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,GACpD,MAAM,mBA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AK,EAAE,YAAY,CAAC,QAAQ,CAAC,KAAK;KACrC,CAAC,CAAC;IACH,MAAM,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,WAAW,CAAC,CAAC;IAC7D,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEnC,sBAAsB;IACtB,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzC,MAAM,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC;IACtD,GAAG,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAElC,sBAAsB;IACtB,MAAM,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IAC1E,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjC,MAAM,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;IACvF,GAAG,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAElC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,GAAG,CAAC,KAAK,CAAC,UAAU,SAAS,aAAa,CAAC,CAAC;IAC5C,GAAG,CAAC,GAAG,CAAC,WAAW,SAAS,EAAE,CAAC,CAAC;IAChC,GAAG,CAAC,GAAG,CAAC,uBAAuB,SAAS,EAAE,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function deleteCommand(blockName: string, options?: {
2
+ hard?: boolean;
3
+ }): Promise<void>;
4
+ export declare function restoreCommand(archiveName: string): Promise<void>;
5
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/commands/delete.ts"],"names":[],"mappings":"AA6DA,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmElG;AAED,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCvE"}
@@ -0,0 +1,147 @@
1
+ import { join } from 'node:path';
2
+ import { promises as fsp } from 'node:fs';
3
+ import * as p from '@clack/prompts';
4
+ import chalk from 'chalk';
5
+ import { loadGlobalConfig, resolveBlocksDir, isInitialized } from '@memoryblock/core';
6
+ import { ensureDir, pathExists } from '@memoryblock/core';
7
+ import { log } from '@memoryblock/core';
8
+ import { t } from '@memoryblock/locale';
9
+ /**
10
+ * Find archived folders matching a block name.
11
+ * Supports both:
12
+ * - Exact archive name: "dev-pal_2026-03-21T10-33-24-242Z"
13
+ * - Block name prefix: "dev-pal" (matches all archives of that block)
14
+ */
15
+ async function findArchives(archiveDir, query) {
16
+ // Strip _archive/ prefix if user pastes it
17
+ const name = query.replace(/^_archive\//, '');
18
+ try {
19
+ const entries = await fsp.readdir(archiveDir);
20
+ // 1. Exact match
21
+ if (entries.includes(name))
22
+ return [name];
23
+ // 2. Prefix match: "dev-pal" matches "dev-pal_2026-03-21T10-33-24-242Z"
24
+ const matches = entries
25
+ .filter(e => e.startsWith(`${name}_`))
26
+ .sort()
27
+ .reverse(); // newest first
28
+ return matches;
29
+ }
30
+ catch {
31
+ return [];
32
+ }
33
+ }
34
+ /**
35
+ * Resolve a single archive — if multiple exist, let user pick.
36
+ */
37
+ async function resolveArchive(archiveDir, query) {
38
+ const matches = await findArchives(archiveDir, query);
39
+ if (matches.length === 0)
40
+ return null;
41
+ if (matches.length === 1)
42
+ return matches[0];
43
+ // Multiple archives — let the user pick
44
+ const selection = await p.select({
45
+ message: `Multiple archives found for "${query}". Which one?`,
46
+ options: matches.map(m => {
47
+ // Extract the timestamp for a cleaner label
48
+ const tsMatch = m.match(/_(\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2})/);
49
+ const hint = tsMatch ? tsMatch[1].replace(/-/g, ':').replace('T', ' ').slice(0, 16) : '';
50
+ return { value: m, label: m, hint };
51
+ }),
52
+ });
53
+ if (p.isCancel(selection))
54
+ return null;
55
+ return selection;
56
+ }
57
+ export async function deleteCommand(blockName, options) {
58
+ if (!(await isInitialized())) {
59
+ throw new Error(t.general.notInitialized);
60
+ }
61
+ const globalConfig = await loadGlobalConfig();
62
+ const blocksDir = resolveBlocksDir(globalConfig);
63
+ const blockPath = join(blocksDir, blockName);
64
+ // Check if it's a direct block path first
65
+ if (await pathExists(blockPath)) {
66
+ if (blockName.startsWith('_archive/')) {
67
+ if (!options?.hard) {
68
+ throw new Error(t.archive.mustUseHard);
69
+ }
70
+ }
71
+ if (options?.hard) {
72
+ try {
73
+ await fsp.rm(blockPath, { recursive: true, force: true });
74
+ log.success(t.archive.hardDeleteSuccess(blockName));
75
+ }
76
+ catch (err) {
77
+ throw new Error(`Failed to delete: ${err.message}`);
78
+ }
79
+ return;
80
+ }
81
+ // Soft delete — move to _archive directory
82
+ const archiveDir = join(blocksDir, '_archive');
83
+ await ensureDir(archiveDir);
84
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
85
+ const archiveName = `${blockName}_${timestamp}`;
86
+ const archivePath = join(archiveDir, archiveName);
87
+ try {
88
+ await fsp.rename(blockPath, archivePath);
89
+ log.success(t.archive.success(blockName));
90
+ log.dim(` ${t.archive.location(`_archive/${archiveName}`)}`);
91
+ log.dim(` ${t.archive.restoreCmd(blockName)}`);
92
+ log.dim(` ${t.archive.deleteCmd(blockName)}`);
93
+ }
94
+ catch (err) {
95
+ throw new Error(`Failed to archive block: ${err.message}`);
96
+ }
97
+ return;
98
+ }
99
+ // Not a live block — maybe user wants to hard-delete an archive by name?
100
+ if (options?.hard) {
101
+ const archiveDir = join(blocksDir, '_archive');
102
+ const resolved = await resolveArchive(archiveDir, blockName);
103
+ if (!resolved) {
104
+ throw new Error(`Block or archive "${blockName}" not found.`);
105
+ }
106
+ const archivePath = join(archiveDir, resolved);
107
+ try {
108
+ await fsp.rm(archivePath, { recursive: true, force: true });
109
+ log.success(`"${resolved}" permanently deleted from archive.`);
110
+ }
111
+ catch (err) {
112
+ throw new Error(`Failed to delete: ${err.message}`);
113
+ }
114
+ return;
115
+ }
116
+ throw new Error(`Block "${blockName}" not found. Run \`mblk status\` to see available blocks.`);
117
+ }
118
+ export async function restoreCommand(archiveName) {
119
+ if (!(await isInitialized())) {
120
+ throw new Error(t.general.notInitialized);
121
+ }
122
+ const globalConfig = await loadGlobalConfig();
123
+ const blocksDir = resolveBlocksDir(globalConfig);
124
+ const archiveDir = join(blocksDir, '_archive');
125
+ // Resolve the archive — supports block name, full name, or prefix
126
+ const resolved = await resolveArchive(archiveDir, archiveName);
127
+ if (!resolved) {
128
+ throw new Error(`No archive found for "${archiveName}". Run \`mblk status\` to check archives.`);
129
+ }
130
+ const archivePath = join(archiveDir, resolved);
131
+ // Extract original block name (strip timestamp suffix)
132
+ const match = resolved.match(/^(.*?)_\d{4}-\d{2}-\d{2}T.*/);
133
+ const targetName = match ? match[1] : resolved;
134
+ const targetPath = join(blocksDir, targetName);
135
+ if (await pathExists(targetPath)) {
136
+ throw new Error(`Cannot restore: A block named "${targetName}" already exists. Delete or rename it first.`);
137
+ }
138
+ try {
139
+ await fsp.rename(archivePath, targetPath);
140
+ log.success(`Block "${targetName}" restored successfully.`);
141
+ log.dim(` Start with: ${chalk.bold(`mblk start ${targetName}`)}`);
142
+ }
143
+ catch (err) {
144
+ throw new Error(`Failed to restore block: ${err.message}`);
145
+ }
146
+ }
147
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../src/commands/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,IA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,CAAC;IACvE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,4BAA6B,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;AACL,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Interactive onboarding wizard.
3
+ * Multi-step setup: providers → channels → plugins → API keys → first block.
4
+ * Uses @clack/prompts for styled terminal UI.
5
+ */
6
+ export declare function initCommand(options?: {
7
+ nonInteractive?: boolean;
8
+ }): Promise<void>;
9
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA4NvF"}