@guyghost/swarm-dao-copilot-adapter 0.2.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.
@@ -0,0 +1,12 @@
1
+ {
2
+ "servers": {
3
+ "swarm-dao": {
4
+ "type": "stdio",
5
+ "command": "npx",
6
+ "args": ["-y", "@guyghost/swarm-dao-copilot-adapter"],
7
+ "env": {
8
+ "DAO_ROOT": "${workspaceFolder}"
9
+ }
10
+ }
11
+ }
12
+ }
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # @guyghost/swarm-dao-copilot-adapter
2
+
3
+ Swarm DAO governance adapter for **GitHub Copilot** (VS Code Copilot Chat,
4
+ Copilot CLI, and the Copilot coding agent).
5
+
6
+ It bundles:
7
+
8
+ - the Swarm DAO MCP server (`swarm-dao-copilot` bin)
9
+ - a native `.vscode/mcp.json` template
10
+ - Copilot custom instructions (`copilot-instructions.md`)
11
+ - a `HostAdapter` implementation for programmatic use
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ npm install @guyghost/swarm-dao-copilot-adapter
17
+ ```
18
+
19
+ ## Configure
20
+
21
+ ### VS Code Copilot Chat
22
+
23
+ Copy `.vscode/mcp.json` into your project (it registers the `swarm-dao` MCP
24
+ server). Restart VS Code, then the `dao_*` tools appear under the `swarm-dao`
25
+ MCP server in Copilot Chat.
26
+
27
+ ### Custom instructions
28
+
29
+ Append the contents of `copilot-instructions.md` to your repo's
30
+ `.github/copilot-instructions.md` so Copilot follows the DAO workflow.
31
+
32
+ ## Run the server directly
33
+
34
+ ```bash
35
+ swarm-dao-copilot # uses $DAO_ROOT or cwd
36
+ ```
37
+
38
+ ## Programmatic API
39
+
40
+ ```ts
41
+ import { createCopilotHostAdapter, startCopilotServer } from "@guyghost/swarm-dao-copilot-adapter";
42
+
43
+ const adapter = createCopilotHostAdapter("/path/to/repo");
44
+ await startCopilotServer(); // boots the stdio MCP server
45
+ ```
46
+
47
+ ## Workflow
48
+
49
+ See [`copilot-instructions.md`](./copilot-instructions.md) for the full
50
+ DAO workflow (setup → propose → deliberate → dispatch → record → control →
51
+ execute → ship).
52
+
53
+ ## License
54
+
55
+ MIT
@@ -0,0 +1,92 @@
1
+ # Swarm DAO — GitHub Copilot Instructions
2
+
3
+ You are operating inside a **Swarm DAO**-governed repository. Swarm DAO is a
4
+ multi-agent governance layer: proposals are deliberated by a swarm of agents,
5
+ validated by quality-control gates, then executed and tracked.
6
+
7
+ ## The DAO workflow
8
+
9
+ Always follow this order. Do not skip steps.
10
+
11
+ 1. **Setup** — `dao_setup` once per repo to create the default 7 product agents.
12
+ 2. **Propose** — `dao_propose` with a `title`, `type`, and `description`.
13
+ 3. **Deliberate** — `dao_deliberate proposalId=N` returns a dispatch plan that
14
+ names the agents to run and the model each should use.
15
+ 4. **Dispatch** — spawn one sub-agent per entry in the dispatch plan (Copilot
16
+ cannot spawn agents through MCP, so run them yourself as separate tasks).
17
+ 5. **Record** — `dao_record_outputs proposalId=N outputs=[...]` with each
18
+ sub-agent's `agentId` + `content`.
19
+ 6. **Control** — `dao_control proposalId=N` runs the quality gates.
20
+ 7. **Execute** — `dao_execute proposalId=N` applies the approved change.
21
+ 8. **Ship** — `dao_ship proposalId=N` cascades and finalizes dependencies.
22
+
23
+ ## Operating rules
24
+
25
+ - Treat every `dao_*` tool result as the source of truth for DAO state.
26
+ - Never edit `.swarm-dao/` files directly — always go through the DAO tools.
27
+ - If `dao_control` fails a gate, fix the root cause, do not force-skip.
28
+ - Prefer `dao_dry_run` before `dao_execute` for risky changes.
29
+ - Use `dao_rollback` if an executed proposal misbehaves.
30
+ - Rate outcomes with `dao_rate` so the governance health score stays accurate.
31
+
32
+ ## Complete command reference
33
+
34
+ The canonical list of DAO commands lives in the core command registry and is
35
+ mirrored here. Every command maps to one MCP tool. When the user types
36
+ `/dao <command>`, invoke the matching `dao_*` tool.
37
+
38
+ > The registry is the single source of truth. If this list drifts from
39
+ > `packages/core/src/commands/registry.ts`, the registry wins.
40
+
41
+ ### Setup
42
+
43
+ - `/dao setup` → `dao_setup` — Initialize the DAO with the default 7 product agents
44
+
45
+ ### Propose
46
+
47
+ - `/dao propose` → `dao_propose` — Create a new proposal
48
+ - `/dao update-proposal` → `dao_update_proposal` — Update structured fields on an open proposal
49
+
50
+ ### Deliberate
51
+
52
+ - `/dao deliberate` → `dao_deliberate` — Run swarm deliberation / build the dispatch plan
53
+ - `/dao record-outputs` → `dao_record_outputs` — Record sub-agent outputs and finalize deliberation
54
+
55
+ ### Control
56
+
57
+ - `/dao control` → `dao_control` — Run the quality-control gates
58
+
59
+ ### Execute
60
+
61
+ - `/dao execute` → `dao_execute` — Execute an approved / controlled proposal
62
+
63
+ ### Ship
64
+
65
+ - `/dao ship` → `dao_ship` — Ship a controlled proposal (optionally cascade dependencies)
66
+
67
+ ### Retro
68
+
69
+ - `/dao rollback` → `dao_rollback` — Revert an executed proposal to its pre-execution snapshot
70
+ - `/dao rate` → `dao_rate` — Rate a proposal outcome (1–5 stars)
71
+
72
+ ### Discover
73
+
74
+ - `/dao help` → `dao_help` — Show the DAO workflow and every available command
75
+ - `/dao status` → `dao_dashboard` — Show the governance health dashboard
76
+ - `/dao list` → `dao_list` — List all proposals
77
+ - `/dao agents` → `dao_agents` — List the configured DAO agents
78
+ - `/dao plan` → `dao_plan` — Show the delivery plan for a proposal
79
+ - `/dao artefacts` → `dao_artefacts` — View the auto-generated artefacts for a proposal
80
+ - `/dao audit` → `dao_audit` — View the audit trail
81
+ - `/dao dry-run` → `dao_dry_run` — Preview execution without applying changes
82
+ - `/dao roundtable` → `dao_roundtable` — Ask every agent to suggest a proposal idea
83
+
84
+ ### Governance
85
+
86
+ - `/dao propose-amendment` → `dao_propose_amendment` — Propose an amendment (agents, config, quorum, gates)
87
+
88
+ ### GitHub
89
+
90
+ - `/dao github-config` → `dao_config_github` — Configure the GitHub integration
91
+ - `/dao github-branch` → `dao_github_create_branch` — Create a GitHub branch for a proposal
92
+ - `/dao github-pr` → `dao_github_open_pr` — Open a GitHub pull request for a proposal
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { startCopilotServer } from "./index.js";
3
+ startCopilotServer().catch((error) => {
4
+ console.error("[swarm-dao-copilot] fatal:", error);
5
+ process.exit(1);
6
+ });
7
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,kBAAkB,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACnC,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { HostAdapter } from "@guyghost/swarm-dao-core";
2
+ import { resolveDaoRoot } from "@guyghost/swarm-dao-mcp";
3
+ export { resolveDaoRoot };
4
+ /** Host adapter specialized for GitHub Copilot (`hostId = "copilot"`). */
5
+ export declare function createCopilotHostAdapter(workDir?: string): HostAdapter;
6
+ /** Boot the Swarm DAO MCP server with Copilot defaults. */
7
+ export declare function startCopilotServer(workDir?: string): Promise<void>;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAA0B,cAAc,EAA0B,MAAM,yBAAyB,CAAC;AAEzG,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,0EAA0E;AAC1E,wBAAgB,wBAAwB,CAAC,OAAO,SAAmB,GAAG,WAAW,CAEhF;AAED,2DAA2D;AAC3D,wBAAsB,kBAAkB,CAAC,OAAO,SAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAElF"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ import { createStdioHostAdapter, resolveDaoRoot, startSwarmDaoMcpServer } from "@guyghost/swarm-dao-mcp";
2
+ export { resolveDaoRoot };
3
+ /** Host adapter specialized for GitHub Copilot (`hostId = "copilot"`). */
4
+ export function createCopilotHostAdapter(workDir = resolveDaoRoot()) {
5
+ return createStdioHostAdapter("copilot", workDir);
6
+ }
7
+ /** Boot the Swarm DAO MCP server with Copilot defaults. */
8
+ export async function startCopilotServer(workDir = resolveDaoRoot()) {
9
+ await startSwarmDaoMcpServer(workDir);
10
+ }
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEzG,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,0EAA0E;AAC1E,MAAM,UAAU,wBAAwB,CAAC,OAAO,GAAG,cAAc,EAAE;IACjE,OAAO,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAAO,GAAG,cAAc,EAAE;IACjE,MAAM,sBAAsB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@guyghost/swarm-dao-copilot-adapter",
3
+ "version": "0.2.0",
4
+ "description": "Swarm DAO governance adapter for GitHub Copilot — MCP server, native config, and custom instructions",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "sideEffects": false,
9
+ "bin": {
10
+ "swarm-dao-copilot": "./dist/cli.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "README.md",
15
+ ".vscode/mcp.json",
16
+ "copilot-instructions.md"
17
+ ],
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ }
23
+ },
24
+ "scripts": {
25
+ "build": "tsc",
26
+ "test": "bun test",
27
+ "lint": "biome check .",
28
+ "typecheck": "tsc --noEmit",
29
+ "prepublishOnly": "bun run build"
30
+ },
31
+ "dependencies": {
32
+ "@guyghost/swarm-dao-core": "^0.3.0",
33
+ "@guyghost/swarm-dao-mcp": "^0.2.0"
34
+ },
35
+ "devDependencies": {
36
+ "@types/bun": "latest"
37
+ },
38
+ "keywords": [
39
+ "swarm-dao",
40
+ "copilot",
41
+ "github-copilot",
42
+ "mcp",
43
+ "dao",
44
+ "governance",
45
+ "multi-agent",
46
+ "deliberation",
47
+ "quality-gates"
48
+ ],
49
+ "author": "guyghost",
50
+ "license": "MIT",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/guyghost/swarm-dao.git",
54
+ "directory": "packages/copilot-adapter"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/guyghost/swarm-dao/issues"
58
+ },
59
+ "homepage": "https://github.com/guyghost/swarm-dao#readme",
60
+ "publishConfig": {
61
+ "access": "public"
62
+ }
63
+ }