@codemcp/ade 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.
@@ -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.3"
40
42
  }
@@ -0,0 +1,11 @@
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
+ noExternal: ["@clack/prompts"]
11
+ });
@@ -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.3"
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.3"
35
43
  }
@@ -206,16 +206,17 @@ describe("kiroWriter", () => {
206
206
 
207
207
  expect(rigidAgent.tools).toContain("read");
208
208
  expect(rigidAgent.tools).toContain("spec");
209
+ expect(rigidAgent.tools).toContain("shell");
209
210
  expect(rigidAgent.tools).toContain("@workflows/*");
210
211
  expect(rigidAgent.allowedTools).toContain("@workflows/*");
211
212
  expect(rigidAgent.mcpServers.workflows.autoApprove).toEqual(["*"]);
212
213
  expect(rigidAgent.tools).not.toContain("write");
213
- expect(rigidAgent.tools).not.toContain("shell");
214
+ expect(rigidAgent.tools).not.toContain("shell(*)");
214
215
  expect(rigidAgent.tools).not.toContain("web");
215
216
 
216
217
  expect(maxAgent.tools).toContain("read");
217
218
  expect(maxAgent.tools).toContain("write");
218
- expect(maxAgent.tools).toContain("shell");
219
+ expect(maxAgent.tools).toContain("shell(*)");
219
220
  expect(maxAgent.tools).toContain("spec");
220
221
  expect(maxAgent.tools).toContain("@workflows/*");
221
222
  expect(maxAgent.allowedTools).toContain("@workflows/*");
@@ -53,7 +53,7 @@ function getKiroTools(config: LogicalConfig): string[] {
53
53
  return [
54
54
  ...(getCapabilityDecision(config, "read") !== "deny" ? ["read"] : []),
55
55
  ...(allowsCapability(config, "edit_write") ? ["write"] : []),
56
- ...(allowsCapability(config, "bash_unsafe") ? ["shell"] : []),
56
+ ...(allowsCapability(config, "bash_unsafe") ? ["shell(*)"] : ["shell"]),
57
57
  "spec",
58
58
  ...mcpTools
59
59
  ];
@@ -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"
package/rebuild_cli.sh ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+ cd packages/cli
3
+ pnpm build
@@ -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
- ];