@appweaver/cli 1.0.24 → 1.0.25

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appweaver/cli",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "Appweaver - the backend framework for AI-first development (@cli)",
5
5
  "author": "Luka Matosevic",
6
6
  "license": "MIT",
@@ -241,7 +241,7 @@ export async function createAdminUser(): Promise<void> {
241
241
  data: {
242
242
  firstName: 'Admin',
243
243
  lastName: 'Admin',
244
- email: 'admin@appweaver.com',
244
+ email: 'admin@appweaver.co',
245
245
  roles: {
246
246
  connectOrCreate: [
247
247
  {
package/skill/SKILL.md CHANGED
@@ -472,7 +472,7 @@ export async function createAdminUser(): Promise<void> {
472
472
  data: {
473
473
  firstName: 'Admin',
474
474
  lastName: 'Admin',
475
- email: 'admin@appweaver.com',
475
+ email: 'admin@appweaver.co',
476
476
  phone: '01234435',
477
477
  roles: {
478
478
  connectOrCreate: [
@@ -554,7 +554,6 @@ weaver update # update all @appweaver/* packages
554
554
  weaver update @appweaver/core @appweaver/cli # update specific packages
555
555
  weaver update --targetVersion 1.2.3 # update to a specific version
556
556
  weaver update --noSkill # skip updating AI agent skill files (.claude, .agents, …)
557
- weaver update --noGuidelines # skip updating AI agent guideline files (AGENTS.md, CLAUDE.md)
558
557
  weaver update --force # force update despite peerDependency mismatches
559
558
  ```
560
559
 
@@ -205,10 +205,9 @@ Update the Appweaver packages.
205
205
 
206
206
  **Options:**
207
207
 
208
- | Option | Description | Default |
209
- |-----------------------------------|-------------------------------------------------------------------------|------------|
210
- | `--targetVersion [targetVersion]` | The version to update the packages to | `"latest"` |
208
+ | Option | Description | Default |
209
+ |-----------------------------------|-----------------------------------------------------------------------------|------------|
210
+ | `--targetVersion [targetVersion]` | The version to update the packages to | `"latest"` |
211
211
  | `--noSkill` | Skip updating AI agents skill files in agent dirs (`.claude`, `.agents`, …) | `false` |
212
- | `--noGuidelines` | Skip updating AI agents guideline files (`AGENTS.md`, `CLAUDE.md`) | `false` |
213
- | `-f, --force` | Force update despite peerDependency version mismatches | `false` |
214
- | `--verbose` | Print verbose output | `false` |
212
+ | `-f, --force` | Force update despite peerDependency version mismatches | `false` |
213
+ | `--verbose` | Print verbose output | `false` |
@@ -14,14 +14,12 @@ function updateCommand(program) {
14
14
  'Defaults to all currently installed @appweaver/* packages.')
15
15
  .option('--targetVersion [targetVersion]', 'The version to update the packages.', 'latest')
16
16
  .option('--noSkill', 'Skip updating AI agents skill files in the agent directories (e.g. .claude, .agents) of the current project.')
17
- .option('--noGuidelines', 'Skip updating AI agents guideline files (e.g. AGENTS.md, CLAUDE.md) in the current project.')
18
17
  .option('-f, --force', 'Force update despite peerDependency version mismatches.')
19
18
  .option('--verbose', 'Print verbose output.')
20
19
  .action(async (packages, _, command) => {
21
20
  const quiet = !command.getOptionValue('verbose');
22
21
  const force = command.getOptionValue('force');
23
22
  const updateSkill = !command.getOptionValue('noSkill');
24
- const updateGuidelines = !command.getOptionValue('noGuidelines');
25
23
  const targetVersion = command.getOptionValue('targetVersion');
26
24
  // Load all currently installed packages
27
25
  const installedPackages = {};
@@ -73,8 +71,8 @@ function updateCommand(program) {
73
71
  }
74
72
  const status = await (0, update_packages_1.updatePackages)(appweaverPackages, targetVersion, force, quiet);
75
73
  if (status === 0) {
76
- if (updateSkill || updateGuidelines) {
77
- await (0, update_skill_1.updateSkillFiles)(quiet, updateSkill, updateGuidelines);
74
+ if (updateSkill) {
75
+ await (0, update_skill_1.updateSkillFiles)(quiet);
78
76
  }
79
77
  console.log(`Successfully updated packages to ${targetVersion} version.`);
80
78
  }
@@ -1,10 +1,13 @@
1
1
  /**
2
- * Updates skill files and AI guidelines in the project by copying the skill directory
3
- * to specified agent directories and updating references in guideline files.
2
+ * Updates the Appweaver skill files in the project by copying the skill
3
+ * directory (including the framework GUIDELINES.md) into every discovered agent
4
+ * directory (e.g. `.claude`, `.agents`).
4
5
  *
5
- * @param {boolean} quiet - If true, suppresses logging output; otherwise, logs actions performed.
6
- * @param {boolean} updateSkill - If true, copies skill files into agent directories (e.g. .claude, .agents).
7
- * @param {boolean} updateGuidelines - If true, updates AI guideline files (e.g. AGENTS.md, CLAUDE.md).
6
+ * The project's own root guidelines file (`AGENTS.md` / `CLAUDE.md`) is never
7
+ * touched here — it only references the framework guidelines from the skills
8
+ * directory, so it can be freely extended in the project.
9
+ *
10
+ * @param {boolean} quiet - If true, suppresses logging output; otherwise, logs actions are performed.
8
11
  * @return {Promise<void>} A promise that resolves when the update process is complete.
9
12
  */
10
- export declare function updateSkillFiles(quiet: boolean, updateSkill?: boolean, updateGuidelines?: boolean): Promise<void>;
13
+ export declare function updateSkillFiles(quiet: boolean): Promise<void>;
@@ -8,18 +8,18 @@ const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const promises_1 = __importDefault(require("node:fs/promises"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
10
  /**
11
- * Updates skill files and AI guidelines in the project by copying the skill directory
12
- * to specified agent directories and updating references in guideline files.
11
+ * Updates the Appweaver skill files in the project by copying the skill
12
+ * directory (including the framework GUIDELINES.md) into every discovered agent
13
+ * directory (e.g. `.claude`, `.agents`).
13
14
  *
14
- * @param {boolean} quiet - If true, suppresses logging output; otherwise, logs actions performed.
15
- * @param {boolean} updateSkill - If true, copies skill files into agent directories (e.g. .claude, .agents).
16
- * @param {boolean} updateGuidelines - If true, updates AI guideline files (e.g. AGENTS.md, CLAUDE.md).
15
+ * The project's own root guidelines file (`AGENTS.md` / `CLAUDE.md`) is never
16
+ * touched here — it only references the framework guidelines from the skills
17
+ * directory, so it can be freely extended in the project.
18
+ *
19
+ * @param {boolean} quiet - If true, suppresses logging output; otherwise, logs actions are performed.
17
20
  * @return {Promise<void>} A promise that resolves when the update process is complete.
18
21
  */
19
- async function updateSkillFiles(quiet, updateSkill = true, updateGuidelines = true) {
20
- if (!updateSkill && !updateGuidelines) {
21
- return;
22
- }
22
+ async function updateSkillFiles(quiet) {
23
23
  const projectDir = process.cwd();
24
24
  const skillDir = node_path_1.default.join(__dirname, '..', 'skill');
25
25
  if (!(await exists(skillDir))) {
@@ -28,9 +28,6 @@ async function updateSkillFiles(quiet, updateSkill = true, updateGuidelines = tr
28
28
  }
29
29
  return;
30
30
  }
31
- const guidelinesFilePath = node_path_1.default.join(skillDir, 'GUIDELINES.md');
32
- const guidelinesContents = await promises_1.default.readFile(guidelinesFilePath, 'utf8');
33
- const foundAgentDirs = [];
34
31
  for (const agentDir of [
35
32
  '.claude',
36
33
  '.junie',
@@ -44,60 +41,13 @@ async function updateSkillFiles(quiet, updateSkill = true, updateGuidelines = tr
44
41
  if (!(await exists(agentDirPath))) {
45
42
  continue;
46
43
  }
47
- foundAgentDirs.push(agentDir);
48
- // Skip copying skill files when disabled, but keep the discovered agent
49
- // dir so guideline references can still point to it.
50
- if (!updateSkill) {
51
- continue;
52
- }
53
44
  // Copy skill directory to {agentDir}/skills/appweaver/
54
45
  const skillDestPath = node_path_1.default.join(agentDirPath, 'skills', 'appweaver');
55
- await promises_1.default.cp(skillDir, skillDestPath, {
56
- recursive: true,
57
- filter: (src) => !src.endsWith('GUIDELINES.md')
58
- });
46
+ await promises_1.default.cp(skillDir, skillDestPath, { recursive: true });
59
47
  if (!quiet) {
60
48
  console.log(`Updated skill files in ${node_path_1.default.join(agentDir, 'skills', 'appweaver')}\n`);
61
49
  }
62
50
  }
63
- // Nothing more to do when guideline files should not be updated
64
- if (!updateGuidelines) {
65
- return;
66
- }
67
- let firstAgentDir = foundAgentDirs[0];
68
- for (const guidelinesFile of ['AGENTS.md', 'CLAUDE.md']) {
69
- const guidelinesFilePath = node_path_1.default.join(projectDir, guidelinesFile);
70
- // Update only agent guidelines files that already exist
71
- if (!(await exists(guidelinesFilePath))) {
72
- continue;
73
- }
74
- // If no agent-specific dir was discovered, fall back to a generic .agents
75
- // dir and, unless skill updates are disabled, populate it with skill files.
76
- if (!firstAgentDir) {
77
- firstAgentDir = '.agents';
78
- if (updateSkill) {
79
- const skillDestPath = node_path_1.default.join(node_path_1.default.join(projectDir, firstAgentDir), 'skills', 'appweaver');
80
- await promises_1.default.cp(skillDir, skillDestPath, {
81
- recursive: true,
82
- filter: (src) => !src.endsWith('GUIDELINES.md')
83
- });
84
- }
85
- }
86
- // Replace guideline file path references with path references in first
87
- // discovered agents dir
88
- const referencesPath = node_path_1.default
89
- .join(firstAgentDir, 'skills', 'appweaver', 'references')
90
- .replace(/\\/g, '/');
91
- const guidelinesContent = guidelinesContents.replace(/(\[.+]\()references\/(.+\))/g, `$1${referencesPath}/$2`);
92
- await promises_1.default.writeFile(guidelinesFilePath, guidelinesContent, {
93
- encoding: 'utf8'
94
- });
95
- if (!quiet) {
96
- console.log(`Updated AI guidelines file ${guidelinesFile}\n`);
97
- }
98
- // Update only the first found guidelines file
99
- break;
100
- }
101
51
  }
102
52
  async function exists(filePath) {
103
53
  try {