gsclaw 0.1.0 → 0.1.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/adapters/netlify.js +1 -1
- package/dist/adapters/node-http.js +1 -1
- package/dist/adapters/stdio.js +2 -2
- package/dist/adapters/vercel.js +1 -1
- package/dist/{app-DdGjQNXR.js → app-DhK9JWEH.js} +2 -2
- package/dist/{app-DdGjQNXR.js.map → app-DhK9JWEH.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{node-http-DW9OenCi.js → node-http-BBSleZ3g.js} +2 -2
- package/dist/{node-http-DW9OenCi.js.map → node-http-BBSleZ3g.js.map} +1 -1
- package/package.json +27 -16
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as VERSION, i as REPO_URL, l as randomToken } from "./app-
|
|
3
|
-
import { n as startNodeServer, t as SetupError } from "./node-http-
|
|
2
|
+
import { a as VERSION, i as REPO_URL, l as randomToken } from "./app-DhK9JWEH.js";
|
|
3
|
+
import { n as startNodeServer, t as SetupError } from "./node-http-BBSleZ3g.js";
|
|
4
4
|
import { runStdio } from "./adapters/stdio.js";
|
|
5
5
|
//#region src/cli.ts
|
|
6
6
|
const HELP = `GSClaw ${VERSION} — Google Search Console MCP server
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as VERSION, o as formatConfigErrors, t as createApp } from "./app-
|
|
1
|
+
import { a as VERSION, o as formatConfigErrors, t as createApp } from "./app-DhK9JWEH.js";
|
|
2
2
|
import { serve } from "srvx";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { readFile, stat } from "node:fs/promises";
|
|
@@ -115,4 +115,4 @@ async function startNodeServer(opts = {}) {
|
|
|
115
115
|
//#endregion
|
|
116
116
|
export { startNodeServer as n, SetupError as t };
|
|
117
117
|
|
|
118
|
-
//# sourceMappingURL=node-http-
|
|
118
|
+
//# sourceMappingURL=node-http-BBSleZ3g.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-http-
|
|
1
|
+
{"version":3,"file":"node-http-BBSleZ3g.js","names":[],"sources":["../src/adapters/static.ts","../src/adapters/node-http.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { readFile, stat } from 'node:fs/promises';\nimport { extname, join, normalize, sep } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst TYPES: Record<string, string> = {\n '.js': 'text/javascript; charset=utf-8',\n '.css': 'text/css; charset=utf-8',\n '.svg': 'image/svg+xml',\n '.png': 'image/png',\n '.ico': 'image/x-icon',\n '.txt': 'text/plain; charset=utf-8',\n '.json': 'application/json',\n '.map': 'application/json',\n '.woff2': 'font/woff2',\n};\n\n/**\n * Locates dist/public whether we run from the bundle (dist/*.js, dist/adapters/*.js) or from\n * source via tsx (src/adapters/*.ts). GSCLAW_STATIC_DIR overrides.\n */\nexport function findStaticDir(override?: string): string | null {\n const candidates = override\n ? [override]\n : ['./public/', '../public/', '../../dist/public/'].map((rel) =>\n fileURLToPath(new URL(rel, import.meta.url)),\n );\n return candidates.find((dir) => existsSync(dir)) ?? null;\n}\n\n/** Serves files below `root` for GET/HEAD. Returns null when nothing matches. */\nexport function createStaticHandler(root: string): (request: Request) => Promise<Response | null> {\n const base = normalize(root.endsWith(sep) ? root : root + sep);\n return async (request) => {\n let pathname: string;\n try {\n pathname = decodeURIComponent(new URL(request.url).pathname);\n } catch {\n return null;\n }\n if (pathname.includes('\\0')) return null;\n const file = normalize(join(base, pathname));\n if (!file.startsWith(base)) return null; // path traversal\n try {\n const info = await stat(file);\n if (!info.isFile()) return null;\n const etag = `\"${info.size.toString(16)}-${Math.floor(info.mtimeMs).toString(16)}\"`;\n const headers = {\n 'content-type': TYPES[extname(file)] ?? 'application/octet-stream',\n 'cache-control': 'no-cache',\n etag,\n 'x-content-type-options': 'nosniff',\n };\n if (request.headers.get('if-none-match') === etag)\n return new Response(null, { status: 304, headers });\n const body = request.method === 'HEAD' ? null : await readFile(file);\n return new Response(body, { headers: { ...headers, 'content-length': String(info.size) } });\n } catch {\n return null;\n }\n };\n}\n","import { serve } from 'srvx';\nimport { createApp, type App } from '../core/app.js';\nimport { formatConfigErrors, type Env } from '../core/config.js';\nimport { VERSION } from '../core/version.js';\nimport { createStaticHandler, findStaticDir } from './static.js';\n\nexport interface NodeServerOptions {\n env?: Env;\n port?: number;\n /** Defaults to 0.0.0.0 when the platform sets PORT (PaaS/containers), 127.0.0.1 otherwise. */\n host?: string;\n /** Outbound fetch override (tests). */\n fetch?: typeof fetch;\n}\n\nexport interface RunningServer {\n url: string;\n app: App;\n close(): Promise<void>;\n}\n\nexport class SetupError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'SetupError';\n }\n}\n\nconst LOOPBACK = new Set(['127.0.0.1', 'localhost', '::1']);\n\n/** Standalone HTTP server (Docker, DigitalOcean, Render, Railway, Fly, VPS, local dev). */\nexport async function startNodeServer(opts: NodeServerOptions = {}): Promise<RunningServer> {\n const env = opts.env ?? process.env;\n const port = opts.port ?? Number(env.PORT ?? 3000);\n const host = opts.host ?? env.HOST ?? (env.PORT ? '0.0.0.0' : '127.0.0.1');\n\n const staticDir = findStaticDir(env.GSCLAW_STATIC_DIR);\n const app = createApp(env, {\n name: 'node',\n localOnly: LOOPBACK.has(host),\n fetch: opts.fetch,\n serveStatic: staticDir ? createStaticHandler(staticDir) : undefined,\n });\n if (app.setupErrors.length > 0) throw new SetupError(formatConfigErrors(app.setupErrors));\n\n const server = serve({\n fetch: (request) => app.fetch(request),\n port,\n hostname: host,\n silent: true,\n gracefulShutdown: false,\n });\n await server.ready();\n const address = server.node?.server?.address();\n const actualPort = typeof address === 'object' && address ? address.port : port;\n const displayHost = host === '0.0.0.0' || host === '::' ? 'localhost' : host;\n const url = `http://${displayHost}:${actualPort}`;\n app.runtime?.logger.info('gsclaw listening', { url, version: VERSION, mcp: `${url}/mcp` });\n\n return {\n url,\n app,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AI;CAChC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gsclaw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Sink your claws into your Search Console data. A remote-first, one-click-deployable Google Search Console MCP server.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -20,16 +20,40 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"bin": {
|
|
23
|
-
"gsclaw": "
|
|
23
|
+
"gsclaw": "dist/cli.js"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"dist",
|
|
27
27
|
"README.md",
|
|
28
28
|
"LICENSE"
|
|
29
29
|
],
|
|
30
|
+
"packageManager": "pnpm@10.34.6",
|
|
30
31
|
"engines": {
|
|
31
32
|
"node": ">=22"
|
|
32
33
|
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsdown && node scripts/build-dashboard.mjs",
|
|
36
|
+
"dev": "tsx watch src/cli.ts serve",
|
|
37
|
+
"dev:dashboard": "node scripts/build-dashboard.mjs --watch",
|
|
38
|
+
"demo": "tsx scripts/demo.ts",
|
|
39
|
+
"start": "node dist/cli.js serve",
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"test:watch": "vitest",
|
|
42
|
+
"lint": "eslint . && prettier --check .",
|
|
43
|
+
"format": "prettier --write .",
|
|
44
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p dashboard",
|
|
45
|
+
"inspector": "npx @modelcontextprotocol/inspector",
|
|
46
|
+
"prepack": "node scripts/manifest.mjs strip",
|
|
47
|
+
"postpack": "node scripts/manifest.mjs restore"
|
|
48
|
+
},
|
|
49
|
+
"pnpm": {
|
|
50
|
+
"onlyBuiltDependencies": [
|
|
51
|
+
"esbuild"
|
|
52
|
+
],
|
|
53
|
+
"overrides": {
|
|
54
|
+
"sharp": "0.35.5"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
33
57
|
"dependencies": {
|
|
34
58
|
"@modelcontextprotocol/server": "^2.2.0",
|
|
35
59
|
"srvx": "^1.0.5",
|
|
@@ -63,18 +87,5 @@
|
|
|
63
87
|
"description": "Long random secret clients must present. Generate with: openssl rand -hex 32"
|
|
64
88
|
}
|
|
65
89
|
}
|
|
66
|
-
},
|
|
67
|
-
"scripts": {
|
|
68
|
-
"build": "tsdown && node scripts/build-dashboard.mjs",
|
|
69
|
-
"dev": "tsx watch src/cli.ts serve",
|
|
70
|
-
"dev:dashboard": "node scripts/build-dashboard.mjs --watch",
|
|
71
|
-
"demo": "tsx scripts/demo.ts",
|
|
72
|
-
"start": "node dist/cli.js serve",
|
|
73
|
-
"test": "vitest run",
|
|
74
|
-
"test:watch": "vitest",
|
|
75
|
-
"lint": "eslint . && prettier --check .",
|
|
76
|
-
"format": "prettier --write .",
|
|
77
|
-
"typecheck": "tsc --noEmit && tsc --noEmit -p dashboard",
|
|
78
|
-
"inspector": "npx @modelcontextprotocol/inspector"
|
|
79
90
|
}
|
|
80
|
-
}
|
|
91
|
+
}
|