@vibevibes/mcp 0.4.0 → 0.4.1
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/bundler.js +4 -4
- package/dist/server.js +0 -1
- package/package.json +1 -1
package/dist/bundler.js
CHANGED
|
@@ -74,7 +74,7 @@ function stripExternalImports(code, externals = EXTERNALS) {
|
|
|
74
74
|
* CJS shim definitions for server-side eval (new Function()).
|
|
75
75
|
* Maps esbuild-generated variable names to runtime-provided globals.
|
|
76
76
|
*/
|
|
77
|
-
const SDK_CORE_SHIM = "{ defineExperience: defineExperience, defineTool: defineTool, defineTest: defineTest, defineStream: defineStream,
|
|
77
|
+
const SDK_CORE_SHIM = "{ defineExperience: defineExperience, defineTool: defineTool, defineTest: defineTest, defineStream: defineStream, default: { defineExperience: defineExperience, defineTool: defineTool, defineTest: defineTest, defineStream: defineStream } }";
|
|
78
78
|
const CJS_BASE_SHIMS = {
|
|
79
79
|
import_react: "{ default: React, __esModule: true, createElement: React.createElement, Fragment: React.Fragment, useState: React.useState, useEffect: React.useEffect, useCallback: React.useCallback, useMemo: React.useMemo, useRef: React.useRef, useContext: React.useContext, useReducer: React.useReducer, createContext: React.createContext, forwardRef: React.forwardRef, memo: React.memo }",
|
|
80
80
|
import_zod: "{ z: z, default: z }",
|
|
@@ -182,7 +182,7 @@ export async function bundleForServer(entryPath) {
|
|
|
182
182
|
*/
|
|
183
183
|
export async function evalServerBundle(serverCode) {
|
|
184
184
|
const sdk = await import("@vibevibes/sdk");
|
|
185
|
-
const { defineExperience, defineTool, defineTest, defineStream
|
|
185
|
+
const { defineExperience, defineTool, defineTest, defineStream } = sdk;
|
|
186
186
|
const noop = () => null;
|
|
187
187
|
const stubReact = {
|
|
188
188
|
createElement: noop, Fragment: "Fragment",
|
|
@@ -194,11 +194,11 @@ export async function evalServerBundle(serverCode) {
|
|
|
194
194
|
};
|
|
195
195
|
const zodModule = await import("zod");
|
|
196
196
|
const z = zodModule.z ?? zodModule.default ?? zodModule;
|
|
197
|
-
const fn = new Function("globalThis", "process", "global", "React", "Y", "z", "defineExperience", "defineTool", "defineTest", "defineStream", "
|
|
197
|
+
const fn = new Function("globalThis", "process", "global", "React", "Y", "z", "defineExperience", "defineTool", "defineTest", "defineStream", "require", "exports", "module", "console", `"use strict";\n${serverCode}\nreturn typeof __experience_export__ !== 'undefined' ? __experience_export__ : (typeof module !== 'undefined' ? module.exports : undefined);`);
|
|
198
198
|
const fakeModule = { exports: {} };
|
|
199
199
|
const sandboxGlobal = Object.create(null);
|
|
200
200
|
const sandboxProcess = { env: { NODE_ENV: "production" } };
|
|
201
|
-
const result = fn(sandboxGlobal, sandboxProcess, sandboxGlobal, stubReact, {}, z, defineExperience, defineTool, defineTest, defineStream,
|
|
201
|
+
const result = fn(sandboxGlobal, sandboxProcess, sandboxGlobal, stubReact, {}, z, defineExperience, defineTool, defineTest, defineStream, (id) => { throw new Error(`require('${id}') is not supported in the vibevibes server sandbox. Add '${id}' to EXTERNALS in bundler.ts.`); }, fakeModule.exports, fakeModule, console);
|
|
202
202
|
const exports = fakeModule.exports;
|
|
203
203
|
return result?.default ?? result ?? exports?.default ?? exports;
|
|
204
204
|
}
|
package/dist/server.js
CHANGED
|
@@ -454,7 +454,6 @@ export function defineExperience(c) { return c; }
|
|
|
454
454
|
export function defineTool(c) { return { risk: "low", capabilities_required: [], ...c }; }
|
|
455
455
|
export function defineTest(c) { return c; }
|
|
456
456
|
export function defineStream(c) { return c; }
|
|
457
|
-
export function createChatTools() { return []; }
|
|
458
457
|
`);
|
|
459
458
|
});
|
|
460
459
|
// ── State endpoint ─────────────────────────────────────────
|