@vibevibes/mcp 0.3.2 → 0.4.0
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/dist/index.js +2 -2
- package/dist/server.js +2 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -480,10 +480,10 @@ Call this first, then use act to interact. The stop hook keeps you present.`, {
|
|
|
480
480
|
outputParts.push(`BEHAVIOR MODE:`, ` You are a behavior-only agent. All actions run autonomously via the tick engine.`, ` No stop hook — you will NOT receive wake-up events.`, ` Set up behaviors now, then disconnect. The tick engine runs them automatically.`, ``);
|
|
481
481
|
}
|
|
482
482
|
else if (agentMode === "manual") {
|
|
483
|
-
outputParts.push(`MANUAL MODE:`, ` You are a manual agent. Use act() for all decisions. No behaviors.`, ` The stop hook keeps you present — use act to interact.`, `
|
|
483
|
+
outputParts.push(`MANUAL MODE:`, ` You are a manual agent. Use act() for all decisions. No behaviors.`, ` The stop hook keeps you present — use act to interact.`, ` Use act() to interact. The stop hook keeps you present.`, ``);
|
|
484
484
|
}
|
|
485
485
|
else {
|
|
486
|
-
outputParts.push(`FAST BRAIN / SLOW BRAIN:`, ` Fast brain: Register behaviors via _behavior.set for reactive, per-tick actions that run automatically.`, ` Slow brain: Use act() for strategic decisions and adapting to new situations.`, ` Set up your fast brain FIRST, then use your slow brain to observe and adapt.`, `
|
|
486
|
+
outputParts.push(`FAST BRAIN / SLOW BRAIN:`, ` Fast brain: Register behaviors via _behavior.set for reactive, per-tick actions that run automatically.`, ` Slow brain: Use act() for strategic decisions and adapting to new situations.`, ` Set up your fast brain FIRST, then use your slow brain to observe and adapt.`, ` Use act() to interact. The stop hook keeps you present.`, ``, `You are now a live participant. The stop hook keeps you present — use act to interact.`);
|
|
487
487
|
}
|
|
488
488
|
// Register the stop hook so Claude Code wakes us on events
|
|
489
489
|
ensureStopHook();
|
package/dist/server.js
CHANGED
|
@@ -11,13 +11,12 @@ import http from "http";
|
|
|
11
11
|
import path from "path";
|
|
12
12
|
import fs from "fs";
|
|
13
13
|
import { fileURLToPath } from "url";
|
|
14
|
-
import {
|
|
14
|
+
import { ZodError } from "zod";
|
|
15
15
|
import { EventEmitter } from "events";
|
|
16
16
|
import { bundleForServer, bundleForClient, evalServerBundle, validateClientBundle } from "./bundler.js";
|
|
17
17
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
18
18
|
import { TickEngine } from "./tick-engine.js";
|
|
19
19
|
import { isProtocolExperience, loadProtocolManifest, createProtocolModule, SubprocessExecutor } from "./protocol.js";
|
|
20
|
-
import { createChatTools } from "@vibevibes/sdk";
|
|
21
20
|
function formatZodError(err, toolName, tool) {
|
|
22
21
|
const issues = err.issues.map((issue) => {
|
|
23
22
|
const path = issue.path.length > 0 ? `'${issue.path.join(".")}'` : "input";
|
|
@@ -375,9 +374,6 @@ async function loadExperience() {
|
|
|
375
374
|
if (!mod?.manifest || !mod?.tools) {
|
|
376
375
|
throw new Error(`Experience at ${entryPath} missing manifest or tools`);
|
|
377
376
|
}
|
|
378
|
-
if (!mod.tools.some((t) => t.name === '_chat.send')) {
|
|
379
|
-
mod.tools.push(...createChatTools(z));
|
|
380
|
-
}
|
|
381
377
|
const clientError = validateClientBundle(cCode);
|
|
382
378
|
if (clientError) {
|
|
383
379
|
throw new Error(`Client bundle validation failed for ${entryPath}: ${clientError}`);
|
|
@@ -405,9 +401,6 @@ async function loadProtocolExperience(manifestPath) {
|
|
|
405
401
|
}
|
|
406
402
|
catch { }
|
|
407
403
|
const mod = createProtocolModule(manifest, executor, manifestDir);
|
|
408
|
-
if (!mod.tools.some((t) => t.name === '_chat.send')) {
|
|
409
|
-
mod.tools.push(...createChatTools(z));
|
|
410
|
-
}
|
|
411
404
|
loadedExperience = {
|
|
412
405
|
module: mod,
|
|
413
406
|
clientBundle: "",
|
|
@@ -461,20 +454,7 @@ export function defineExperience(c) { return c; }
|
|
|
461
454
|
export function defineTool(c) { return { risk: "low", capabilities_required: [], ...c }; }
|
|
462
455
|
export function defineTest(c) { return c; }
|
|
463
456
|
export function defineStream(c) { return c; }
|
|
464
|
-
export function createChatTools(
|
|
465
|
-
return [
|
|
466
|
-
{ name: "_chat.send", description: "Send a chat message", risk: "low", capabilities_required: ["state.write"],
|
|
467
|
-
input_schema: z.object({ message: z.string() }),
|
|
468
|
-
handler: async (ctx, input) => {
|
|
469
|
-
const chat = Array.isArray(ctx.state._chat) ? ctx.state._chat : [];
|
|
470
|
-
ctx.setState({ ...ctx.state, _chat: [...chat.slice(-99), { actorId: ctx.actorId, message: input.message, ts: Date.now() }] });
|
|
471
|
-
return { sent: true };
|
|
472
|
-
}},
|
|
473
|
-
{ name: "_chat.clear", description: "Clear chat", risk: "low", capabilities_required: ["state.write"],
|
|
474
|
-
input_schema: z.object({}),
|
|
475
|
-
handler: async (ctx) => { ctx.setState({ ...ctx.state, _chat: [] }); return { cleared: true }; }},
|
|
476
|
-
];
|
|
477
|
-
}
|
|
457
|
+
export function createChatTools() { return []; }
|
|
478
458
|
`);
|
|
479
459
|
});
|
|
480
460
|
// ── State endpoint ─────────────────────────────────────────
|