@johpaz/hive-sdk 0.0.15 → 0.0.17
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/CHANGELOG.md +35 -1
- package/README.md +179 -57
- package/docs/API-AGENTS.md +9 -9
- package/docs/API-CONTEXT-COMPILER.md +13 -13
- package/docs/API-DAG-SCHEDULER.md +8 -8
- package/docs/API-TOOLS-SKILLS-CHANNELS.md +150 -93
- package/docs/API-WORKERS-EVENTS.md +206 -59
- package/docs/INDEX.md +99 -50
- package/docs/README.md +117 -24
- package/docs/TEMPLATE-HIVE-APP.md +360 -0
- package/package.json +13 -6
- package/packages/cli/bin/hives +2 -0
- package/packages/cli/src/commands/add-skill.ts +42 -0
- package/packages/cli/src/commands/add-tool.ts +45 -0
- package/packages/cli/src/commands/add-worker.ts +49 -0
- package/packages/cli/src/commands/create-app-utils.ts +32 -0
- package/packages/cli/src/commands/create-app.test.ts +151 -0
- package/packages/cli/src/commands/create-app.ts +35 -0
- package/packages/cli/src/index.ts +22 -6
- package/packages/cli/templates/hive-app/.env.example +17 -0
- package/packages/cli/templates/hive-app/docker-compose.yml +20 -0
- package/packages/cli/templates/hive-app/hive.config.ts +19 -0
- package/packages/cli/templates/hive-app/package.json +16 -0
- package/packages/cli/templates/hive-app/src/agents/coordinator.ts +9 -0
- package/packages/cli/templates/hive-app/src/main.ts +56 -0
- package/packages/core/src/auth/auth.ts +108 -0
- package/packages/core/src/auth/index.ts +1 -0
- package/packages/core/src/canvas/canvas.test.ts +32 -0
- package/packages/core/src/canvas/emitter.ts +1 -1
- package/packages/core/src/canvas/index.ts +3 -6
- package/packages/core/src/channels/base.ts +154 -0
- package/packages/core/src/channels/channels.test.ts +18 -0
- package/packages/core/src/channels/discord.ts +273 -0
- package/packages/core/src/channels/index.ts +7 -0
- package/packages/core/src/channels/manager.ts +450 -0
- package/packages/core/src/channels/slack.ts +323 -0
- package/packages/core/src/channels/telegram.ts +612 -0
- package/packages/core/src/channels/webchat.ts +139 -0
- package/packages/core/src/channels/whatsapp.ts +548 -0
- package/packages/core/src/events/agent-bus.ts +460 -0
- package/packages/core/src/events/event-bus.ts +169 -0
- package/packages/core/src/gateway/channel-notify.ts +32 -7
- package/packages/core/src/gateway/gateway.test.ts +38 -0
- package/packages/core/src/gateway/index.ts +2 -1
- package/packages/core/src/gateway/server.ts +139 -0
- package/packages/core/src/heartbeat/index.ts +157 -0
- package/packages/core/src/index.ts +44 -0
- package/packages/core/src/multimodal/index.ts +2 -2
- package/packages/core/src/multimodal/vision-service.ts +283 -0
- package/packages/core/src/plugins/api.ts +128 -0
- package/packages/core/src/plugins/index.ts +2 -0
- package/packages/core/src/plugins/loader.ts +365 -0
- package/packages/core/src/resilience/circuit-breaker.ts +225 -0
- package/packages/core/src/scheduler/CronScheduler.ts +699 -0
- package/packages/core/src/scheduler/dag/AgentExecutor.ts +53 -0
- package/packages/core/src/scheduler/dag/DAGScheduler.ts +250 -0
- package/packages/core/src/scheduler/dag/EventBridge.ts +122 -0
- package/packages/core/src/scheduler/dag/TaskGraph.ts +192 -0
- package/packages/core/src/scheduler/dag/TaskNode.ts +97 -0
- package/packages/core/src/scheduler/dag/TaskResult.ts +22 -0
- package/packages/core/src/scheduler/dag/errors.ts +37 -0
- package/packages/core/src/scheduler/dag/index.ts +26 -0
- package/packages/core/src/scheduler/dag/presets/ResearchPreset.ts +97 -0
- package/packages/core/src/scheduler/dag/strategies/ParallelStrategy.ts +21 -0
- package/packages/core/src/scheduler/dag/strategies/PriorityStrategy.ts +46 -0
- package/packages/core/src/scheduler/index.ts +22 -0
- package/packages/core/src/scheduler/integration.ts +237 -0
- package/packages/core/src/scheduler/scheduler.test.ts +19 -0
- package/packages/core/src/scheduler/types.ts +164 -0
- package/packages/core/src/security/google-chat.ts +269 -0
- package/packages/core/src/security/index.ts +192 -4
- package/packages/core/src/security/rate-limit.ts +270 -0
- package/packages/core/src/security/signal.ts +321 -0
- package/packages/core/src/storage/crypto.ts +198 -66
- package/packages/core/src/storage/storage.test.ts +37 -0
- package/packages/core/src/swarm/swarm.test.ts +24 -0
- package/packages/core/src/tool-runtime/index.ts +522 -0
- package/packages/core/src/tool-runtime/tool-runtime.test.ts +91 -0
- package/packages/core/src/tool-runtime/tool-worker.ts +125 -0
- package/packages/core/src/voice/index.ts +5 -18
- package/packages/core/src/workers/WorkerPool.ts +167 -0
- package/packages/core/src/workers/agent.worker.ts +68 -0
- package/packages/core/src/workers/createWorker.ts +144 -0
- package/packages/core/src/workers/index.ts +5 -0
- package/packages/core/src/workers/workers.test.ts +48 -0
- package/test/setup-db.ts +2 -2
- package/tsconfig.json +2 -1
- package/.github/CODEOWNERS +0 -9
- package/.github/workflows/publish.yml +0 -89
- package/.github/workflows/version-bump.yml +0 -102
- package/bun.lock +0 -543
- package/bunfig.toml +0 -7
- package/packages/core/src/agent/providers.ts +0 -1
- package/packages/core/src/gateway/channel-notify.test.ts +0 -14
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
# API Reference — Tools, Skills, MCP y Storage
|
|
1
|
+
# API Reference — Tools, Skills, MCP, Gateway, Channels y Storage
|
|
2
2
|
|
|
3
3
|
## Índice
|
|
4
4
|
|
|
5
5
|
1. [Tools](#tools)
|
|
6
6
|
2. [Skills](#skills)
|
|
7
7
|
3. [MCP](#mcp)
|
|
8
|
-
4. [
|
|
9
|
-
5. [
|
|
10
|
-
6. [
|
|
11
|
-
7. [
|
|
8
|
+
4. [Gateway](#gateway)
|
|
9
|
+
5. [Channels](#channels)
|
|
10
|
+
6. [Tool Runtime](#tool-runtime)
|
|
11
|
+
7. [Canvas](#canvas)
|
|
12
|
+
8. [Storage](#storage)
|
|
13
|
+
9. [Config](#config)
|
|
12
14
|
|
|
13
15
|
---
|
|
14
16
|
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
Función para definir herramientas que el agente puede invocar.
|
|
20
22
|
|
|
21
23
|
```typescript
|
|
22
|
-
import { defineTool } from "@hive
|
|
24
|
+
import { defineTool } from "@johpaz/hive-sdk";
|
|
23
25
|
|
|
24
26
|
const tool = defineTool({
|
|
25
27
|
name: "saludar",
|
|
@@ -35,25 +37,19 @@ const tool = defineTool({
|
|
|
35
37
|
Registro central de herramientas.
|
|
36
38
|
|
|
37
39
|
```typescript
|
|
38
|
-
import { ToolRegistry, defineTool } from "@hive
|
|
40
|
+
import { ToolRegistry, defineTool } from "@johpaz/hive-sdk";
|
|
39
41
|
|
|
40
42
|
const reg = new ToolRegistry();
|
|
41
43
|
|
|
42
|
-
// Registrar
|
|
43
44
|
reg.register(defineTool({ name: "t1", description: "...", execute: async () => ({}) }));
|
|
44
45
|
|
|
45
|
-
// Consultar
|
|
46
46
|
reg.has("t1"); // true
|
|
47
47
|
reg.get("t1"); // ToolDefinition
|
|
48
|
-
reg.list();
|
|
48
|
+
reg.list(); // ToolDefinition[]
|
|
49
49
|
reg.getByCategory("web"); // Filtrar por categoría
|
|
50
50
|
reg.getNames(); // ["t1"]
|
|
51
51
|
reg.size(); // 1
|
|
52
|
-
|
|
53
|
-
// Merge con otro registry
|
|
54
52
|
reg.merge(otherRegistry);
|
|
55
|
-
|
|
56
|
-
// Limpiar
|
|
57
53
|
reg.clear();
|
|
58
54
|
```
|
|
59
55
|
|
|
@@ -62,7 +58,7 @@ reg.clear();
|
|
|
62
58
|
Ejecutor de herramientas con validación Zod.
|
|
63
59
|
|
|
64
60
|
```typescript
|
|
65
|
-
import { ToolRegistry, ToolExecutor, defineTool } from "@hive
|
|
61
|
+
import { ToolRegistry, ToolExecutor, defineTool } from "@johpaz/hive-sdk";
|
|
66
62
|
|
|
67
63
|
const reg = new ToolRegistry();
|
|
68
64
|
reg.register(defineTool({
|
|
@@ -72,27 +68,15 @@ reg.register(defineTool({
|
|
|
72
68
|
}));
|
|
73
69
|
|
|
74
70
|
const exec = new ToolExecutor(reg);
|
|
75
|
-
|
|
76
|
-
// Ejecutar una tool
|
|
77
71
|
const result = await exec.execute("echo", { msg: "hola" });
|
|
78
|
-
// { toolName: "echo", args: { msg: "hola" }, result: { msg: "hola" }, durationMs: 1 }
|
|
79
|
-
|
|
80
|
-
// Ejecución batch
|
|
81
|
-
const results = await exec.executeBatch([
|
|
82
|
-
{ name: "echo", args: { msg: "a" } },
|
|
83
|
-
{ name: "echo", args: { msg: "b" } },
|
|
84
|
-
]);
|
|
85
72
|
```
|
|
86
73
|
|
|
87
74
|
### Tool Selection (FTS5)
|
|
88
75
|
|
|
89
76
|
```typescript
|
|
90
|
-
import { selectTools, CORE_TOOL_CATALOG } from "@hive
|
|
77
|
+
import { selectTools, CORE_TOOL_CATALOG } from "@johpaz/hive-sdk";
|
|
91
78
|
|
|
92
|
-
// Selección automática por relevancia
|
|
93
79
|
const tools = selectTools("Buscar archivos en el proyecto");
|
|
94
|
-
|
|
95
|
-
// Filtrar por categoría
|
|
96
80
|
const webTools = tools.filter(t => t.category === "web");
|
|
97
81
|
```
|
|
98
82
|
|
|
@@ -103,7 +87,7 @@ const webTools = tools.filter(t => t.category === "web");
|
|
|
103
87
|
### defineSkill
|
|
104
88
|
|
|
105
89
|
```typescript
|
|
106
|
-
import { defineSkill } from "@hive
|
|
90
|
+
import { defineSkill } from "@johpaz/hive-sdk";
|
|
107
91
|
|
|
108
92
|
const skill = defineSkill({
|
|
109
93
|
name: "file-manager",
|
|
@@ -119,10 +103,8 @@ const skill = defineSkill({
|
|
|
119
103
|
|
|
120
104
|
### SkillLoader
|
|
121
105
|
|
|
122
|
-
Carga skills desde archivos YAML o datos bundled.
|
|
123
|
-
|
|
124
106
|
```typescript
|
|
125
|
-
import { SkillLoader } from "@hive
|
|
107
|
+
import { SkillLoader } from "@johpaz/hive-sdk";
|
|
126
108
|
|
|
127
109
|
const loader = new SkillLoader({
|
|
128
110
|
allowBundled: ["file-manager", "web-researcher"],
|
|
@@ -137,14 +119,13 @@ const skill = loader.get("file-manager");
|
|
|
137
119
|
|
|
138
120
|
## MCP
|
|
139
121
|
|
|
140
|
-
Model Context Protocol — herramientas externas via STDIO/SSE.
|
|
122
|
+
Model Context Protocol — herramientas externas via STDIO/SSE/WebSocket.
|
|
141
123
|
|
|
142
124
|
### MCPClientManager
|
|
143
125
|
|
|
144
126
|
```typescript
|
|
145
|
-
import { MCPClientManager } from "@hive
|
|
127
|
+
import { MCPClientManager } from "@johpaz/hive-sdk";
|
|
146
128
|
|
|
147
|
-
// Configurar con servidores
|
|
148
129
|
const mcp = new MCPClientManager({
|
|
149
130
|
servers: {
|
|
150
131
|
"filesystem": {
|
|
@@ -161,43 +142,149 @@ const mcp = new MCPClientManager({
|
|
|
161
142
|
},
|
|
162
143
|
});
|
|
163
144
|
|
|
164
|
-
// Inicializar y conectar
|
|
165
145
|
await mcp.initialize();
|
|
166
|
-
|
|
167
|
-
// Obtener tools de servidores MCP
|
|
168
146
|
const tools = mcp.getTools("filesystem");
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Transports
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { createTransport, SSETransport, WebSocketTransport } from "@johpaz/hive-sdk";
|
|
169
153
|
|
|
170
|
-
|
|
171
|
-
|
|
154
|
+
const transport = createTransport({
|
|
155
|
+
type: "stdio",
|
|
156
|
+
stdio: { command: "npx", args: ["-y", "server"], env: {} },
|
|
157
|
+
});
|
|
172
158
|
```
|
|
173
159
|
|
|
174
|
-
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Gateway
|
|
175
163
|
|
|
176
|
-
|
|
164
|
+
Servidor HTTP/WebSocket simplificado para exponer el agente como API.
|
|
165
|
+
|
|
166
|
+
### startGateway
|
|
177
167
|
|
|
178
168
|
```typescript
|
|
179
|
-
import {
|
|
169
|
+
import { startGateway } from "@johpaz/hive-sdk";
|
|
170
|
+
|
|
171
|
+
const server = await startGateway({
|
|
172
|
+
host: "127.0.0.1",
|
|
173
|
+
port: 18790,
|
|
174
|
+
agentId: "coordinator",
|
|
175
|
+
mcpManager: null,
|
|
176
|
+
});
|
|
180
177
|
|
|
181
|
-
|
|
182
|
-
await syncMCPToolsToFTS();
|
|
178
|
+
console.log(`Gateway at http://127.0.0.1:18790`);
|
|
183
179
|
```
|
|
184
180
|
|
|
185
|
-
###
|
|
181
|
+
### Endpoints
|
|
182
|
+
|
|
183
|
+
| Método | Ruta | Descripción |
|
|
184
|
+
|--------|------|-------------|
|
|
185
|
+
| GET | `/status` | Health check |
|
|
186
|
+
| POST | `/chat` | Chat con el agente |
|
|
187
|
+
| WS | `/ws` | WebSocket streaming |
|
|
188
|
+
|
|
189
|
+
### Ejemplo: Chat HTTP
|
|
186
190
|
|
|
187
191
|
```typescript
|
|
188
|
-
|
|
192
|
+
const res = await fetch("http://127.0.0.1:18790/chat", {
|
|
193
|
+
method: "POST",
|
|
194
|
+
headers: { "Content-Type": "application/json" },
|
|
195
|
+
body: JSON.stringify({ message: "Hello!", threadId: "t1" }),
|
|
196
|
+
});
|
|
189
197
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
198
|
+
const data = await res.json();
|
|
199
|
+
console.log(data.response);
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Channels
|
|
205
|
+
|
|
206
|
+
Integraciones con plataformas de mensajería.
|
|
207
|
+
|
|
208
|
+
### ChannelManager
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import { ChannelManager } from "@johpaz/hive-sdk";
|
|
212
|
+
|
|
213
|
+
const manager = new ChannelManager(config);
|
|
214
|
+
await manager.initialize();
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Canales soportados
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
import {
|
|
221
|
+
TelegramChannel,
|
|
222
|
+
DiscordChannel,
|
|
223
|
+
WhatsAppChannel,
|
|
224
|
+
SlackChannel,
|
|
225
|
+
WebChatChannel,
|
|
226
|
+
} from "@johpaz/hive-sdk";
|
|
227
|
+
|
|
228
|
+
// Telegram
|
|
229
|
+
const telegram = new TelegramChannel({ botToken: process.env.TELEGRAM_BOT_TOKEN! });
|
|
230
|
+
|
|
231
|
+
// Discord
|
|
232
|
+
const discord = new DiscordChannel({ botToken: process.env.DISCORD_BOT_TOKEN! });
|
|
233
|
+
|
|
234
|
+
// WhatsApp
|
|
235
|
+
const whatsapp = new WhatsAppChannel();
|
|
236
|
+
|
|
237
|
+
// Slack
|
|
238
|
+
const slack = new SlackChannel({ botToken: process.env.SLACK_BOT_TOKEN! });
|
|
239
|
+
|
|
240
|
+
// Webchat
|
|
241
|
+
const webchat = new WebChatChannel();
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Tool Runtime
|
|
247
|
+
|
|
248
|
+
Ejecución paralela de herramientas vía Bun Workers.
|
|
249
|
+
|
|
250
|
+
### executeToolBatch
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
import { executeToolBatch, shutdownToolRuntime } from "@johpaz/hive-sdk";
|
|
254
|
+
|
|
255
|
+
const results = await executeToolBatch({
|
|
256
|
+
toolCalls: [
|
|
257
|
+
{ id: "1", function: { name: "search", arguments: JSON.stringify({ q: "AI" }) } },
|
|
258
|
+
{ id: "2", function: { name: "fetch", arguments: JSON.stringify({ url: "..." }) } },
|
|
259
|
+
],
|
|
260
|
+
allTools: [searchTool, fetchTool],
|
|
261
|
+
toolConfig: { user_id: "u1", thread_id: "t1" },
|
|
262
|
+
hiveConfig: loadConfig(),
|
|
263
|
+
workerPool: {
|
|
264
|
+
enabled: true,
|
|
265
|
+
maxWorkers: 4,
|
|
266
|
+
toolTimeoutMs: 30000,
|
|
267
|
+
parallelToolCalls: true,
|
|
268
|
+
},
|
|
194
269
|
});
|
|
195
270
|
|
|
196
|
-
//
|
|
197
|
-
|
|
271
|
+
// Limpieza
|
|
272
|
+
shutdownToolRuntime();
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### ToolBatchResult
|
|
198
276
|
|
|
199
|
-
|
|
200
|
-
|
|
277
|
+
```typescript
|
|
278
|
+
interface ToolBatchResult {
|
|
279
|
+
toolCall: ToolCallLike;
|
|
280
|
+
toolName: string;
|
|
281
|
+
result: unknown;
|
|
282
|
+
ok: boolean;
|
|
283
|
+
durationMs: number;
|
|
284
|
+
error?: SerializedError;
|
|
285
|
+
timedOut?: boolean;
|
|
286
|
+
aborted?: boolean;
|
|
287
|
+
}
|
|
201
288
|
```
|
|
202
289
|
|
|
203
290
|
---
|
|
@@ -207,28 +294,17 @@ const ws = new WebSocketTransport({ url: "wss://api.example.com/mcp" });
|
|
|
207
294
|
Visualización en tiempo real del estado de agentes.
|
|
208
295
|
|
|
209
296
|
```typescript
|
|
210
|
-
import {
|
|
297
|
+
import { emitCanvas, subscribeCanvas, unsubscribeCanvas } from "@johpaz/hive-sdk";
|
|
211
298
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
console.log("Estado:", update.changes.status);
|
|
215
|
-
});
|
|
299
|
+
const handler = (data: any) => console.log("Canvas:", data);
|
|
300
|
+
subscribeCanvas(handler);
|
|
216
301
|
|
|
217
|
-
// Emitir eventos
|
|
218
302
|
emitCanvas("canvas:node_update", {
|
|
219
303
|
nodeId: "agent-1",
|
|
220
304
|
changes: { status: "running", currentTool: "web_search" },
|
|
221
305
|
});
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### A2UI Tools
|
|
225
306
|
|
|
226
|
-
|
|
227
|
-
import { createA2UISurfaceTool, createA2UIUpdateComponentsTool } from "@hive/core/canvas";
|
|
228
|
-
|
|
229
|
-
// Crear tools A2UI para UI generada por agentes
|
|
230
|
-
const surfaceTool = createA2UISurfaceTool();
|
|
231
|
-
const updateTool = createA2UIUpdateComponentsTool();
|
|
307
|
+
unsubscribeCanvas(handler);
|
|
232
308
|
```
|
|
233
309
|
|
|
234
310
|
---
|
|
@@ -238,29 +314,20 @@ const updateTool = createA2UIUpdateComponentsTool();
|
|
|
238
314
|
Base de datos SQLite con FTS5.
|
|
239
315
|
|
|
240
316
|
```typescript
|
|
241
|
-
import { initializeDatabase,
|
|
317
|
+
import { initializeDatabase, dbService } from "@johpaz/hive-sdk";
|
|
242
318
|
|
|
243
|
-
// Inicializar (crea tablas si no existen)
|
|
244
319
|
await initializeDatabase();
|
|
320
|
+
const db = getTestDb();
|
|
245
321
|
|
|
246
|
-
// Obtener instancia DB
|
|
247
|
-
const db = getDb();
|
|
248
|
-
|
|
249
|
-
// Queries
|
|
250
322
|
const results = db.query("SELECT * FROM agents WHERE id = ?").all(agentId);
|
|
251
323
|
const single = db.query("SELECT * FROM agents WHERE id = ?").get(agentId);
|
|
252
324
|
|
|
253
|
-
// Insert/Update
|
|
254
|
-
db.query("INSERT INTO agents (id, name) VALUES (?, ?)").run("a1", "Agent 1");
|
|
255
|
-
|
|
256
|
-
// Cerrar
|
|
257
325
|
dbService.close();
|
|
258
326
|
```
|
|
259
327
|
|
|
260
328
|
### Schemas FTS5
|
|
261
329
|
|
|
262
330
|
```sql
|
|
263
|
-
-- 4 tablas virtuales FTS5 para búsqueda full-text
|
|
264
331
|
CREATE VIRTUAL TABLE playbook_fts USING fts5(rule, category, applicable_to);
|
|
265
332
|
CREATE VIRTUAL TABLE tools_fts USING fts5(tool_name, name, description, category);
|
|
266
333
|
CREATE VIRTUAL TABLE skills_fts USING fts5(id, name, description, category, tools, triggers, body);
|
|
@@ -272,22 +339,12 @@ CREATE VIRTUAL TABLE mcp_tools_fts USING fts5(id, name, description, category);
|
|
|
272
339
|
## Config
|
|
273
340
|
|
|
274
341
|
```typescript
|
|
275
|
-
import { loadConfig, loadEnv, getHiveDir } from "@hive
|
|
342
|
+
import { loadConfig, loadEnv, getHiveDir } from "@johpaz/hive-sdk";
|
|
276
343
|
|
|
277
344
|
const config = await loadConfig();
|
|
278
|
-
// { HIVE_DATA_DIR: "./data", LOG_LEVEL: "info", ... }
|
|
279
|
-
|
|
280
345
|
const hiveDir = getHiveDir(); // ~/.hive o HIVE_DATA_DIR
|
|
281
346
|
```
|
|
282
347
|
|
|
283
348
|
---
|
|
284
349
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
```typescript
|
|
288
|
-
import { sendToUserChannel } from "@hive/core/gateway";
|
|
289
|
-
|
|
290
|
-
// Stub — logs al console, retorna { ok: true }
|
|
291
|
-
// Reemplazar cuando se integre con un sistema de notificaciones real
|
|
292
|
-
const result = await sendToUserChannel("cli:user-1", "user-1", "Hello!");
|
|
293
|
-
```
|
|
350
|
+
*Documentación Hive SDK v0.0.17*
|