@harness-engineering/core 0.14.0 → 0.16.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.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { Result, SessionSectionName, SessionEntry, SessionSections, WorkflowStep, WorkflowStepResult, Workflow, WorkflowResult, SkillLifecycleHooks, SkillContext, SkillResult, TurnContext, CICheckName, CIFailOnSeverity, CICheckReport, Roadmap, FeatureStatus } from '@harness-engineering/types';
1
+ import { Result, SessionSectionName, SessionEntry, SessionSections, WorkflowStep, WorkflowStepResult, Workflow, WorkflowResult, SkillLifecycleHooks, SkillContext, SkillResult, TurnContext, CICheckName, CIFailOnSeverity, CICheckReport, Roadmap, FeatureStatus, ModelPricing, UsageRecord, DailyUsage, SessionUsage } from '@harness-engineering/types';
2
2
  export * from '@harness-engineering/types';
3
3
  import { z } from 'zod';
4
4
  import { C as Collector, A as ArchConfig, a as ConstraintRule, M as MetricResult, b as ArchMetricCategory, c as ArchBaseline, d as ArchDiffResult, T as ThresholdConfig } from './matchers-D20x48U9.js';
5
5
  export { e as ArchBaselineSchema, f as ArchConfigSchema, g as ArchDiffResultSchema, h as ArchHandle, i as ArchMetricCategorySchema, j as ArchitectureOptions, k as CategoryBaseline, l as CategoryBaselineSchema, m as CategoryRegression, n as CategoryRegressionSchema, o as ConstraintRuleSchema, p as MetricResultSchema, q as ThresholdConfigSchema, V as Violation, r as ViolationSchema, s as archMatchers, t as archModule, u as architecture } from './matchers-D20x48U9.js';
6
+ import Parser from 'web-tree-sitter';
6
7
 
7
8
  /**
8
9
  * Represents an error code for identifying specific error types.
@@ -293,6 +294,73 @@ interface ContextFilterResult {
293
294
  declare function contextFilter(phase: WorkflowPhase, maxCategories?: number, graphFilePaths?: string[]): ContextFilterResult;
294
295
  declare function getPhaseCategories(phase: WorkflowPhase): FileCategory[];
295
296
 
297
+ /**
298
+ * Supported languages for AST code navigation.
299
+ */
300
+ type SupportedLanguage = 'typescript' | 'javascript' | 'python';
301
+ /**
302
+ * Kind of code symbol extracted from AST.
303
+ */
304
+ type SymbolKind = 'function' | 'class' | 'interface' | 'type' | 'variable' | 'method' | 'property' | 'export' | 'import';
305
+ /**
306
+ * A code symbol with its location and metadata.
307
+ */
308
+ interface CodeSymbol {
309
+ name: string;
310
+ kind: SymbolKind;
311
+ file: string;
312
+ line: number;
313
+ endLine: number;
314
+ signature: string;
315
+ children?: CodeSymbol[];
316
+ }
317
+ /**
318
+ * Result of code_outline — structural skeleton of a file.
319
+ */
320
+ interface OutlineResult {
321
+ file: string;
322
+ language: SupportedLanguage | 'unknown';
323
+ totalLines: number;
324
+ symbols: CodeSymbol[];
325
+ error?: string;
326
+ }
327
+ /**
328
+ * A single match from code_search.
329
+ */
330
+ interface SearchMatch {
331
+ symbol: CodeSymbol;
332
+ context: string;
333
+ }
334
+ /**
335
+ * Result of code_search — cross-file symbol discovery.
336
+ */
337
+ interface SearchResult {
338
+ query: string;
339
+ matches: SearchMatch[];
340
+ skipped: string[];
341
+ }
342
+ /**
343
+ * Result of code_unfold — AST-bounded code extraction.
344
+ */
345
+ interface UnfoldResult {
346
+ file: string;
347
+ symbolName?: string;
348
+ startLine: number;
349
+ endLine: number;
350
+ content: string;
351
+ language: SupportedLanguage | 'unknown';
352
+ fallback: boolean;
353
+ warning?: string;
354
+ }
355
+ /**
356
+ * Map file extensions to supported languages.
357
+ */
358
+ declare const EXTENSION_MAP: Record<string, SupportedLanguage>;
359
+ /**
360
+ * Detect language from file extension.
361
+ */
362
+ declare function detectLanguage(filePath: string): SupportedLanguage | null;
363
+
296
364
  /**
297
365
  * Abstract Syntax Tree representation
298
366
  */
@@ -361,6 +429,10 @@ interface LanguageParser {
361
429
  extractImports(ast: AST): Result<Import[], ParseError>;
362
430
  extractExports(ast: AST): Result<Export[], ParseError>;
363
431
  health(): Promise<Result<HealthCheckResult, ParseError>>;
432
+ /** Extract structural outline from a parsed AST. Optional — code-nav parsers implement this. */
433
+ outline?(filePath: string, ast: AST): OutlineResult;
434
+ /** Extract a specific symbol's full implementation. Optional — code-nav parsers implement this. */
435
+ unfold?(filePath: string, ast: AST, symbolName: string): UnfoldResult | null;
364
436
  }
365
437
  /**
366
438
  * Create a ParseError with standard structure
@@ -3520,6 +3592,24 @@ declare const DEFAULT_STATE: HarnessState;
3520
3592
  declare function loadState(projectPath: string, stream?: string, session?: string): Promise<Result<HarnessState, Error>>;
3521
3593
  declare function saveState(projectPath: string, state: HarnessState, stream?: string, session?: string): Promise<Result<void, Error>>;
3522
3594
 
3595
+ interface LearningsFrontmatter {
3596
+ hash: string;
3597
+ tags: string[];
3598
+ }
3599
+ interface LearningsIndexEntry {
3600
+ hash: string;
3601
+ tags: string[];
3602
+ summary: string;
3603
+ fullText: string;
3604
+ }
3605
+ /** Parse a frontmatter comment line: <!-- hash:XXXX tags:a,b --> */
3606
+ declare function parseFrontmatter(line: string): LearningsFrontmatter | null;
3607
+ /**
3608
+ * Extract a lightweight index entry from a full learning entry.
3609
+ * Summary = first line only. Tags extracted from [skill:X] and [outcome:Y] markers.
3610
+ * Hash computed from full entry text.
3611
+ */
3612
+ declare function extractIndexEntry(entry: string): LearningsIndexEntry;
3523
3613
  declare function clearLearningsCache(): void;
3524
3614
  declare function appendLearning(projectPath: string, learning: string, skillName?: string, outcome?: string, stream?: string, session?: string): Promise<Result<void, Error>>;
3525
3615
  /**
@@ -3545,6 +3635,7 @@ interface BudgetedLearningsOptions {
3545
3635
  skill?: string;
3546
3636
  session?: string;
3547
3637
  stream?: string;
3638
+ depth?: 'index' | 'summary' | 'full';
3548
3639
  }
3549
3640
  /**
3550
3641
  * Load learnings with token budget, two-tier loading, recency sorting, and relevance filtering.
@@ -3556,6 +3647,14 @@ interface BudgetedLearningsOptions {
3556
3647
  * - Capped at tokenBudget (default 1000 tokens)
3557
3648
  */
3558
3649
  declare function loadBudgetedLearnings(projectPath: string, options: BudgetedLearningsOptions): Promise<Result<string[], Error>>;
3650
+ /**
3651
+ * Load lightweight index entries from a learnings file.
3652
+ * Returns summaries (first line) with hash and tags for each entry.
3653
+ * Uses frontmatter when available; computes hash and extracts tags on-the-fly when not.
3654
+ *
3655
+ * This is Layer 1 of the progressive disclosure pipeline.
3656
+ */
3657
+ declare function loadIndexEntries(projectPath: string, skillName?: string, stream?: string, session?: string): Promise<Result<LearningsIndexEntry[], Error>>;
3559
3658
  declare function loadRelevantLearnings(projectPath: string, skillName?: string, stream?: string, session?: string): Promise<Result<string[], Error>>;
3560
3659
  interface PruneResult {
3561
3660
  kept: number;
@@ -3577,6 +3676,26 @@ declare function archiveLearnings(projectPath: string, entries: string[], stream
3577
3676
  * Returns the prune result with pattern analysis and counts.
3578
3677
  */
3579
3678
  declare function pruneLearnings(projectPath: string, stream?: string): Promise<Result<PruneResult, Error>>;
3679
+ interface PromoteResult {
3680
+ promoted: number;
3681
+ skipped: number;
3682
+ }
3683
+ /**
3684
+ * Promote generalizable session learnings to global learnings.md.
3685
+ *
3686
+ * Generalizable entries are those tagged with [outcome:gotcha],
3687
+ * [outcome:decision], or [outcome:observation]. These represent
3688
+ * reusable insights that apply beyond the current session.
3689
+ *
3690
+ * Task-specific entries (e.g., [outcome:success] completion summaries,
3691
+ * or entries without outcome tags) stay in the session directory.
3692
+ */
3693
+ declare function promoteSessionLearnings(projectPath: string, sessionSlug: string, stream?: string): Promise<Result<PromoteResult, Error>>;
3694
+ /**
3695
+ * Count the number of learning entries in the global learnings.md file.
3696
+ * Useful for checking if pruning should be suggested (threshold: 30).
3697
+ */
3698
+ declare function countLearningEntries(projectPath: string, stream?: string): Promise<number>;
3580
3699
 
3581
3700
  declare function clearFailuresCache(): void;
3582
3701
  declare function appendFailure(projectPath: string, description: string, skillName: string, type: string, stream?: string, session?: string): Promise<Result<void, Error>>;
@@ -3753,6 +3872,88 @@ declare function updateSessionEntryStatus(projectPath: string, sessionSlug: stri
3753
3872
  */
3754
3873
  declare function archiveSession(projectPath: string, sessionSlug: string): Promise<Result<void, Error>>;
3755
3874
 
3875
+ /** Event types emitted at skill lifecycle points. */
3876
+ type EventType = 'phase_transition' | 'decision' | 'gate_result' | 'handoff' | 'error' | 'checkpoint';
3877
+ /** A structured skill lifecycle event. */
3878
+ interface SkillEvent {
3879
+ timestamp: string;
3880
+ skill: string;
3881
+ session?: string;
3882
+ type: EventType;
3883
+ summary: string;
3884
+ data?: Record<string, unknown>;
3885
+ refs?: string[];
3886
+ contentHash?: string;
3887
+ }
3888
+ /** Zod schema for validating SkillEvent objects. */
3889
+ declare const SkillEventSchema: z.ZodObject<{
3890
+ timestamp: z.ZodString;
3891
+ skill: z.ZodString;
3892
+ session: z.ZodOptional<z.ZodString>;
3893
+ type: z.ZodEnum<["phase_transition", "decision", "gate_result", "handoff", "error", "checkpoint"]>;
3894
+ summary: z.ZodString;
3895
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3896
+ refs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3897
+ contentHash: z.ZodOptional<z.ZodString>;
3898
+ }, "strip", z.ZodTypeAny, {
3899
+ type: "error" | "decision" | "phase_transition" | "gate_result" | "handoff" | "checkpoint";
3900
+ timestamp: string;
3901
+ skill: string;
3902
+ summary: string;
3903
+ session?: string | undefined;
3904
+ data?: Record<string, unknown> | undefined;
3905
+ refs?: string[] | undefined;
3906
+ contentHash?: string | undefined;
3907
+ }, {
3908
+ type: "error" | "decision" | "phase_transition" | "gate_result" | "handoff" | "checkpoint";
3909
+ timestamp: string;
3910
+ skill: string;
3911
+ summary: string;
3912
+ session?: string | undefined;
3913
+ data?: Record<string, unknown> | undefined;
3914
+ refs?: string[] | undefined;
3915
+ contentHash?: string | undefined;
3916
+ }>;
3917
+ /** Input to emitEvent — timestamp and contentHash are computed automatically. */
3918
+ type EmitEventInput = Omit<SkillEvent, 'timestamp' | 'contentHash'>;
3919
+ interface EmitEventOptions {
3920
+ session?: string;
3921
+ stream?: string;
3922
+ }
3923
+ interface EmitEventResult {
3924
+ written: boolean;
3925
+ reason?: string;
3926
+ }
3927
+ /** Clear the known-hashes cache (for testing). */
3928
+ declare function clearEventHashCache(): void;
3929
+ /**
3930
+ * Emit a structured event to the JSONL event log.
3931
+ *
3932
+ * - Appends one JSON line to events.jsonl (crash-safe via appendFileSync)
3933
+ * - Born-deduplicated: same {skill, type, summary, session} tuple writes only once
3934
+ * - Session-scoped when options.session is provided
3935
+ * - Uses in-memory hash set for O(1) dedup checks after initial file load
3936
+ */
3937
+ declare function emitEvent(projectPath: string, event: EmitEventInput, options?: EmitEventOptions): Promise<Result<EmitEventResult, Error>>;
3938
+ interface LoadEventsOptions {
3939
+ session?: string | undefined;
3940
+ stream?: string | undefined;
3941
+ }
3942
+ /**
3943
+ * Load all events from the JSONL event log.
3944
+ * Skips malformed lines gracefully.
3945
+ */
3946
+ declare function loadEvents(projectPath: string, options?: LoadEventsOptions): Promise<Result<SkillEvent[], Error>>;
3947
+ /**
3948
+ * Format events as a compact timeline for display in gather_context.
3949
+ *
3950
+ * Example output:
3951
+ * - 10:30 [harness-execution] phase: PREPARE -> EXECUTE (12 tasks)
3952
+ * - 10:45 [harness-execution] gate: passed (test Y, lint Y)
3953
+ * - 11:02 [harness-execution] decision: Use polling over WebSocket
3954
+ */
3955
+ declare function formatEventTimeline(events: SkillEvent[], limit?: number): string;
3956
+
3756
3957
  type StepExecutor = (step: WorkflowStep, previousArtifact?: string) => Promise<WorkflowStepResult>;
3757
3958
  declare function executeWorkflow(workflow: Workflow, executor: StepExecutor): Promise<WorkflowResult>;
3758
3959
 
@@ -3776,7 +3977,7 @@ type TurnExecutor = (context: TurnContext) => Promise<{
3776
3977
  declare function runPipeline(initialContext: SkillContext, executor: SkillExecutor, options?: PipelineOptions): Promise<PipelineResult>;
3777
3978
  declare function runMultiTurnPipeline(initialContext: SkillContext, turnExecutor: TurnExecutor, options?: PipelineOptions): Promise<PipelineResult>;
3778
3979
 
3779
- type SecurityCategory = 'secrets' | 'injection' | 'xss' | 'crypto' | 'network' | 'deserialization' | 'path-traversal';
3980
+ type SecurityCategory = 'secrets' | 'injection' | 'xss' | 'crypto' | 'network' | 'deserialization' | 'path-traversal' | 'agent-config' | 'mcp' | 'insecure-defaults' | 'sharp-edges';
3780
3981
  type SecuritySeverity = 'error' | 'warning' | 'info';
3781
3982
  type SecurityConfidence = 'high' | 'medium' | 'low';
3782
3983
  interface SecurityRule {
@@ -3814,6 +4015,12 @@ interface ScanResult {
3814
4015
  externalToolsUsed: string[];
3815
4016
  coverage: 'baseline' | 'enhanced';
3816
4017
  }
4018
+ interface SuppressionRecord {
4019
+ ruleId: string;
4020
+ file: string;
4021
+ line: number;
4022
+ justification: string | null;
4023
+ }
3817
4024
  type RuleOverride = 'off' | SecuritySeverity;
3818
4025
  interface SecurityConfig {
3819
4026
  enabled: boolean;
@@ -3832,14 +4039,32 @@ interface SecurityConfig {
3832
4039
  }
3833
4040
  declare const DEFAULT_SECURITY_CONFIG: SecurityConfig;
3834
4041
 
4042
+ interface SuppressionMatch {
4043
+ ruleId: string;
4044
+ justification: string | null;
4045
+ }
4046
+ declare function parseHarnessIgnore(line: string, ruleId: string): SuppressionMatch | null;
3835
4047
  declare class SecurityScanner {
3836
4048
  private registry;
3837
4049
  private config;
3838
4050
  private activeRules;
3839
4051
  constructor(config?: Partial<SecurityConfig>);
3840
4052
  configureForProject(projectRoot: string): void;
4053
+ /**
4054
+ * Scan raw content against all active rules. Note: this method does NOT apply
4055
+ * fileGlob filtering — every active rule is evaluated regardless of filePath.
4056
+ * If you are scanning a specific file and want fileGlob-based rule filtering,
4057
+ * use {@link scanFile} instead.
4058
+ */
3841
4059
  scanContent(content: string, filePath: string, startLine?: number): SecurityFinding[];
3842
4060
  scanFile(filePath: string): Promise<SecurityFinding[]>;
4061
+ private scanContentForFile;
4062
+ /**
4063
+ * Core scanning loop shared by scanContent and scanContentForFile.
4064
+ * Evaluates each rule against each line, handling suppression (FP gate)
4065
+ * and pattern matching uniformly.
4066
+ */
4067
+ private scanLinesWithRules;
3843
4068
  scanFiles(filePaths: string[]): Promise<ScanResult>;
3844
4069
  }
3845
4070
 
@@ -3941,6 +4166,120 @@ declare const networkRules: SecurityRule[];
3941
4166
 
3942
4167
  declare const deserializationRules: SecurityRule[];
3943
4168
 
4169
+ declare const agentConfigRules: SecurityRule[];
4170
+
4171
+ declare const mcpRules: SecurityRule[];
4172
+
4173
+ declare const insecureDefaultsRules: SecurityRule[];
4174
+
4175
+ declare const sharpEdgesRules: SecurityRule[];
4176
+
4177
+ /**
4178
+ * Sentinel Injection Pattern Engine
4179
+ *
4180
+ * Shared pattern library for detecting prompt injection attacks in text input.
4181
+ * Used by sentinel hooks, MCP middleware, and the scan-config CLI.
4182
+ *
4183
+ * This engine DETECTS and REPORTS patterns. It does NOT strip them --
4184
+ * the existing sanitizeExternalText() in ConnectorUtils.ts handles stripping.
4185
+ */
4186
+ type InjectionSeverity = 'high' | 'medium' | 'low';
4187
+ interface InjectionFinding {
4188
+ severity: InjectionSeverity;
4189
+ ruleId: string;
4190
+ match: string;
4191
+ line?: number;
4192
+ }
4193
+ interface InjectionPattern {
4194
+ ruleId: string;
4195
+ severity: InjectionSeverity;
4196
+ category: string;
4197
+ description: string;
4198
+ pattern: RegExp;
4199
+ }
4200
+ /**
4201
+ * Scan text for prompt injection patterns.
4202
+ *
4203
+ * Returns an array of findings sorted by severity (high first).
4204
+ * The caller decides how to act on findings based on severity:
4205
+ * - HIGH/MEDIUM: Trigger taint (hooks and MCP middleware)
4206
+ * - LOW: Informational only (logged to stderr, no taint)
4207
+ */
4208
+ declare function scanForInjection(text: string): InjectionFinding[];
4209
+ /**
4210
+ * Get all registered injection patterns.
4211
+ * Useful for inspection, documentation, and testing.
4212
+ */
4213
+ declare function getInjectionPatterns(): ReadonlyArray<InjectionPattern>;
4214
+ /**
4215
+ * Bash command patterns that are blocked during tainted sessions.
4216
+ * Used by sentinel hooks and MCP middleware — kept in one place to prevent drift.
4217
+ * Hooks that cannot import from core at startup define their own inline copy with a sync comment.
4218
+ */
4219
+ declare const DESTRUCTIVE_BASH: ReadonlyArray<RegExp>;
4220
+
4221
+ /**
4222
+ * Sentinel Taint State Management
4223
+ *
4224
+ * Session-scoped taint file read/write/check/clear/expire logic.
4225
+ * Taint files live at `.harness/session-taint-{sessionId}.json`.
4226
+ *
4227
+ * The taint file is the single source of truth for enforcement.
4228
+ * Hooks and MCP middleware read this file on every invocation.
4229
+ */
4230
+
4231
+ interface TaintFinding {
4232
+ ruleId: string;
4233
+ severity: string;
4234
+ match: string;
4235
+ source: string;
4236
+ detectedAt: string;
4237
+ }
4238
+ interface TaintState {
4239
+ sessionId: string;
4240
+ taintedAt: string;
4241
+ expiresAt: string;
4242
+ reason: string;
4243
+ severity: 'high' | 'medium';
4244
+ findings: TaintFinding[];
4245
+ }
4246
+ interface TaintCheckResult {
4247
+ tainted: boolean;
4248
+ expired: boolean;
4249
+ state: TaintState | null;
4250
+ }
4251
+ /**
4252
+ * Get the taint file path for a given session.
4253
+ */
4254
+ declare function getTaintFilePath(projectRoot: string, sessionId?: string): string;
4255
+ /**
4256
+ * Read the taint state for a session.
4257
+ * Returns null if no taint file exists or if the file is malformed (fail-open).
4258
+ * If malformed, the file is deleted.
4259
+ */
4260
+ declare function readTaint(projectRoot: string, sessionId?: string): TaintState | null;
4261
+ /**
4262
+ * Check taint status for a session.
4263
+ * Handles expiry: if taint has expired, deletes the file and returns expired=true.
4264
+ */
4265
+ declare function checkTaint(projectRoot: string, sessionId?: string): TaintCheckResult;
4266
+ /**
4267
+ * Write taint state for a session.
4268
+ * Creates .harness/ directory if it doesn't exist.
4269
+ * If taint already exists for this session, appends new findings and keeps the earlier taintedAt.
4270
+ */
4271
+ declare function writeTaint(projectRoot: string, sessionId: string | undefined, reason: string, findings: InjectionFinding[], source: string): TaintState;
4272
+ /**
4273
+ * Clear taint for a specific session or all sessions.
4274
+ * Returns the number of taint files removed.
4275
+ */
4276
+ declare function clearTaint(projectRoot: string, sessionId?: string): number;
4277
+ /**
4278
+ * List all active taint sessions.
4279
+ * Returns session IDs with active (non-expired) taint.
4280
+ */
4281
+ declare function listTaintedSessions(projectRoot: string): string[];
4282
+
3944
4283
  declare const nodeRules: SecurityRule[];
3945
4284
 
3946
4285
  declare const expressRules: SecurityRule[];
@@ -3949,6 +4288,34 @@ declare const reactRules: SecurityRule[];
3949
4288
 
3950
4289
  declare const goRules: SecurityRule[];
3951
4290
 
4291
+ /**
4292
+ * Shared scan-config types and utilities.
4293
+ * Used by both the CLI `harness scan-config` command and the orchestrator workspace scanner.
4294
+ */
4295
+
4296
+ interface ScanConfigFinding {
4297
+ ruleId: string;
4298
+ severity: 'high' | 'medium' | 'low';
4299
+ message: string;
4300
+ match: string;
4301
+ line?: number;
4302
+ }
4303
+ interface ScanConfigFileResult {
4304
+ file: string;
4305
+ findings: ScanConfigFinding[];
4306
+ overallSeverity: 'high' | 'medium' | 'low' | 'clean';
4307
+ }
4308
+ interface ScanConfigResult {
4309
+ exitCode: number;
4310
+ results: ScanConfigFileResult[];
4311
+ }
4312
+ declare function mapSecuritySeverity(severity: string): 'high' | 'medium' | 'low';
4313
+ declare function computeOverallSeverity(findings: ScanConfigFinding[]): 'high' | 'medium' | 'low' | 'clean';
4314
+ declare function computeScanExitCode(results: ScanConfigFileResult[]): number;
4315
+ declare function mapInjectionFindings(injectionFindings: InjectionFinding[]): ScanConfigFinding[];
4316
+ declare function isDuplicateFinding(existing: ScanConfigFinding[], secFinding: SecurityFinding): boolean;
4317
+ declare function mapSecurityFindings(secFindings: SecurityFinding[], existing: ScanConfigFinding[]): ScanConfigFinding[];
4318
+
3952
4319
  interface RunCIChecksInput {
3953
4320
  projectRoot: string;
3954
4321
  config: Record<string, unknown>;
@@ -4738,8 +5105,18 @@ interface SyncOptions {
4738
5105
  /**
4739
5106
  * Scan execution state files and infer status changes for roadmap features.
4740
5107
  * Returns proposed changes without modifying the roadmap.
5108
+ *
5109
+ * Human-always-wins rule (directional): sync never regresses a feature's
5110
+ * status (e.g. done → in-progress) unless forceSync is set. Forward
5111
+ * progression (planned → in-progress → done) is always allowed regardless
5112
+ * of manual edits.
4741
5113
  */
4742
5114
  declare function syncRoadmap(options: SyncOptions): Result<SyncChange[]>;
5115
+ /**
5116
+ * Apply sync changes to a roadmap in-place and update lastSynced.
5117
+ * Shared by manage_roadmap sync action and autoSyncRoadmap.
5118
+ */
5119
+ declare function applySyncChanges(roadmap: Roadmap, changes: SyncChange[]): void;
4743
5120
 
4744
5121
  declare const InteractionTypeSchema: z.ZodEnum<["question", "confirmation", "transition"]>;
4745
5122
  declare const QuestionSchema: z.ZodObject<{
@@ -4968,6 +5345,146 @@ declare function spawnBackgroundCheck(currentVersion: string): void;
4968
5345
  */
4969
5346
  declare function getUpdateNotification(currentVersion: string): string | null;
4970
5347
 
5348
+ interface ParsedFile {
5349
+ tree: Parser.Tree;
5350
+ language: SupportedLanguage;
5351
+ source: string;
5352
+ filePath: string;
5353
+ }
5354
+ interface ParseFileError {
5355
+ code: 'UNSUPPORTED_LANGUAGE' | 'FILE_NOT_FOUND' | 'PARSE_FAILED' | 'INIT_FAILED';
5356
+ message: string;
5357
+ }
5358
+ /**
5359
+ * Get or create a cached parser for the given language.
5360
+ */
5361
+ declare function getParser(lang: SupportedLanguage): Promise<Parser>;
5362
+ /**
5363
+ * Parse a file and return the tree-sitter tree with metadata.
5364
+ */
5365
+ declare function parseFile(filePath: string): Promise<Result<ParsedFile, ParseFileError>>;
5366
+ /**
5367
+ * Reset the parser cache (for testing).
5368
+ */
5369
+ declare function resetParserCache(): void;
5370
+
5371
+ /**
5372
+ * Get structural outline for a single file.
5373
+ */
5374
+ declare function getOutline(filePath: string): Promise<OutlineResult>;
5375
+ /**
5376
+ * Format an outline result as the tree-style text format shown in the spec.
5377
+ */
5378
+ declare function formatOutline(outline: OutlineResult): string;
5379
+
5380
+ /**
5381
+ * Search for symbols matching a query across files in a directory.
5382
+ */
5383
+ declare function searchSymbols(query: string, directory: string, fileGlob?: string): Promise<SearchResult>;
5384
+
5385
+ /**
5386
+ * Extract a specific symbol's implementation from a file by name.
5387
+ */
5388
+ declare function unfoldSymbol(filePath: string, symbolName: string): Promise<UnfoldResult>;
5389
+ /**
5390
+ * Extract a range of lines from a file.
5391
+ */
5392
+ declare function unfoldRange(filePath: string, startLine: number, endLine: number): Promise<UnfoldResult>;
5393
+
5394
+ /** Shape of the LiteLLM pricing JSON (per-model entry). */
5395
+ interface LiteLLMModelEntry {
5396
+ input_cost_per_token?: number;
5397
+ output_cost_per_token?: number;
5398
+ cache_read_input_token_cost?: number;
5399
+ cache_creation_input_token_cost?: number;
5400
+ mode?: string;
5401
+ [key: string]: unknown;
5402
+ }
5403
+ /** Shape of the full LiteLLM pricing JSON file. */
5404
+ interface LiteLLMPricingData {
5405
+ [modelName: string]: LiteLLMModelEntry;
5406
+ }
5407
+ /** Parsed pricing dataset keyed by model name. */
5408
+ type PricingDataset = Map<string, ModelPricing>;
5409
+ /** Shape of the disk cache file. */
5410
+ interface PricingCacheFile {
5411
+ fetchedAt: string;
5412
+ data: LiteLLMPricingData;
5413
+ }
5414
+ /** Shape of the fallback.json file. */
5415
+ interface FallbackPricingFile {
5416
+ _generatedAt: string;
5417
+ _source: string;
5418
+ models: Record<string, ModelPricing>;
5419
+ }
5420
+
5421
+ /**
5422
+ * Parses LiteLLM's raw pricing JSON into a PricingDataset map.
5423
+ * Only includes chat-mode models with valid input/output costs.
5424
+ */
5425
+ declare function parseLiteLLMData(raw: LiteLLMPricingData): PricingDataset;
5426
+ /**
5427
+ * Looks up pricing for a given model name.
5428
+ * Returns null and logs a warning if the model is not found.
5429
+ */
5430
+ declare function getModelPrice(model: string, dataset: PricingDataset): ModelPricing | null;
5431
+
5432
+ /** Pinned LiteLLM pricing URL. */
5433
+ declare const LITELLM_PRICING_URL = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json";
5434
+ /** Cache time-to-live: 24 hours in milliseconds. */
5435
+ declare const CACHE_TTL_MS: number;
5436
+ /** Number of days after which fallback usage triggers a staleness warning. */
5437
+ declare const STALENESS_WARNING_DAYS = 7;
5438
+ /**
5439
+ * Loads pricing data with the following priority:
5440
+ * 1. Fresh disk cache (<24h old) — no network request
5441
+ * 2. Network fetch from LiteLLM — writes to disk cache
5442
+ * 3. Expired disk cache (any age) — when network fails
5443
+ * 4. Bundled fallback.json — when no cache and no network
5444
+ */
5445
+ declare function loadPricingData(projectRoot: string): Promise<PricingDataset>;
5446
+
5447
+ /**
5448
+ * Calculates the cost of a usage record in integer microdollars.
5449
+ * Returns null if the model is unknown or not specified.
5450
+ */
5451
+ declare function calculateCost(record: UsageRecord, dataset: PricingDataset): number | null;
5452
+
5453
+ /**
5454
+ * Aggregates an array of UsageRecords into per-session summaries.
5455
+ *
5456
+ * When records from both harness and Claude Code sources share a session ID:
5457
+ * - Harness token counts are authoritative
5458
+ * - CC data supplements the model field
5459
+ * - The result is marked as 'merged'
5460
+ */
5461
+ declare function aggregateBySession(records: UsageRecord[]): SessionUsage[];
5462
+ /**
5463
+ * Aggregates an array of UsageRecords into per-day summaries.
5464
+ * Groups by calendar date (UTC) derived from the record timestamp.
5465
+ */
5466
+ declare function aggregateByDay(records: UsageRecord[]): DailyUsage[];
5467
+
5468
+ /**
5469
+ * Reads .harness/metrics/costs.jsonl and normalizes snake_case hook output
5470
+ * to camelCase UsageRecord format.
5471
+ *
5472
+ * - Skips malformed lines with a warning to stderr
5473
+ * - Handles legacy entries missing cache/model fields
5474
+ * - Returns empty array if file does not exist
5475
+ */
5476
+ declare function readCostRecords(projectRoot: string): UsageRecord[];
5477
+
5478
+ /**
5479
+ * Discovers and parses Claude Code JSONL files from ~/.claude/projects/ directories.
5480
+ *
5481
+ * Best-effort: the path is not a public API and may change across CC versions.
5482
+ * - If ~/.claude/projects/ does not exist, returns empty array (no error)
5483
+ * - Malformed entries are skipped with a console.warn
5484
+ * - Each valid assistant entry with usage data maps to a UsageRecord tagged with _source: 'claude-code'
5485
+ */
5486
+ declare function parseCCRecords(): UsageRecord[];
5487
+
4971
5488
  /**
4972
5489
  * @harness-engineering/core
4973
5490
  *
@@ -4987,6 +5504,6 @@ declare function getUpdateNotification(currentVersion: string): string | null;
4987
5504
  * release. Kept only as a fallback for consumers that cannot resolve the CLI
4988
5505
  * package at runtime.
4989
5506
  */
4990
- declare const VERSION = "0.14.0";
5507
+ declare const VERSION = "0.15.0";
4991
5508
 
4992
- export { AGENT_DESCRIPTORS, ARCHITECTURE_DESCRIPTOR, type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentReviewResult, type AgentType, type AgentsMapConfig, ArchBaseline, ArchBaselineManager, ArchConfig, ArchDiffResult, ArchMetricCategory, BUG_DETECTION_DESCRIPTOR, type BaseError, type Baseline, BaselineManager, type BaselinesFile, type BenchmarkResult, type BenchmarkRunOptions, BenchmarkRunner, type BlueprintData, BlueprintGenerator, type BlueprintModule, type BlueprintOptions, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type BudgetedLearningsOptions, type Bundle, type BundleConstraints, BundleConstraintsSchema, BundleSchema, COMPLIANCE_DESCRIPTOR, type ChangeType, type ChangedFile, ChecklistBuilder, type CircularDependency, CircularDepsCollector, type CircularDepsResult, type CleanupFinding, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, Collector, type CommentedCodeBlock, type CommitFormat, type CommitHistoryEntry, type CommitValidation, ComplexityCollector, type ComplexityConfig, type ComplexityReport, type ComplexityThresholds, type ComplexityViolation, type ConfigError, type ConfigPattern, type Confirmation, ConfirmationSchema, type ConflictReport, ConsoleSink, type ConstraintError, type ConstraintNodeStore, ConstraintRule, type Content, ContentPipeline, type ContextBundle, type ContextError, type ContextFile, type ContextFilterResult, type ContextScopeOptions, type Contributions, ContributionsSchema, type Convention, CouplingCollector, type CouplingConfig, type CouplingReport, type CouplingThresholds, type CouplingViolation, type CoverageOptions, type CoverageReport, type CriticalPathEntry, CriticalPathResolver, type CriticalPathSet, type CustomRule, type CustomRuleResult, DEFAULT_PROVIDER_TIERS, DEFAULT_SECURITY_CONFIG, DEFAULT_STATE, DEFAULT_STREAM_INDEX, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DeduplicateFindingsOptions, DepDepthCollector, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DetectStaleResult, type DiffInfo, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, type EligibilityResult, type EmitInteractionInput, EmitInteractionInputSchema, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport, type EvidenceCoverageReport, ExclusionSet, type ExecutorHealth, type Export, type ExportMap, type FailureEntry, FailureEntrySchema, type FanOutOptions, type FeedbackAgentConfig, type FeedbackConfig, type FeedbackError$1 as FeedbackError, type FileCategory, FileSink, type FindingSeverity, type Fix, type FixConfig, type FixResult, type FixType, ForbiddenImportCollector, type ForbiddenImportViolation, type ForbiddenPattern, type GateConfig, GateConfigSchema, type GateResult, GateResultSchema, type GenerationSection, type GitHubInlineComment, type GraphAdapter, type GraphComplexityData, type GraphCouplingData, type GraphCoverageData, type GraphCriticalPathData, type GraphDependencyData, type GraphHarnessCheckData, type GraphImpactData, type Handoff, HandoffSchema, type HarnessState, HarnessStateSchema, type HealthCheckResult, type Hotspot, type HotspotContext, type Import, type InlineReference, type IntegrityReport, type InteractionType, InteractionTypeSchema, type InternalSymbol, type JSDocComment, type LanguageParser, type Layer, type LayerConfig, LayerViolationCollector, type LearningPattern, type Lockfile, type LockfilePackage, LockfilePackageSchema, LockfileSchema, type LogEntry, type LogFilter, type Manifest, ManifestSchema, type MechanicalCheckOptions, type MechanicalCheckResult, type MechanicalCheckStatus, type MechanicalFinding, type MergeResult, type Metric, MetricResult, type ModelProvider, type ModelTier, type ModelTierConfig, type ModuleDependency, ModuleSizeCollector, NoOpExecutor, NoOpSink, NoOpTelemetryAdapter, type OrphanedDep, type ParseError, type PatternConfig, PatternConfigSchema, type PatternMatch, type PatternReport, type PatternViolation, type PeerReview, type PeerReviewOptions, type PipelineContext, type PipelineFlags, type PipelineOptions, type PipelineResult, type PrMetadata, type PriorReview, ProjectScanner, type ProviderDefaults, type PruneResult, type Question, QuestionSchema, REQUIRED_SECTIONS, type ReachabilityNode, RegressionDetector, type RegressionReport, type RegressionResult, type ReviewAgentDescriptor, type ReviewAssessment, type ReviewChecklist, type ReviewComment, type ReviewContext, type ReviewDomain, type ReviewFinding, type ReviewItem, type ReviewOutputOptions, type ReviewPipelineResult, type ReviewStrength, type RuleOverride, RuleRegistry, type RunCIChecksInput, type RunPipelineOptions, SECURITY_DESCRIPTOR, type SafetyLevel, type ScanResult, type SecurityCategory, type SecurityConfidence, type SecurityConfig, SecurityConfigSchema, type SecurityFinding, type SecurityRule, SecurityScanner, type SecuritySeverity, type SelfReviewConfig, type SessionSummaryData, SharableBoundaryConfigSchema, SharableForbiddenImportSchema, SharableLayerSchema, SharableSecurityRulesSchema, type SizeBudgetConfig, type SizeBudgetReport, type SizeBudgetViolation, type SkillExecutor, type SourceFile, type Span, type SpanEvent, type StaleConstraint, type StepExecutor, type StreamIndex, StreamIndexSchema, type StreamInfo, StreamInfoSchema, type StructureValidation, type Suggestion, type SuggestionReport, type SyncChange, type SyncOptions, type TelemetryAdapter, type TelemetryHealth, ThresholdConfig, type TimeRange, type TokenBudget, type TokenBudgetOverrides, type Trace, type Transition, TransitionSchema, type TurnExecutor, TypeScriptParser, type UnusedImport, type UpdateCheckState, VERSION, type ValidateFindingsOptions, type ValidationError, type WorkflowPhase, addProvenance, analyzeDiff, analyzeLearningPatterns, appendFailure, appendLearning, appendSessionEntry, applyFixes, applyHotspotDowngrade, archiveFailures, archiveLearnings, archiveSession, archiveStream, buildDependencyGraph, buildExclusionSet, buildSnapshot, checkDocCoverage, checkEligibility, checkEvidenceCoverage, classifyFinding, clearFailuresCache, clearLearningsCache, configureFeedback, constraintRuleId, contextBudget, contextFilter, createBoundaryValidator, createCommentedCodeFixes, createError, createFixes, createForbiddenImportFixes, createOrphanedDepFixes, createParseError, createSelfReview, createStream, cryptoRules, deduplicateCleanupFindings, deduplicateFindings, deepMergeConstraints, defaultCollectors, defineLayer, deserializationRules, detectChangeType, detectCircularDeps, detectCircularDepsInFiles, detectComplexityViolations, detectCouplingViolations, detectDeadCode, detectDocDrift, detectPatternViolations, detectSizeBudgetViolations, detectStack, detectStaleConstraints, determineAssessment, diff, executeWorkflow, expressRules, extractBundle, extractMarkdownLinks, extractSections, fanOutReview, formatFindingBlock, formatGitHubComment, formatGitHubSummary, formatTerminalOutput, generateAgentsMap, generateSuggestions, getActionEmitter, getExitCode, getFeedbackConfig, getPhaseCategories, getStreamForBranch, getUpdateNotification, goRules, injectionRules, isSmallSuggestion, isUpdateCheckEnabled, listActiveSessions, listStreams, loadBudgetedLearnings, loadFailures, loadHandoff, loadRelevantLearnings, loadSessionSummary, loadState, loadStreamIndex, logAgentAction, migrateToStreams, networkRules, nodeRules, parseDateFromEntry, parseDiff, parseManifest, parseRoadmap, parseSecurityConfig, parseSize, pathTraversalRules, previewFix, pruneLearnings, reactRules, readCheckState, readLockfile, readSessionSection, readSessionSections, removeContributions, removeProvenance, requestMultiplePeerReviews, requestPeerReview, resetFeedbackConfig, resolveFileToLayer, resolveModelTier, resolveRuleSeverity, resolveSessionDir, resolveStreamPath, resolveThresholds, runAll, runArchitectureAgent, runBugDetectionAgent, runCIChecks, runComplianceAgent, runMechanicalChecks, runMechanicalGate, runMultiTurnPipeline, runPipeline, runReviewPipeline, runSecurityAgent, saveHandoff, saveState, saveStreamIndex, scopeContext, secretRules, serializeRoadmap, setActiveStream, shouldRunCheck, spawnBackgroundCheck, syncConstraintNodes, syncRoadmap, tagUncitedFindings, touchStream, trackAction, updateSessionEntryStatus, updateSessionIndex, validateAgentsMap, validateBoundaries, validateCommitMessage, validateConfig, validateDependencies, validateFileStructure, validateFindings, validateKnowledgeMap, validatePatternConfig, violationId, writeConfig, writeLockfile, writeSessionSummary, xssRules };
5509
+ export { AGENT_DESCRIPTORS, ARCHITECTURE_DESCRIPTOR, type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentReviewResult, type AgentType, type AgentsMapConfig, ArchBaseline, ArchBaselineManager, ArchConfig, ArchDiffResult, ArchMetricCategory, BUG_DETECTION_DESCRIPTOR, type BaseError, type Baseline, BaselineManager, type BaselinesFile, type BenchmarkResult, type BenchmarkRunOptions, BenchmarkRunner, type BlueprintData, BlueprintGenerator, type BlueprintModule, type BlueprintOptions, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type BudgetedLearningsOptions, type Bundle, type BundleConstraints, BundleConstraintsSchema, BundleSchema, CACHE_TTL_MS, COMPLIANCE_DESCRIPTOR, type ChangeType, type ChangedFile, ChecklistBuilder, type CircularDependency, CircularDepsCollector, type CircularDepsResult, type CleanupFinding, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodeSymbol, type CodebaseSnapshot, Collector, type CommentedCodeBlock, type CommitFormat, type CommitHistoryEntry, type CommitValidation, ComplexityCollector, type ComplexityConfig, type ComplexityReport, type ComplexityThresholds, type ComplexityViolation, type ConfigError, type ConfigPattern, type Confirmation, ConfirmationSchema, type ConflictReport, ConsoleSink, type ConstraintError, type ConstraintNodeStore, ConstraintRule, type Content, ContentPipeline, type ContextBundle, type ContextError, type ContextFile, type ContextFilterResult, type ContextScopeOptions, type Contributions, ContributionsSchema, type Convention, CouplingCollector, type CouplingConfig, type CouplingReport, type CouplingThresholds, type CouplingViolation, type CoverageOptions, type CoverageReport, type CriticalPathEntry, CriticalPathResolver, type CriticalPathSet, type CustomRule, type CustomRuleResult, DEFAULT_PROVIDER_TIERS, DEFAULT_SECURITY_CONFIG, DEFAULT_STATE, DEFAULT_STREAM_INDEX, DESTRUCTIVE_BASH, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DeduplicateFindingsOptions, DepDepthCollector, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DetectStaleResult, type DiffInfo, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, EXTENSION_MAP, type EligibilityResult, type EmitEventInput, type EmitEventOptions, type EmitEventResult, type EmitInteractionInput, EmitInteractionInputSchema, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport, type EventType, type EvidenceCoverageReport, ExclusionSet, type ExecutorHealth, type Export, type ExportMap, type FailureEntry, FailureEntrySchema, type FallbackPricingFile, type FanOutOptions, type FeedbackAgentConfig, type FeedbackConfig, type FeedbackError$1 as FeedbackError, type FileCategory, FileSink, type FindingSeverity, type Fix, type FixConfig, type FixResult, type FixType, ForbiddenImportCollector, type ForbiddenImportViolation, type ForbiddenPattern, type GateConfig, GateConfigSchema, type GateResult, GateResultSchema, type GenerationSection, type GitHubInlineComment, type GraphAdapter, type GraphComplexityData, type GraphCouplingData, type GraphCoverageData, type GraphCriticalPathData, type GraphDependencyData, type GraphHarnessCheckData, type GraphImpactData, type Handoff, HandoffSchema, type HarnessState, HarnessStateSchema, type HealthCheckResult, type Hotspot, type HotspotContext, type Import, type InjectionFinding, type InjectionPattern, type InjectionSeverity, type InlineReference, type IntegrityReport, type InteractionType, InteractionTypeSchema, type InternalSymbol, type JSDocComment, LITELLM_PRICING_URL, type LanguageParser, type Layer, type LayerConfig, LayerViolationCollector, type LearningPattern, type LearningsFrontmatter, type LearningsIndexEntry, type LiteLLMModelEntry, type LiteLLMPricingData, type LoadEventsOptions, type Lockfile, type LockfilePackage, LockfilePackageSchema, LockfileSchema, type LogEntry, type LogFilter, type Manifest, ManifestSchema, type MechanicalCheckOptions, type MechanicalCheckResult, type MechanicalCheckStatus, type MechanicalFinding, type MergeResult, type Metric, MetricResult, type ModelProvider, type ModelTier, type ModelTierConfig, type ModuleDependency, ModuleSizeCollector, NoOpExecutor, NoOpSink, NoOpTelemetryAdapter, type OrphanedDep, type OutlineResult, type ParseError, type ParsedFile, type PatternConfig, PatternConfigSchema, type PatternMatch, type PatternReport, type PatternViolation, type PeerReview, type PeerReviewOptions, type PipelineContext, type PipelineFlags, type PipelineOptions, type PipelineResult, type PrMetadata, type PricingCacheFile, type PricingDataset, type PriorReview, ProjectScanner, type PromoteResult, type ProviderDefaults, type PruneResult, type Question, QuestionSchema, REQUIRED_SECTIONS, type ReachabilityNode, RegressionDetector, type RegressionReport, type RegressionResult, type ReviewAgentDescriptor, type ReviewAssessment, type ReviewChecklist, type ReviewComment, type ReviewContext, type ReviewDomain, type ReviewFinding, type ReviewItem, type ReviewOutputOptions, type ReviewPipelineResult, type ReviewStrength, type RuleOverride, RuleRegistry, type RunCIChecksInput, type RunPipelineOptions, SECURITY_DESCRIPTOR, STALENESS_WARNING_DAYS, type SafetyLevel, type ScanConfigFileResult, type ScanConfigFinding, type ScanConfigResult, type ScanResult, type SearchMatch, type SearchResult, type SecurityCategory, type SecurityConfidence, type SecurityConfig, SecurityConfigSchema, type SecurityFinding, type SecurityRule, SecurityScanner, type SecuritySeverity, type SelfReviewConfig, type SessionSummaryData, SharableBoundaryConfigSchema, SharableForbiddenImportSchema, SharableLayerSchema, SharableSecurityRulesSchema, type SizeBudgetConfig, type SizeBudgetReport, type SizeBudgetViolation, type SkillEvent, SkillEventSchema, type SkillExecutor, type SourceFile, type Span, type SpanEvent, type StaleConstraint, type StepExecutor, type StreamIndex, StreamIndexSchema, type StreamInfo, StreamInfoSchema, type StructureValidation, type Suggestion, type SuggestionReport, type SupportedLanguage, type SuppressionRecord, type SymbolKind, type SyncChange, type SyncOptions, type TaintCheckResult, type TaintFinding, type TaintState, type TelemetryAdapter, type TelemetryHealth, ThresholdConfig, type TimeRange, type TokenBudget, type TokenBudgetOverrides, type Trace, type Transition, TransitionSchema, type TurnExecutor, TypeScriptParser, type UnfoldResult, type UnusedImport, type UpdateCheckState, VERSION, type ValidateFindingsOptions, type ValidationError, type WorkflowPhase, addProvenance, agentConfigRules, aggregateByDay, aggregateBySession, analyzeDiff, analyzeLearningPatterns, appendFailure, appendLearning, appendSessionEntry, applyFixes, applyHotspotDowngrade, applySyncChanges, archiveFailures, archiveLearnings, archiveSession, archiveStream, buildDependencyGraph, buildExclusionSet, buildSnapshot, calculateCost, checkDocCoverage, checkEligibility, checkEvidenceCoverage, checkTaint, classifyFinding, clearEventHashCache, clearFailuresCache, clearLearningsCache, clearTaint, computeOverallSeverity, computeScanExitCode, configureFeedback, constraintRuleId, contextBudget, contextFilter, countLearningEntries, createBoundaryValidator, createCommentedCodeFixes, createError, createFixes, createForbiddenImportFixes, createOrphanedDepFixes, createParseError, createSelfReview, createStream, cryptoRules, deduplicateCleanupFindings, deduplicateFindings, deepMergeConstraints, defaultCollectors, defineLayer, deserializationRules, detectChangeType, detectCircularDeps, detectCircularDepsInFiles, detectComplexityViolations, detectCouplingViolations, detectDeadCode, detectDocDrift, detectLanguage, detectPatternViolations, detectSizeBudgetViolations, detectStack, detectStaleConstraints, determineAssessment, diff, emitEvent, executeWorkflow, expressRules, extractBundle, extractIndexEntry, extractMarkdownLinks, extractSections, fanOutReview, formatEventTimeline, formatFindingBlock, formatGitHubComment, formatGitHubSummary, formatOutline, formatTerminalOutput, generateAgentsMap, generateSuggestions, getActionEmitter, getExitCode, getFeedbackConfig, getInjectionPatterns, getModelPrice, getOutline, getParser, getPhaseCategories, getStreamForBranch, getTaintFilePath, getUpdateNotification, goRules, injectionRules, insecureDefaultsRules, isDuplicateFinding, isSmallSuggestion, isUpdateCheckEnabled, listActiveSessions, listStreams, listTaintedSessions, loadBudgetedLearnings, loadEvents, loadFailures, loadHandoff, loadIndexEntries, loadPricingData, loadRelevantLearnings, loadSessionSummary, loadState, loadStreamIndex, logAgentAction, mapInjectionFindings, mapSecurityFindings, mapSecuritySeverity, mcpRules, migrateToStreams, networkRules, nodeRules, parseCCRecords, parseDateFromEntry, parseDiff, parseFile, parseFrontmatter, parseHarnessIgnore, parseLiteLLMData, parseManifest, parseRoadmap, parseSecurityConfig, parseSize, pathTraversalRules, previewFix, promoteSessionLearnings, pruneLearnings, reactRules, readCheckState, readCostRecords, readLockfile, readSessionSection, readSessionSections, readTaint, removeContributions, removeProvenance, requestMultiplePeerReviews, requestPeerReview, resetFeedbackConfig, resetParserCache, resolveFileToLayer, resolveModelTier, resolveRuleSeverity, resolveSessionDir, resolveStreamPath, resolveThresholds, runAll, runArchitectureAgent, runBugDetectionAgent, runCIChecks, runComplianceAgent, runMechanicalChecks, runMechanicalGate, runMultiTurnPipeline, runPipeline, runReviewPipeline, runSecurityAgent, saveHandoff, saveState, saveStreamIndex, scanForInjection, scopeContext, searchSymbols, secretRules, serializeRoadmap, setActiveStream, sharpEdgesRules, shouldRunCheck, spawnBackgroundCheck, syncConstraintNodes, syncRoadmap, tagUncitedFindings, touchStream, trackAction, unfoldRange, unfoldSymbol, updateSessionEntryStatus, updateSessionIndex, validateAgentsMap, validateBoundaries, validateCommitMessage, validateConfig, validateDependencies, validateFileStructure, validateFindings, validateKnowledgeMap, validatePatternConfig, violationId, writeConfig, writeLockfile, writeSessionSummary, writeTaint, xssRules };