@guyghost/swarm-dao-codex-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.
package/AGENTS.md ADDED
@@ -0,0 +1,89 @@
1
+ # AGENTS.md — Swarm DAO governance
2
+
3
+ This repository is governed by **Swarm DAO**, a multi-agent governance layer.
4
+ Proposals are deliberated by a swarm of agents, validated by quality-control
5
+ gates, then executed and tracked.
6
+
7
+ ## Workflow (always follow this order)
8
+
9
+ 1. `dao_setup` — create the default 7 product agents (once per repo).
10
+ 2. `dao_propose` — open a proposal (`title`, `type`, `description`).
11
+ 3. `dao_deliberate proposalId=N` — returns a dispatch plan naming the agents and
12
+ the model each should use.
13
+ 4. Spawn one sub-agent per dispatch-plan entry (Codex subagents / `codex exec`).
14
+ 5. `dao_record_outputs proposalId=N outputs=[...]` — feed each sub-agent's
15
+ `agentId` + `content` back into the DAO.
16
+ 6. `dao_control proposalId=N` — run the quality gates.
17
+ 7. `dao_execute proposalId=N` — apply the approved change.
18
+ 8. `dao_ship proposalId=N` — cascade and finalize dependencies.
19
+
20
+ ## Rules
21
+
22
+ - Treat `dao_*` tool results as the source of truth for DAO state.
23
+ - Never hand-edit files under `.swarm-dao/` — always use the DAO tools.
24
+ - If a gate fails in `dao_control`, fix the root cause; do not force-skip.
25
+ - Run `dao_dry_run` before `dao_execute` for risky changes.
26
+ - Use `dao_rollback` to revert a misbehaving executed proposal.
27
+ - Rate outcomes with `dao_rate` to keep the governance health score accurate.
28
+
29
+ ## Complete command reference
30
+
31
+ The canonical list of DAO commands lives in the core command registry and is
32
+ mirrored here. Every command maps to one MCP tool. When the user types
33
+ `/dao <command>`, invoke the matching `dao_*` tool.
34
+
35
+ > The registry is the single source of truth. If this list drifts from
36
+ > `packages/core/src/commands/registry.ts`, the registry wins.
37
+
38
+ ### Setup
39
+
40
+ - `/dao setup` → `dao_setup` — Initialize the DAO with the default 7 product agents
41
+
42
+ ### Propose
43
+
44
+ - `/dao propose` → `dao_propose` — Create a new proposal
45
+ - `/dao update-proposal` → `dao_update_proposal` — Update structured fields on an open proposal
46
+
47
+ ### Deliberate
48
+
49
+ - `/dao deliberate` → `dao_deliberate` — Run swarm deliberation / build the dispatch plan
50
+ - `/dao record-outputs` → `dao_record_outputs` — Record sub-agent outputs and finalize deliberation
51
+
52
+ ### Control
53
+
54
+ - `/dao control` → `dao_control` — Run the quality-control gates
55
+
56
+ ### Execute
57
+
58
+ - `/dao execute` → `dao_execute` — Execute an approved / controlled proposal
59
+
60
+ ### Ship
61
+
62
+ - `/dao ship` → `dao_ship` — Ship a controlled proposal (optionally cascade dependencies)
63
+
64
+ ### Retro
65
+
66
+ - `/dao rollback` → `dao_rollback` — Revert an executed proposal to its pre-execution snapshot
67
+ - `/dao rate` → `dao_rate` — Rate a proposal outcome (1–5 stars)
68
+
69
+ ### Discover
70
+
71
+ - `/dao help` → `dao_help` — Show the DAO workflow and every available command
72
+ - `/dao status` → `dao_dashboard` — Show the governance health dashboard
73
+ - `/dao list` → `dao_list` — List all proposals
74
+ - `/dao agents` → `dao_agents` — List the configured DAO agents
75
+ - `/dao plan` → `dao_plan` — Show the delivery plan for a proposal
76
+ - `/dao artefacts` → `dao_artefacts` — View the auto-generated artefacts for a proposal
77
+ - `/dao audit` → `dao_audit` — View the audit trail
78
+ - `/dao dry-run` → `dao_dry_run` — Preview execution without applying changes
79
+ - `/dao roundtable` → `dao_roundtable` — Ask every agent to suggest a proposal idea
80
+
81
+ ### Governance
82
+
83
+ - `/dao propose-amendment` → `dao_propose_amendment` — Propose an amendment (agents, config, quorum, gates)
84
+
85
+ ### GitHub
86
+
87
+ - `/dao github-config` → `dao_config_github` — Configure the GitHub integration
88
+ - `/dao github-branch` → `dao_github_create_branch` — Create a GitHub branch for a proposal
89
+ - `/dao github-pr` → `dao_github_open_pr` — Open a GitHub pull request for a proposal
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @guyghost/swarm-dao-codex-adapter
2
+
3
+ Swarm DAO governance adapter for **OpenAI Codex** (Codex CLI).
4
+
5
+ It bundles:
6
+
7
+ - the Swarm DAO MCP server (`swarm-dao-codex` bin)
8
+ - a native `config.toml` snippet for `[mcp_servers]`
9
+ - an `AGENTS.md` instructions file
10
+ - a `HostAdapter` implementation for programmatic use
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install @guyghost/swarm-dao-codex-adapter
16
+ ```
17
+
18
+ ## Configure
19
+
20
+ ### MCP server
21
+
22
+ Append the block from `config/mcp-config.toml` to your Codex config
23
+ (`~/.codex/config.toml` or the project-local config):
24
+
25
+ ```toml
26
+ [mcp_servers.swarm_dao]
27
+ command = "npx"
28
+ args = ["-y", "@guyghost/swarm-dao-codex-adapter"]
29
+ env = { DAO_ROOT = "." }
30
+ ```
31
+
32
+ The `dao_*` tools then become available to Codex as the `swarm_dao` MCP server.
33
+
34
+ ### Instructions
35
+
36
+ Append the contents of `AGENTS.md` to your repo's `AGENTS.md` so Codex follows
37
+ the DAO workflow.
38
+
39
+ ## Run the server directly
40
+
41
+ ```bash
42
+ swarm-dao-codex # uses $DAO_ROOT or cwd
43
+ ```
44
+
45
+ ## Programmatic API
46
+
47
+ ```ts
48
+ import { createCodexHostAdapter, startCodexServer } from "@guyghost/swarm-dao-codex-adapter";
49
+
50
+ const adapter = createCodexHostAdapter("/path/to/repo");
51
+ await startCodexServer();
52
+ ```
53
+
54
+ ## License
55
+
56
+ MIT
@@ -0,0 +1,9 @@
1
+ # Swarm DAO — Codex MCP server config
2
+ #
3
+ # Add this block to your Codex CLI config (~/.codex/config.toml or the
4
+ # project-local codex config) to register the Swarm DAO MCP server.
5
+
6
+ [mcp_servers.swarm_dao]
7
+ command = "npx"
8
+ args = ["-y", "@guyghost/swarm-dao-codex-adapter"]
9
+ env = { DAO_ROOT = "." }
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 { startCodexServer } from "./index.js";
3
+ startCodexServer().catch((error) => {
4
+ console.error("[swarm-dao-codex] 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,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACjC,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IACjD,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 OpenAI Codex (`hostId = "codex"`). */
5
+ export declare function createCodexHostAdapter(workDir?: string): HostAdapter;
6
+ /** Boot the Swarm DAO MCP server with Codex defaults. */
7
+ export declare function startCodexServer(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,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,OAAO,SAAmB,GAAG,WAAW,CAE9E;AAED,yDAAyD;AACzD,wBAAsB,gBAAgB,CAAC,OAAO,SAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhF"}
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 OpenAI Codex (`hostId = "codex"`). */
4
+ export function createCodexHostAdapter(workDir = resolveDaoRoot()) {
5
+ return createStdioHostAdapter("codex", workDir);
6
+ }
7
+ /** Boot the Swarm DAO MCP server with Codex defaults. */
8
+ export async function startCodexServer(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,sEAAsE;AACtE,MAAM,UAAU,sBAAsB,CAAC,OAAO,GAAG,cAAc,EAAE;IAC/D,OAAO,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,yDAAyD;AACzD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAO,GAAG,cAAc,EAAE;IAC/D,MAAM,sBAAsB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@guyghost/swarm-dao-codex-adapter",
3
+ "version": "0.2.0",
4
+ "description": "Swarm DAO governance adapter for OpenAI Codex — MCP server, native config.toml, and AGENTS.md",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "sideEffects": false,
9
+ "bin": {
10
+ "swarm-dao-codex": "./dist/cli.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "README.md",
15
+ "config/mcp-config.toml",
16
+ "AGENTS.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
+ "codex",
41
+ "openai",
42
+ "codex-cli",
43
+ "mcp",
44
+ "dao",
45
+ "governance",
46
+ "multi-agent",
47
+ "deliberation",
48
+ "quality-gates"
49
+ ],
50
+ "author": "guyghost",
51
+ "license": "MIT",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/guyghost/swarm-dao.git",
55
+ "directory": "packages/codex-adapter"
56
+ },
57
+ "bugs": {
58
+ "url": "https://github.com/guyghost/swarm-dao/issues"
59
+ },
60
+ "homepage": "https://github.com/guyghost/swarm-dao#readme",
61
+ "publishConfig": {
62
+ "access": "public"
63
+ }
64
+ }