@codemcp/ade-harnesses 0.2.0 → 0.2.3

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.
@@ -34,7 +34,7 @@ function getKiroTools(config) {
34
34
  return [
35
35
  ...(getCapabilityDecision(config, "read") !== "deny" ? ["read"] : []),
36
36
  ...(allowsCapability(config, "edit_write") ? ["write"] : []),
37
- ...(allowsCapability(config, "bash_unsafe") ? ["shell"] : []),
37
+ ...(allowsCapability(config, "bash_unsafe") ? ["shell(*)"] : ["shell"]),
38
38
  "spec",
39
39
  ...mcpTools
40
40
  ];
package/package.json CHANGED
@@ -3,33 +3,41 @@
3
3
  "main": "dist/index.js",
4
4
  "types": "dist/index.d.ts",
5
5
  "type": "module",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
6
15
  "publishConfig": {
7
16
  "access": "public"
8
17
  },
9
18
  "dependencies": {
10
19
  "@codemcp/skills": "^2.3.0",
11
- "@codemcp/ade-core": "0.2.0"
20
+ "@codemcp/ade-core": "0.2.3"
12
21
  },
13
22
  "devDependencies": {
14
- "@typescript-eslint/eslint-plugin": "^8.21.0",
15
- "@typescript-eslint/parser": "^8.21.0",
16
- "eslint": "^9.18.0",
17
- "eslint-config-prettier": "^10.0.1",
23
+ "oxlint": "^1.0.0",
18
24
  "prettier": "^3.4.2",
19
- "rimraf": "^6.0.1",
20
- "typescript": "^5.7.3"
25
+ "rimraf": "^6.1.3",
26
+ "tsx": "^4.19.0",
27
+ "typescript": "^5.9.3",
28
+ "vitest": "^3.2.4"
21
29
  },
22
- "version": "0.2.0",
30
+ "version": "0.2.3",
23
31
  "scripts": {
24
32
  "build": "tsc -p tsconfig.build.json",
25
33
  "clean:build": "rimraf ./dist",
26
- "dev": "nodemon",
27
- "lint": "eslint .",
28
- "lint:fix": "eslint --fix .",
34
+ "dev": "tsx watch src/index.ts",
35
+ "lint": "oxlint .",
36
+ "lint:fix": "oxlint --fix .",
29
37
  "format": "prettier --check .",
30
38
  "format:fix": "prettier --write .",
31
39
  "test": "vitest --run",
32
40
  "test:watch": "vitest",
33
- "typecheck": "tsc"
41
+ "typecheck": "tsc --noEmit"
34
42
  }
35
43
  }
package/.prettierignore DELETED
@@ -1 +0,0 @@
1
- dist
@@ -1,4 +0,0 @@
1
-
2
- > @codemcp/ade-harnesses@0.2.0 build /home/runner/work/ade/ade/packages/harnesses
3
- > tsc -p tsconfig.build.json
4
-
@@ -1,6 +0,0 @@
1
-
2
- > @codemcp/ade-harnesses@0.2.0 format /home/runner/work/ade/ade/packages/harnesses
3
- > prettier --check .
4
-
5
- Checking formatting...
6
- All matched files use Prettier code style!
@@ -1,4 +0,0 @@
1
-
2
- > @codemcp/ade-harnesses@0.2.0 lint /home/runner/work/ade/ade/packages/harnesses
3
- > eslint .
4
-
@@ -1,23 +0,0 @@
1
-
2
- > @codemcp/ade-harnesses@0.2.0 test /home/runner/work/ade/ade/packages/harnesses
3
- > vitest --run
4
-
5
-
6
-  RUN  v3.2.4 /home/runner/work/ade/ade/packages/harnesses
7
-
8
- ✓ src/writers/copilot.spec.ts (5 tests) 80ms
9
- ✓ src/writers/claude-code.spec.ts (10 tests) 115ms
10
- ✓ src/writers/opencode.spec.ts (2 tests) 94ms
11
- ✓ src/writers/cline.spec.ts (5 tests) 64ms
12
- ✓ src/writers/cursor.spec.ts (6 tests) 97ms
13
- ✓ src/writers/kiro.spec.ts (4 tests) 92ms
14
- ✓ src/writers/windsurf.spec.ts (4 tests) 49ms
15
- ✓ src/writers/universal.spec.ts (3 tests) 34ms
16
- ✓ src/writers/roo-code.spec.ts (4 tests) 73ms
17
- ✓ src/index.spec.ts (4 tests) 5ms
18
-
19
-  Test Files  10 passed (10)
20
-  Tests  47 passed (47)
21
-  Start at  14:05:59
22
-  Duration  3.61s (transform 706ms, setup 0ms, collect 1.70s, tests 703ms, environment 11ms, prepare 2.58s)
23
-
@@ -1,4 +0,0 @@
1
-
2
- > @codemcp/ade-harnesses@0.2.0 typecheck /home/runner/work/ade/ade/packages/harnesses
3
- > tsc
4
-
package/eslint.config.mjs DELETED
@@ -1,40 +0,0 @@
1
- import js from "@eslint/js";
2
- import { parser, configs } from "typescript-eslint";
3
- import prettier from "eslint-config-prettier";
4
-
5
- export default [
6
- js.configs.recommended,
7
- ...configs.recommended,
8
- prettier,
9
- {
10
- // Config for TypeScript files
11
- files: ["**/*.{ts,tsx}"],
12
- languageOptions: {
13
- parser,
14
- parserOptions: {
15
- project: ["./tsconfig.json", "./tsconfig.vitest.json"]
16
- }
17
- }
18
- },
19
- {
20
- // Config for JavaScript files - no TypeScript parsing
21
- files: ["**/*.{js,jsx}"],
22
- ...js.configs.recommended
23
- },
24
- {
25
- // Relaxed rules for test files
26
- files: ["**/*.test.ts", "**/*.spec.ts"],
27
- rules: {
28
- "@typescript-eslint/no-explicit-any": "off",
29
- "@typescript-eslint/no-unused-vars": "off"
30
- }
31
- },
32
- {
33
- ignores: [
34
- "**/node_modules/**",
35
- "**/dist/**",
36
- ".pnpm-store/**",
37
- "pnpm-lock.yaml"
38
- ]
39
- }
40
- ];
package/src/index.spec.ts DELETED
@@ -1,45 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { allHarnessWriters, getHarnessWriter, getHarnessIds } from "./index.js";
3
-
4
- describe("harness registry", () => {
5
- it("exports all harness writers", () => {
6
- expect(allHarnessWriters).toHaveLength(9);
7
- const ids = allHarnessWriters.map((w) => w.id);
8
- expect(ids).toContain("universal");
9
- expect(ids).toContain("claude-code");
10
- expect(ids).toContain("cursor");
11
- expect(ids).toContain("copilot");
12
- expect(ids).toContain("windsurf");
13
- expect(ids).toContain("cline");
14
- expect(ids).toContain("roo-code");
15
- expect(ids).toContain("kiro");
16
- expect(ids).toContain("opencode");
17
- });
18
-
19
- it("looks up harness by id", () => {
20
- expect(getHarnessWriter("cursor")?.label).toBe("Cursor");
21
- expect(getHarnessWriter("nonexistent")).toBeUndefined();
22
- });
23
-
24
- it("returns all harness ids", () => {
25
- const ids = getHarnessIds();
26
- expect(ids).toEqual([
27
- "universal",
28
- "claude-code",
29
- "cursor",
30
- "copilot",
31
- "windsurf",
32
- "cline",
33
- "roo-code",
34
- "kiro",
35
- "opencode"
36
- ]);
37
- });
38
-
39
- it("all writers have label and description", () => {
40
- for (const w of allHarnessWriters) {
41
- expect(w.label).toBeTruthy();
42
- expect(w.description).toBeTruthy();
43
- }
44
- });
45
- });
package/src/index.ts DELETED
@@ -1,47 +0,0 @@
1
- export type { HarnessWriter } from "./types.js";
2
- export { installSkills } from "./skills-installer.js";
3
- export { writeInlineSkills } from "./util.js";
4
-
5
- export { universalWriter } from "./writers/universal.js";
6
- export { claudeCodeWriter } from "./writers/claude-code.js";
7
- export { cursorWriter } from "./writers/cursor.js";
8
- export { copilotWriter } from "./writers/copilot.js";
9
- export { windsurfWriter } from "./writers/windsurf.js";
10
- export { clineWriter } from "./writers/cline.js";
11
- export { rooCodeWriter } from "./writers/roo-code.js";
12
- export { kiroWriter } from "./writers/kiro.js";
13
- export { opencodeWriter } from "./writers/opencode.js";
14
-
15
- import type { HarnessWriter } from "./types.js";
16
- import { universalWriter } from "./writers/universal.js";
17
- import { claudeCodeWriter } from "./writers/claude-code.js";
18
- import { cursorWriter } from "./writers/cursor.js";
19
- import { copilotWriter } from "./writers/copilot.js";
20
- import { windsurfWriter } from "./writers/windsurf.js";
21
- import { clineWriter } from "./writers/cline.js";
22
- import { rooCodeWriter } from "./writers/roo-code.js";
23
- import { kiroWriter } from "./writers/kiro.js";
24
- import { opencodeWriter } from "./writers/opencode.js";
25
-
26
- /** All built-in harness writers, ordered for wizard display. */
27
- export const allHarnessWriters: HarnessWriter[] = [
28
- universalWriter,
29
- claudeCodeWriter,
30
- cursorWriter,
31
- copilotWriter,
32
- windsurfWriter,
33
- clineWriter,
34
- rooCodeWriter,
35
- kiroWriter,
36
- opencodeWriter
37
- ];
38
-
39
- /** Look up a harness writer by id. */
40
- export function getHarnessWriter(id: string): HarnessWriter | undefined {
41
- return allHarnessWriters.find((w) => w.id === id);
42
- }
43
-
44
- /** All valid harness IDs. */
45
- export function getHarnessIds(): string[] {
46
- return allHarnessWriters.map((w) => w.id);
47
- }
@@ -1,173 +0,0 @@
1
- import type {
2
- AutonomyCapability,
3
- LogicalConfig,
4
- PermissionDecision,
5
- PermissionRule
6
- } from "@codemcp/ade-core";
7
-
8
- const SENSIBLE_DEFAULTS_RULES: Record<string, PermissionRule> = {
9
- read: {
10
- "*": "allow",
11
- "*.env": "deny",
12
- "*.env.*": "deny",
13
- "*.env.example": "allow"
14
- },
15
- edit: "allow",
16
- glob: "allow",
17
- grep: "allow",
18
- list: "allow",
19
- lsp: "allow",
20
- task: "allow",
21
- todoread: "deny",
22
- todowrite: "deny",
23
- skill: "deny",
24
- webfetch: "ask",
25
- websearch: "ask",
26
- codesearch: "ask",
27
- bash: {
28
- "*": "deny",
29
- "grep *": "allow",
30
- "rg *": "allow",
31
- "find *": "allow",
32
- "fd *": "allow",
33
- ls: "allow",
34
- "ls *": "allow",
35
- "cat *": "allow",
36
- "head *": "allow",
37
- "tail *": "allow",
38
- "wc *": "allow",
39
- "sort *": "allow",
40
- "uniq *": "allow",
41
- "diff *": "allow",
42
- "echo *": "allow",
43
- "printf *": "allow",
44
- pwd: "allow",
45
- "which *": "allow",
46
- "type *": "allow",
47
- whoami: "allow",
48
- date: "allow",
49
- "date *": "allow",
50
- env: "allow",
51
- "tree *": "allow",
52
- "file *": "allow",
53
- "stat *": "allow",
54
- "readlink *": "allow",
55
- "realpath *": "allow",
56
- "dirname *": "allow",
57
- "basename *": "allow",
58
- "sed *": "allow",
59
- "awk *": "allow",
60
- "cut *": "allow",
61
- "tr *": "allow",
62
- "tee *": "allow",
63
- "xargs *": "allow",
64
- "jq *": "allow",
65
- "yq *": "allow",
66
- "mkdir *": "allow",
67
- "touch *": "allow",
68
- "cp *": "ask",
69
- "mv *": "ask",
70
- "ln *": "ask",
71
- "npm *": "ask",
72
- "node *": "ask",
73
- "pip *": "ask",
74
- "python *": "ask",
75
- "python3 *": "ask",
76
- "rm *": "deny",
77
- "rmdir *": "deny",
78
- "curl *": "deny",
79
- "wget *": "deny",
80
- "chmod *": "deny",
81
- "chown *": "deny",
82
- "sudo *": "deny",
83
- "su *": "deny",
84
- "sh *": "deny",
85
- "bash *": "deny",
86
- "zsh *": "deny",
87
- "eval *": "deny",
88
- "exec *": "deny",
89
- "source *": "deny",
90
- ". *": "deny",
91
- "nohup *": "deny",
92
- "dd *": "deny",
93
- "mkfs *": "deny",
94
- "mount *": "deny",
95
- "umount *": "deny",
96
- "kill *": "deny",
97
- "killall *": "deny",
98
- "pkill *": "deny",
99
- "nc *": "deny",
100
- "ncat *": "deny",
101
- "ssh *": "deny",
102
- "scp *": "deny",
103
- "rsync *": "deny",
104
- "docker *": "deny",
105
- "kubectl *": "deny",
106
- "systemctl *": "deny",
107
- "service *": "deny",
108
- "crontab *": "deny",
109
- reboot: "deny",
110
- "shutdown *": "deny",
111
- "passwd *": "deny",
112
- "useradd *": "deny",
113
- "userdel *": "deny",
114
- "iptables *": "deny"
115
- },
116
- external_directory: "deny",
117
- doom_loop: "deny"
118
- };
119
-
120
- export function getAutonomyProfile(config: LogicalConfig) {
121
- return config.permission_policy?.profile;
122
- }
123
-
124
- export function hasPermissionPolicy(config: LogicalConfig): boolean {
125
- return config.permission_policy !== undefined;
126
- }
127
-
128
- export function getCapabilityDecision(
129
- config: LogicalConfig,
130
- capability: AutonomyCapability
131
- ): PermissionDecision | undefined {
132
- return config.permission_policy?.capabilities?.[capability];
133
- }
134
-
135
- export function allowsCapability(
136
- config: LogicalConfig,
137
- capability: AutonomyCapability
138
- ): boolean {
139
- return getCapabilityDecision(config, capability) === "allow";
140
- }
141
-
142
- export function keepsWebOnAsk(config: LogicalConfig): boolean {
143
- return getCapabilityDecision(config, "web") === "ask";
144
- }
145
-
146
- export function getHarnessPermissionRules(
147
- config: LogicalConfig
148
- ): Record<string, PermissionRule> | undefined {
149
- switch (config.permission_policy?.profile) {
150
- case "rigid":
151
- return {
152
- "*": "ask",
153
- webfetch: "ask",
154
- websearch: "ask",
155
- codesearch: "ask",
156
- external_directory: "deny",
157
- doom_loop: "deny"
158
- };
159
- case "sensible-defaults":
160
- return SENSIBLE_DEFAULTS_RULES;
161
- case "max-autonomy":
162
- return {
163
- "*": "allow",
164
- webfetch: "ask",
165
- websearch: "ask",
166
- codesearch: "ask",
167
- external_directory: "deny",
168
- doom_loop: "deny"
169
- };
170
- default:
171
- return undefined;
172
- }
173
- }
@@ -1,54 +0,0 @@
1
- import { join } from "node:path";
2
- import type { SkillDefinition, InlineSkill } from "@codemcp/ade-core";
3
- import { runAdd } from "@codemcp/skills/api";
4
-
5
- function isInlineSkill(skill: SkillDefinition): skill is InlineSkill {
6
- return "body" in skill;
7
- }
8
-
9
- /**
10
- * Install skills using the @codemcp/skills programmatic API.
11
- *
12
- * Inline skills are expected to already exist as SKILL.md files under
13
- * `<projectRoot>/.ade/skills/<name>/` (written by the agent writer).
14
- * This function calls `runAdd` with the local path for inline skills
15
- * and the remote source for external skills.
16
- *
17
- * Note: `runAdd` uses `process.cwd()` to determine the install destination.
18
- * This function changes cwd to `projectRoot` before calling `runAdd`.
19
- */
20
- export async function installSkills(
21
- skills: SkillDefinition[],
22
- projectRoot: string
23
- ): Promise<void> {
24
- if (skills.length === 0) return;
25
-
26
- const originalCwd = process.cwd();
27
- process.chdir(projectRoot);
28
-
29
- try {
30
- for (const skill of skills) {
31
- const source = isInlineSkill(skill)
32
- ? join(projectRoot, ".ade", "skills", skill.name)
33
- : skill.source;
34
-
35
- try {
36
- await runAdd([source], { yes: true, all: true });
37
- } catch (err) {
38
- // runAdd may throw on network errors for external skills.
39
- // Log and continue — inline skills should always succeed.
40
- console.warn(
41
- `Warning: failed to install skill "${skill.name}" from ${source}:`,
42
- err instanceof Error ? err.message : err
43
- );
44
- }
45
- }
46
- } finally {
47
- // Restore cwd only if the original directory still exists
48
- try {
49
- process.chdir(originalCwd);
50
- } catch {
51
- // Original cwd may have been removed (e.g. in tests)
52
- }
53
- }
54
- }
package/src/types.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { AgentWriterDef } from "@codemcp/ade-core";
2
-
3
- /**
4
- * A harness writer extends AgentWriterDef with metadata for display in the
5
- * setup wizard and CLI help.
6
- */
7
- export interface HarnessWriter extends AgentWriterDef {
8
- /** Human-readable label for the wizard (e.g. "Claude Code") */
9
- label: string;
10
- /** Short description shown as hint in the wizard */
11
- description: string;
12
- }