@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 +1 -1
- package/skill/GUIDELINES.md +1 -1
- package/skill/SKILL.md +1 -2
- package/skill/references/cli.md +5 -6
- package/update/update-command.js +2 -4
- package/update/update-skill.d.ts +9 -6
- package/update/update-skill.js +10 -60
package/package.json
CHANGED
package/skill/GUIDELINES.md
CHANGED
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.
|
|
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
|
|
package/skill/references/cli.md
CHANGED
|
@@ -205,10 +205,9 @@ Update the Appweaver packages.
|
|
|
205
205
|
|
|
206
206
|
**Options:**
|
|
207
207
|
|
|
208
|
-
| Option | Description
|
|
209
|
-
|
|
210
|
-
| `--targetVersion [targetVersion]` | The version to update the packages to
|
|
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
|
-
|
|
|
213
|
-
|
|
|
214
|
-
| `--verbose` | Print verbose output | `false` |
|
|
212
|
+
| `-f, --force` | Force update despite peerDependency version mismatches | `false` |
|
|
213
|
+
| `--verbose` | Print verbose output | `false` |
|
package/update/update-command.js
CHANGED
|
@@ -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
|
|
77
|
-
await (0, update_skill_1.updateSkillFiles)(quiet
|
|
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
|
}
|
package/update/update-skill.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Updates skill files
|
|
3
|
-
*
|
|
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
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
13
|
+
export declare function updateSkillFiles(quiet: boolean): Promise<void>;
|
package/update/update-skill.js
CHANGED
|
@@ -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
|
|
12
|
-
*
|
|
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
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
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
|
|
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 {
|