mirror of
https://github.com/stablyai/orca.git
synced 2026-09-23 00:02:29 +00:00
Migrate fileURLToPath(import.meta.url) / dirname(...) boilerplate to the
native import.meta.dirname / import.meta.filename, then enable the rule
at error so new code stays on the native form.
The oxlint autofix rewrites the expression but leaves the now-unused
node:url / node:path imports behind (which the already-enabled
no-unused-vars=error would then flag), so this commit also removes those
34 orphaned imports — trimming the named import where other names are
still used, deleting the line where it was the sole import.
Scope is build scripts + Node-env tests only (config/scripts, tools/
benchmarks, *.test.{ts,mjs}, vitest configs); zero shipped runtime code.
The native properties are exact equivalents (Node >= 20.11; repo is on
24), so behavior is unchanged.
Verified: oxlint 0 errors tree-wide (root + mobile), oxfmt clean,
typecheck (node+cli+web) + mobile tsc pass, root vitest 22825 passed /
0 failed, mobile vitest 1018 passed. Exercised the rewritten scripts
directly: build:relay (6 targets), ensure-native-runtime,
verify-macos-entitlements all run correctly with import.meta.dirname.
37 lines
1.5 KiB
JavaScript
37 lines
1.5 KiB
JavaScript
import { readFileSync } from 'node:fs'
|
|
import { join, resolve } from 'node:path'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const projectDir = resolve(import.meta.dirname, '../..')
|
|
const skillPath = join(projectDir, 'skills', 'computer-use', 'SKILL.md')
|
|
|
|
describe('computer-use skill guidance', () => {
|
|
it('keeps web-app targeting on the computer-use surface', () => {
|
|
const skill = readFileSync(skillPath, 'utf8')
|
|
|
|
expect(skill).toContain('Use this skill for desktop UI through `orca computer`')
|
|
expect(skill).toContain('operate the desktop browser app/window that contains the page')
|
|
expect(skill).not.toContain('orca goto')
|
|
expect(skill).not.toContain('orca snapshot')
|
|
expect(skill).not.toContain('orca click')
|
|
expect(skill).not.toContain('orca fill')
|
|
expect(skill).not.toContain('Routing:')
|
|
})
|
|
|
|
it('warns agents to verify browser-hosted form focus before drafting text', () => {
|
|
const skill = readFileSync(skillPath, 'utf8')
|
|
|
|
expect(skill).toContain('For browser-hosted forms such as Gmail compose')
|
|
expect(skill).toContain('verify the focused UI element after each field action')
|
|
expect(skill).toContain('Prefer `paste-text` into the verified focused field')
|
|
})
|
|
|
|
it('warns agents about occluded Linux and Windows screenshots', () => {
|
|
const skill = readFileSync(skillPath, 'utf8')
|
|
|
|
expect(skill).toContain('On Linux and Windows')
|
|
expect(skill).toContain('use `--restore-window` so another window does not cover')
|
|
expect(skill).toContain('trust the tree over potentially occluded pixels')
|
|
})
|
|
})
|