harness-alchemist 0.1.7 → 0.1.9

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.
Files changed (42) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/README.md +41 -13
  4. package/alchemy.json +8 -0
  5. package/alchemy.schema.json +1 -1
  6. package/bin/harness-alchemist.mjs +5 -0
  7. package/dist/deepseek.d.ts +2 -2
  8. package/dist/deepseek.d.ts.map +1 -1
  9. package/dist/deepseek.js +7 -20
  10. package/dist/deepseek.js.map +1 -1
  11. package/dist/opencode.d.ts +2 -19
  12. package/dist/opencode.d.ts.map +1 -1
  13. package/dist/opencode.js +5 -53
  14. package/dist/opencode.js.map +1 -1
  15. package/lib/create.mjs +2 -0
  16. package/lib/install-check.mjs +363 -0
  17. package/lib/validate.mjs +86 -12
  18. package/mcp.json +19 -0
  19. package/package.json +6 -1
  20. package/plugin.json +16 -2
  21. package/skills/harness-alchemist/SKILL.md +5 -5
  22. package/skills/harness-alchemist/references/antigravity.md +2 -2
  23. package/skills/harness-alchemist/references/compatibility.md +10 -8
  24. package/skills/harness-alchemist/references/deepseek-harness.md +5 -3
  25. package/skills/harness-alchemist/references/publishing.md +14 -3
  26. package/skills/harness-alchemist/skill-runtime.json +50 -0
  27. package/templates/v0.1.0/universal-typescript/.agents/skills/develop-template/SKILL.md.tpl +8 -8
  28. package/templates/v0.1.0/universal-typescript/.agents/skills/develop-template/references/compatibility.md.tpl +12 -12
  29. package/templates/v0.1.0/universal-typescript/.agents/skills/develop-template/scripts/check-package.mjs.tpl +3 -0
  30. package/templates/v0.1.0/universal-typescript/.agents/skills/develop-template/scripts/sync-metadata.mjs.tpl +12 -4
  31. package/templates/v0.1.0/universal-typescript/.github/workflows/npm-publish.yml.tpl +6 -3
  32. package/templates/v0.1.0/universal-typescript/AGENTS.md.tpl +4 -2
  33. package/templates/v0.1.0/universal-typescript/README.md.tpl +5 -3
  34. package/templates/v0.1.0/universal-typescript/mcp.json.tpl +19 -0
  35. package/templates/v0.1.0/universal-typescript/package.json.tpl +4 -0
  36. package/templates/v0.1.0/universal-typescript/plugin.json.tpl +10 -2
  37. package/templates/v0.1.0/universal-typescript/skills/shared-skill/SKILL.md.tpl +4 -3
  38. package/templates/v0.1.0/universal-typescript/skills/shared-skill/references/tool-contract.md.tpl +14 -12
  39. package/templates/v0.1.0/universal-typescript/skills/shared-skill/skill-runtime.json.tpl +50 -0
  40. package/templates/v0.1.0/universal-typescript/src/deepseek.ts.tpl +7 -26
  41. package/templates/v0.1.0/universal-typescript/src/opencode.ts.tpl +6 -59
  42. package/templates/v0.1.0/universal-typescript/tests/runtimes.test.mjs.tpl +44 -9
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
3
3
  "name": "harness-alchemist",
4
4
  "displayName": "Harness Alchemist",
5
- "version": "0.1.7",
5
+ "version": "0.1.9",
6
6
  "description": "Scaffold, validate, and publish portable coding-agent plugins across Claude Code, Codex, OpenCode, Antigravity, and DeepSeek Harness.",
7
7
  "author": {
8
8
  "name": "Haochuan Zhang"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harness-alchemist",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Scaffold, validate, and publish portable coding-agent plugins across Claude Code, Codex, OpenCode, Antigravity, and DeepSeek Harness.",
5
5
  "author": {
6
6
  "name": "Haochuan Zhang",
package/README.md CHANGED
@@ -28,7 +28,7 @@
28
28
 
29
29
  ---
30
30
 
31
- Harness Alchemist scaffolds one TypeScript plugin repository that installs natively into **Claude Code**, **Codex/ChatGPT**, **OpenCode**, **Google Antigravity**, and **DeepSeek Harness/Cordis**. Product skills ship behavioral `.mjs`/`.py` script twins; every harness entrypoint is a thin adapter that delegates to them.
31
+ Harness Alchemist scaffolds one TypeScript plugin repository that installs natively into **Claude Code**, **Codex/ChatGPT**, **OpenCode**, **Google Antigravity**, and **DeepSeek Harness/Cordis**. Each product skill declares its fixed executable and portable tool schema in `skill-runtime.json`; host entrypoints delegate through `@lunarmoon26/agent-skill-runtime`.
32
32
 
33
33
  ## Install
34
34
 
@@ -38,7 +38,7 @@ npm install -g harness-alchemist
38
38
  npx harness-alchemist@latest create my-plugin --help
39
39
  ```
40
40
 
41
- Requires Node.js 22.20+ (Bun 1.2+ also supported). Zero runtime dependencies.
41
+ Requires Node.js 22.20+ (Bun 1.2+ also supported).
42
42
 
43
43
  ## Quick start
44
44
 
@@ -78,10 +78,10 @@ retains the strict generated single-package layout.
78
78
 
79
79
  The optional `runtime` field selects what the adapted package must contain:
80
80
 
81
- - `"npm"` (default) — the full generated contract: npm metadata, OpenCode and
82
- Cordis adapters, Cordis patch, and `.mjs`/`.py` script twins.
83
- - `"skills"` — skills and harness manifests only. No npm package, adapters, or
84
- Cordis patch are required, and single-language scripts are allowed, so
81
+ - `"npm"` (default) — the full generated contract: npm metadata, portable
82
+ runtime manifests, OpenCode and Cordis adapters, and the Cordis patch.
83
+ - `"skills"` — skills, portable runtime manifests, and harness manifests only.
84
+ No npm package, adapters, or Cordis patch are required, and single-language scripts are allowed, so
85
85
  Python, Go, Rust, Java, C#, or Swift repositories can expose their workflows
86
86
  to Claude Code, Codex, Antigravity, and DeepSeek's filesystem skill roots
87
87
  without adopting a JavaScript runtime.
@@ -95,10 +95,10 @@ version.
95
95
 
96
96
  | Surface | Purpose |
97
97
  | --- | --- |
98
- | `skills/<name>/` | Agent Skills spec skill with `.mjs`/`.py` script twins under `scripts/` and a tool-contract reference |
99
- | `src/opencode.ts` | OpenCode plugin registering tools that spawn the skill scripts |
100
- | `src/deepseek.ts` + `cordis.patch.yml` | Cordis function plugin providing a service over the same scripts |
101
- | `.claude-plugin/`, `.codex-plugin/`, `.agents/plugins/`, `plugin.json` | Native manifests for Claude Code, Codex, and Antigravity marketplaces |
98
+ | `skills/<name>/` | Agent Skills workflow, portable `skill-runtime.json`, fixed executable, optional tested twin, and tool-contract reference |
99
+ | `src/opencode.ts` | OpenCode plugin projecting the portable runtime manifest as native tools |
100
+ | `src/deepseek.ts` + `cordis.patch.yml` | Cordis function plugin registering the same portable tools |
101
+ | `.claude-plugin/`, `.codex-plugin/`, `.agents/plugins/`, `plugin.json`, `mcp.json` | Native and Agent Plugins manifests for Claude Code, Codex, Antigravity, and MCP hosts |
102
102
  | `.agents/skills/develop-<name>/` | Repository-maintenance skill so agents can develop the project recursively |
103
103
  | `.github/workflows/` | CI plus tag-triggered publish (`vX.Y.Z` → verify → npm provenance) |
104
104
 
@@ -112,12 +112,16 @@ Install paths below are verified against real CLIs before shipping in the templa
112
112
  | Codex/ChatGPT | bundled natively | — | `codex plugin add <name>@<marketplace>` |
113
113
  | OpenCode | via `~/.agents/skills/` | npm package hooks | `"plugin": ["<package>"]` in `opencode.json` |
114
114
  | Google Antigravity | nested bundle | — | `agy plugin validate . && agy plugin install .` |
115
- | DeepSeek Harness | profile filesystem roots | Cordis service plugin | `dsh plugin --profile demo add <package-or-path>` |
115
+ | DeepSeek Harness | profile filesystem roots | Cordis tool plugin | `dsh plugin --profile demo add <package-or-path>` |
116
116
 
117
117
  ## Skill script contract
118
118
 
119
119
  Product skills own their logic; adapters never do.
120
120
 
121
+ `skills/<name>/skill-runtime.json` declares the model-facing schema and selects
122
+ one author-controlled entrypoint. Hosts validate the same manifest and never
123
+ accept an executable path from model input.
124
+
121
125
  ```bash
122
126
  echo '{"request": "hello"}' | node skills/<name>/scripts/main.mjs
123
127
  # {"ok":true,"plugin":"my-plugin","echo":{"request":"hello"}}
@@ -125,11 +129,35 @@ echo '{"request": "hello"}' | node skills/<name>/scripts/main.mjs
125
129
 
126
130
  - One JSON object on stdin, one JSON result plus newline on stdout.
127
131
  - Non-zero exit with a stderr diagnostic on failure.
128
- - `scripts/main.py` is a stdlib-only behavioral twin of `scripts/main.mjs`.
132
+ - `scripts/main.py` is a stdlib-only behavioral twin for direct compatibility
133
+ testing; the starter manifest selects `scripts/main.mjs` for host tools.
134
+
135
+ ## Install-level verification
136
+
137
+ `install-check` drives your local harness CLIs against the project and asserts
138
+ each one can discover the plugin — the same checks a user's install would
139
+ perform, automated and cleaned up afterwards:
140
+
141
+ ```bash
142
+ npx harness-alchemist@latest install-check /path/to/project
143
+ npx harness-alchemist@latest install-check . --harness agy --json
144
+ ```
145
+
146
+ | Harness | Verified by | Isolation |
147
+ | --- | --- | --- |
148
+ | Claude Code | marketplace add → install → `plugin details` skill inventory | user scope, auto-removed |
149
+ | Codex | marketplace add → plugin add → `plugin list` enabled | plugin cache, auto-removed |
150
+ | Antigravity | `plugin validate` → install → `plugin list` | staged, auto-uninstalled |
151
+ | OpenCode | skills discovery via `debug skill` + plugin startup | temp `XDG_CONFIG_HOME` |
152
+ | DeepSeek | Cordis bundle composed into profile (`--dump-config`) | temp `DSH_HOME` |
153
+
154
+ Claude, Codex, and Antigravity run in both runtimes; the OpenCode plugin leg
155
+ and the DeepSeek Cordis check require npm mode with built adapters
156
+ (`npm run build` first). Missing CLIs are reported as skipped, not failures.
129
157
 
130
158
  ## Validation tiers
131
159
 
132
- `npm run validate` always enforces Agent Skills frontmatter compliance, SKILL.md reference resolution, and twin parity. With the optional `pyodide` devDependency installed, Python entrypoints are additionally compiled and smoke-executed inside a WebAssembly CPython sandbox no native Python required.
160
+ `npm run validate` always enforces Agent Skills frontmatter compliance, SKILL.md reference resolution, runtime-manifest validation, fixed contained entrypoints, and npm-mode twin parity. With the optional `pyodide` devDependency installed, Python twins are additionally compiled and smoke-executed inside a WebAssembly CPython sandbox; Pyodide is validation-only, not a version 1 execution engine.
133
161
 
134
162
  ## Release automation
135
163
 
package/alchemy.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://unpkg.com/harness-alchemist/alchemy.schema.json",
3
+ "runtime": "npm",
4
+ "template": "v0.1.0",
5
+ "generator": "harness-alchemist",
6
+ "generatorVersion": "0.1.9",
7
+ "createdAt": "2026-08-24T00:00:00.000Z"
8
+ }
@@ -13,7 +13,7 @@
13
13
  "runtime": {
14
14
  "enum": ["npm", "skills"],
15
15
  "default": "npm",
16
- "description": "'npm' requires the full generated contract (npm package, OpenCode and Cordis adapters, Cordis patch, .mjs/.py script twins). 'skills' requires skills and harness manifests only and allows single-language scripts."
16
+ "description": "'npm' requires the full generated contract (npm package, portable runtime manifests, OpenCode and Cordis adapters, and Cordis patch). 'skills' requires skills, portable runtime manifests, and harness manifests only and allows single-language scripts."
17
17
  },
18
18
  "pluginRoot": {
19
19
  "type": "string",
@@ -3,6 +3,7 @@
3
3
  import { readFile } from "node:fs/promises"
4
4
 
5
5
  import { listTemplates, runCreate } from "../lib/create.mjs"
6
+ import { runInstallCheck } from "../lib/install-check.mjs"
6
7
  import { runValidate } from "../lib/validate.mjs"
7
8
 
8
9
  const packageJson = JSON.parse(
@@ -17,6 +18,8 @@ Usage: harness-alchemist <command> [options]
17
18
  Commands:
18
19
  create <directory> Create a universal coding-agent plugin repository.
19
20
  validate [directory] Validate a generated repository.
21
+ install-check Install the plugin into local harness CLIs and verify
22
+ discovery (claude, codex, agy, opencode, dsh).
20
23
  templates List bundled canonical templates.
21
24
  version Print the CLI version.
22
25
  help Show this help.
@@ -36,6 +39,8 @@ if (!command || command === "help" || command === "--help" || command === "-h")
36
39
  process.exitCode = await runCreate(args)
37
40
  } else if (command === "validate") {
38
41
  process.exitCode = await runValidate(args)
42
+ } else if (command === "install-check") {
43
+ process.exitCode = await runInstallCheck(args)
39
44
  } else {
40
45
  console.error(`Unknown command: ${command}\n`)
41
46
  console.error(usage())
@@ -1,5 +1,5 @@
1
1
  import type { Context } from "@deepseek-ai/cordis";
2
2
  export declare const name = "harness-alchemist";
3
- export declare function runSkillScript(script: string, payload: string): unknown;
4
- export declare function apply(context: Context): void;
3
+ export declare const inject: string[];
4
+ export declare function apply(context: Context): Promise<void>;
5
5
  //# sourceMappingURL=deepseek.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepseek.d.ts","sourceRoot":"","sources":["../src/deepseek.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAO,MAAM,IAAI,sBAAsB,CAAA;AAQvC,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAcvE;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAK5C"}
1
+ {"version":3,"file":"deepseek.d.ts","sourceRoot":"","sources":["../src/deepseek.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,eAAO,MAAM,IAAI,sBAAsB,CAAA;AACvC,eAAO,MAAM,MAAM,UAAY,CAAA;AAI/B,wBAAsB,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAK3D"}
package/dist/deepseek.js CHANGED
@@ -1,26 +1,13 @@
1
- import { spawnSync } from "node:child_process";
2
1
  import { dirname, join } from "node:path";
3
2
  import { fileURLToPath } from "node:url";
3
+ import { registerDeepSeekTools } from "@lunarmoon26/agent-skill-runtime/deepseek";
4
4
  export const name = "harness-alchemist";
5
- const scriptsDirectory = join(dirname(fileURLToPath(import.meta.url)), "..", "skills/harness-alchemist/scripts");
6
- export function runSkillScript(script, payload) {
7
- const runtime = script.endsWith(".py") ? "python3" : process.execPath;
8
- const result = spawnSync(runtime, [join(scriptsDirectory, script)], {
9
- input: payload,
10
- encoding: "utf8",
11
- });
12
- if (result.error) {
13
- throw new Error(`Could not run ${script} via ${runtime}: ${result.error.message}`);
14
- }
15
- if (result.status !== 0) {
16
- const diagnostic = result.stderr.trim() || `${script} exited with code ${result.status}`;
17
- throw new Error(diagnostic);
18
- }
19
- return JSON.parse(result.stdout);
20
- }
21
- export function apply(context) {
22
- context.provide(name, {
23
- run: (payload, runtime = "node") => runSkillScript(runtime === "python" ? "main.py" : "main.mjs", payload),
5
+ export const inject = ["tools"];
6
+ const pluginRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
7
+ export async function apply(context) {
8
+ await registerDeepSeekTools(context, {
9
+ pluginRoot,
10
+ manifestPaths: ["skills/harness-alchemist/skill-runtime.json"],
24
11
  });
25
12
  }
26
13
  //# sourceMappingURL=deepseek.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepseek.js","sourceRoot":"","sources":["../src/deepseek.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAIxC,MAAM,CAAC,MAAM,IAAI,GAAG,mBAAmB,CAAA;AAEvC,MAAM,gBAAgB,GAAG,IAAI,CAC3B,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EACvC,IAAI,EACJ,kCAAkC,CACnC,CAAA;AAED,MAAM,UAAU,cAAc,CAAC,MAAc,EAAE,OAAe;IAC5D,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAA;IACrE,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,EAAE;QAClE,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;IACF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,iBAAiB,MAAM,QAAQ,OAAO,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;IACpF,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,qBAAqB,MAAM,CAAC,MAAM,EAAE,CAAA;QACxF,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAA;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAClC,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,OAAgB;IACpC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE;QACpB,GAAG,EAAE,CAAC,OAAe,EAAE,UAA6B,MAAM,EAAE,EAAE,CAC5D,cAAc,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC;KACzE,CAAC,CAAA;AACJ,CAAC"}
1
+ {"version":3,"file":"deepseek.js","sourceRoot":"","sources":["../src/deepseek.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAA;AAEjF,MAAM,CAAC,MAAM,IAAI,GAAG,mBAAmB,CAAA;AACvC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,CAAA;AAE/B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AAEtE,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,OAAgB;IAC1C,MAAM,qBAAqB,CAAC,OAAO,EAAE;QACnC,UAAU;QACV,aAAa,EAAE,CAAC,6CAA6C,CAAC;KAC/D,CAAC,CAAA;AACJ,CAAC"}
@@ -1,21 +1,4 @@
1
- export declare function runSkillScript(script: string, payload: string): Promise<string>;
2
- declare const plugin: () => Promise<{
3
- tool: {
4
- harness_alchemist_run: {
5
- description: string;
6
- args: {
7
- input: import("zod").ZodString;
8
- runtime: import("zod").ZodOptional<import("zod").ZodEnum<{
9
- node: "node";
10
- python: "python";
11
- }>>;
12
- };
13
- execute(args: {
14
- input: string;
15
- runtime?: "node" | "python" | undefined;
16
- }, context: import("@opencode-ai/plugin").ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
17
- };
18
- };
19
- }>;
1
+ import type { Plugin } from "@opencode-ai/plugin";
2
+ declare const plugin: Plugin;
20
3
  export default plugin;
21
4
  //# sourceMappingURL=opencode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../src/opencode.ts"],"names":[],"mappings":"AAaA,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA0B/E;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;EAuBO,CAAA;AAEnB,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../src/opencode.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAKjD,QAAA,MAAM,MAAM,EAAE,MAGZ,CAAA;AAEF,eAAe,MAAM,CAAA"}
package/dist/opencode.js CHANGED
@@ -1,58 +1,10 @@
1
- import { spawn } from "node:child_process";
2
1
  import { dirname, join } from "node:path";
3
2
  import { fileURLToPath } from "node:url";
4
- import { tool } from "@opencode-ai/plugin";
5
- const scriptsDirectory = join(dirname(fileURLToPath(import.meta.url)), "..", "skills/harness-alchemist/scripts");
6
- export function runSkillScript(script, payload) {
7
- return new Promise((resolveResult, rejectResult) => {
8
- const runtime = script.endsWith(".py") ? "python3" : process.execPath;
9
- const child = spawn(runtime, [join(scriptsDirectory, script)], {
10
- stdio: ["pipe", "pipe", "pipe"],
11
- });
12
- let stdout = "";
13
- let stderr = "";
14
- child.stdout.on("data", (chunk) => {
15
- stdout += chunk;
16
- });
17
- child.stderr.on("data", (chunk) => {
18
- stderr += chunk;
19
- });
20
- child.on("error", (error) => {
21
- rejectResult(new Error(`Could not run ${script} via ${runtime}: ${error.message}`));
22
- });
23
- child.on("close", (code) => {
24
- if (code !== 0) {
25
- rejectResult(new Error(stderr.trim() || `${script} exited with code ${code}`));
26
- }
27
- else {
28
- resolveResult(stdout);
29
- }
30
- });
31
- child.stdin.end(payload);
32
- });
33
- }
34
- const plugin = (async () => {
35
- return {
36
- tool: {
37
- harness_alchemist_run: tool({
38
- description: "Run the Harness Alchemist shared-skill workflow. Delegates to skills/harness-alchemist/scripts.",
39
- args: {
40
- input: tool.schema
41
- .string()
42
- .describe("JSON object passed on stdin to the skill entrypoint"),
43
- runtime: tool.schema
44
- .enum(["node", "python"])
45
- .optional()
46
- .describe("Entrypoint runtime; defaults to node"),
47
- },
48
- execute: async (args) => {
49
- const script = args.runtime === "python" ? "main.py" : "main.mjs";
50
- const output = await runSkillScript(script, args.input);
51
- return JSON.stringify(JSON.parse(output));
52
- },
53
- }),
54
- },
55
- };
3
+ import { createOpenCodePlugin } from "@lunarmoon26/agent-skill-runtime/opencode";
4
+ const pluginRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
5
+ const plugin = createOpenCodePlugin({
6
+ pluginRoot,
7
+ manifestPaths: ["skills/harness-alchemist/skill-runtime.json"],
56
8
  });
57
9
  export default plugin;
58
10
  //# sourceMappingURL=opencode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"opencode.js","sourceRoot":"","sources":["../src/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAG1C,MAAM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,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAEhF,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AAEtE,MAAM,MAAM,GAAW,oBAAoB,CAAC;IAC1C,UAAU;IACV,aAAa,EAAE,CAAC,6CAA6C,CAAC;CAC/D,CAAC,CAAA;AAEF,eAAe,MAAM,CAAA"}
package/lib/create.mjs CHANGED
@@ -247,6 +247,8 @@ export async function runCreate(argv) {
247
247
  const tokens = {
248
248
  NAME: options.name,
249
249
  NAME_JSON: JSON.stringify(options.name),
250
+ TOOL_NAME: `${options.name.replaceAll("-", "_")}_run`,
251
+ TOOL_NAME_JSON: JSON.stringify(`${options.name.replaceAll("-", "_")}_run`),
250
252
  DISPLAY_NAME: options.displayName,
251
253
  DISPLAY_NAME_JSON: JSON.stringify(options.displayName),
252
254
  DESCRIPTION: options.description,