diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d265e68 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,71 @@ +name: Release & Publish Apify OpenCode Plugin + +on: + release: + types: [published] + +permissions: + id-token: write + contents: write + +jobs: + build_and_release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Set up Node.js & cache npm + uses: actions/setup-node@v6 + with: + node-version: '24.x' + registry-url: 'https://registry.npmjs.org' + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Type check + run: npm run check + + - name: Build project + run: npm run build + + - name: Verify plugin assets exist + run: | + test -f agents/apify.md + test -f instructions/apify-routing.md + test -d skills + + - name: Extract release version + id: get_version + run: | + FULL_TAG_NAME="${{ github.event.release.tag_name }}" + VERSION_NUMBER="${FULL_TAG_NAME#v}" + echo "VERSION=${VERSION_NUMBER}" >> $GITHUB_ENV + + - name: Update package.json version + run: | + echo "Updating package.json to version ${{ env.VERSION }}" + npm version ${{ env.VERSION }} --no-git-tag-version + + - name: Commit version update + uses: apify/actions/signed-commit@v1.1.2 + with: + message: "chore(release): set version to ${{ env.VERSION }} [skip ci]" + add: 'package.json' + github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} + branch: ${{ github.event.release.target_commitish }} + + - name: Publish to npm + run: | + if npm view opencode-apify@${{ env.VERSION }} version > /dev/null 2>&1; then + echo "Version ${{ env.VERSION }} of opencode-apify is already published to npm. Skipping publish step." + else + echo "Publishing opencode-apify@${{ env.VERSION }} to npm..." + npm publish --provenance --access public + fi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2d59d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/node_modules +/dist \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..eb45d9c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to the **Apify for Open Code** plugin are documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.0] — Initial Open Code release + +### Added +- `apify` setup with agent, skills, rules and MCP server configuration. +- Apache-2.0 license. \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ce2a292 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018 Apify Technologies s.r.o. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index 2c142a1..64aac1a 100644 --- a/README.md +++ b/README.md @@ -1 +1,169 @@ -# apify-opencode-plugin +# Apify for Open Code + +Official Apify plugin for [Open Code](https://opencode.ai) — adds the Apify MCP server, one `apify` routing agent, and five bundled skills for the main Apify workflows: using existing Actors, building and deploying your own Actors, actorizing existing projects, generating Actor output schemas, and integrating Apify into existing applications. + +> **Apify** is a platform of thousands of serverless cloud programs called **Actors** for web scraping, browser automation, and data extraction. Learn more at [apify.com](https://apify.com). + +## What you get + +| Component | Name | Purpose | +|---|---|---| +| Agent (entry point) | `apify` | Routes every Apify request to the right skill or transport path. **This is the one you should invoke.** | +| MCP server | `apify` (`https://mcp.apify.com/`) | Lets the agent search the Apify Store, fetch Actor details, run Actors, and read the Apify docs. | +| Skill | `apify-actor-development` | Create, debug, and deploy a brand new Apify Actor from scratch. | +| Skill | `apify-actorization` | Convert an existing JS/TS, Python, or CLI project into an Apify Actor. | +| Skill | `apify-generate-output-schema` | Generate `dataset_schema.json` / `output_schema.json` / `key_value_store_schema.json` for an existing Actor. | +| Skill | `apify-sdk-integration` | Add Apify Actor execution to an existing application using the `apify-client` package. | +| Skill | `apify-ultimate-scraper` | CLI-driven data extraction workflow for selecting, configuring, and running pre-built Actors across 15+ platforms. | + + +## Prerequisites + +- **Open Code** CLI installed ([opencode.ai](https://opencode.ai)). + +## First-run setup + +The plugin uses **three setup paths** depending on what you're doing. The `apify` agent will guide you through the right one, but here is the high-level map. + +### Path 1 — Using existing Actors through MCP + +Uses **OAuth**. The first time the agent calls a tool that needs auth (for example `call-actor` or `get-dataset-items`), Open Code opens `console.apify.com` in your browser and asks you to sign in. Read-only tools such as `search-actors`, `fetch-actor-details`, `search-apify-docs`, and `fetch-apify-docs` work without auth. + +### Path 2 — CLI workflows for Actor development, actorization, or scraper runs + +These skills expect the local `apify` CLI to be available. Install it first: + +```bash +npm install -g apify-cli +``` + +For interactive use, authenticate with: + +```bash +apify login +``` + +In headless or CI environments, export an **`APIFY_TOKEN`** instead; the CLI can read it automatically: + +```bash +export APIFY_TOKEN="apify_api_xxxxxxxxxxxx" +``` + +Generate a token at [console.apify.com/settings/integrations](https://console.apify.com/settings/integrations). Don't have an account? [Sign up free](https://console.apify.com/sign-up) — no credit card required. + +### Path 3 — SDK integration into an existing application + +Uses an **`APIFY_TOKEN`** environment variable with the `apify-client` package or the REST API: + +```bash +export APIFY_TOKEN="apify_api_xxxxxxxxxxxx" +``` + +## Installation + +### 1. Add the plugin to your project + +Add the plugin entry to your project's `opencode.json`: + +```json +{ + "$schema": "https://opencode.ai/config.json", + "plugin": ["opencode-apify"] +} +``` + +Or run: + +```bash +opencode plugin opencode-apify +``` + +This will add the entry to `opencode.json` automatically. + +> **Local development:** you can also pass a file path instead of the package name for local testing, e.g. `"plugin": ["./path/to/opencode-apify"]`. + +### 2. Check available MCPs + +```bash +opencode mcp list +``` + +### 3. Authenticate + +```bash +opencode mcp auth apify +``` + +### 4. Verify the setup + +```bash +opencode run "List the names of all skills and instructions available to you, and list of MCPs you can use + allowed tools" +``` + +If everything is working, you should see the `apify` agent, the five skills, and the Apify MCP tools listed in the output. + +### Working in headless / SSH environments (no browser) + +The MCP OAuth flow needs a browser. If you're running Open Code over SSH or in any environment without a browser, you have these options: + +1. **Authenticate locally first.** Run Open Code once on your laptop so the OAuth refresh token is stored, then reconnect remotely. +2. **Use the CLI-based skills.** `apify-actor-development`, `apify-actorization`, and `apify-ultimate-scraper` can work in headless environments when the `apify` CLI is installed and `APIFY_TOKEN` is exported. +3. **Use the SDK integration skill.** `apify-sdk-integration` uses `apify-client` and only needs `APIFY_TOKEN`. + +## How to use it + +Start an Open Code session and describe what you need. The `apify` agent reads the request, chooses between MCP, CLI, or SDK-based workflows, and dispatches to the right skill or tool. + +``` +find me 5 well-rated coffee shops in Seattle and export to CSV +build me an Actor that scrapes a sitemap and stores titles +add Apify to this Next.js app so I can run a scraper from /api/scrape +generate output schemas for the Actor in this folder +``` + +## Components reference + +### MCP server + +The `apify` MCP server is configured automatically by the plugin and the agent uses it for Route 1 tasks. It exposes: + +- `search-actors` — search the Apify Store by keyword (no auth) +- `fetch-actor-details` — Actor specs, input schema, pricing (no auth) +- `run-actor` — execute an Actor and return results (OAuth) +- `get-dataset-items` — retrieve dataset rows from a previous run (OAuth) +- `search-apify-docs` / `fetch-apify-docs` — Apify documentation lookup + +### Bundled skills + +The bundled skills ship with markdown references that the agent uses while working: + +- `skills/apify-actor-development/references/` — Actor config, schemas, logging, standby mode, and README guidance +- `skills/apify-actorization/references/` — JS/TS, Python, and CLI actorization guides plus schema/output notes +- `skills/apify-ultimate-scraper/references/` — Actor index, gotchas, and workflow playbooks for common scraping use cases + +Route 1 uses the MCP server, Route 2 relies on the local `apify` CLI, and Route 3 uses the `apify-client` SDK. + +## Troubleshooting + +**OAuth browser never opens / hangs.** See the "Working in headless / SSH environments" section above and switch to a CLI- or SDK-based path if needed. + +**`apify` CLI not found.** Install it with `npm install -g apify-cli` before using `apify-actor-development`, `apify-actorization`, or `apify-ultimate-scraper`. + +**`APIFY_TOKEN` not found.** Export `APIFY_TOKEN` in your shell before starting Open Code when using headless CLI auth or the `apify-sdk-integration` skill. + +**The wrong skill keeps getting picked.** The five bundled skills are routed through the `apify` agent. If routing looks wrong, describe the goal more explicitly: use existing Actors, build an Actor, actorize a project, generate output schemas, or integrate Apify into an app. + +**`apify` vs `apify-client`** — these are two different npm packages. The `apify` package is the SDK for **building** Actors (used inside an Actor's code, on the Apify platform). The `apify-client` package is the API client for **calling** Actors from your own application. The agent picks the right one for you; if you're installing manually, double-check. + +## Resources + +- Apify Console — [console.apify.com](https://console.apify.com) +- Apify Store — [apify.com/store](https://apify.com/store) +- Docs (LLM-friendly) — [docs.apify.com/llms.txt](https://docs.apify.com/llms.txt) +- Docs (full) — [docs.apify.com/llms-full.txt](https://docs.apify.com/llms-full.txt) +- Source repo — [github.com/apify/apify-opencode-plugin](https://github.com/apify/apify-opencode-plugin) +- Issues / feedback — open an issue on the source repo, or email [support@apify.com](mailto:support@apify.com) + +## License + +Apache-2.0. See [LICENSE](./LICENSE). diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..f37f5b8 --- /dev/null +++ b/index.ts @@ -0,0 +1,62 @@ +import type { Plugin } from "@opencode-ai/plugin"; +import type { Config as ConfigV2 } from "@opencode-ai/sdk/v2" +import { existsSync, readFileSync } from "node:fs"; +import path, { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; + +const current_dir = dirname(fileURLToPath(import.meta.url)); +const root_dir = path.join(current_dir, ".."); + +export const ApifyPlugin: Plugin = async () => { + const agentPath = path.join(root_dir, "agents/apify.md") + if (!existsSync(agentPath)) { + throw new Error('Apify agent.md not found') + } + const agent = readFileSync(agentPath, "utf8") + + const skillsPath = path.join(root_dir, "skills") + if (!existsSync(skillsPath)) { + throw new Error('Apify skills not found') + } + + const instructionsPath = path.join(root_dir, "instructions/apify-routing.md") + if (!existsSync(instructionsPath)) { + throw new Error('Apify instructions not found') + } + + return { + config: async (config) => { + // ConfigV2 includes `skills` which isn't in the plugin's Config type yet + const cfg = config as typeof config & Pick + + cfg.mcp = { ...cfg.mcp, apify: { type: "remote", enabled: true, url: "https://mcp.apify.com" } } + cfg.agent = { + ...cfg.agent, + apify: { + prompt: agent, + mode: "all", + tools: { + "apify_*": true, + }, + description: "Anything related to Apify, use the apify_* tools to interact with the Apify platform.", + }, + } + cfg.skills = { + ...cfg.skills, + paths: [...(cfg.skills?.paths ?? []), skillsPath], + } + cfg.tools = { + ...cfg.tools, + "apify_*": true, + } + cfg.instructions = [...(cfg.instructions ?? []), instructionsPath] + }, + "shell.env": async (_input, output) => { + if (process.env.APIFY_TOKEN) { + output.env.APIFY_TOKEN = process.env.APIFY_TOKEN; + } + }, + } +} + +export default ApifyPlugin; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..3bacba0 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,324 @@ +{ + "name": "opencode-apify", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "opencode-apify", + "version": "1.0.0", + "license": "Apache-2.0", + "devDependencies": { + "@opencode-ai/plugin": "^1.0.0", + "@opencode-ai/sdk": "^1.17.4", + "@types/node": "^25.2.2", + "typescript": "^5.0.0" + } + }, + "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { + "version": "3.0.4", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@opencode-ai/plugin": { + "version": "1.17.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@opencode-ai/sdk": "1.17.4", + "effect": "4.0.0-beta.74", + "zod": "4.1.8" + }, + "peerDependencies": { + "@opentui/core": ">=0.3.4", + "@opentui/keymap": ">=0.3.4", + "@opentui/solid": ">=0.3.4" + }, + "peerDependenciesMeta": { + "@opentui/core": { + "optional": true + }, + "@opentui/keymap": { + "optional": true + }, + "@opentui/solid": { + "optional": true + } + } + }, + "node_modules/@opencode-ai/sdk": { + "version": "1.17.4", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "7.0.6" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "25.9.3", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/effect": { + "version": "4.0.0-beta.74", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "fast-check": "^4.8.0", + "find-my-way-ts": "^0.1.6", + "ini": "^7.0.0", + "kubernetes-types": "^1.30.0", + "msgpackr": "^2.0.1", + "multipasta": "^0.2.7", + "toml": "^4.1.1", + "uuid": "^14.0.0", + "yaml": "^2.9.0" + } + }, + "node_modules/fast-check": { + "version": "4.8.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "dependencies": { + "pure-rand": "^8.0.0" + }, + "engines": { + "node": ">=12.17.0" + } + }, + "node_modules/find-my-way-ts": { + "version": "0.1.6", + "dev": true, + "license": "MIT" + }, + "node_modules/ini": { + "version": "7.0.0", + "dev": true, + "license": "ISC", + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/kubernetes-types": { + "version": "1.30.0", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/msgpackr": { + "version": "2.0.4", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "msgpackr-extract": "^3.0.4" + } + }, + "node_modules/msgpackr-extract": { + "version": "3.0.4", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build-optional-packages": "5.2.2" + }, + "bin": { + "download-msgpackr-prebuilds": "bin/download-prebuilds.js" + }, + "optionalDependencies": { + "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.4", + "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.4", + "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.4", + "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.4", + "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.4", + "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.4" + } + }, + "node_modules/multipasta": { + "version": "0.2.7", + "dev": true, + "license": "MIT" + }, + "node_modules/node-gyp-build-optional-packages": { + "version": "5.2.2", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.1" + }, + "bin": { + "node-gyp-build-optional-packages": "bin.js", + "node-gyp-build-optional-packages-optional": "optional.js", + "node-gyp-build-optional-packages-test": "build-test.js" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pure-rand": { + "version": "8.4.0", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/toml": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.24.6", + "dev": true, + "license": "MIT" + }, + "node_modules/uuid": { + "version": "14.0.0", + "dev": true, + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist-node/bin/uuid" + } + }, + "node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/yaml": { + "version": "2.9.0", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/zod": { + "version": "4.1.8", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..4de7b1e --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "opencode-apify", + "version": "1.0.0", + "description": "Apify plugin for OpenCode - web scraping, automation, and data extraction via the Apify platform", + "type": "module", + "main": "./dist/index.js", + "files": [ + "dist", + "agents", + "instructions", + "skills" + ], + "keywords": [ + "opencode", + "opencode-plugin", + "apify", + "web-scraping", + "automation", + "data-extraction", + "actors", + "llm", + "ai" + ], + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/apify/apify-opencode-plugin" + }, + "homepage": "https://apify.com", + "author": { + "name": "Apify Technologies s.r.o." + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "check": "tsc -p tsconfig.json --noEmit" + }, + "devDependencies": { + "@opencode-ai/plugin": "^1.0.0", + "@opencode-ai/sdk": "^1.17.4", + "@types/node": "^25.2.2", + "typescript": "^5.0.0" + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..034b4fc --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "strict": true, + "outDir": "./dist", + "skipLibCheck": true, + "declaration": false + }, + "include": ["index.ts"] +} \ No newline at end of file