@codemcp/ade 0.2.0 → 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.
@@ -0,0 +1,8 @@
1
+ # Changesets
2
+
3
+ Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
+ with multi-package repos, or single-package repos to help you version and publish your code. You can
5
+ find the full documentation for it [in our repository](https://github.com/changesets/changesets).
6
+
7
+ We have a quick list of common questions to get you started engaging with this project in
8
+ [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json",
3
+ "changelog": "@changesets/cli/changelog",
4
+ "commit": false,
5
+ "fixed": [],
6
+ "linked": [],
7
+ "access": "restricted",
8
+ "baseBranch": "main",
9
+ "updateInternalDependencies": "patch",
10
+ "ignore": []
11
+ }
package/.lintstagedrc.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export default {
2
2
  "*": "prettier --write --ignore-unknown",
3
- "*.js,*.ts": "eslint --fix"
3
+ "*.{js,ts,mjs,mts,cjs,cts}": "oxlint --fix"
4
4
  };
package/.oxlintrc.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
3
+ "plugins": ["typescript"],
4
+ "env": {
5
+ "es2022": true,
6
+ "node": true
7
+ },
8
+ "rules": {
9
+ "no-unused-vars": "off",
10
+ "@typescript-eslint/no-unused-vars": "error",
11
+ "@typescript-eslint/no-explicit-any": "error"
12
+ },
13
+ "ignorePatterns": [
14
+ "dist/",
15
+ "node_modules/",
16
+ "docs/.vitepress/cache/",
17
+ "pnpm-lock.yaml"
18
+ ]
19
+ }
package/.prettierignore CHANGED
@@ -1,2 +1,3 @@
1
1
  dist
2
2
  .knowledge/docsets
3
+ .claude
@@ -0,0 +1,3 @@
1
+ export default {
2
+ extends: ["@commitlint/config-conventional"]
3
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/ade",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "ADE CLI — Agentic Development Environment setup and configuration tool",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "engines": {
18
18
  "node": ">=22",
19
- "pnpm": ">=9.0.0"
19
+ "pnpm": ">=10.0.0"
20
20
  },
21
21
  "type": "module",
22
22
  "bin": {
@@ -26,54 +26,52 @@
26
26
  "access": "public"
27
27
  },
28
28
  "devDependencies": {
29
- "@braintree/sanitize-url": "7.1.1",
30
- "@eslint/js": "9.18.0",
31
- "@swc/core": "^1.10.9",
32
- "@tsconfig/node22": "22.0.0",
33
- "@tsconfig/strictest": "2.0.5",
34
- "@types/eslint-config-prettier": "6.11.3",
29
+ "@changesets/cli": "^2.30.0",
30
+ "@commitlint/cli": "^19.6.0",
31
+ "@commitlint/config-conventional": "^19.6.0",
32
+ "@tsconfig/node22": "^22.0.5",
33
+ "@turbo/gen": "^2.8.17",
35
34
  "@types/node": "^22.10.7",
36
- "@typescript-eslint/eslint-plugin": "^8.21.0",
37
- "@typescript-eslint/parser": "^8.21.0",
38
- "@vitest/coverage-v8": "^3.0.3",
35
+ "@vitest/coverage-v8": "^3.2.4",
39
36
  "cytoscape": "3.31.0",
40
37
  "cytoscape-cose-bilkent": "4.1.0",
41
38
  "dayjs": "1.11.13",
42
39
  "debug": "4.4.0",
43
- "eslint": "^9.18.0",
44
- "eslint-config-prettier": "^10.0.1",
45
40
  "husky": "^9.1.7",
46
- "lint-staged": "^15.4.1",
47
- "nodemon": "^3.1.9",
41
+ "knip": "^5.86.0",
42
+ "lint-staged": "^16.0.0",
43
+ "oxlint": "^1.0.0",
48
44
  "prettier": "^3.4.2",
49
- "rimraf": "^6.0.1",
50
- "turbo": "^2.3.3",
51
- "typescript": "^5.7.3",
52
- "typescript-eslint": "8.21.0",
45
+ "turbo": "^2.8.17",
46
+ "typescript": "^5.9.3",
53
47
  "vitepress": "1.6.2",
54
48
  "vitepress-plugin-mermaid": "2.0.17",
55
- "vitest": "^3.0.3"
49
+ "vitest": "^3.2.4"
56
50
  },
57
51
  "dependencies": {
58
52
  "yaml": "^2.8.2"
59
53
  },
60
54
  "scripts": {
61
55
  "build": "turbo run build",
62
- "build:clean": "turbo run clean:build",
56
+ "clean": "turbo run clean:build",
63
57
  "dev": "turbo run dev",
64
58
  "docs:dev": "vitepress dev docs",
65
59
  "docs:build": "vitepress build docs",
66
60
  "docs:preview": "vitepress preview docs",
67
- "test": "turbo run --parallel test",
68
- "test:watch": "turbo run --parallel test:watch",
61
+ "test": "vitest --run",
62
+ "test:watch": "vitest",
69
63
  "lint:all": "turbo run --parallel lint",
70
64
  "lint:fix:all": "turbo run --parallel lint:fix",
71
65
  "format:check:all": "turbo run --parallel format",
72
66
  "format:all": "turbo run --parallel format:fix",
73
67
  "typecheck:all": "turbo run --parallel typecheck",
74
- "lint": "eslint",
75
- "lint:fix": "eslint --fix",
68
+ "lint": "oxlint .",
69
+ "lint:fix": "oxlint --fix .",
76
70
  "format": "prettier --check .",
77
- "format:fix": "prettier --write ."
71
+ "format:fix": "prettier --write .",
72
+ "knip": "knip",
73
+ "changeset": "changeset",
74
+ "version": "changeset version",
75
+ "release": "pnpm build && changeset publish"
78
76
  }
79
77
  }
@@ -1,43 +1,285 @@
1
1
  #!/usr/bin/env node
2
- import { version } from "./version.js";
3
- import { runSetup } from "./commands/setup.js";
4
- import { runInstall } from "./commands/install.js";
5
- import { getDefaultCatalog } from "@codemcp/ade-core";
6
- import { getHarnessIds } from "@codemcp/ade-harnesses";
7
- const args = process.argv.slice(2);
8
- const command = args[0];
9
- if (command === "setup") {
10
- const projectRoot = args[1] ?? process.cwd();
11
- const catalog = getDefaultCatalog();
12
- await runSetup(projectRoot, catalog);
2
+
3
+ // src/version.ts
4
+ var version = "0.0.0-development";
5
+
6
+ // src/commands/setup.ts
7
+ import * as clack from "@clack/prompts";
8
+ import {
9
+ readUserConfig,
10
+ writeUserConfig,
11
+ writeLockFile,
12
+ resolve,
13
+ collectDocsets,
14
+ createDefaultRegistry,
15
+ getFacet,
16
+ getOption,
17
+ sortFacets,
18
+ getVisibleOptions
19
+ } from "@codemcp/ade-core";
20
+ import {
21
+ allHarnessWriters,
22
+ getHarnessWriter,
23
+ installSkills,
24
+ writeInlineSkills
25
+ } from "@codemcp/ade-harnesses";
26
+ async function runSetup(projectRoot, catalog) {
27
+ clack.intro("ade setup");
28
+ const existingConfig = await readUserConfig(projectRoot);
29
+ const existingChoices = existingConfig?.choices ?? {};
30
+ for (const [facetId, value] of Object.entries(existingChoices)) {
31
+ const facet = getFacet(catalog, facetId);
32
+ if (!facet) continue;
33
+ const ids = Array.isArray(value) ? value : [value];
34
+ for (const optionId of ids) {
35
+ if (!getOption(facet, optionId)) {
36
+ clack.log.warn(
37
+ `Previously selected option "${optionId}" is no longer available in facet "${facet.label}".`
38
+ );
39
+ }
40
+ }
41
+ }
42
+ const choices = {};
43
+ const sortedFacets = sortFacets(catalog);
44
+ for (const facet of sortedFacets) {
45
+ const visibleOptions = getVisibleOptions(facet, choices, catalog);
46
+ if (visibleOptions.length === 0) continue;
47
+ const visibleFacet = { ...facet, options: visibleOptions };
48
+ if (facet.multiSelect) {
49
+ const selected = await promptMultiSelect(visibleFacet, existingChoices);
50
+ if (typeof selected === "symbol") {
51
+ clack.cancel("Setup cancelled.");
52
+ return;
53
+ }
54
+ if (selected.length > 0) {
55
+ choices[facet.id] = selected;
56
+ }
57
+ } else {
58
+ const selected = await promptSelect(visibleFacet, existingChoices);
59
+ if (typeof selected === "symbol") {
60
+ clack.cancel("Setup cancelled.");
61
+ return;
62
+ }
63
+ if (typeof selected === "string" && selected !== "__skip__") {
64
+ choices[facet.id] = selected;
65
+ }
66
+ }
67
+ }
68
+ const impliedDocsets = collectDocsets(choices, catalog);
69
+ let excludedDocsets;
70
+ if (impliedDocsets.length > 0) {
71
+ const selected = await clack.multiselect({
72
+ message: "Documentation \u2014 deselect any you don't need",
73
+ options: impliedDocsets.map((d) => ({
74
+ value: d.id,
75
+ label: d.label,
76
+ hint: d.description
77
+ })),
78
+ initialValues: impliedDocsets.map((d) => d.id),
79
+ required: false
80
+ });
81
+ if (typeof selected === "symbol") {
82
+ clack.cancel("Setup cancelled.");
83
+ return;
84
+ }
85
+ const selectedSet = new Set(selected);
86
+ const excluded = impliedDocsets.filter((d) => !selectedSet.has(d.id)).map((d) => d.id);
87
+ if (excluded.length > 0) {
88
+ excludedDocsets = excluded;
89
+ }
90
+ }
91
+ const existingHarnesses = existingConfig?.harnesses;
92
+ const harnessOptions = allHarnessWriters.map((w) => ({
93
+ value: w.id,
94
+ label: w.label,
95
+ hint: w.description
96
+ }));
97
+ const validExistingHarnesses = existingHarnesses?.filter(
98
+ (h) => allHarnessWriters.some((w) => w.id === h)
99
+ );
100
+ const selectedHarnesses = await clack.multiselect({
101
+ message: "Harnesses \u2014 which coding agents should receive config?",
102
+ options: harnessOptions,
103
+ initialValues: validExistingHarnesses && validExistingHarnesses.length > 0 ? validExistingHarnesses : ["universal"],
104
+ required: false
105
+ });
106
+ if (typeof selectedHarnesses === "symbol") {
107
+ clack.cancel("Setup cancelled.");
108
+ return;
109
+ }
110
+ const harnesses = selectedHarnesses;
111
+ const userConfig = {
112
+ choices,
113
+ ...excludedDocsets && { excluded_docsets: excludedDocsets },
114
+ ...harnesses.length > 0 && { harnesses }
115
+ };
116
+ const registry = createDefaultRegistry();
117
+ const logicalConfig = await resolve(userConfig, catalog, registry);
118
+ await writeUserConfig(projectRoot, userConfig);
119
+ const lockFile = {
120
+ version: 1,
121
+ generated_at: (/* @__PURE__ */ new Date()).toISOString(),
122
+ choices: userConfig.choices,
123
+ ...harnesses.length > 0 && { harnesses },
124
+ logical_config: logicalConfig
125
+ };
126
+ await writeLockFile(projectRoot, lockFile);
127
+ for (const harnessId of harnesses) {
128
+ const writer = getHarnessWriter(harnessId);
129
+ if (writer) {
130
+ await writer.install(logicalConfig, projectRoot);
131
+ }
132
+ }
133
+ const modifiedSkills = await writeInlineSkills(logicalConfig, projectRoot);
134
+ if (modifiedSkills.length > 0) {
135
+ clack.log.warn(
136
+ `The following skills have been locally modified and will NOT be updated:
137
+ ` + modifiedSkills.map((s) => ` - ${s}`).join("\n") + `
138
+
139
+ To use the latest defaults, remove .ade/skills/ and re-run setup.`
140
+ );
141
+ }
142
+ await installSkills(logicalConfig.skills, projectRoot);
143
+ if (logicalConfig.knowledge_sources.length > 0) {
144
+ clack.log.info(
145
+ "Knowledge sources selected. Initialize them separately:\n npx @codemcp/knowledge init"
146
+ );
147
+ }
148
+ for (const note of logicalConfig.setup_notes) {
149
+ clack.log.info(note);
150
+ }
151
+ clack.outro("Setup complete!");
152
+ }
153
+ function getValidInitialValue(facet, existingChoices) {
154
+ const value = existingChoices[facet.id];
155
+ if (typeof value !== "string") return void 0;
156
+ return facet.options.some((o) => o.id === value) ? value : void 0;
13
157
  }
14
- else if (command === "install") {
15
- const projectRoot = args[1] ?? process.cwd();
16
- let harnessIds;
17
- // Support --harness flag (comma-separated)
18
- if (args.includes("--harness")) {
19
- const val = args[args.indexOf("--harness") + 1];
20
- if (val) {
21
- harnessIds = val.split(",").map((s) => s.trim());
22
- }
23
- }
24
- await runInstall(projectRoot, harnessIds);
158
+ function getValidInitialValues(facet, existingChoices) {
159
+ const value = existingChoices[facet.id];
160
+ if (!Array.isArray(value)) return void 0;
161
+ const valid = value.filter((v) => facet.options.some((o) => o.id === v));
162
+ return valid.length > 0 ? valid : void 0;
25
163
  }
26
- else if (command === "--version" || command === "-v") {
27
- console.log(version);
164
+ function promptSelect(facet, existingChoices) {
165
+ const options = facet.options.map((o) => ({
166
+ value: o.id,
167
+ label: o.label,
168
+ hint: o.description
169
+ }));
170
+ if (!facet.required) {
171
+ options.push({ value: "__skip__", label: "Skip", hint: "" });
172
+ }
173
+ const initialValue = getValidInitialValue(facet, existingChoices);
174
+ return clack.select({
175
+ message: facet.label,
176
+ options,
177
+ ...initialValue !== void 0 && { initialValue }
178
+ });
28
179
  }
29
- else {
30
- const allIds = getHarnessIds();
31
- console.log(`ade v${version}`);
32
- console.log();
33
- console.log("Usage: ade <command> [options]");
34
- console.log();
35
- console.log("Commands:");
36
- console.log(" setup [dir] Interactive setup wizard (re-run to change selections)");
37
- console.log(" install [dir] Apply lock file to generate agent files (idempotent)");
38
- console.log();
39
- console.log("Options:");
40
- console.log(` --harness <ids> Comma-separated harnesses (${allIds.join(", ")})`);
41
- console.log(" -v, --version Show version");
42
- process.exitCode = command ? 1 : 0;
180
+ function promptMultiSelect(facet, existingChoices) {
181
+ const options = facet.options.map((o) => ({
182
+ value: o.id,
183
+ label: o.label,
184
+ hint: o.description
185
+ }));
186
+ const initialValues = getValidInitialValues(facet, existingChoices);
187
+ return clack.multiselect({
188
+ message: facet.label,
189
+ options,
190
+ required: false,
191
+ ...initialValues !== void 0 && { initialValues }
192
+ });
193
+ }
194
+
195
+ // src/commands/install.ts
196
+ import * as clack2 from "@clack/prompts";
197
+ import { readLockFile } from "@codemcp/ade-core";
198
+ import {
199
+ getHarnessWriter as getHarnessWriter2,
200
+ getHarnessIds,
201
+ installSkills as installSkills2,
202
+ writeInlineSkills as writeInlineSkills2
203
+ } from "@codemcp/ade-harnesses";
204
+ async function runInstall(projectRoot, harnessIds) {
205
+ clack2.intro("ade install");
206
+ const lockFile = await readLockFile(projectRoot);
207
+ if (!lockFile) {
208
+ throw new Error("config.lock.yaml not found. Run `ade setup` first.");
209
+ }
210
+ const ids = harnessIds ?? lockFile.harnesses ?? ["universal"];
211
+ const validIds = getHarnessIds();
212
+ for (const id of ids) {
213
+ if (!validIds.includes(id)) {
214
+ throw new Error(
215
+ `Unknown harness "${id}". Available: ${validIds.join(", ")}`
216
+ );
217
+ }
218
+ }
219
+ const logicalConfig = lockFile.logical_config;
220
+ for (const id of ids) {
221
+ const writer = getHarnessWriter2(id);
222
+ if (writer) {
223
+ await writer.install(logicalConfig, projectRoot);
224
+ }
225
+ }
226
+ const modifiedSkills = await writeInlineSkills2(logicalConfig, projectRoot);
227
+ if (modifiedSkills.length > 0) {
228
+ clack2.log.warn(
229
+ `The following skills have been locally modified and will NOT be updated:
230
+ ` + modifiedSkills.map((s) => ` - ${s}`).join("\n") + `
231
+
232
+ To use the latest defaults, remove .ade/skills/ and re-run install.`
233
+ );
234
+ }
235
+ await installSkills2(logicalConfig.skills, projectRoot);
236
+ if (logicalConfig.knowledge_sources.length > 0) {
237
+ clack2.log.info(
238
+ "Knowledge sources configured. Initialize them separately:\n npx @codemcp/knowledge init"
239
+ );
240
+ }
241
+ clack2.outro("Install complete!");
242
+ }
243
+
244
+ // src/index.ts
245
+ import { getDefaultCatalog } from "@codemcp/ade-core";
246
+ import { getHarnessIds as getHarnessIds2 } from "@codemcp/ade-harnesses";
247
+ var args = process.argv.slice(2);
248
+ var command = args[0];
249
+ if (command === "setup") {
250
+ const projectRoot = args[1] ?? process.cwd();
251
+ const catalog = getDefaultCatalog();
252
+ await runSetup(projectRoot, catalog);
253
+ } else if (command === "install") {
254
+ const projectRoot = args[1] ?? process.cwd();
255
+ let harnessIds;
256
+ if (args.includes("--harness")) {
257
+ const val = args[args.indexOf("--harness") + 1];
258
+ if (val) {
259
+ harnessIds = val.split(",").map((s) => s.trim());
260
+ }
261
+ }
262
+ await runInstall(projectRoot, harnessIds);
263
+ } else if (command === "--version" || command === "-v") {
264
+ console.log(version);
265
+ } else {
266
+ const allIds = getHarnessIds2();
267
+ console.log(`ade v${version}`);
268
+ console.log();
269
+ console.log("Usage: ade <command> [options]");
270
+ console.log();
271
+ console.log("Commands:");
272
+ console.log(
273
+ " setup [dir] Interactive setup wizard (re-run to change selections)"
274
+ );
275
+ console.log(
276
+ " install [dir] Apply lock file to generate agent files (idempotent)"
277
+ );
278
+ console.log();
279
+ console.log("Options:");
280
+ console.log(
281
+ ` --harness <ids> Comma-separated harnesses (${allIds.join(", ")})`
282
+ );
283
+ console.log(" -v, --version Show version");
284
+ process.exitCode = command ? 1 : 0;
43
285
  }
@@ -6,20 +6,23 @@
6
6
  "bin": {
7
7
  "ade": "dist/index.js"
8
8
  },
9
+ "files": [
10
+ "dist"
11
+ ],
9
12
  "publishConfig": {
10
13
  "access": "public"
11
14
  },
12
15
  "scripts": {
13
- "build": "tsc -p tsconfig.build.json",
16
+ "build": "tsup",
14
17
  "clean:build": "rimraf ./dist",
15
- "dev": "nodemon",
16
- "lint": "eslint .",
17
- "lint:fix": "eslint --fix .",
18
+ "dev": "tsup --watch",
19
+ "lint": "oxlint .",
20
+ "lint:fix": "oxlint --fix .",
18
21
  "format": "prettier --check .",
19
22
  "format:fix": "prettier --write .",
20
23
  "test": "vitest --run",
21
24
  "test:watch": "vitest",
22
- "typecheck": "tsc"
25
+ "typecheck": "tsc --noEmit"
23
26
  },
24
27
  "dependencies": {
25
28
  "@codemcp/ade-core": "workspace:*",
@@ -28,13 +31,12 @@
28
31
  },
29
32
  "devDependencies": {
30
33
  "@codemcp/knowledge": "2.1.0",
31
- "@typescript-eslint/eslint-plugin": "^8.21.0",
32
- "@typescript-eslint/parser": "^8.21.0",
33
- "eslint": "^9.18.0",
34
- "eslint-config-prettier": "^10.0.1",
35
- "prettier": "^3.4.2",
36
- "rimraf": "^6.0.1",
37
- "typescript": "^5.7.3"
34
+ "oxlint": "catalog:",
35
+ "prettier": "catalog:",
36
+ "rimraf": "catalog:",
37
+ "tsup": "catalog:",
38
+ "typescript": "catalog:",
39
+ "vitest": "catalog:"
38
40
  },
39
- "version": "0.2.0"
41
+ "version": "0.2.2"
40
42
  }
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.ts"],
5
+ format: ["esm"],
6
+ dts: true,
7
+ tsconfig: "tsconfig.build.json",
8
+ target: "node22",
9
+ clean: true
10
+ });
@@ -3,32 +3,40 @@
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
  "scripts": {
10
19
  "build": "tsc -p tsconfig.build.json",
11
20
  "clean:build": "rimraf ./dist",
12
- "dev": "nodemon",
13
- "lint": "eslint .",
14
- "lint:fix": "eslint --fix .",
21
+ "dev": "tsx watch src/index.ts",
22
+ "lint": "oxlint .",
23
+ "lint:fix": "oxlint --fix .",
15
24
  "format": "prettier --check .",
16
25
  "format:fix": "prettier --write .",
17
26
  "test": "vitest --run",
18
27
  "test:watch": "vitest",
19
- "typecheck": "tsc"
20
- },
21
- "devDependencies": {
22
- "@typescript-eslint/eslint-plugin": "^8.21.0",
23
- "@typescript-eslint/parser": "^8.21.0",
24
- "eslint": "^9.18.0",
25
- "eslint-config-prettier": "^10.0.1",
26
- "prettier": "^3.4.2",
27
- "rimraf": "^6.0.1",
28
- "typescript": "^5.7.3"
28
+ "typecheck": "tsc --noEmit"
29
29
  },
30
30
  "dependencies": {
31
31
  "yaml": "^2.8.2"
32
32
  },
33
- "version": "0.2.0"
33
+ "devDependencies": {
34
+ "oxlint": "catalog:",
35
+ "prettier": "catalog:",
36
+ "rimraf": "catalog:",
37
+ "tsx": "catalog:",
38
+ "typescript": "catalog:",
39
+ "vitest": "catalog:"
40
+ },
41
+ "version": "0.2.2"
34
42
  }
@@ -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
  "scripts": {
10
19
  "build": "tsc -p tsconfig.build.json",
11
20
  "clean:build": "rimraf ./dist",
12
- "dev": "nodemon",
13
- "lint": "eslint .",
14
- "lint:fix": "eslint --fix .",
21
+ "dev": "tsx watch src/index.ts",
22
+ "lint": "oxlint .",
23
+ "lint:fix": "oxlint --fix .",
15
24
  "format": "prettier --check .",
16
25
  "format:fix": "prettier --write .",
17
26
  "test": "vitest --run",
18
27
  "test:watch": "vitest",
19
- "typecheck": "tsc"
28
+ "typecheck": "tsc --noEmit"
20
29
  },
21
30
  "dependencies": {
22
31
  "@codemcp/ade-core": "workspace:*",
23
32
  "@codemcp/skills": "^2.3.0"
24
33
  },
25
34
  "devDependencies": {
26
- "@typescript-eslint/eslint-plugin": "^8.21.0",
27
- "@typescript-eslint/parser": "^8.21.0",
28
- "eslint": "^9.18.0",
29
- "eslint-config-prettier": "^10.0.1",
30
- "prettier": "^3.4.2",
31
- "rimraf": "^6.0.1",
32
- "typescript": "^5.7.3"
35
+ "oxlint": "catalog:",
36
+ "prettier": "catalog:",
37
+ "rimraf": "catalog:",
38
+ "tsx": "catalog:",
39
+ "typescript": "catalog:",
40
+ "vitest": "catalog:"
33
41
  },
34
- "version": "0.2.0"
42
+ "version": "0.2.2"
35
43
  }
@@ -1,2 +1,19 @@
1
1
  packages:
2
2
  - "packages/*"
3
+
4
+ catalog:
5
+ # TypeScript
6
+ typescript: "^5.9.3"
7
+ "@tsconfig/node22": "^22.0.5"
8
+ "@types/node": "^22.10.7"
9
+ # Linting — oxlint replaces ESLint + typescript-eslint + eslint-config-prettier
10
+ oxlint: "^1.0.0"
11
+ # Formatting
12
+ prettier: "^3.4.2"
13
+ # Testing — pinned to 3.x; vitest 4+ requires vite 6 which vitepress 1.x doesn't support yet
14
+ vitest: "^3.2.4"
15
+ "@vitest/coverage-v8": "^3.2.4"
16
+ # Build / Dev
17
+ rimraf: "^6.1.3"
18
+ tsx: "^4.19.0"
19
+ tsup: "^8.3.0"
@@ -1,39 +0,0 @@
1
- import * as clack from "@clack/prompts";
2
- import { readLockFile } from "@codemcp/ade-core";
3
- import { getHarnessWriter, getHarnessIds, installSkills, writeInlineSkills } from "@codemcp/ade-harnesses";
4
- export async function runInstall(projectRoot, harnessIds) {
5
- clack.intro("ade install");
6
- const lockFile = await readLockFile(projectRoot);
7
- if (!lockFile) {
8
- throw new Error("config.lock.yaml not found. Run `ade setup` first.");
9
- }
10
- // Determine which harnesses to install for:
11
- // 1. --harness flag (comma-separated)
12
- // 2. harnesses saved in the lock file
13
- // 3. default: universal
14
- const ids = harnessIds ?? lockFile.harnesses ?? ["universal"];
15
- const validIds = getHarnessIds();
16
- for (const id of ids) {
17
- if (!validIds.includes(id)) {
18
- throw new Error(`Unknown harness "${id}". Available: ${validIds.join(", ")}`);
19
- }
20
- }
21
- const logicalConfig = lockFile.logical_config;
22
- for (const id of ids) {
23
- const writer = getHarnessWriter(id);
24
- if (writer) {
25
- await writer.install(logicalConfig, projectRoot);
26
- }
27
- }
28
- const modifiedSkills = await writeInlineSkills(logicalConfig, projectRoot);
29
- if (modifiedSkills.length > 0) {
30
- clack.log.warn(`The following skills have been locally modified and will NOT be updated:\n` +
31
- modifiedSkills.map((s) => ` - ${s}`).join("\n") +
32
- `\n\nTo use the latest defaults, remove .ade/skills/ and re-run install.`);
33
- }
34
- await installSkills(logicalConfig.skills, projectRoot);
35
- if (logicalConfig.knowledge_sources.length > 0) {
36
- clack.log.info("Knowledge sources configured. Initialize them separately:\n npx @codemcp/knowledge init");
37
- }
38
- clack.outro("Install complete!");
39
- }
@@ -1,177 +0,0 @@
1
- import * as clack from "@clack/prompts";
2
- import { readUserConfig, writeUserConfig, writeLockFile, resolve, collectDocsets, createDefaultRegistry, getFacet, getOption, sortFacets, getVisibleOptions } from "@codemcp/ade-core";
3
- import { allHarnessWriters, getHarnessWriter, installSkills, writeInlineSkills } from "@codemcp/ade-harnesses";
4
- export async function runSetup(projectRoot, catalog) {
5
- clack.intro("ade setup");
6
- const existingConfig = await readUserConfig(projectRoot);
7
- const existingChoices = existingConfig?.choices ?? {};
8
- // Warn about stale choices that reference options no longer in the catalog
9
- for (const [facetId, value] of Object.entries(existingChoices)) {
10
- const facet = getFacet(catalog, facetId);
11
- if (!facet)
12
- continue;
13
- const ids = Array.isArray(value) ? value : [value];
14
- for (const optionId of ids) {
15
- if (!getOption(facet, optionId)) {
16
- clack.log.warn(`Previously selected option "${optionId}" is no longer available in facet "${facet.label}".`);
17
- }
18
- }
19
- }
20
- const choices = {};
21
- const sortedFacets = sortFacets(catalog);
22
- for (const facet of sortedFacets) {
23
- const visibleOptions = getVisibleOptions(facet, choices, catalog);
24
- if (visibleOptions.length === 0)
25
- continue;
26
- const visibleFacet = { ...facet, options: visibleOptions };
27
- if (facet.multiSelect) {
28
- const selected = await promptMultiSelect(visibleFacet, existingChoices);
29
- if (typeof selected === "symbol") {
30
- clack.cancel("Setup cancelled.");
31
- return;
32
- }
33
- if (selected.length > 0) {
34
- choices[facet.id] = selected;
35
- }
36
- }
37
- else {
38
- const selected = await promptSelect(visibleFacet, existingChoices);
39
- if (typeof selected === "symbol") {
40
- clack.cancel("Setup cancelled.");
41
- return;
42
- }
43
- if (typeof selected === "string" && selected !== "__skip__") {
44
- choices[facet.id] = selected;
45
- }
46
- }
47
- }
48
- // Docset confirmation step: collect implied docsets, let user deselect
49
- const impliedDocsets = collectDocsets(choices, catalog);
50
- let excludedDocsets;
51
- if (impliedDocsets.length > 0) {
52
- const selected = await clack.multiselect({
53
- message: "Documentation — deselect any you don't need",
54
- options: impliedDocsets.map((d) => ({
55
- value: d.id,
56
- label: d.label,
57
- hint: d.description
58
- })),
59
- initialValues: impliedDocsets.map((d) => d.id),
60
- required: false
61
- });
62
- if (typeof selected === "symbol") {
63
- clack.cancel("Setup cancelled.");
64
- return;
65
- }
66
- const selectedSet = new Set(selected);
67
- const excluded = impliedDocsets
68
- .filter((d) => !selectedSet.has(d.id))
69
- .map((d) => d.id);
70
- if (excluded.length > 0) {
71
- excludedDocsets = excluded;
72
- }
73
- }
74
- // Harness selection — multi-select from all available harnesses
75
- const existingHarnesses = existingConfig?.harnesses;
76
- const harnessOptions = allHarnessWriters.map((w) => ({
77
- value: w.id,
78
- label: w.label,
79
- hint: w.description
80
- }));
81
- const validExistingHarnesses = existingHarnesses?.filter((h) => allHarnessWriters.some((w) => w.id === h));
82
- const selectedHarnesses = await clack.multiselect({
83
- message: "Harnesses — which coding agents should receive config?",
84
- options: harnessOptions,
85
- initialValues: validExistingHarnesses && validExistingHarnesses.length > 0
86
- ? validExistingHarnesses
87
- : ["universal"],
88
- required: false
89
- });
90
- if (typeof selectedHarnesses === "symbol") {
91
- clack.cancel("Setup cancelled.");
92
- return;
93
- }
94
- const harnesses = selectedHarnesses;
95
- const userConfig = {
96
- choices,
97
- ...(excludedDocsets && { excluded_docsets: excludedDocsets }),
98
- ...(harnesses.length > 0 && { harnesses })
99
- };
100
- const registry = createDefaultRegistry();
101
- const logicalConfig = await resolve(userConfig, catalog, registry);
102
- await writeUserConfig(projectRoot, userConfig);
103
- const lockFile = {
104
- version: 1,
105
- generated_at: new Date().toISOString(),
106
- choices: userConfig.choices,
107
- ...(harnesses.length > 0 && { harnesses }),
108
- logical_config: logicalConfig
109
- };
110
- await writeLockFile(projectRoot, lockFile);
111
- // Install to all selected harnesses
112
- for (const harnessId of harnesses) {
113
- const writer = getHarnessWriter(harnessId);
114
- if (writer) {
115
- await writer.install(logicalConfig, projectRoot);
116
- }
117
- }
118
- const modifiedSkills = await writeInlineSkills(logicalConfig, projectRoot);
119
- if (modifiedSkills.length > 0) {
120
- clack.log.warn(`The following skills have been locally modified and will NOT be updated:\n` +
121
- modifiedSkills.map((s) => ` - ${s}`).join("\n") +
122
- `\n\nTo use the latest defaults, remove .ade/skills/ and re-run setup.`);
123
- }
124
- await installSkills(logicalConfig.skills, projectRoot);
125
- if (logicalConfig.knowledge_sources.length > 0) {
126
- clack.log.info("Knowledge sources selected. Initialize them separately:\n npx @codemcp/knowledge init");
127
- }
128
- for (const note of logicalConfig.setup_notes) {
129
- clack.log.info(note);
130
- }
131
- clack.outro("Setup complete!");
132
- }
133
- function getValidInitialValue(facet, existingChoices) {
134
- const value = existingChoices[facet.id];
135
- if (typeof value !== "string")
136
- return undefined;
137
- // Only set initialValue if the option still exists in the catalog
138
- return facet.options.some((o) => o.id === value) ? value : undefined;
139
- }
140
- function getValidInitialValues(facet, existingChoices) {
141
- const value = existingChoices[facet.id];
142
- if (!Array.isArray(value))
143
- return undefined;
144
- // Only include options that still exist in the catalog
145
- const valid = value.filter((v) => facet.options.some((o) => o.id === v));
146
- return valid.length > 0 ? valid : undefined;
147
- }
148
- function promptSelect(facet, existingChoices) {
149
- const options = facet.options.map((o) => ({
150
- value: o.id,
151
- label: o.label,
152
- hint: o.description
153
- }));
154
- if (!facet.required) {
155
- options.push({ value: "__skip__", label: "Skip", hint: "" });
156
- }
157
- const initialValue = getValidInitialValue(facet, existingChoices);
158
- return clack.select({
159
- message: facet.label,
160
- options,
161
- ...(initialValue !== undefined && { initialValue })
162
- });
163
- }
164
- function promptMultiSelect(facet, existingChoices) {
165
- const options = facet.options.map((o) => ({
166
- value: o.id,
167
- label: o.label,
168
- hint: o.description
169
- }));
170
- const initialValues = getValidInitialValues(facet, existingChoices);
171
- return clack.multiselect({
172
- message: facet.label,
173
- options,
174
- required: false,
175
- ...(initialValues !== undefined && { initialValues })
176
- });
177
- }
@@ -1,38 +0,0 @@
1
- import { createDocset, initDocset } from "@codemcp/knowledge/packages/cli/dist/exports.js";
2
- /**
3
- * Install knowledge sources using the @codemcp/knowledge programmatic API.
4
- *
5
- * For each knowledge source:
6
- * 1. Creates a docset config entry via `createDocset`
7
- * 2. Initializes (downloads) the docset via `initDocset`
8
- *
9
- * Errors on individual sources are logged and skipped so that one failure
10
- * doesn't block the rest.
11
- */
12
- export async function installKnowledge(sources, projectRoot) {
13
- if (sources.length === 0)
14
- return;
15
- for (const source of sources) {
16
- try {
17
- await createDocset({
18
- id: source.name,
19
- name: source.description,
20
- preset: "git-repo",
21
- url: source.origin
22
- }, { cwd: projectRoot });
23
- }
24
- catch (err) {
25
- console.warn(`Warning: failed to create docset "${source.name}":`, err instanceof Error ? err.message : err);
26
- continue;
27
- }
28
- try {
29
- await initDocset({
30
- docsetId: source.name,
31
- cwd: projectRoot
32
- });
33
- }
34
- catch (err) {
35
- console.warn(`Warning: failed to initialize docset "${source.name}":`, err instanceof Error ? err.message : err);
36
- }
37
- }
38
- }
@@ -1 +0,0 @@
1
- export const version = "0.0.0-development";
@@ -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
- ];
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/nodemon.json",
3
- "watch": ["./src/**", "./node_modules/@mme/**/dist/**"],
4
- "ignoreRoot": [],
5
- "ext": "ts,js",
6
- "exec": "pnpm typecheck && pnpm build"
7
- }
@@ -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
- ];
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/nodemon.json",
3
- "watch": ["./src/**", "./node_modules/@mme/**/dist/**"],
4
- "ignoreRoot": [],
5
- "ext": "ts,js",
6
- "exec": "pnpm typecheck && pnpm build"
7
- }
@@ -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
- ];