@sjawhar/opencode-legion-envoy 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/server.js +17 -0
- package/package.json +6 -4
- package/skills/AGENTS.md +38 -0
- package/skills/envoy/SKILL.md +396 -0
- package/skills/github/SKILL.md +203 -0
- package/skills/legion-architect/SKILL.md +201 -0
- package/skills/legion-controller/SKILL.md +136 -0
- package/skills/legion-oracle/SKILL.md +63 -0
- package/skills/legion-retro/SKILL.md +87 -0
- package/skills/legion-worker/SKILL.md +177 -0
- package/skills/legion-worker/references/config.md +259 -0
- package/skills/legion-worker/references/knowledge-injection.md +98 -0
- package/skills/legion-worker/resources/strategies/cleanup-deletion.md +22 -0
- package/skills/legion-worker/resources/strategies/systematic-rename.md +19 -0
- package/skills/linear/SKILL.md +76 -0
- package/src/server.ts +29 -1
package/src/server.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
1
4
|
import { agentSubject } from "@legion/contracts";
|
|
2
5
|
import { envoyDefaultsFromEnvironment } from "@legion/envoy-client/defaults";
|
|
3
6
|
import { dispatchSubscriptionTopic } from "@legion/envoy-client/dispatch-subscribe";
|
|
@@ -10,6 +13,18 @@ import { buildDispatchMcpEntry, injectEnvoyMcp } from "./dispatch-mcp";
|
|
|
10
13
|
import { logger } from "./log";
|
|
11
14
|
import { resolvePort } from "./port";
|
|
12
15
|
|
|
16
|
+
const moduleDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
// Legion skills ship inside this package so OpenCode carries them without a
|
|
18
|
+
// vendor checkout. OpenCode discovers skills only from fixed directories and
|
|
19
|
+
// `config.skills.paths` — never from plugin package dirs — so the config hook
|
|
20
|
+
// below must inject this path itself.
|
|
21
|
+
// Published tarball: dist/src/server.js → <pkg>/skills (staged at prepack).
|
|
22
|
+
// Repo checkout: src/server.ts → <repo>/skills.
|
|
23
|
+
const skillsDirectory = [
|
|
24
|
+
path.resolve(moduleDirectory, "../../skills"),
|
|
25
|
+
path.resolve(moduleDirectory, "../../../skills"),
|
|
26
|
+
].find((dir) => existsSync(dir));
|
|
27
|
+
|
|
13
28
|
const [
|
|
14
29
|
subscribeSpec,
|
|
15
30
|
unsubscribeSpec,
|
|
@@ -139,7 +154,20 @@ export default async (input: { serverUrl: URL }) => {
|
|
|
139
154
|
});
|
|
140
155
|
|
|
141
156
|
return {
|
|
142
|
-
config: (
|
|
157
|
+
config: (
|
|
158
|
+
cfg: { mcp?: Record<string, unknown>; skills?: { paths?: string[] } } & Record<
|
|
159
|
+
string,
|
|
160
|
+
unknown
|
|
161
|
+
>
|
|
162
|
+
) => {
|
|
163
|
+
// Serve the bundled legion skills to every session on this serve.
|
|
164
|
+
if (skillsDirectory) {
|
|
165
|
+
cfg.skills ??= {};
|
|
166
|
+
cfg.skills.paths ??= [];
|
|
167
|
+
if (!cfg.skills.paths.includes(skillsDirectory)) {
|
|
168
|
+
cfg.skills.paths.push(skillsDirectory);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
143
171
|
// Inject the envoy MCP entry into the OpenCode config when
|
|
144
172
|
// dispatch is enabled. Centralizing this in the plugin (instead of
|
|
145
173
|
// each user's opencode.json) means:
|