@codemcp/ade-harnesses 0.1.1 → 0.2.2
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/package.json +20 -12
- package/.prettierignore +0 -1
- package/.turbo/turbo-build.log +0 -4
- package/.turbo/turbo-format.log +0 -6
- package/.turbo/turbo-lint.log +0 -4
- package/.turbo/turbo-test.log +0 -23
- package/.turbo/turbo-typecheck.log +0 -4
- package/eslint.config.mjs +0 -40
- package/src/index.spec.ts +0 -45
- package/src/index.ts +0 -47
- package/src/permission-policy.ts +0 -173
- package/src/skills-installer.ts +0 -54
- package/src/types.ts +0 -12
- package/src/util.ts +0 -221
- package/src/writers/claude-code.spec.ts +0 -320
- package/src/writers/claude-code.ts +0 -107
- package/src/writers/cline.spec.ts +0 -212
- package/src/writers/cline.ts +0 -24
- package/src/writers/copilot.spec.ts +0 -258
- package/src/writers/copilot.ts +0 -105
- package/src/writers/cursor.spec.ts +0 -219
- package/src/writers/cursor.ts +0 -95
- package/src/writers/kiro.spec.ts +0 -228
- package/src/writers/kiro.ts +0 -89
- package/src/writers/opencode.spec.ts +0 -258
- package/src/writers/opencode.ts +0 -67
- package/src/writers/roo-code.spec.ts +0 -197
- package/src/writers/roo-code.ts +0 -71
- package/src/writers/universal.spec.ts +0 -134
- package/src/writers/universal.ts +0 -84
- package/src/writers/windsurf.spec.ts +0 -178
- package/src/writers/windsurf.ts +0 -89
- package/tsconfig.build.json +0 -8
- package/tsconfig.json +0 -7
- package/tsconfig.tsbuildinfo +0 -1
- package/tsconfig.vitest.json +0 -7
- package/vitest.config.ts +0 -5
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.
|
|
20
|
+
"@codemcp/ade-core": "0.2.2"
|
|
12
21
|
},
|
|
13
22
|
"devDependencies": {
|
|
14
|
-
"
|
|
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.
|
|
20
|
-
"
|
|
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.
|
|
30
|
+
"version": "0.2.2",
|
|
23
31
|
"scripts": {
|
|
24
32
|
"build": "tsc -p tsconfig.build.json",
|
|
25
33
|
"clean:build": "rimraf ./dist",
|
|
26
|
-
"dev": "
|
|
27
|
-
"lint": "
|
|
28
|
-
"lint: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
|
package/.turbo/turbo-build.log
DELETED
package/.turbo/turbo-format.log
DELETED
package/.turbo/turbo-lint.log
DELETED
package/.turbo/turbo-test.log
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @codemcp/ade-harnesses@0.1.1 test /home/runner/work/ade/ade/packages/harnesses
|
|
3
|
-
> vitest --run
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[1m[46m RUN [49m[22m [36mv3.2.4 [39m[90m/home/runner/work/ade/ade/packages/harnesses[39m
|
|
7
|
-
|
|
8
|
-
[32m✓[39m src/writers/claude-code.spec.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 113[2mms[22m[39m
|
|
9
|
-
[32m✓[39m src/writers/copilot.spec.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 136[2mms[22m[39m
|
|
10
|
-
[32m✓[39m src/writers/opencode.spec.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 98[2mms[22m[39m
|
|
11
|
-
[32m✓[39m src/writers/kiro.spec.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 109[2mms[22m[39m
|
|
12
|
-
[32m✓[39m src/writers/cline.spec.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 94[2mms[22m[39m
|
|
13
|
-
[32m✓[39m src/writers/cursor.spec.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 123[2mms[22m[39m
|
|
14
|
-
[32m✓[39m src/writers/windsurf.spec.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 94[2mms[22m[39m
|
|
15
|
-
[32m✓[39m src/writers/roo-code.spec.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 69[2mms[22m[39m
|
|
16
|
-
[32m✓[39m src/writers/universal.spec.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 69[2mms[22m[39m
|
|
17
|
-
[32m✓[39m src/index.spec.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
18
|
-
|
|
19
|
-
[2m Test Files [22m [1m[32m10 passed[39m[22m[90m (10)[39m
|
|
20
|
-
[2m Tests [22m [1m[32m47 passed[39m[22m[90m (47)[39m
|
|
21
|
-
[2m Start at [22m 12:30:08
|
|
22
|
-
[2m Duration [22m 3.94s[2m (transform 620ms, setup 0ms, collect 1.70s, tests 915ms, environment 3ms, prepare 2.95s)[22m
|
|
23
|
-
|
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
|
-
}
|
package/src/permission-policy.ts
DELETED
|
@@ -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
|
-
}
|
package/src/skills-installer.ts
DELETED
|
@@ -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
|
-
}
|