wendkeep 0.72.1 → 0.73.0
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 +30 -0
- package/README.en.md +28 -11
- package/README.md +28 -11
- package/docs/en/commands/changes-and-verification.md +10 -5
- package/docs/en/commands/maintenance-and-diagnostics.md +17 -9
- package/docs/en/commands/operating-profiles.md +28 -3
- package/docs/pt-BR/commands/changes-and-verification.md +10 -5
- package/docs/pt-BR/commands/maintenance-and-diagnostics.md +12 -5
- package/docs/pt-BR/commands/operating-profiles.md +28 -3
- package/hooks/brain-inject.mjs +6 -6
- package/hooks/change-context.mjs +11 -0
- package/hooks/change-core.mjs +53 -21
- package/hooks/change-warn.mjs +2 -0
- package/hooks/harness-doctor.mjs +13 -5
- package/hooks/vault-health.mjs +2 -2
- package/package.json +2 -2
- package/packages/cli/src/index.mjs +12 -2
- package/src/change.mjs +10 -4
- package/src/delivery.mjs +303 -0
- package/src/doctor.mjs +47 -10
- package/src/release-provenance.mjs +47 -0
- package/src/skills-seed.mjs +25 -9
- package/src/sync-defs.mjs +5 -2
- package/src/sync.mjs +2 -2
- package/src/work-kind.mjs +62 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export const WORK_KINDS = Object.freeze([
|
|
2
|
+
'inspection',
|
|
3
|
+
'maintenance',
|
|
4
|
+
'implementation',
|
|
5
|
+
'delivery',
|
|
6
|
+
'recovery',
|
|
7
|
+
]);
|
|
8
|
+
|
|
9
|
+
export const CONTRACT_IMPACTS = Object.freeze(['none', 'internal', 'public']);
|
|
10
|
+
|
|
11
|
+
function normalize(value, values, code, label) {
|
|
12
|
+
const normalized = String(value || '').trim().toLowerCase();
|
|
13
|
+
if (values.includes(normalized)) return normalized;
|
|
14
|
+
const error = new Error(`${label} inválido: ${String(value || '(vazio)')}. Use ${values.join(', ')}.`);
|
|
15
|
+
error.code = code;
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function normalizeWorkKind(value) {
|
|
20
|
+
return normalize(value, WORK_KINDS, 'WENDKEEP_WORK_KIND_INVALID', 'work kind');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function normalizeContractImpact(value) {
|
|
24
|
+
return normalize(value, CONTRACT_IMPACTS, 'WENDKEEP_CONTRACT_IMPACT_INVALID', 'contract impact');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function createWorkRoute({
|
|
28
|
+
workKind,
|
|
29
|
+
profile = '',
|
|
30
|
+
contractImpact = 'none',
|
|
31
|
+
operationRisk = [],
|
|
32
|
+
sourceChange = '',
|
|
33
|
+
sourceCommit = '',
|
|
34
|
+
} = {}) {
|
|
35
|
+
const kind = normalizeWorkKind(workKind);
|
|
36
|
+
const impact = normalizeContractImpact(contractImpact);
|
|
37
|
+
const risks = [...new Set((Array.isArray(operationRisk) ? operationRisk : [operationRisk])
|
|
38
|
+
.map((item) => String(item || '').trim()).filter(Boolean))];
|
|
39
|
+
if (kind === 'delivery' && impact !== 'none') {
|
|
40
|
+
const error = new Error('delivery só aceita contract_impact none; alteração de contrato exige implementation.');
|
|
41
|
+
error.code = 'WENDKEEP_DELIVERY_CONTRACT_IMPACT';
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
work_kind: kind,
|
|
46
|
+
profile: String(profile || (kind === 'delivery' ? 'ASSURE' : '')).trim().toUpperCase(),
|
|
47
|
+
contract_impact: impact,
|
|
48
|
+
operation_risk: risks,
|
|
49
|
+
...(sourceChange ? { source_change: String(sourceChange) } : {}),
|
|
50
|
+
...(sourceCommit ? { source_commit: String(sourceCommit) } : {}),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function classifyWorkRequest(prompt) {
|
|
55
|
+
const text = String(prompt || '').toLowerCase();
|
|
56
|
+
if (/acompanhar|acompanhe|status|actions|diff|inspecion/.test(text)) return 'inspection';
|
|
57
|
+
if (/token\s+(?:expir|venc)|credencial.*(?:expir|venc)/.test(text)) return 'recovery';
|
|
58
|
+
if (/corrig|corrij|alter|implementar|package\.json.*errad|workflow.*(?:errad|falh)/.test(text)) return 'implementation';
|
|
59
|
+
if (/merge|push|public|publish|tag|release/.test(text)) return 'delivery';
|
|
60
|
+
if (/texto|formata|manuten/.test(text)) return 'maintenance';
|
|
61
|
+
return 'implementation';
|
|
62
|
+
}
|