hackmyagent 0.9.4 → 0.9.5
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/dist/cli.js +70 -23
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/soul/index.d.ts +2 -2
- package/dist/soul/index.d.ts.map +1 -1
- package/dist/soul/index.js +2 -1
- package/dist/soul/index.js.map +1 -1
- package/dist/soul/scanner.d.ts +36 -3
- package/dist/soul/scanner.d.ts.map +1 -1
- package/dist/soul/scanner.js +326 -102
- package/dist/soul/scanner.js.map +1 -1
- package/dist/soul/templates.d.ts +4 -0
- package/dist/soul/templates.d.ts.map +1 -1
- package/dist/soul/templates.js +217 -0
- package/dist/soul/templates.js.map +1 -1
- package/package.json +1 -1
package/dist/soul/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/soul/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/soul/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qCAAuG;AAA9F,sGAAA,WAAW,OAAA;AAAE,uGAAA,YAAY,OAAA;AAAE,uGAAA,YAAY,OAAA;AAAE,2GAAA,gBAAgB,OAAA;AAAE,0GAAA,eAAe,OAAA;AAWnF,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA"}
|
package/dist/soul/scanner.d.ts
CHANGED
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export type AgentTier = 'BASIC' | 'TOOL-USING' | 'AGENTIC' | 'MULTI-AGENT';
|
|
8
8
|
export type SoulGrade = 'A' | 'B' | 'C' | 'D' | 'F';
|
|
9
|
+
/** Progress-oriented maturity level (replaces punitive letter grades in display). */
|
|
10
|
+
export type SoulLevel = 'hardened' | 'standard' | 'developing' | 'initial' | 'not-started';
|
|
9
11
|
export type ConformanceLevel = 'none' | 'essential' | 'standard' | 'hardened';
|
|
12
|
+
/** Agent profile determines which governance domains are relevant. */
|
|
13
|
+
export type AgentProfile = 'conversational' | 'code-assistant' | 'tool-agent' | 'autonomous' | 'orchestrator' | 'custom';
|
|
10
14
|
export interface ControlCheck {
|
|
11
15
|
id: string;
|
|
12
16
|
name: string;
|
|
@@ -21,6 +25,8 @@ export interface DomainResult {
|
|
|
21
25
|
passed: number;
|
|
22
26
|
total: number;
|
|
23
27
|
percentage: number;
|
|
28
|
+
/** True when this domain was skipped due to agent profile filtering. */
|
|
29
|
+
skippedByProfile?: boolean;
|
|
24
30
|
}
|
|
25
31
|
export interface DeepAnalysisEntry {
|
|
26
32
|
controlId: string;
|
|
@@ -32,9 +38,17 @@ export interface SoulScanResult {
|
|
|
32
38
|
fileSize: number;
|
|
33
39
|
agentTier: AgentTier;
|
|
34
40
|
tierForced: boolean;
|
|
41
|
+
/** Detected or forced agent profile. */
|
|
42
|
+
agentProfile: AgentProfile;
|
|
43
|
+
profileForced: boolean;
|
|
44
|
+
/** Domain IDs skipped due to profile filtering. */
|
|
45
|
+
skippedDomains: string[];
|
|
35
46
|
domains: DomainResult[];
|
|
36
47
|
score: number;
|
|
48
|
+
/** @deprecated Use `level` instead. Kept for backward compatibility. */
|
|
37
49
|
grade: SoulGrade;
|
|
50
|
+
/** Progress-oriented maturity level. */
|
|
51
|
+
level: SoulLevel;
|
|
38
52
|
conformance: ConformanceLevel;
|
|
39
53
|
criticalFloor: boolean;
|
|
40
54
|
criticalMissing: string[];
|
|
@@ -61,9 +75,13 @@ interface ControlDef {
|
|
|
61
75
|
critical?: boolean;
|
|
62
76
|
/** Which tiers must satisfy this control. Empty means all tiers. */
|
|
63
77
|
tiers: AgentTier[];
|
|
78
|
+
/** Short remediation text that naturally contains the control's keywords. */
|
|
79
|
+
remediation?: string;
|
|
64
80
|
}
|
|
65
81
|
declare const CONTROL_DEFS: ControlDef[];
|
|
66
82
|
declare const DOMAIN_ORDER: string[];
|
|
83
|
+
/** Domain IDs that apply to each profile. */
|
|
84
|
+
declare const PROFILE_DOMAINS: Record<AgentProfile, number[]>;
|
|
67
85
|
export declare class SoulScanner {
|
|
68
86
|
/**
|
|
69
87
|
* Find the governance file in a directory.
|
|
@@ -72,13 +90,19 @@ export declare class SoulScanner {
|
|
|
72
90
|
findGovernanceFile(targetDir: string): string | null;
|
|
73
91
|
/**
|
|
74
92
|
* Detect agent tier by scanning governance file content and project files.
|
|
93
|
+
* Respects a `<!-- soul:tier=TIER -->` marker if present (prevents tier drift).
|
|
75
94
|
*/
|
|
76
95
|
detectTier(targetDir: string, governanceContent: string): AgentTier;
|
|
96
|
+
/**
|
|
97
|
+
* Detect agent profile from governance content.
|
|
98
|
+
* Respects a `<!-- soul:profile=PROFILE -->` marker if present.
|
|
99
|
+
*/
|
|
100
|
+
detectProfile(governanceContent: string): AgentProfile;
|
|
77
101
|
/**
|
|
78
102
|
* Check if content matches any keyword for a control.
|
|
79
103
|
* Case-insensitive substring match.
|
|
80
104
|
*/
|
|
81
|
-
|
|
105
|
+
checkControl(content: string, def: ControlDef): boolean;
|
|
82
106
|
/**
|
|
83
107
|
* LLM-powered semantic analysis for a single control.
|
|
84
108
|
* Uses claude CLI first, falls back to Anthropic API.
|
|
@@ -88,8 +112,13 @@ export declare class SoulScanner {
|
|
|
88
112
|
private analyzeControlDeep;
|
|
89
113
|
/**
|
|
90
114
|
* Calculate grade from score, applying critical floor if needed.
|
|
115
|
+
* @deprecated Use calculateLevel() for display; grade kept for backward compat.
|
|
91
116
|
*/
|
|
92
117
|
private calculateGrade;
|
|
118
|
+
/**
|
|
119
|
+
* Calculate progress-oriented maturity level.
|
|
120
|
+
*/
|
|
121
|
+
private calculateLevel;
|
|
93
122
|
/**
|
|
94
123
|
* Calculate conformance level based on score and critical control status.
|
|
95
124
|
* none: one or more critical controls are missing
|
|
@@ -99,7 +128,7 @@ export declare class SoulScanner {
|
|
|
99
128
|
*/
|
|
100
129
|
private calculateConformance;
|
|
101
130
|
/**
|
|
102
|
-
* Return the subset of controls applicable to a given agent tier.
|
|
131
|
+
* Return the subset of controls applicable to a given agent tier and profile.
|
|
103
132
|
*/
|
|
104
133
|
private applicableControls;
|
|
105
134
|
/**
|
|
@@ -108,14 +137,18 @@ export declare class SoulScanner {
|
|
|
108
137
|
scanSoul(targetDir: string, options?: {
|
|
109
138
|
verbose?: boolean;
|
|
110
139
|
tier?: string;
|
|
140
|
+
profile?: string;
|
|
111
141
|
deepAnalysis?: boolean;
|
|
112
142
|
}): Promise<SoulScanResult>;
|
|
113
143
|
/**
|
|
114
144
|
* Generate or update SOUL.md with missing governance sections.
|
|
145
|
+
* Supports iterative hardening: if a domain heading exists but controls
|
|
146
|
+
* are failing, appends targeted remediation for those controls.
|
|
115
147
|
*/
|
|
116
148
|
hardenSoul(targetDir: string, options?: {
|
|
117
149
|
dryRun?: boolean;
|
|
150
|
+
profile?: string;
|
|
118
151
|
}): Promise<HardenResult>;
|
|
119
152
|
}
|
|
120
|
-
export { CONTROL_DEFS, DOMAIN_ORDER, GOVERNANCE_FILES };
|
|
153
|
+
export { CONTROL_DEFS, DOMAIN_ORDER, GOVERNANCE_FILES, PROFILE_DOMAINS };
|
|
121
154
|
//# sourceMappingURL=scanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/soul/scanner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,GAAG,aAAa,CAAC;AAE3E,MAAM,MAAM,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9E,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