{"_id":"@agentwebskills/web-skills","_rev":"3-2e17fa315d0eb9a4195dcb45a83655a3","name":"@agentwebskills/web-skills","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@agentwebskills/web-skills","version":"0.1.0","_id":"@agentwebskills/web-skills@0.1.0","maintainers":[{"name":"webskillsdev","email":"liamh@hey.com"}],"dist":{"shasum":"cad67eb757c4f8051817c5fae7e698b53e774225","tarball":"https://registry.npmjs.org/@agentwebskills/web-skills/-/web-skills-0.1.0.tgz","fileCount":7,"integrity":"sha512-cDw8unoR54QWCnOMjoMHqZXqBEYI+a1+ft27UgHW/n3uh2VhXWUY6vXwE6mfDfXuMki6wOfBLrS2ga+qK9UEZA==","signatures":[{"sig":"MEUCIDMxm1f9ESew3/kNxL6KzUn1yCB0LxLhBSEdVpVLOxtAAiEA/YXA/ek2hUdt6HVBPuIVVoqGsHo7YOBmD5fztyJ5orY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":111693},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"963f0cdcbf4e9138a99daf78b487a628ad4c9a2f","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"webskillsdev","email":"liamh@hey.com"},"_npmVersion":"11.3.0","description":"Browser skill execution engine for AI agents","directories":{},"_nodeVersion":"24.1.0","dependencies":{"zod":"^3.24.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^2.1.0","happy-dom":"^15.11.0","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/web-skills_0.1.0_1773442124159_0.9254130850388036","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@agentwebskills/web-skills","version":"0.2.0","_id":"@agentwebskills/web-skills@0.2.0","maintainers":[{"name":"webskillsdev","email":"liamh@hey.com"}],"dist":{"shasum":"4530840e5a4294796eb8249315c81a638bec176c","tarball":"https://registry.npmjs.org/@agentwebskills/web-skills/-/web-skills-0.2.0.tgz","fileCount":8,"integrity":"sha512-81gIfb6M59gv6MkM1bfwKCz1nnuNxU7oEz9r4wBUpwaABw/ISq3odkFP9jzbWpxuqrkAzPDa2+Xe98khkCoMNQ==","signatures":[{"sig":"MEYCIQCiYdNaoHsHzNX+Yhx+7VrcfhWF9F5LbtuUGxmw717okgIhAPbY7p/8+YHxon4PFv2tDugnjP0UH10vvBP9imGfriOY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120159},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"d63694e9ab3b17af4de31ce8a1e7e7f9cbccafe8","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"webskillsdev","email":"liamh@hey.com"},"_npmVersion":"11.3.0","description":"Browser skill execution engine for AI agents","directories":{},"_nodeVersion":"24.1.0","dependencies":{"zod":"^3.24.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.0","vitest":"^2.1.0","happy-dom":"^15.11.0","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/web-skills_0.2.0_1774658927913_0.5996291608671296","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@agentwebskills/web-skills","version":"0.4.0","description":"Browser skill execution engine for AI agents","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"bin":{"web-skills":"dist/cli/build.js"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit"},"dependencies":{"esbuild":"^0.24.0","zod":"^3.24.0"},"devDependencies":{"@types/node":"^25.5.0","happy-dom":"^15.11.0","tsup":"^8.3.0","typescript":"^5.7.0","vitest":"^2.1.0"},"_id":"@agentwebskills/web-skills@0.4.0","gitHead":"c5ea1afb8d2ebbb5590e33659f015e372d603ce4","_nodeVersion":"24.1.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-syXhbXAQ9vu7B0vJsYjaFfHfd0CowJ77CqLrp4kts2fBu0IYNJYFUFwRS+MFED+D45L0xkX2fK9OB1Xwf5kM4Q==","shasum":"7d5a45aa77945a4852664d1cf08306f1d9c50266","tarball":"https://registry.npmjs.org/@agentwebskills/web-skills/-/web-skills-0.4.0.tgz","fileCount":10,"unpackedSize":131192,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEVRthQROk5O3QfmCZcemmgcFjy1IJXhAi4BTPzFYX83AiEA/jEWFMMxLgDNvr4KuiEzCh8hcDZaBFw2ll/kLzzHOow="}]},"_npmUser":{"name":"webskillsdev","email":"liamh@hey.com"},"directories":{},"maintainers":[{"name":"webskillsdev","email":"liamh@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/web-skills_0.4.0_1775347167766_0.5933349736690601"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-13T22:48:44.082Z","modified":"2026-04-04T23:59:28.059Z","0.1.0":"2026-03-13T22:48:44.304Z","0.2.0":"2026-03-28T00:48:48.068Z","0.4.0":"2026-04-04T23:59:27.925Z"},"description":"Browser skill execution engine for AI agents","maintainers":[{"name":"webskillsdev","email":"liamh@hey.com"}],"readme":"# @agentwebskills/web-skills\n\nA browser skill execution engine for AI agents. Define skills in [AgentSkills.io](https://agentskills.io) format and execute them in the browser — HTTP requests, DOM interactions, and semantic element targeting.\n\n## Install\n\n```bash\nnpm install @agentwebskills/web-skills\n```\n\n## Quick start\n\nDefine a skill in a `SKILL.md` file with embedded JSON:\n\n````md\n---\nname: github-skill\ndescription: Create GitHub issues via the GitHub API.\n---\n\n# GitHub Skill\n\n## createGithubIssue\n\nCreate a GitHub issue in a repository.\n\nParameters:\n- owner (string): Repository owner\n- repo (string): Repository name\n- title (string): Issue title\n- token (string): GitHub personal access token\n\n```json\n{\n  \"name\": \"createGithubIssue\",\n  \"type\": \"http\",\n  \"parameters\": {\n    \"owner\": \"string\",\n    \"repo\": \"string\",\n    \"title\": \"string\",\n    \"token\": \"string\"\n  },\n  \"request\": {\n    \"method\": \"POST\",\n    \"url\": \"https://api.github.com/repos/{owner}/{repo}/issues\",\n    \"headers\": {\n      \"Authorization\": \"Bearer {token}\"\n    },\n    \"body\": {\n      \"title\": \"{title}\"\n    }\n  }\n}\n```\n````\n\nBuild the skill bundle:\n\n```bash\nnpx web-skills build ./my-skill\n```\n\nThis produces `scripts/skill-bundle.js` — a self-contained IIFE that can be injected into any browser page via Playwright or similar. Once injected, skills are available at `window.webSkill`:\n\n```js\nconst result = await window.webSkill.execute(\"createGithubIssue\", {\n  owner: \"myorg\",\n  repo: \"myrepo\",\n  title: \"Bug report\",\n  token: \"ghp_...\"\n})\n```\n\n## Creating a skill\n\nA skill follows the [AgentSkills.io](https://agentskills.io) format:\n\n```\nmy-skill/\n├── SKILL.md              # Metadata + instructions + JSON definitions\n└── scripts/\n    └── skill-bundle.js   # Generated by `npx web-skills build`\n```\n\nThe `SKILL.md` must include:\n- A `## How to execute` section that tells the agent to use the browser (prevents curl execution)\n- A **Target URL** for each function — where the agent should navigate before calling it\n  - `about:blank` for HTTP-only skills (API calls work from any page)\n  - The actual site URL for DOM/semantic skills (e.g. `https://www.paknsave.co.nz/login`)\n\nEach JSON definition can include an optional `target_url` field for programmatic access.\n\nSee `examples/github-skill/SKILL.md` for a complete example.\n\n## Skill types\n\n### `http` — API requests\n\nMake HTTP requests with interpolated parameters in URLs, headers, and body.\n\n```json\n{\n  \"name\": \"fetchUser\",\n  \"type\": \"http\",\n  \"target_url\": \"about:blank\",\n  \"parameters\": { \"id\": \"string\" },\n  \"request\": {\n    \"method\": \"GET\",\n    \"url\": \"https://api.example.com/users/{id}\"\n  }\n}\n```\n\n### `dom` — DOM interactions\n\nClick, type, wait, select, and extract data using CSS selectors.\n\n```json\n{\n  \"name\": \"login\",\n  \"type\": \"dom\",\n  \"target_url\": \"https://example.com/login\",\n  \"parameters\": { \"email\": \"string\", \"password\": \"string\" },\n  \"steps\": [\n    { \"action\": \"type\", \"selector\": \"#email\", \"value\": \"{email}\" },\n    { \"action\": \"type\", \"selector\": \"#password\", \"value\": \"{password}\" },\n    { \"action\": \"click\", \"selector\": \"#login-button\" }\n  ]\n}\n```\n\n### `semantic_dom` — Semantic element targeting\n\nTarget elements by description instead of CSS selectors. Uses ARIA labels and text content to find elements.\n\n```json\n{\n  \"name\": \"addToCart\",\n  \"type\": \"semantic_dom\",\n  \"target_url\": \"https://example.com/products\",\n  \"parameters\": { \"product\": \"string\" },\n  \"steps\": [\n    { \"action\": \"click\", \"description\": \"Add to cart button for {product}\" }\n  ]\n}\n```\n\n## API\n\n### `SkillEngine.fromMarkdown(md: string): SkillEngine`\n\nCreate an engine from a `SKILL.md` file. Parses all JSON code blocks as skill definitions.\n\n### `new SkillEngine({ skills, executors? })`\n\nCreate an engine from raw skill definition objects. Optionally pass custom executors.\n\n### `engine.execute(name: string, args?: Record<string, unknown>): Promise<ExecutionResult>`\n\nExecute a skill by name with the given arguments.\n\n### `engine.getSkillNames(): string[]`\n\nList all registered skill names.\n\n### `engine.registerExecutor(type: string, executor: Executor)`\n\nRegister a custom executor for a new skill type.\n\n## Development\n\n```bash\nnpm run build       # Build with tsup\nnpm test            # Run tests\nnpm run typecheck   # Type-check without emitting\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}