bmad-plus 0.17.0 → 0.17.1
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/CHANGELOG.md +90 -29
- package/README.md +21 -21
- package/SECURITY.md +9 -1
- package/osint-agent-package/README.md +13 -0
- package/osint-agent-package/SETUP_KEYS.md +13 -0
- package/package.json +30 -8
- package/readme-international/README.de.md +134 -542
- package/readme-international/README.es.md +136 -561
- package/readme-international/README.fr.md +135 -558
- package/src/bmad-plus/agents/agent-shadow/SKILL.md +6 -0
- package/src/bmad-plus/packs/pack-memory/README.md +1 -1
- package/src/bmad-plus/packs/pack-memory/memory-orchestrator.md +1 -1
- package/src/bmad-plus/packs/pack-memory/shared/memory-protocol.md +1 -1
- package/src/bmad-plus/packs/pack-shield/README.md +2 -0
- package/src/bmad-plus/packs/pack-shield/SKILL.md +2 -0
- package/src/bmad-plus/packs/pack-shield/shared/audit-report-template.md +6 -0
- package/src/bmad-plus/packs/pack-shield/shield-orchestrator.md +4 -0
- package/tools/build/adapters.config.js +1 -1
- package/tools/build/generate-adapters.js +186 -60
- package/tools/build/generate.js +49 -13
- package/tools/cli/bmad-plus-cli.js +3 -6
- package/tools/cli/commands/autoconfig.js +62 -22
- package/tools/cli/commands/install.js +620 -356
- package/tools/cli/commands/memory.js +40 -13
- package/tools/cli/commands/scan.js +94 -30
- package/tools/cli/commands/uninstall.js +65 -16
- package/tools/cli/commands/update-check.js +8 -3
- package/tools/cli/commands/update-policy.js +14 -5
- package/tools/cli/commands/update.js +89 -20
- package/tools/cli/i18n.js +120 -68
- package/tools/cli/lib/ide-config.js +3 -1
- package/tools/cli/lib/install-manifest.js +13 -6
- package/tools/cli/lib/installation-health.js +33 -1
- package/tools/cli/lib/installed-adapters.js +29 -6
- package/tools/cli/lib/memory-init.js +19 -4
- package/tools/cli/lib/packs.js +17 -28
- package/tools/cli/lib/path-hash.js +5 -1
- package/tools/cli/lib/python-provision.js +51 -12
- package/tools/cli/lib/stack-detect.js +51 -25
- package/tools/cli/lib/update-check.js +132 -34
- package/tools/cli/lib/update-dispatch.js +2 -2
- package/tools/cli/lib/update-policy.js +57 -19
- package/tools/cli/lib/update-transaction.js +439 -85
- package/tools/build/README.md +0 -78
- package/tools/build/check-counts.js +0 -626
- package/tools/build/check-install-contract.js +0 -648
- package/tools/build/generated-adapters/.codex/AGENTS.md +0 -134
- package/tools/build/generated-adapters/.cursor/rules/bmad-plus.mdc +0 -139
- package/tools/build/generated-adapters/.opencode/AGENTS.md +0 -134
- package/tools/build/generated-adapters/AGENTS.md +0 -132
- package/tools/build/generated-adapters/CLAUDE.md +0 -135
- package/tools/build/generated-adapters/CONVENTIONS.md +0 -134
- package/tools/build/generated-adapters/GEMINI.md +0 -139
- package/tools/build/generated-adapters/README.md +0 -79
- package/tools/maintain/upstream-candidate.js +0 -456
- package/tools/release/publication-content.js +0 -904
- package/tools/release/supply-chain.js +0 -282
|
@@ -8,14 +8,19 @@ const { safeAdapterPath } = require('./installed-adapters');
|
|
|
8
8
|
const POLICY_FILE = '_bmad/update-policy.json';
|
|
9
9
|
const OFFICIAL_REGISTRY = 'https://registry.npmjs.org/';
|
|
10
10
|
const DEFAULT_POLICY = Object.freeze({
|
|
11
|
-
mode: 'notify',
|
|
12
|
-
|
|
11
|
+
mode: 'notify',
|
|
12
|
+
channel: 'latest',
|
|
13
|
+
allowedRange: null,
|
|
14
|
+
allowPrerelease: false,
|
|
15
|
+
registry: OFFICIAL_REGISTRY,
|
|
13
16
|
});
|
|
14
17
|
|
|
15
18
|
function isExactVersion(version) {
|
|
16
|
-
return
|
|
19
|
+
return (
|
|
20
|
+
typeof version === 'string' &&
|
|
17
21
|
/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(version) &&
|
|
18
|
-
semver.valid(version) !== null
|
|
22
|
+
semver.valid(version) !== null
|
|
23
|
+
);
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
function validatePolicy(value) {
|
|
@@ -27,13 +32,21 @@ function validatePolicy(value) {
|
|
|
27
32
|
}
|
|
28
33
|
const policy = { ...DEFAULT_POLICY, ...value };
|
|
29
34
|
delete policy.schemaVersion;
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
if (
|
|
36
|
+
Object.keys(policy).some((key) => !Object.hasOwn(DEFAULT_POLICY, key)) ||
|
|
37
|
+
!['off', 'notify', 'auto'].includes(policy.mode) ||
|
|
38
|
+
typeof policy.channel !== 'string' ||
|
|
39
|
+
!/^[a-z][a-z0-9_-]{0,31}$/.test(policy.channel) ||
|
|
40
|
+
typeof policy.allowPrerelease !== 'boolean' ||
|
|
41
|
+
policy.registry !== OFFICIAL_REGISTRY ||
|
|
42
|
+
(policy.allowedRange !== null &&
|
|
43
|
+
(typeof policy.allowedRange !== 'string' ||
|
|
44
|
+
!policy.allowedRange.trim() ||
|
|
45
|
+
!semver.validRange(policy.allowedRange)))
|
|
46
|
+
) {
|
|
47
|
+
throw new Error(
|
|
48
|
+
'Invalid update policy: check mode, channel, range, prerelease flag and official registry.'
|
|
49
|
+
);
|
|
37
50
|
}
|
|
38
51
|
if (policy.mode === 'auto' && policy.allowedRange === null) {
|
|
39
52
|
throw new Error('Automatic updates require an explicit allowedRange.');
|
|
@@ -58,11 +71,18 @@ function writeProjectJson(projectDir, relativeFile, data) {
|
|
|
58
71
|
const temporaryName = `${relativeFile}.${process.pid}.${crypto.randomUUID()}.tmp`;
|
|
59
72
|
const temporary = safeAdapterPath(projectDir, temporaryName);
|
|
60
73
|
try {
|
|
61
|
-
fs.writeFileSync(temporary, JSON.stringify(data, null, 2) + '\n', {
|
|
74
|
+
fs.writeFileSync(temporary, JSON.stringify(data, null, 2) + '\n', {
|
|
75
|
+
encoding: 'utf8',
|
|
76
|
+
flag: 'wx',
|
|
77
|
+
});
|
|
62
78
|
safeAdapterPath(projectDir, relativeFile);
|
|
63
79
|
fs.renameSync(temporary, file);
|
|
64
80
|
} finally {
|
|
65
|
-
try {
|
|
81
|
+
try {
|
|
82
|
+
fs.unlinkSync(temporary);
|
|
83
|
+
} catch {
|
|
84
|
+
/* Preserve the original write error if cleanup fails. */
|
|
85
|
+
}
|
|
66
86
|
}
|
|
67
87
|
}
|
|
68
88
|
|
|
@@ -74,17 +94,35 @@ function writeUpdatePolicy(projectDir, value) {
|
|
|
74
94
|
|
|
75
95
|
function authorizeTarget(value, version) {
|
|
76
96
|
let policy;
|
|
77
|
-
try {
|
|
97
|
+
try {
|
|
98
|
+
policy = validatePolicy(value);
|
|
99
|
+
} catch {
|
|
100
|
+
return { allowed: false, reason: 'invalid-policy' };
|
|
101
|
+
}
|
|
78
102
|
if (!isExactVersion(version)) return { allowed: false, reason: 'invalid-target-version' };
|
|
79
|
-
if (policy.mode !== 'auto')
|
|
80
|
-
|
|
81
|
-
|
|
103
|
+
if (policy.mode !== 'auto')
|
|
104
|
+
return {
|
|
105
|
+
allowed: false,
|
|
106
|
+
reason: policy.mode === 'off' ? 'updates-disabled' : 'approval-required',
|
|
107
|
+
};
|
|
108
|
+
if (!policy.allowPrerelease && semver.prerelease(version))
|
|
109
|
+
return { allowed: false, reason: 'prerelease-not-allowed' };
|
|
110
|
+
if (
|
|
111
|
+
!semver.satisfies(version, policy.allowedRange, { includePrerelease: policy.allowPrerelease })
|
|
112
|
+
) {
|
|
82
113
|
return { allowed: false, reason: 'outside-allowed-range' };
|
|
83
114
|
}
|
|
84
115
|
return { allowed: true, reason: 'authorized-policy' };
|
|
85
116
|
}
|
|
86
117
|
|
|
87
118
|
module.exports = {
|
|
88
|
-
DEFAULT_POLICY,
|
|
89
|
-
|
|
119
|
+
DEFAULT_POLICY,
|
|
120
|
+
POLICY_FILE,
|
|
121
|
+
OFFICIAL_REGISTRY,
|
|
122
|
+
isExactVersion,
|
|
123
|
+
validatePolicy,
|
|
124
|
+
readUpdatePolicy,
|
|
125
|
+
writeUpdatePolicy,
|
|
126
|
+
authorizeTarget,
|
|
127
|
+
writeProjectJson,
|
|
90
128
|
};
|