Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Yoke",
"version": "0.1.10",
"version": "0.1.11",
"description": "Let MCP clients drive your signed in Chrome by tab id: tabs, page text, trusted input, screenshots, console, network.",
"icons": {
"16": "icons/16.png",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yoke-mcp",
"version": "0.1.10",
"version": "0.1.11",
"description": "MCP server for the Chrome you are already signed in to. Every tab in every window, addressed by tab id, with no second profile and no browser-wide debugging port.",
"bin": {
"yoke": "dist/cli.js"
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-extension-id.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const bundle = new URL('../extension/browser/background.js', import.meta.url);
if (!existsSync(bundle)) {
throw new Error('extension/browser/background.js is missing. Run `npm run build` before packaging.');
}
const bundleVersion = readFileSync(bundle, 'utf8').match(/io\.github\.hamzahamidi\.yoke/);
const bundleVersion = /io\.github\.hamzahamidi\.yoke/.exec(readFileSync(bundle, 'utf8'));
if (!bundleVersion) {
throw new Error('the built extension does not name the current native messaging host, so it is stale');
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-versions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const manifest = JSON.parse(read('../extension/manifest.json'));

// Read from source rather than dist, so this works before a build.
const serverSource = read('../src/mcp-server.ts');
const found = serverSource.match(/SERVER_VERSION\s*=\s*'([^']+)'/);
const found = /SERVER_VERSION\s*=\s*'([^']+)'/.exec(serverSource);
if (!found) {
throw new Error('could not find SERVER_VERSION in src/mcp-server.ts');
}
Expand Down
2 changes: 1 addition & 1 deletion src/mcp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type { ResultOf } from './protocol.js';
import { ask, ExtensionUnavailable, NOT_CONNECTED } from './socket-client.js';

export const SERVER_NAME = 'yoke';
export const SERVER_VERSION = '0.1.10';
export const SERVER_VERSION = '0.1.11';
export const PROTOCOL_VERSION = '2024-11-05';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/socket-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ export function listEndpoints(): string[] {
if (!existsSync(dir)) { return []; }
return readdirSync(dir)
.filter((name) => endpointIdOf(name) !== undefined)
.sort()
.sort((left, right) => left.localeCompare(right, 'en'))
.map((name) => join(dir, name));
}
9 changes: 9 additions & 0 deletions test/release-checks.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { test } from 'node:test';

test('the extension identifier release check accepts the built extension', async () => {
await import('../scripts/check-extension-id.mjs');
});

test('the version release check accepts matching package, manifest, and server versions', async () => {
await import('../scripts/check-versions.mjs');
});
22 changes: 21 additions & 1 deletion test/socket-path.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
// work: node:path is bound to the real platform at import, so join() keeps
// producing that platform's separators whatever the flag says.
import assert from 'node:assert/strict';
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';

import { LEGACY_ID, endpointIdOf, endpointPathFor } from '../dist/socket-path.js';
import { LEGACY_ID, endpointIdOf, endpointPathFor, listEndpoints } from '../dist/socket-path.js';

const windows = process.platform === 'win32';

Expand All @@ -19,6 +22,23 @@ test('on unix the legacy id is the socket every earlier release used', { skip: w
assert.equal(endpointIdOf('/x/yoke/notes.txt'), undefined);
});

test('on unix listEndpoints returns valid socket paths in alphabetical order', { skip: windows }, () => {
const runtime = mkdtempSync(join(tmpdir(), 'yoke-socket-path-'));
const previous = process.env['XDG_RUNTIME_DIR'];
process.env['XDG_RUNTIME_DIR'] = runtime;
const directory = join(runtime, 'yoke');
mkdirSync(directory);
for (const name of ['b.sock', 'a.sock', 'notes.txt', 'bad id.sock']) {
writeFileSync(join(directory, name), '');
}
try {
assert.deepEqual(listEndpoints(), [join(directory, 'a.sock'), join(directory, 'b.sock')]);
} finally {
if (previous === undefined) { delete process.env['XDG_RUNTIME_DIR']; } else { process.env['XDG_RUNTIME_DIR'] = previous; }
rmSync(runtime, { recursive: true, force: true });
}
});

test('on windows the legacy id is the bare pipe name, and a profile id is suffixed', { skip: !windows }, () => {
const previous = process.env['USERNAME'];
process.env['USERNAME'] = 'hamza';
Expand Down
Loading