💬 Commit message: Update 2026-02-08 04:14:33, 6 files, 36 lines
📁 Files changed: 6 📝 Lines changed: 36 • cli.js • cli.js.map • mcp.js • mcp.js.map • cli.ts • mcp.ts
This commit is contained in:
Vendored
+6
-2
@@ -1,9 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
import { resolve } from 'node:path';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { parseArgs } from 'node:util';
|
||||
import { ClaudeBrowser } from './browser.js';
|
||||
import * as image from './image.js';
|
||||
import { startServer } from './server.js';
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const pkg = JSON.parse(readFileSync(resolve(__dirname, '../package.json'), 'utf-8'));
|
||||
const { values, positionals } = parseArgs({
|
||||
allowPositionals: true,
|
||||
options: {
|
||||
@@ -223,7 +227,7 @@ async function runBrowserMode() {
|
||||
}
|
||||
async function main() {
|
||||
if (values.version) {
|
||||
console.log('claude-browse 0.1.0');
|
||||
console.log(`claude-browse ${pkg.version}`);
|
||||
process.exit(0);
|
||||
}
|
||||
if (values.help) {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+6
-1
@@ -1,10 +1,15 @@
|
||||
#!/usr/bin/env node
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
||||
import { z } from 'zod';
|
||||
import { ClaudeBrowser } from './browser.js';
|
||||
import * as image from './image.js';
|
||||
import { stderrLogger as log } from './logger.js';
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const pkg = JSON.parse(readFileSync(resolve(__dirname, '../package.json'), 'utf-8'));
|
||||
const browser = new ClaudeBrowser({ headless: true, width: 1280, height: 800 });
|
||||
let launched = false;
|
||||
let currentScreenshotBuffer = null;
|
||||
@@ -36,7 +41,7 @@ function withLogging(cmd, fn) {
|
||||
}
|
||||
const server = new McpServer({
|
||||
name: 'claude-browse',
|
||||
version: '0.1.0',
|
||||
version: pkg.version,
|
||||
});
|
||||
// Navigation
|
||||
server.tool('goto', 'Navigate to a URL', { url: z.string().url() }, withLogging('goto', async ({ url }) => {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+7
-2
@@ -1,11 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
import { resolve } from 'node:path';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { parseArgs } from 'node:util';
|
||||
import { ClaudeBrowser } from './browser.js';
|
||||
import * as image from './image.js';
|
||||
import { startServer } from './server.js';
|
||||
import type { ElementInfo } from './types.js';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const pkg = JSON.parse(readFileSync(resolve(__dirname, '../package.json'), 'utf-8'));
|
||||
|
||||
const { values, positionals } = parseArgs({
|
||||
allowPositionals: true,
|
||||
options: {
|
||||
@@ -250,7 +255,7 @@ async function runBrowserMode(): Promise<void> {
|
||||
|
||||
async function main(): Promise<void> {
|
||||
if (values.version) {
|
||||
console.log('claude-browse 0.1.0');
|
||||
console.log(`claude-browse ${pkg.version}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { McpServer, ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
||||
import { z } from 'zod';
|
||||
@@ -6,6 +9,9 @@ import { ClaudeBrowser } from './browser.js';
|
||||
import * as image from './image.js';
|
||||
import { type CommandLike, type ResultLike, stderrLogger as log } from './logger.js';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const pkg = JSON.parse(readFileSync(resolve(__dirname, '../package.json'), 'utf-8'));
|
||||
|
||||
const browser = new ClaudeBrowser({ headless: true, width: 1280, height: 800 });
|
||||
let launched = false;
|
||||
let currentScreenshotBuffer: Buffer | null = null;
|
||||
@@ -45,7 +51,7 @@ function withLogging<T extends Record<string, unknown>>(
|
||||
|
||||
const server = new McpServer({
|
||||
name: 'claude-browse',
|
||||
version: '0.1.0',
|
||||
version: pkg.version,
|
||||
});
|
||||
|
||||
// Navigation
|
||||
|
||||
Reference in New Issue
Block a user