@harness-engineering/core 0.5.0 → 0.6.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/dist/index.d.mts +3 -51
- package/dist/index.d.ts +3 -51
- package/dist/index.js +125 -158
- package/dist/index.mjs +4 -27
- package/package.json +4 -3
- package/dist/.tsbuildinfo +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
import { WorkflowStep, WorkflowStepResult, Workflow, WorkflowResult, SkillLifecycleHooks, SkillContext, SkillResult, TurnContext } from '@harness-engineering/types';
|
|
1
|
+
import { Result, WorkflowStep, WorkflowStepResult, Workflow, WorkflowResult, SkillLifecycleHooks, SkillContext, SkillResult, TurnContext } from '@harness-engineering/types';
|
|
2
2
|
export * from '@harness-engineering/types';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
type Result<T, E = Error> = {
|
|
6
|
-
ok: true;
|
|
7
|
-
value: T;
|
|
8
|
-
} | {
|
|
9
|
-
ok: false;
|
|
10
|
-
error: E;
|
|
11
|
-
};
|
|
12
|
-
declare const Ok: <T>(value: T) => Result<T, never>;
|
|
13
|
-
declare function isOk<T, E>(result: Result<T, E>): result is {
|
|
14
|
-
ok: true;
|
|
15
|
-
value: T;
|
|
16
|
-
};
|
|
17
|
-
declare const Err: <E>(error: E) => Result<never, E>;
|
|
18
|
-
declare function isErr<T, E>(result: Result<T, E>): result is {
|
|
19
|
-
ok: false;
|
|
20
|
-
error: E;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
5
|
/**
|
|
24
6
|
* Abstract Syntax Tree representation
|
|
25
7
|
*/
|
|
@@ -802,52 +784,22 @@ declare class EntropyAnalyzer {
|
|
|
802
784
|
detectPatterns(config: PatternConfig): Promise<Result<PatternReport, EntropyError>>;
|
|
803
785
|
}
|
|
804
786
|
|
|
805
|
-
/**
|
|
806
|
-
* Resolve entry points for dead code analysis
|
|
807
|
-
*
|
|
808
|
-
* Entry points are the starting files from which reachability analysis begins.
|
|
809
|
-
* The resolution order is:
|
|
810
|
-
* 1. Explicit entries provided as arguments
|
|
811
|
-
* 2. package.json exports/main/bin fields
|
|
812
|
-
* 3. Conventional entry files (src/index.ts, index.ts, etc.)
|
|
813
|
-
*/
|
|
814
|
-
declare function resolveEntryPoints(rootDir: string, explicitEntries?: string[]): Promise<Result<string[], EntropyError>>;
|
|
815
|
-
/**
|
|
816
|
-
* Parse a documentation file
|
|
817
|
-
*/
|
|
818
|
-
declare function parseDocumentationFile(path: string): Promise<Result<DocumentationFile, EntropyError>>;
|
|
819
787
|
/**
|
|
820
788
|
* Build a complete CodebaseSnapshot
|
|
821
789
|
*/
|
|
822
790
|
declare function buildSnapshot(config: EntropyConfig): Promise<Result<CodebaseSnapshot, EntropyError>>;
|
|
823
791
|
|
|
824
|
-
/**
|
|
825
|
-
* Calculate Levenshtein distance between two strings
|
|
826
|
-
*/
|
|
827
|
-
declare function levenshteinDistance(a: string, b: string): number;
|
|
828
|
-
/**
|
|
829
|
-
* Find possible matches for a reference in a list of exports
|
|
830
|
-
*/
|
|
831
|
-
declare function findPossibleMatches(reference: string, exportNames: string[], maxDistance?: number): string[];
|
|
832
792
|
/**
|
|
833
793
|
* Detect documentation drift in a codebase
|
|
834
794
|
*/
|
|
835
795
|
declare function detectDocDrift(snapshot: CodebaseSnapshot, config?: Partial<DriftConfig>): Promise<Result<DriftReport, EntropyError>>;
|
|
836
796
|
|
|
837
|
-
/**
|
|
838
|
-
* Build a map of file reachability from entry points
|
|
839
|
-
*/
|
|
840
|
-
declare function buildReachabilityMap(snapshot: CodebaseSnapshot): Map<string, boolean>;
|
|
841
797
|
/**
|
|
842
798
|
* Detect dead code in a codebase snapshot.
|
|
843
799
|
* Analyzes exports, files, imports, and internal symbols to find unused code.
|
|
844
800
|
*/
|
|
845
801
|
declare function detectDeadCode(snapshot: CodebaseSnapshot): Promise<Result<DeadCodeReport, EntropyError>>;
|
|
846
802
|
|
|
847
|
-
/**
|
|
848
|
-
* Check a single config pattern against a file
|
|
849
|
-
*/
|
|
850
|
-
declare function checkConfigPattern(pattern: ConfigPattern, file: SourceFile, rootDir: string): PatternMatch[];
|
|
851
803
|
/**
|
|
852
804
|
* Detect pattern violations across a codebase
|
|
853
805
|
*/
|
|
@@ -2305,6 +2257,6 @@ declare function runMultiTurnPipeline(initialContext: SkillContext, turnExecutor
|
|
|
2305
2257
|
* Core library for Harness Engineering toolkit
|
|
2306
2258
|
*/
|
|
2307
2259
|
|
|
2308
|
-
declare const VERSION = "0.
|
|
2260
|
+
declare const VERSION = "0.6.0";
|
|
2309
2261
|
|
|
2310
|
-
export { type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentConfig, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentType, type AgentsMapConfig, type BaseError, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type ChangedFile, ChecklistBuilder, type CircularDependency, type CircularDepsResult, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, type CommitFormat, type CommitValidation, type ConfigError, type ConfigPattern, ConsoleSink, type ConstraintError, type ContextError, type ContextFilterResult, type Convention, type CoverageOptions, type CoverageReport, type CustomRule, type CustomRuleResult, DEFAULT_STATE, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport,
|
|
2262
|
+
export { type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentConfig, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentType, type AgentsMapConfig, type BaseError, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type ChangedFile, ChecklistBuilder, type CircularDependency, type CircularDepsResult, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, type CommitFormat, type CommitValidation, type ConfigError, type ConfigPattern, ConsoleSink, type ConstraintError, type ContextError, type ContextFilterResult, type Convention, type CoverageOptions, type CoverageReport, type CustomRule, type CustomRuleResult, DEFAULT_STATE, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport, type ExecutorHealth, type Export, type ExportMap, type FailureEntry, FailureEntrySchema, type FeedbackConfig, type FeedbackError$1 as FeedbackError, type FileCategory, FileSink, type Fix, type FixConfig, type FixResult, type FixType, type ForbiddenPattern, type GateConfig, GateConfigSchema, type GateResult, GateResultSchema, type GenerationSection, type Handoff, HandoffSchema, type HarnessState, HarnessStateSchema, type HealthCheckResult, type Import, type InlineReference, type IntegrityReport, type InternalSymbol, type JSDocComment, type LanguageParser, type Layer, type LayerConfig, type LogEntry, type LogFilter, type Metric, NoOpExecutor, NoOpSink, NoOpTelemetryAdapter, type ParseError, type PatternConfig, PatternConfigSchema, type PatternMatch, type PatternReport, type PatternViolation, type PeerReview, type PeerReviewOptions, type PipelineOptions, type PipelineResult, REQUIRED_SECTIONS, type ReachabilityNode, type ReviewChecklist, type ReviewComment, type ReviewContext, type ReviewItem, type SelfReviewConfig, type SkillExecutor, type SourceFile, type Span, type SpanEvent, type StepExecutor, type StructureValidation, type Suggestion, type SuggestionReport, type TelemetryAdapter, type TelemetryHealth, type TimeRange, type TokenBudget, type TokenBudgetOverrides, type Trace, type TurnExecutor, TypeScriptParser, type UnusedImport, VERSION, type ValidationError, type WorkflowPhase, analyzeDiff, appendFailure, appendLearning, applyFixes, archiveFailures, buildDependencyGraph, buildSnapshot, checkDocCoverage, configureFeedback, contextBudget, contextFilter, createBoundaryValidator, createError, createFixes, createParseError, createSelfReview, defineLayer, detectCircularDeps, detectCircularDepsInFiles, detectDeadCode, detectDocDrift, detectPatternViolations, executeWorkflow, extractMarkdownLinks, extractSections, generateAgentsMap, generateSuggestions, getActionEmitter, getFeedbackConfig, getPhaseCategories, loadFailures, loadHandoff, loadRelevantLearnings, loadState, logAgentAction, parseDiff, previewFix, requestMultiplePeerReviews, requestPeerReview, resetFeedbackConfig, resolveFileToLayer, runMechanicalGate, runMultiTurnPipeline, runPipeline, saveHandoff, saveState, trackAction, validateAgentsMap, validateBoundaries, validateCommitMessage, validateConfig, validateDependencies, validateFileStructure, validateKnowledgeMap, validatePatternConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
import { WorkflowStep, WorkflowStepResult, Workflow, WorkflowResult, SkillLifecycleHooks, SkillContext, SkillResult, TurnContext } from '@harness-engineering/types';
|
|
1
|
+
import { Result, WorkflowStep, WorkflowStepResult, Workflow, WorkflowResult, SkillLifecycleHooks, SkillContext, SkillResult, TurnContext } from '@harness-engineering/types';
|
|
2
2
|
export * from '@harness-engineering/types';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
type Result<T, E = Error> = {
|
|
6
|
-
ok: true;
|
|
7
|
-
value: T;
|
|
8
|
-
} | {
|
|
9
|
-
ok: false;
|
|
10
|
-
error: E;
|
|
11
|
-
};
|
|
12
|
-
declare const Ok: <T>(value: T) => Result<T, never>;
|
|
13
|
-
declare function isOk<T, E>(result: Result<T, E>): result is {
|
|
14
|
-
ok: true;
|
|
15
|
-
value: T;
|
|
16
|
-
};
|
|
17
|
-
declare const Err: <E>(error: E) => Result<never, E>;
|
|
18
|
-
declare function isErr<T, E>(result: Result<T, E>): result is {
|
|
19
|
-
ok: false;
|
|
20
|
-
error: E;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
5
|
/**
|
|
24
6
|
* Abstract Syntax Tree representation
|
|
25
7
|
*/
|
|
@@ -802,52 +784,22 @@ declare class EntropyAnalyzer {
|
|
|
802
784
|
detectPatterns(config: PatternConfig): Promise<Result<PatternReport, EntropyError>>;
|
|
803
785
|
}
|
|
804
786
|
|
|
805
|
-
/**
|
|
806
|
-
* Resolve entry points for dead code analysis
|
|
807
|
-
*
|
|
808
|
-
* Entry points are the starting files from which reachability analysis begins.
|
|
809
|
-
* The resolution order is:
|
|
810
|
-
* 1. Explicit entries provided as arguments
|
|
811
|
-
* 2. package.json exports/main/bin fields
|
|
812
|
-
* 3. Conventional entry files (src/index.ts, index.ts, etc.)
|
|
813
|
-
*/
|
|
814
|
-
declare function resolveEntryPoints(rootDir: string, explicitEntries?: string[]): Promise<Result<string[], EntropyError>>;
|
|
815
|
-
/**
|
|
816
|
-
* Parse a documentation file
|
|
817
|
-
*/
|
|
818
|
-
declare function parseDocumentationFile(path: string): Promise<Result<DocumentationFile, EntropyError>>;
|
|
819
787
|
/**
|
|
820
788
|
* Build a complete CodebaseSnapshot
|
|
821
789
|
*/
|
|
822
790
|
declare function buildSnapshot(config: EntropyConfig): Promise<Result<CodebaseSnapshot, EntropyError>>;
|
|
823
791
|
|
|
824
|
-
/**
|
|
825
|
-
* Calculate Levenshtein distance between two strings
|
|
826
|
-
*/
|
|
827
|
-
declare function levenshteinDistance(a: string, b: string): number;
|
|
828
|
-
/**
|
|
829
|
-
* Find possible matches for a reference in a list of exports
|
|
830
|
-
*/
|
|
831
|
-
declare function findPossibleMatches(reference: string, exportNames: string[], maxDistance?: number): string[];
|
|
832
792
|
/**
|
|
833
793
|
* Detect documentation drift in a codebase
|
|
834
794
|
*/
|
|
835
795
|
declare function detectDocDrift(snapshot: CodebaseSnapshot, config?: Partial<DriftConfig>): Promise<Result<DriftReport, EntropyError>>;
|
|
836
796
|
|
|
837
|
-
/**
|
|
838
|
-
* Build a map of file reachability from entry points
|
|
839
|
-
*/
|
|
840
|
-
declare function buildReachabilityMap(snapshot: CodebaseSnapshot): Map<string, boolean>;
|
|
841
797
|
/**
|
|
842
798
|
* Detect dead code in a codebase snapshot.
|
|
843
799
|
* Analyzes exports, files, imports, and internal symbols to find unused code.
|
|
844
800
|
*/
|
|
845
801
|
declare function detectDeadCode(snapshot: CodebaseSnapshot): Promise<Result<DeadCodeReport, EntropyError>>;
|
|
846
802
|
|
|
847
|
-
/**
|
|
848
|
-
* Check a single config pattern against a file
|
|
849
|
-
*/
|
|
850
|
-
declare function checkConfigPattern(pattern: ConfigPattern, file: SourceFile, rootDir: string): PatternMatch[];
|
|
851
803
|
/**
|
|
852
804
|
* Detect pattern violations across a codebase
|
|
853
805
|
*/
|
|
@@ -2305,6 +2257,6 @@ declare function runMultiTurnPipeline(initialContext: SkillContext, turnExecutor
|
|
|
2305
2257
|
* Core library for Harness Engineering toolkit
|
|
2306
2258
|
*/
|
|
2307
2259
|
|
|
2308
|
-
declare const VERSION = "0.
|
|
2260
|
+
declare const VERSION = "0.6.0";
|
|
2309
2261
|
|
|
2310
|
-
export { type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentConfig, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentType, type AgentsMapConfig, type BaseError, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type ChangedFile, ChecklistBuilder, type CircularDependency, type CircularDepsResult, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, type CommitFormat, type CommitValidation, type ConfigError, type ConfigPattern, ConsoleSink, type ConstraintError, type ContextError, type ContextFilterResult, type Convention, type CoverageOptions, type CoverageReport, type CustomRule, type CustomRuleResult, DEFAULT_STATE, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport,
|
|
2262
|
+
export { type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentConfig, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentType, type AgentsMapConfig, type BaseError, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type ChangedFile, ChecklistBuilder, type CircularDependency, type CircularDepsResult, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, type CommitFormat, type CommitValidation, type ConfigError, type ConfigPattern, ConsoleSink, type ConstraintError, type ContextError, type ContextFilterResult, type Convention, type CoverageOptions, type CoverageReport, type CustomRule, type CustomRuleResult, DEFAULT_STATE, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport, type ExecutorHealth, type Export, type ExportMap, type FailureEntry, FailureEntrySchema, type FeedbackConfig, type FeedbackError$1 as FeedbackError, type FileCategory, FileSink, type Fix, type FixConfig, type FixResult, type FixType, type ForbiddenPattern, type GateConfig, GateConfigSchema, type GateResult, GateResultSchema, type GenerationSection, type Handoff, HandoffSchema, type HarnessState, HarnessStateSchema, type HealthCheckResult, type Import, type InlineReference, type IntegrityReport, type InternalSymbol, type JSDocComment, type LanguageParser, type Layer, type LayerConfig, type LogEntry, type LogFilter, type Metric, NoOpExecutor, NoOpSink, NoOpTelemetryAdapter, type ParseError, type PatternConfig, PatternConfigSchema, type PatternMatch, type PatternReport, type PatternViolation, type PeerReview, type PeerReviewOptions, type PipelineOptions, type PipelineResult, REQUIRED_SECTIONS, type ReachabilityNode, type ReviewChecklist, type ReviewComment, type ReviewContext, type ReviewItem, type SelfReviewConfig, type SkillExecutor, type SourceFile, type Span, type SpanEvent, type StepExecutor, type StructureValidation, type Suggestion, type SuggestionReport, type TelemetryAdapter, type TelemetryHealth, type TimeRange, type TokenBudget, type TokenBudgetOverrides, type Trace, type TurnExecutor, TypeScriptParser, type UnusedImport, VERSION, type ValidationError, type WorkflowPhase, analyzeDiff, appendFailure, appendLearning, applyFixes, archiveFailures, buildDependencyGraph, buildSnapshot, checkDocCoverage, configureFeedback, contextBudget, contextFilter, createBoundaryValidator, createError, createFixes, createParseError, createSelfReview, defineLayer, detectCircularDeps, detectCircularDepsInFiles, detectDeadCode, detectDocDrift, detectPatternViolations, executeWorkflow, extractMarkdownLinks, extractSections, generateAgentsMap, generateSuggestions, getActionEmitter, getFeedbackConfig, getPhaseCategories, loadFailures, loadHandoff, loadRelevantLearnings, loadState, logAgentAction, parseDiff, previewFix, requestMultiplePeerReviews, requestPeerReview, resetFeedbackConfig, resolveFileToLayer, runMechanicalGate, runMultiTurnPipeline, runPipeline, saveHandoff, saveState, trackAction, validateAgentsMap, validateBoundaries, validateCommitMessage, validateConfig, validateDependencies, validateFileStructure, validateKnowledgeMap, validatePatternConfig };
|