dsh-hive-runner 0.0.0-stage → 0.1.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/README.md CHANGED
@@ -1,3 +1,22 @@
1
- # Temporary Holding Version
1
+ # dsh-hive-runner
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A DSH host plugin for [Hive](https://github.com/d86e/hive). It adds three tools to every agent:
4
+
5
+ | Tool | Does |
6
+ | --- | --- |
7
+ | `hive_run_round` | `hive-run --once`: triage, claim, spawn, verify, record |
8
+ | `hive_tasks_ready` | `hive-tasks ready --json` |
9
+ | `hive_board` | `hive board --json` |
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ dsh plugin --profile desktop add /path/to/dsh-hive-runner
15
+ # restart DSH, then ask an agent: "run a hive round"
16
+ ```
17
+
18
+ Binaries come from PATH by default; override with `HIVE_RUN_BIN`, `HIVE_TASKS_BIN`, `HIVE_BIN`.
19
+
20
+ ## License
21
+
22
+ MIT
@@ -0,0 +1,5 @@
1
+ # dsh-hive-runner — DSH host half: a tool that starts one Hive round.
2
+ - insert:
3
+ - id: hive-runner
4
+ name: dsh-hive-runner
5
+ config: {}
package/index.js ADDED
@@ -0,0 +1,77 @@
1
+ /**
2
+ * DSH host half for Hive.
3
+ *
4
+ * Two tools, both thin wrappers over the hive CLIs:
5
+ * hive_run_round -> hive-run --once (triage, claim, spawn, verify, record)
6
+ * hive_tasks_ready -> hive-tasks ready --json
7
+ *
8
+ * The heavy lifting stays in the CLI packages; this plugin only makes them reachable
9
+ * from a DSH agent without leaving the harness.
10
+ */
11
+ import { execFile } from "node:child_process";
12
+ import { promisify } from "node:util";
13
+ import { defineTool } from "@deepseek-ai/dsh-tools";
14
+
15
+ const exec = promisify(execFile);
16
+
17
+ export const name = "hive-runner";
18
+ export const inject = ["tools"];
19
+
20
+ function bin(envName, fallback) {
21
+ return process.env[envName] || fallback;
22
+ }
23
+
24
+ async function runJson(file, args, cwd) {
25
+ const { stdout } = await exec(file, args, { cwd, timeout: 120000, maxBuffer: 16 * 1024 * 1024 });
26
+ return stdout;
27
+ }
28
+
29
+ export function apply(ctx, config = {}) {
30
+ const cwd = config.cwd || process.cwd();
31
+
32
+ ctx.tools.register(
33
+ defineTool({
34
+ name: "hive_run_round",
35
+ description:
36
+ "Run one round of Hive work in this repository: triage recorded conflicts, take ready task cards, spawn one agent per card, verify each commit, record done or fail, then stop. Returns the per-card result lines.",
37
+ parameters: {
38
+ concurrency: { type: "number", description: "How many agents may run at once. Default 3." },
39
+ timeout: { type: "string", description: "Hard limit per agent, for example 15m. Default 15m." },
40
+ agent: { type: "string", description: "Identity used for claims. Defaults to HIVE_AGENT or hive-runner." }
41
+ },
42
+ output: { schema: { type: "string" } },
43
+ execute: async (args = {}) => {
44
+ const argv = ["--once", "--agent", args.agent || process.env.HIVE_AGENT || "hive-runner"];
45
+ if (args.concurrency) argv.push("--concurrency", String(args.concurrency));
46
+ if (args.timeout) argv.push("--timeout", String(args.timeout));
47
+ const { stdout } = await exec(bin("HIVE_RUN_BIN", "hive-run"), argv, {
48
+ cwd,
49
+ timeout: 30 * 60 * 1000,
50
+ maxBuffer: 16 * 1024 * 1024,
51
+ });
52
+ return stdout.trim() || "round finished with no output";
53
+ },
54
+ }),
55
+ );
56
+
57
+ ctx.tools.register(
58
+ defineTool({
59
+ name: "hive_tasks_ready",
60
+ description:
61
+ "List the task cards that are ready to be claimed right now, best first (dependencies done, mode allows them). Returns the raw JSON array.",
62
+ parameters: {},
63
+ output: { schema: { type: "string" } },
64
+ execute: async () => runJson(bin("HIVE_TASKS_BIN", "hive-tasks"), ["ready", "--json"], cwd),
65
+ }),
66
+ );
67
+
68
+ ctx.tools.register(
69
+ defineTool({
70
+ name: "hive_board",
71
+ description: "Show which agents are on the board right now: who is working, on which card, with which paths.",
72
+ parameters: {},
73
+ output: { schema: { type: "string" } },
74
+ execute: async () => runJson(bin("HIVE_BIN", "hive"), ["board", "--json"], cwd),
75
+ }),
76
+ );
77
+ }
package/package.json CHANGED
@@ -1,6 +1,27 @@
1
1
  {
2
2
  "name": "dsh-hive-runner",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "DSH host plugin for Hive: run a round of agent work from inside the harness.",
5
+ "type": "module",
6
+ "main": "./index.js",
7
+ "files": [
8
+ "index.js",
9
+ "cordis.patch.yml",
10
+ "README.md"
11
+ ],
12
+ "peerDependencies": {
13
+ "@deepseek-ai/dsh-tools": "*"
14
+ },
15
+ "dsh": {
16
+ "bundle": {
17
+ "patch": "./cordis.patch.yml"
18
+ }
19
+ },
20
+ "keywords": [
21
+ "dsh-plugin",
22
+ "hive",
23
+ "agents",
24
+ "swarm"
25
+ ],
26
+ "license": "MIT"
27
+ }