-
-
Notifications
You must be signed in to change notification settings - Fork 4
Release/v3.0.0 with breaking changes #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Winify
wants to merge
4
commits into
main
Choose a base branch
from
release/v3.0.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fbc17e7
feat: Add `launch_chrome` tool for launching Chrome with remote debug…
Winify 5146194
feat!: Initial commit for v3.0.0
Winify 49fba1b
refactor: Separate MCP resources from tools
Winify c75d720
fix: Use `z.coerce` to correctly manage booleans with OpenCode and Codex
Winify File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install Dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Lint & Type Check | ||
| run: pnpm run lint | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # MCP Resources — Notes | ||
|
|
||
| ## Template resources are not discoverable via ListResources | ||
|
|
||
| The `session-steps` resource uses a URI template (`wdio://session/{sessionId}/steps`) and does | ||
| not appear in `ListMcpResourcesTool` output. Only fixed-URI resources (`wdio://sessions`, | ||
| `wdio://session/current/steps`) are listed. | ||
|
|
||
| Template resources must be read directly by constructing the URI — clients cannot discover them | ||
| through the standard list call. If client discoverability matters, consider documenting the | ||
| template pattern in the fixed `wdio://sessions` index response, or exposing a separate resource | ||
| that advertises available URI templates. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| import type { SessionProvider, ConnectionConfig } from './types'; | ||
| import { buildIOSCapabilities, buildAndroidCapabilities, getAppiumServerConfig } from '../config/appium.config'; | ||
|
|
||
| export type LocalAppiumOptions = { | ||
| platform: 'iOS' | 'Android'; | ||
| appPath?: string; | ||
| deviceName: string; | ||
| platformVersion?: string; | ||
| automationName?: string; | ||
| appiumHost?: string; | ||
| appiumPort?: number; | ||
| appiumPath?: string; | ||
| autoGrantPermissions?: boolean; | ||
| autoAcceptAlerts?: boolean; | ||
| autoDismissAlerts?: boolean; | ||
| appWaitActivity?: string; | ||
| udid?: string; | ||
| noReset?: boolean; | ||
| fullReset?: boolean; | ||
| newCommandTimeout?: number; | ||
| capabilities?: Record<string, unknown>; | ||
| }; | ||
|
|
||
| export class LocalAppiumProvider implements SessionProvider { | ||
| name = 'local-appium'; | ||
|
|
||
| getConnectionConfig(options: Record<string, unknown>): ConnectionConfig { | ||
| const config = getAppiumServerConfig({ | ||
| hostname: options.appiumHost as string | undefined, | ||
| port: options.appiumPort as number | undefined, | ||
| path: options.appiumPath as string | undefined, | ||
| }); | ||
| return { protocol: 'http', ...config }; | ||
| } | ||
|
|
||
| buildCapabilities(options: Record<string, unknown>): Record<string, unknown> { | ||
| const platform = options.platform as string; | ||
| const appPath = options.appPath as string | undefined; | ||
| const deviceName = options.deviceName as string; | ||
| const platformVersion = options.platformVersion as string | undefined; | ||
| const autoGrantPermissions = options.autoGrantPermissions as boolean | undefined; | ||
| const autoAcceptAlerts = options.autoAcceptAlerts as boolean | undefined; | ||
| const autoDismissAlerts = options.autoDismissAlerts as boolean | undefined; | ||
| const udid = options.udid as string | undefined; | ||
| const noReset = options.noReset as boolean | undefined; | ||
| const fullReset = options.fullReset as boolean | undefined; | ||
| const newCommandTimeout = options.newCommandTimeout as number | undefined; | ||
| const appWaitActivity = options.appWaitActivity as string | undefined; | ||
| const userCapabilities = (options.capabilities as Record<string, unknown> | undefined) ?? {}; | ||
|
|
||
| const capabilities: Record<string, any> = platform === 'iOS' | ||
| ? buildIOSCapabilities(appPath, { | ||
| deviceName, | ||
| platformVersion, | ||
| automationName: (options.automationName as 'XCUITest') || 'XCUITest', | ||
| autoGrantPermissions, | ||
| autoAcceptAlerts, | ||
| autoDismissAlerts, | ||
| udid, | ||
| noReset, | ||
| fullReset, | ||
| newCommandTimeout, | ||
| }) | ||
| : buildAndroidCapabilities(appPath, { | ||
| deviceName, | ||
| platformVersion, | ||
| automationName: (options.automationName as 'UiAutomator2' | 'Espresso') || 'UiAutomator2', | ||
| autoGrantPermissions, | ||
| autoAcceptAlerts, | ||
| autoDismissAlerts, | ||
| appWaitActivity, | ||
| noReset, | ||
| fullReset, | ||
| newCommandTimeout, | ||
| }); | ||
|
|
||
| const mergedCapabilities = { | ||
| ...capabilities, | ||
| ...userCapabilities, | ||
| }; | ||
|
|
||
| for (const [key, value] of Object.entries(mergedCapabilities)) { | ||
| if (value === undefined) { | ||
| delete mergedCapabilities[key]; | ||
| } | ||
| } | ||
|
|
||
| return mergedCapabilities; | ||
| } | ||
|
|
||
| getSessionType(options: Record<string, unknown>): 'ios' | 'android' { | ||
| const platform = options.platform as string; | ||
| return platform.toLowerCase() as 'ios' | 'android'; | ||
| } | ||
|
|
||
| shouldAutoDetach(options: Record<string, unknown>): boolean { | ||
| return options.noReset === true || !options.appPath; | ||
| } | ||
| } | ||
|
|
||
| export const localAppiumProvider = new LocalAppiumProvider(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| import type { SessionProvider, ConnectionConfig } from './types'; | ||
|
|
||
| export type LocalBrowserOptions = { | ||
| browser?: 'chrome' | 'firefox' | 'edge' | 'safari'; | ||
| headless?: boolean; | ||
| windowWidth?: number; | ||
| windowHeight?: number; | ||
| capabilities?: Record<string, unknown>; | ||
| }; | ||
|
|
||
| export class LocalBrowserProvider implements SessionProvider { | ||
| name = 'local-browser'; | ||
|
|
||
| getConnectionConfig(_options: Record<string, unknown>): ConnectionConfig { | ||
| return {}; // local — use WebdriverIO defaults | ||
| } | ||
|
|
||
| buildCapabilities(options: Record<string, unknown>): Record<string, unknown> { | ||
| const selectedBrowser = (options.browser as string | undefined) ?? 'chrome'; | ||
| const headless = (options.headless as boolean | undefined) ?? true; | ||
| const windowWidth = (options.windowWidth as number | undefined) ?? 1920; | ||
| const windowHeight = (options.windowHeight as number | undefined) ?? 1080; | ||
| const userCapabilities = (options.capabilities as Record<string, unknown> | undefined) ?? {}; | ||
|
|
||
| const headlessSupported = selectedBrowser !== 'safari'; | ||
| const effectiveHeadless = headless && headlessSupported; | ||
|
|
||
| const chromiumArgs = [ | ||
| `--window-size=${windowWidth},${windowHeight}`, | ||
| '--no-sandbox', | ||
| '--disable-search-engine-choice-screen', | ||
| '--disable-infobars', | ||
| '--log-level=3', | ||
| '--use-fake-device-for-media-stream', | ||
| '--use-fake-ui-for-media-stream', | ||
| '--disable-web-security', | ||
| '--allow-running-insecure-content', | ||
| ]; | ||
|
|
||
| if (effectiveHeadless) { | ||
| chromiumArgs.push('--headless=new'); | ||
| chromiumArgs.push('--disable-gpu'); | ||
| chromiumArgs.push('--disable-dev-shm-usage'); | ||
| } | ||
|
|
||
| const firefoxArgs: string[] = []; | ||
| if (effectiveHeadless && selectedBrowser === 'firefox') { | ||
| firefoxArgs.push('-headless'); | ||
| } | ||
|
|
||
| const capabilities: Record<string, any> = { | ||
| acceptInsecureCerts: true, | ||
| }; | ||
|
|
||
| switch (selectedBrowser) { | ||
| case 'chrome': | ||
| capabilities.browserName = 'chrome'; | ||
| capabilities['goog:chromeOptions'] = { args: chromiumArgs }; | ||
| break; | ||
| case 'edge': | ||
| capabilities.browserName = 'msedge'; | ||
| capabilities['ms:edgeOptions'] = { args: chromiumArgs }; | ||
| break; | ||
| case 'firefox': | ||
| capabilities.browserName = 'firefox'; | ||
| if (firefoxArgs.length > 0) { | ||
| capabilities['moz:firefoxOptions'] = { args: firefoxArgs }; | ||
| } | ||
| break; | ||
| case 'safari': | ||
| capabilities.browserName = 'safari'; | ||
| break; | ||
| } | ||
|
|
||
| const mergedCapabilities: Record<string, unknown> = { | ||
| ...capabilities, | ||
| ...userCapabilities, | ||
| 'goog:chromeOptions': this.mergeCapabilityOptions(capabilities['goog:chromeOptions'], userCapabilities['goog:chromeOptions']), | ||
| 'ms:edgeOptions': this.mergeCapabilityOptions(capabilities['ms:edgeOptions'], userCapabilities['ms:edgeOptions']), | ||
| 'moz:firefoxOptions': this.mergeCapabilityOptions(capabilities['moz:firefoxOptions'], userCapabilities['moz:firefoxOptions']), | ||
| }; | ||
|
|
||
| for (const [key, value] of Object.entries(mergedCapabilities)) { | ||
| if (value === undefined) { | ||
| delete mergedCapabilities[key]; | ||
| } | ||
| } | ||
|
|
||
| return mergedCapabilities; | ||
| } | ||
|
|
||
| getSessionType(_options: Record<string, unknown>): 'browser' { | ||
| return 'browser'; | ||
| } | ||
|
|
||
| shouldAutoDetach(_options: Record<string, unknown>): boolean { | ||
| return false; | ||
| } | ||
|
|
||
| private mergeCapabilityOptions(defaultOptions: unknown, customOptions: unknown): unknown { | ||
| if (!defaultOptions || typeof defaultOptions !== 'object' || !customOptions || typeof customOptions !== 'object') { | ||
| return customOptions ?? defaultOptions; | ||
| } | ||
|
|
||
| const defaultRecord = defaultOptions as Record<string, unknown>; | ||
| const customRecord = customOptions as Record<string, unknown>; | ||
| const merged = { ...defaultRecord, ...customRecord }; | ||
| if (Array.isArray(defaultRecord.args) || Array.isArray(customRecord.args)) { | ||
| merged.args = [ | ||
| ...(Array.isArray(defaultRecord.args) ? defaultRecord.args : []), | ||
| ...(Array.isArray(customRecord.args) ? customRecord.args : []), | ||
| ]; | ||
| } | ||
| return merged; | ||
| } | ||
| } | ||
|
|
||
| export const localBrowserProvider = new LocalBrowserProvider(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export interface ConnectionConfig { | ||
| hostname?: string; | ||
| port?: number; | ||
| path?: string; | ||
| protocol?: string; | ||
| } | ||
|
|
||
| export interface SessionProvider { | ||
| name: string; | ||
| getConnectionConfig(options: Record<string, unknown>): ConnectionConfig; | ||
| buildCapabilities(options: Record<string, unknown>): Record<string, unknown>; | ||
| getSessionType(options: Record<string, unknown>): 'browser' | 'ios' | 'android'; | ||
| shouldAutoDetach(options: Record<string, unknown>): boolean; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI about 10 hours ago
In general, the fix is to explicitly declare a
permissionsblock in the workflow so theGITHUB_TOKENhas only the scopes required for the job. For a simple lint job that only checks out code and runs local commands, read access to repository contents is sufficient.The best fix here is to add a
permissionssection at the top level of.github/workflows/lint.yml, alongsidenameandon, settingcontents: read. This will apply to all jobs in the workflow (currently justlint) and avoids changing any job steps or behavior. No additional imports or libraries are needed; we are only modifying the YAML configuration. Concretely, insert:between the
name: Lintline and theon:block, i.e., after line 1 and before line 3 in the provided snippet.