-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
41 lines (35 loc) · 1.41 KB
/
index.ts
File metadata and controls
41 lines (35 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { Plugin } from "@opencode-ai/plugin";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
const current_dir = dirname(fileURLToPath(import.meta.url));
export const plugin: Plugin = async () => {
return {
async config(input) {
input.instructions ??= [];
// @ts-expect-error -- skills is a new opencode feature, types not yet updated
input.skills ??= {};
// @ts-expect-error -- skills is a new opencode feature, types not yet updated
input.skills.paths ??= [];
input.instructions.push(
join(current_dir, "skills", "brightdata-cli", "rules", "install.md"),
);
// @ts-expect-error -- skills is a new opencode feature, types not yet updated
input.skills.paths.push(join(current_dir, "skills"));
},
"shell.env": async (_input, output) => {
if (process.env.BRIGHTDATA_API_KEY) {
output.env.BRIGHTDATA_API_KEY = process.env.BRIGHTDATA_API_KEY;
}
if (process.env.BRIGHTDATA_UNLOCKER_ZONE) {
output.env.BRIGHTDATA_UNLOCKER_ZONE = process.env.BRIGHTDATA_UNLOCKER_ZONE;
}
if (process.env.BRIGHTDATA_SERP_ZONE) {
output.env.BRIGHTDATA_SERP_ZONE = process.env.BRIGHTDATA_SERP_ZONE;
}
if (process.env.BRIGHTDATA_POLLING_TIMEOUT) {
output.env.BRIGHTDATA_POLLING_TIMEOUT = process.env.BRIGHTDATA_POLLING_TIMEOUT;
}
},
};
};
export default plugin;