@vibecontrols/vibe-plugin-tool-graphiql 2026.601.1 → 2026.1108.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/index.js +3 -3
- package/package.json +35 -21
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`);return}if(onInit)await onInit(hostServices);if(telemetryEventName)hostServices.telemetry?.emit(telemetryEventName,{plugin:name})},onServerStop:async(hostServices)=>{if(onShutdown)await onShutdown(hostServices)}}}var TelemetryEmitter=class{constructor(pluginName,pluginVersion,hostServices){this.pluginName=pluginName,this.pluginVersion=pluginVersion,this.hostServices=hostServices}pluginName;pluginVersion;hostServices;emit(eventName,payload){let target=this.hostServices?.telemetry;if(!target)return;target.emit(eventName,{plugin:this.pluginName,version:this.pluginVersion,timestamp:new Date().toISOString(),...payload??{}})}emitReady(context){this.emit(`${this.pluginName}.ready`,context)}emitError(error,context){this.emit(`${this.pluginName}.error`,{message:error.message,...context??{}})}emitEvent(type,payload){this.emit(type,payload)}};var PLUGIN_NAME="graphiql",PLUGIN_VERSION="2026.531.1",createPlugin=(_ctx)=>{let lifecycle=createLifecycleHooks({name:PLUGIN_NAME,telemetryEventName:"tool.ready",onInit:(hostServices)=>{new TelemetryEmitter(PLUGIN_NAME,PLUGIN_VERSION,hostServices).emitEvent("tool.ready",{provider:"graphiql"})}});return{capabilities:{storage:"rw",subprocess:!0,audit:!0,telemetry:!0},name:PLUGIN_NAME,version:PLUGIN_VERSION,description:"GraphQL Playground (GraphiQL)",tags:["frontend","integration"],hasUI:!0,apiPrefix:"/api/graphiql",ui:{staticDir:join(import.meta.dir,"ui"),title:"GraphQL Playground",icon:"Network",capabilities:{restPaths:["/ui/graphiql","/api/plugins/graphiql/ui"],wsTopics:[],rpcMethods:["getContext"]},contributions:[{mountPoint:"vibe.detailTab",id:"plugin:graphiql",title:"GraphQL",icon:"Network",order:90,runtimes:["iframe"],capabilities:{restPaths:["/ui/graphiql","/api/plugins/graphiql/ui"],wsTopics:[],rpcMethods:["getContext"]}}]},async onServerStart(app,hostServices){await lifecycle.onServerStart(app,hostServices);let elysiaApp=app
|
|
4
|
-
`)},onServerStop:lifecycle.onServerStop,async onServerReady(){try{
|
|
2
|
+
var __esm=(fn,res,err)=>()=>{if(fn)try{res=fn(fn=0)}catch(e){err=[e]}if(err)throw err[0];return res};import{Elysia as Elysia2}from"elysia";var RoutesBuilder=class{constructor(pluginName,hostServices){this.pluginName=pluginName,this.hostServices=hostServices}pluginName;hostServices;prefix;apiKeyResolver;errorHandlerEnabled=!1;loggingEnabled=!1;withPrefix(prefix){return this.prefix=prefix,this}withAuth(getApiKey){return this.apiKeyResolver=getApiKey,this}withErrorHandler(){return this.errorHandlerEnabled=!0,this}withLogging(){return this.loggingEnabled=!0,this}build(){let opts=this.prefix?{prefix:this.prefix}:void 0,app=new Elysia2(opts);if(this.apiKeyResolver){let resolver=this.apiKeyResolver;app.onBeforeHandle(async({request,set})=>{let supplied=request.headers.get("x-api-key"),expected=await resolver();if(!supplied||supplied!==expected)return set.status=401,{error:"unauthorized"};return})}if(this.errorHandlerEnabled){let pluginName=this.pluginName,logger=this.hostServices?.logger;app.onError(({error,set})=>{let message=error instanceof Error?error.message:String(error);return logger?.error?.(pluginName,"route error",{message}),set.status=500,{error:message}})}if(this.loggingEnabled){let pluginName=this.pluginName,logger=this.hostServices?.logger;app.onRequest(({request})=>{logger?.debug?.(pluginName,"request",{method:request.method,url:request.url})})}return app}};var init_routes=()=>{};function buildGraphiQLRoutes(hostServices,prefix){let storage=hostServices.storage;return new RoutesBuilder("graphiql",hostServices).withPrefix(prefix).withErrorHandler().build().get("/config/:vibeId",async({params,set})=>{let{vibeId}=params,raw=await storage.get(STORAGE_NAMESPACE,`config:${vibeId}`);if(!raw)return set.status=404,{error:`No GraphiQL config found for vibe '${vibeId}'`};try{let config=JSON.parse(raw);return{vibeId,config}}catch{return set.status=500,{error:"Stored config is corrupted"}}}).put("/config/:vibeId",async({params,body,set})=>{let{vibeId}=params,payload=body;if(!payload||typeof payload.graphqlUrl!=="string")return set.status=400,{error:"Request body must include 'graphqlUrl' (string)"};let config={graphqlUrl:payload.graphqlUrl,headers:payload.headers??void 0};return await storage.set(STORAGE_NAMESPACE,`config:${vibeId}`,JSON.stringify(config)),{message:"Config saved",vibeId,config}}).delete("/config/:vibeId",async({params})=>{let{vibeId}=params;return{message:await storage.delete(STORAGE_NAMESPACE,`config:${vibeId}`)?"Config deleted":"No config found (nothing to delete)",vibeId}})}function createGraphiQLRoutes(hostServices){return buildGraphiQLRoutes(hostServices,"/api/graphiql")}function createGraphiQLUIRoutes(hostServices){return buildGraphiQLRoutes(hostServices,"/api/plugins/graphiql/ui")}var STORAGE_NAMESPACE="graphiql";var init_routes2=__esm(()=>{init_routes()});function getRegistry(){let slots=globalThis,existing=slots[REGISTRY_KEY];if(existing)return existing;let created=new Map;return slots[REGISTRY_KEY]=created,created}function registerContextProvider(provider,hostServices){if(!provider||typeof provider.name!=="string"||provider.name.length===0)throw Error("ContextProvider.name is required");if(typeof provider.getContext!=="function")throw Error("ContextProvider.getContext must be a function");getRegistry().set(provider.name,provider),hostServices?.serviceRegistry?.registerProvider?.(CONTEXT_PROVIDER_TYPE,provider,provider.name)}var CONTEXT_PROVIDER_TYPE="context",REGISTRY_KEY;var init_context=__esm(()=>{REGISTRY_KEY=Symbol.for("@vibecontrols/plugin-sdk:contextProviders@1")});import{join}from"path";import{Elysia}from"elysia";function createLifecycleHooks(spec){let{name,onInit,onShutdown,telemetryEventName,skipPlatforms}=spec;return{onServerStart:async(_app,hostServices)=>{if(skipPlatforms&&skipPlatforms.includes(process.platform)){process.stderr.write(`[${name}] skipping init on unsupported platform '${process.platform}'
|
|
3
|
+
`);return}if(onInit)await onInit(hostServices);if(telemetryEventName)hostServices.telemetry?.emit(telemetryEventName,{plugin:name})},onServerStop:async(hostServices)=>{if(onShutdown)await onShutdown(hostServices)}}}var TelemetryEmitter=class{constructor(pluginName,pluginVersion,hostServices){this.pluginName=pluginName,this.pluginVersion=pluginVersion,this.hostServices=hostServices}pluginName;pluginVersion;hostServices;emit(eventName,payload){let target=this.hostServices?.telemetry;if(!target)return;target.emit(eventName,{plugin:this.pluginName,version:this.pluginVersion,timestamp:new Date().toISOString(),...payload??{}})}emitReady(context){this.emit(`${this.pluginName}.ready`,context)}emitError(error,context){this.emit(`${this.pluginName}.error`,{message:error.message,...context??{}})}emitEvent(type,payload){this.emit(type,payload)}};var PLUGIN_NAME="graphiql",PLUGIN_VERSION="2026.531.1",createPlugin=(_ctx)=>{let lifecycle=createLifecycleHooks({name:PLUGIN_NAME,telemetryEventName:"tool.ready",onInit:(hostServices)=>{new TelemetryEmitter(PLUGIN_NAME,PLUGIN_VERSION,hostServices).emitEvent("tool.ready",{provider:"graphiql"})}});return{capabilities:{storage:"rw",subprocess:!0,audit:!0,telemetry:!0},name:PLUGIN_NAME,version:PLUGIN_VERSION,description:"GraphQL Playground (GraphiQL)",tags:["frontend","integration"],hasUI:!0,apiPrefix:"/api/graphiql",ui:{staticDir:join(import.meta.dir,"ui"),title:"GraphQL Playground",icon:"Network",capabilities:{restPaths:["/ui/graphiql","/api/plugins/graphiql/ui"],wsTopics:[],rpcMethods:["getContext"]},contributions:[{mountPoint:"vibe.detailTab",id:"plugin:graphiql",title:"GraphQL",icon:"Network",order:90,runtimes:["iframe"],capabilities:{restPaths:["/ui/graphiql","/api/plugins/graphiql/ui"],wsTopics:[],rpcMethods:["getContext"]}}]},async onServerStart(app,hostServices){await lifecycle.onServerStart(app,hostServices);let elysiaApp=app;await Promise.resolve().then(() => init_routes2());elysiaApp.use(createGraphiQLRoutes(hostServices)),elysiaApp.use(createGraphiQLUIRoutes(hostServices)),process.stdout.write(` Plugin 'graphiql' registered routes: /api/graphiql, /api/plugins/graphiql/ui
|
|
4
|
+
`)},onServerStop:lifecycle.onServerStop,async onServerReady(){try{let sdkContext=await Promise.resolve().then(() => (init_context(),{}));registerContextProvider?.({name:"tool-graphiql",timeoutMs:500,async getContext(){return{pluginName:"tool-graphiql",description:"GraphiQL playground capability metadata for the LLM Context feature.",data:{pluginVersion:PLUGIN_VERSION,apiPrefix:"/api/plugins/graphiql/ui"}}}})}catch{}}}},src_default=createPlugin;export{createPlugin,src_default as default};
|
package/package.json
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibecontrols/vibe-plugin-tool-graphiql",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1108.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
|
-
"bun": ">=1.
|
|
7
|
+
"bun": ">=1.4.4"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "bun build ./src/index.ts --outdir ./dist --target bun --minify-syntax --minify-whitespace --external elysia && tsc
|
|
11
|
-
"dev": "tsc --watch",
|
|
12
|
-
"lint": "eslint
|
|
13
|
-
"format": "
|
|
14
|
-
"format:check": "
|
|
15
|
-
"type:check": "
|
|
10
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target bun --minify-syntax --minify-whitespace --external elysia && tsc -p tsconfig.build.json && mkdir -p ./dist/ui && cp -r ./src/ui/. ./dist/ui/",
|
|
11
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"format": "bun fmt",
|
|
14
|
+
"format:check": "bun fmt --check",
|
|
15
|
+
"type:check": "boff gate -- bun check --no-pretty",
|
|
16
16
|
"clean": "rimraf dist",
|
|
17
17
|
"prebuild": "bun run clean",
|
|
18
18
|
"prepublishOnly": "bun run build",
|
|
19
|
-
"sanity": "
|
|
19
|
+
"sanity": "boff sanity",
|
|
20
|
+
"test": "bun test",
|
|
21
|
+
"sanity:force": "boff sanity --force",
|
|
22
|
+
"audit": "bun audit --audit-level=high"
|
|
20
23
|
},
|
|
21
24
|
"keywords": [
|
|
22
25
|
"vibecontrols",
|
|
@@ -34,16 +37,14 @@
|
|
|
34
37
|
"license": "MIT",
|
|
35
38
|
"description": "GraphQL Playground (GraphiQL) — embedded in VibeControls agent",
|
|
36
39
|
"devDependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@types/bun": "^1.
|
|
40
|
+
"@burdenoff/toolchain": "2026.1107.14",
|
|
41
|
+
"@types/bun": "^1.4.4",
|
|
39
42
|
"commander": "^14.0.3",
|
|
40
|
-
"elysia": "^1.
|
|
41
|
-
"eslint": "^9.
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"typescript": "^5.8.3",
|
|
46
|
-
"typescript-eslint": "^8.56.0"
|
|
43
|
+
"elysia": "^1.4.29",
|
|
44
|
+
"eslint": "^9.39.5",
|
|
45
|
+
"knip": "^6.44.1",
|
|
46
|
+
"rimraf": "^6.1.4",
|
|
47
|
+
"typescript": "6.0.3"
|
|
47
48
|
},
|
|
48
49
|
"peerDependencies": {
|
|
49
50
|
"elysia": ">=1.3.0"
|
|
@@ -55,10 +56,10 @@
|
|
|
55
56
|
},
|
|
56
57
|
"repository": {
|
|
57
58
|
"type": "git",
|
|
58
|
-
"url": "git+https://github.com/
|
|
59
|
+
"url": "git+https://github.com/Algoshred/vibe-plugin-tool-graphiql.git"
|
|
59
60
|
},
|
|
60
61
|
"bugs": {
|
|
61
|
-
"url": "https://github.com/
|
|
62
|
+
"url": "https://github.com/Algoshred/vibe-plugin-tool-graphiql/issues"
|
|
62
63
|
},
|
|
63
64
|
"homepage": "https://vibecontrols.com",
|
|
64
65
|
"publishConfig": {
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
"fast-xml-parser": ">=4.5.5",
|
|
80
81
|
"@xmldom/xmldom": ">=0.8.12",
|
|
81
82
|
"swiper": ">=12.1.2",
|
|
82
|
-
"brace-expansion": ">=
|
|
83
|
+
"brace-expansion": ">=5.0.12",
|
|
83
84
|
"follow-redirects": ">=1.15.12",
|
|
84
85
|
"smol-toml": ">=1.6.1",
|
|
85
86
|
"axios": ">=1.15.0",
|
|
@@ -91,5 +92,18 @@
|
|
|
91
92
|
},
|
|
92
93
|
"dependencies": {
|
|
93
94
|
"@vibecontrols/plugin-sdk": "2026.527.1"
|
|
95
|
+
},
|
|
96
|
+
"packageManager": "bun@1.4.4",
|
|
97
|
+
"boff": {
|
|
98
|
+
"type": "plugin",
|
|
99
|
+
"sanity": {
|
|
100
|
+
"steps": [
|
|
101
|
+
"format",
|
|
102
|
+
"lint",
|
|
103
|
+
"typecheck",
|
|
104
|
+
"build",
|
|
105
|
+
"knip"
|
|
106
|
+
]
|
|
107
|
+
}
|
|
94
108
|
}
|
|
95
109
|
}
|