Skip to content

Commit bac2647

Browse files
committed
feat(plugins): add workspace configuration for plugins monorepo structure
Establish a monorepo structure for the plugins ecosystem with workspace configuration, shared type definitions, and a new weather plugin example. Includes comprehensive .gitignore rules for plugin development and updated import paths across all plugin examples.
1 parent c10d83b commit bac2647

9 files changed

Lines changed: 714 additions & 119 deletions

File tree

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,13 @@ temp/
100100
# Coding agents
101101
.claude/
102102
.grok/
103-
.super-agent/
103+
.super-agent/
104+
105+
@plugins/node_modules
106+
@plugins/dist
107+
@plugins/.bun
108+
@plugins/.claude
109+
@plugins/.grok
110+
@plugins/.super-agent
111+
@plugins/.env
112+
@plugins/.env.local

@plugins/.gitignore

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.env
2+
.env.local
3+
.env.development.local
4+
.env.test.local
5+
.env.production.local
6+
node_modules
7+
dist
8+
.claude
9+
.grok
10+
.super-agent
11+
.vscode
12+
.idea
13+
*.swp
14+
*.swo
15+
*~
16+
.DS_Store
17+
.DS_Store?
18+
._*
19+
.Spotlight-V100
20+
.Trashes
21+
ehthumbs.db
22+
Thumbs.db
23+
logs
24+
*.log
25+
pids
26+
*.pid
27+
*.seed
28+
*.pid.lock
29+
coverage
30+
.nyc_output
31+
*.tsbuildinfo
32+
.npm
33+
.bun
34+
.eslintcache
35+
.rpt2_cache
36+
.rts2_cache_cjs
37+
.rts2_cache_es
38+
.rts2_cache_umd
39+
.node_repl_history
40+
*.tgz
41+
.yarn-integrity
42+
.cache
43+
.parcel-cache
44+
tmp
45+
temp
46+
.vscode/*
47+
!.vscode/extensions.json
48+
.idea
49+
*.suo
50+
*.ntvs*
51+
*.njsproj
52+
*.sln
53+
*.sw?
54+
/*/node_modules
55+
/*/dist
56+
/*/bun.lockb
57+
/*/bun.lock
58+
/templates/*/node_modules
59+
/templates/*/dist
60+
/templates/*/bun.lockb
61+
/templates/*/bun.lock
62+
examples/notify/bun.lock

@plugins/examples/notify/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {
22
PluginContext,
33
SuperAgentPlugin,
44
SuperAgentTool,
5-
} from "../../shared/types";
5+
} from "@involvex/super-agent-cli/@plugins/shared/types";
66

77
interface NotifyConfig {
88
sound?: boolean;
@@ -56,7 +56,7 @@ const sendNotificationTool: SuperAgentTool = {
5656
const { promisify } = await import("util");
5757
const execAsync = promisify(exec);
5858

59-
const script = `display notification "${args.message.replace(/"/g, '\\"')}" with title "${args.title.replace(/"/g, '\\"')}"`;
59+
const script = `display notification "${args.message.replace(/"/g, '\\"')}" with title "${args.title.replace(/'/g, "''")}"`;
6060
await execAsync(`osascript -e '${script}'`);
6161

6262
return `Notification sent: "${args.title}"`;

@plugins/examples/weather/bun.lock

Lines changed: 583 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@plugins/examples/weather/src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {
22
PluginContext,
33
SuperAgentPlugin,
44
SuperAgentTool,
5-
} from "../../shared/types";
5+
} from "@involvex/super-agent-cli/@plugins/shared/types";
66

77
interface WeatherConfig {
88
apiKey?: string;
@@ -63,18 +63,18 @@ const getWeatherTool: SuperAgentTool = {
6363
return `Error: Weather API returned status ${response.status}`;
6464
}
6565

66-
const data = await response.json();
66+
const data = (await response.json()) as any;
6767

6868
// Format response
6969
const tempUnit = units === "metric" ? "°C" : "°F";
7070
const speedUnit = units === "metric" ? "m/s" : "mph";
7171

72-
return `Weather in ${data.name}, ${data.sys.country}:
73-
- Conditions: ${data.weather[0].description}
74-
- Temperature: ${data.main.temp}${tempUnit} (feels like ${data.main.feels_like}${tempUnit})
75-
- Humidity: ${data.main.humidity}%
76-
- Wind: ${data.wind.speed} ${speedUnit}
77-
- Pressure: ${data.main.pressure} hPa`;
72+
return `Weather in ${data.name ?? "Unknown"}, ${data.sys.country ?? "Unknown"}:
73+
- Conditions: ${data.weather[0].description ?? "Unknown"}
74+
- Temperature: ${data.main.temp ?? "Unknown"}${tempUnit} (feels like ${data.main.feels_like ?? "Unknown"}${tempUnit})
75+
- Humidity: ${data.main.humidity ?? "Unknown"}%
76+
- Wind: ${data.wind.speed ?? "Unknown"} ${speedUnit}
77+
- Pressure: ${data.main.pressure ?? "Unknown"} hPa`;
7878
} catch (error: any) {
7979
return `Error fetching weather data: ${error.message}`;
8080
}

@plugins/templates/basic/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {
22
PluginContext,
33
SuperAgentPlugin,
44
SuperAgentTool,
5-
} from "../../shared/types";
5+
} from "@involvex/super-agent-cli/@plugins/shared/types";
66

77
// Example tool that demonstrates the basic plugin pattern
88
const exampleTool: SuperAgentTool = {

0 commit comments

Comments
 (0)