@lumy-pack/line-lore 0.0.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.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +188 -0
  3. package/dist/ast/index.d.ts +1 -0
  4. package/dist/ast/parser.d.ts +6 -0
  5. package/dist/cache/file-cache.d.ts +19 -0
  6. package/dist/cache/index.d.ts +1 -0
  7. package/dist/cli.d.ts +1 -0
  8. package/dist/cli.mjs +2288 -0
  9. package/dist/commands/cache.d.ts +2 -0
  10. package/dist/commands/graph.d.ts +2 -0
  11. package/dist/commands/health.d.ts +2 -0
  12. package/dist/commands/index.d.ts +4 -0
  13. package/dist/commands/trace.d.ts +2 -0
  14. package/dist/components/TraceProgress.d.ts +7 -0
  15. package/dist/components/TraceResult.d.ts +8 -0
  16. package/dist/components/index.d.ts +2 -0
  17. package/dist/core/ancestry/ancestry.d.ts +10 -0
  18. package/dist/core/ancestry/index.d.ts +2 -0
  19. package/dist/core/ast-diff/ast-diff.d.ts +4 -0
  20. package/dist/core/ast-diff/comparison/index.d.ts +2 -0
  21. package/dist/core/ast-diff/comparison/structure-comparator.d.ts +4 -0
  22. package/dist/core/ast-diff/extraction/index.d.ts +2 -0
  23. package/dist/core/ast-diff/extraction/signature-hasher.d.ts +4 -0
  24. package/dist/core/ast-diff/extraction/symbol-extractor.d.ts +3 -0
  25. package/dist/core/ast-diff/index.d.ts +4 -0
  26. package/dist/core/blame/blame.d.ts +3 -0
  27. package/dist/core/blame/detection/cosmetic-detector.d.ts +7 -0
  28. package/dist/core/blame/detection/index.d.ts +2 -0
  29. package/dist/core/blame/index.d.ts +4 -0
  30. package/dist/core/blame/parsing/blame-parser.d.ts +2 -0
  31. package/dist/core/blame/parsing/index.d.ts +1 -0
  32. package/dist/core/core.d.ts +14 -0
  33. package/dist/core/index.d.ts +11 -0
  34. package/dist/core/issue-graph/index.d.ts +2 -0
  35. package/dist/core/issue-graph/issue-graph.d.ts +5 -0
  36. package/dist/core/patch-id/index.d.ts +2 -0
  37. package/dist/core/patch-id/patch-id.d.ts +11 -0
  38. package/dist/core/pr-lookup/index.d.ts +1 -0
  39. package/dist/core/pr-lookup/pr-lookup.d.ts +3 -0
  40. package/dist/errors.d.ts +32 -0
  41. package/dist/git/executor.d.ts +2 -0
  42. package/dist/git/health.d.ts +4 -0
  43. package/dist/git/index.d.ts +3 -0
  44. package/dist/git/remote.d.ts +6 -0
  45. package/dist/index.cjs +1904 -0
  46. package/dist/index.d.ts +6 -0
  47. package/dist/index.mjs +1872 -0
  48. package/dist/output/formats.d.ts +5 -0
  49. package/dist/output/index.d.ts +2 -0
  50. package/dist/output/normalizer.d.ts +11 -0
  51. package/dist/platform/github/github-adapter.d.ts +17 -0
  52. package/dist/platform/github/github-enterprise-adapter.d.ts +8 -0
  53. package/dist/platform/github/index.d.ts +2 -0
  54. package/dist/platform/gitlab/gitlab-adapter.d.ts +17 -0
  55. package/dist/platform/gitlab/gitlab-self-hosted-adapter.d.ts +8 -0
  56. package/dist/platform/gitlab/index.d.ts +2 -0
  57. package/dist/platform/index.d.ts +6 -0
  58. package/dist/platform/platform.d.ts +9 -0
  59. package/dist/platform/scheduler/index.d.ts +2 -0
  60. package/dist/platform/scheduler/request-scheduler.d.ts +17 -0
  61. package/dist/types/ast.d.ts +28 -0
  62. package/dist/types/blame.d.ts +34 -0
  63. package/dist/types/cache.d.ts +5 -0
  64. package/dist/types/git.d.ts +23 -0
  65. package/dist/types/graph.d.ts +15 -0
  66. package/dist/types/index.d.ts +11 -0
  67. package/dist/types/output.d.ts +24 -0
  68. package/dist/types/pipeline.d.ts +28 -0
  69. package/dist/types/platform.d.ts +44 -0
  70. package/dist/types/stage.d.ts +14 -0
  71. package/dist/types/trace.d.ts +38 -0
  72. package/dist/types/util.d.ts +4 -0
  73. package/dist/utils/command-registry.d.ts +29 -0
  74. package/dist/utils/index.d.ts +1 -0
  75. package/dist/utils/line-range.d.ts +2 -0
  76. package/dist/version.d.ts +1 -0
  77. package/package.json +71 -0
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerCacheCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerGraphCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerHealthCommand(program: Command): void;
@@ -0,0 +1,4 @@
1
+ export { registerCacheCommand } from './cache.js';
2
+ export { registerGraphCommand } from './graph.js';
3
+ export { registerHealthCommand } from './health.js';
4
+ export { registerTraceCommand } from './trace.js';
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerTraceCommand(program: Command): void;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface TraceProgressProps {
3
+ stage: string;
4
+ detail?: string;
5
+ }
6
+ export declare function TraceProgress({ stage, detail }: TraceProgressProps): React.ReactElement;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { TraceNode } from '../types/index.js';
3
+ interface TraceResultProps {
4
+ nodes: TraceNode[];
5
+ warnings?: string[];
6
+ }
7
+ export declare function TraceResultView({ nodes, warnings }: TraceResultProps): React.ReactElement;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ export { TraceProgress } from './TraceProgress.js';
2
+ export { TraceResultView } from './TraceResult.js';
@@ -0,0 +1,10 @@
1
+ import type { GitExecOptions } from '../../types/index.js';
2
+ export interface AncestryResult {
3
+ mergeCommitSha: string;
4
+ parentShas: string[];
5
+ subject: string;
6
+ }
7
+ export declare function findMergeCommit(commitSha: string, options?: GitExecOptions & {
8
+ ref?: string;
9
+ }): Promise<AncestryResult | null>;
10
+ export declare function extractPRFromMergeMessage(subject: string): number | null;
@@ -0,0 +1,2 @@
1
+ export { extractPRFromMergeMessage, findMergeCommit } from './ancestry.js';
2
+ export type { AncestryResult } from './ancestry.js';
@@ -0,0 +1,4 @@
1
+ import type { AstTraceResult, GitExecOptions } from '../../types/index.js';
2
+ export declare function traceByAst(file: string, line: number, startCommitSha: string, options?: GitExecOptions & {
3
+ maxDepth?: number;
4
+ }): Promise<AstTraceResult | null>;
@@ -0,0 +1,2 @@
1
+ export { compareSymbolMaps, findMatchAcrossFiles, } from './structure-comparator.js';
2
+ export type { SymbolMap } from './structure-comparator.js';
@@ -0,0 +1,4 @@
1
+ import type { ComparisonResult, ContentHash } from '../../../types/index.js';
2
+ export type SymbolMap = Map<string, ContentHash>;
3
+ export declare function compareSymbolMaps(current: SymbolMap, parent: SymbolMap): ComparisonResult[];
4
+ export declare function findMatchAcrossFiles(targetHash: ContentHash, parentFileMaps: Map<string, SymbolMap>): ComparisonResult | null;
@@ -0,0 +1,2 @@
1
+ export { extractSymbols, findContainingSymbol } from './symbol-extractor.js';
2
+ export { computeContentHash, computeExactHash, computeStructuralHash, } from './signature-hasher.js';
@@ -0,0 +1,4 @@
1
+ import type { ContentHash } from '../../../types/index.js';
2
+ export declare function computeExactHash(bodyText: string): string;
3
+ export declare function computeStructuralHash(bodyText: string): string;
4
+ export declare function computeContentHash(bodyText: string): ContentHash;
@@ -0,0 +1,3 @@
1
+ import type { SymbolInfo } from '../../../types/index.js';
2
+ export declare function extractSymbols(source: string, lang: string): Promise<SymbolInfo[]>;
3
+ export declare function findContainingSymbol(symbols: SymbolInfo[], line: number): SymbolInfo | null;
@@ -0,0 +1,4 @@
1
+ export { traceByAst } from './ast-diff.js';
2
+ export { compareSymbolMaps, findMatchAcrossFiles } from './comparison/index.js';
3
+ export type { SymbolMap } from './comparison/index.js';
4
+ export { computeContentHash, computeExactHash, computeStructuralHash, extractSymbols, findContainingSymbol, } from './extraction/index.js';
@@ -0,0 +1,3 @@
1
+ import type { BlameResult, BlameStageResult, GitExecOptions, LineRange } from '../../types/index.js';
2
+ export declare function executeBlame(file: string, lineRange: LineRange, options?: GitExecOptions): Promise<BlameResult[]>;
3
+ export declare function analyzeBlameResults(results: BlameResult[], options?: GitExecOptions): Promise<BlameStageResult[]>;
@@ -0,0 +1,7 @@
1
+ import type { CosmeticReason, GitExecOptions } from '../../../types/index.js';
2
+ export interface CosmeticCheckResult {
3
+ isCosmetic: boolean;
4
+ reason?: CosmeticReason;
5
+ }
6
+ export declare function isCosmeticDiff(diff: string): CosmeticCheckResult;
7
+ export declare function getCosmeticDiff(commitSha: string, filePath: string, options?: GitExecOptions): Promise<string>;
@@ -0,0 +1,2 @@
1
+ export { getCosmeticDiff, isCosmeticDiff } from './cosmetic-detector.js';
2
+ export type { CosmeticCheckResult } from './cosmetic-detector.js';
@@ -0,0 +1,4 @@
1
+ export { analyzeBlameResults, executeBlame } from './blame.js';
2
+ export { getCosmeticDiff, isCosmeticDiff } from './detection/index.js';
3
+ export type { CosmeticCheckResult } from './detection/index.js';
4
+ export { parsePorcelainOutput } from './parsing/index.js';
@@ -0,0 +1,2 @@
1
+ import type { BlameResult } from '../../../types/index.js';
2
+ export declare function parsePorcelainOutput(output: string): BlameResult[];
@@ -0,0 +1 @@
1
+ export { parsePorcelainOutput } from './blame-parser.js';
@@ -0,0 +1,14 @@
1
+ import type { FeatureFlags, HealthReport, OperatingLevel, TraceNode, TraceOptions } from '../types/index.js';
2
+ export interface TraceFullResult {
3
+ nodes: TraceNode[];
4
+ operatingLevel: OperatingLevel;
5
+ featureFlags: FeatureFlags;
6
+ warnings: string[];
7
+ }
8
+ export declare function trace(options: TraceOptions): Promise<TraceFullResult>;
9
+ export declare function health(options?: {
10
+ cwd?: string;
11
+ }): Promise<HealthReport & {
12
+ operatingLevel: OperatingLevel;
13
+ }>;
14
+ export declare function clearCache(): Promise<void>;
@@ -0,0 +1,11 @@
1
+ export { analyzeBlameResults, executeBlame, isCosmeticDiff, parsePorcelainOutput, } from './blame/index.js';
2
+ export { compareSymbolMaps, computeContentHash, computeExactHash, computeStructuralHash, extractSymbols, findContainingSymbol, findMatchAcrossFiles, traceByAst, } from './ast-diff/index.js';
3
+ export { extractPRFromMergeMessage, findMergeCommit, } from './ancestry/index.js';
4
+ export type { AncestryResult } from './ancestry/index.js';
5
+ export { computePatchId, findPatchIdMatch, resetPatchIdCache, } from './patch-id/index.js';
6
+ export type { PatchIdResult } from './patch-id/index.js';
7
+ export { lookupPR, resetPRCache } from './pr-lookup/index.js';
8
+ export { clearCache, health, trace } from './core.js';
9
+ export type { TraceFullResult } from './core.js';
10
+ export { traverseIssueGraph } from './issue-graph/index.js';
11
+ export type { GraphTraversalOptions } from './issue-graph/index.js';
@@ -0,0 +1,2 @@
1
+ export { traverseIssueGraph } from './issue-graph.js';
2
+ export type { GraphTraversalOptions } from './issue-graph.js';
@@ -0,0 +1,5 @@
1
+ import type { GraphResult, PlatformAdapter } from '../../types/index.js';
2
+ export interface GraphTraversalOptions {
3
+ maxDepth?: number;
4
+ }
5
+ export declare function traverseIssueGraph(adapter: PlatformAdapter, startType: 'pr' | 'issue', startNumber: number, options?: GraphTraversalOptions): Promise<GraphResult>;
@@ -0,0 +1,2 @@
1
+ export { computePatchId, findPatchIdMatch, resetPatchIdCache, } from './patch-id.js';
2
+ export type { PatchIdResult } from './patch-id.js';
@@ -0,0 +1,11 @@
1
+ import type { GitExecOptions } from '../../types/index.js';
2
+ export interface PatchIdResult {
3
+ matchedSha: string;
4
+ patchId: string;
5
+ }
6
+ export declare function computePatchId(commitSha: string, options?: GitExecOptions): Promise<string | null>;
7
+ export declare function findPatchIdMatch(commitSha: string, options?: GitExecOptions & {
8
+ scanDepth?: number;
9
+ ref?: string;
10
+ }): Promise<PatchIdResult | null>;
11
+ export declare function resetPatchIdCache(): void;
@@ -0,0 +1 @@
1
+ export { lookupPR, resetPRCache } from './pr-lookup.js';
@@ -0,0 +1,3 @@
1
+ import type { GitExecOptions, PRInfo, PlatformAdapter } from '../../types/index.js';
2
+ export declare function lookupPR(commitSha: string, adapter: PlatformAdapter | null, options?: GitExecOptions): Promise<PRInfo | null>;
3
+ export declare function resetPRCache(): void;
@@ -0,0 +1,32 @@
1
+ export declare const LineLoreErrorCode: {
2
+ readonly NOT_GIT_REPO: "NOT_GIT_REPO";
3
+ readonly FILE_NOT_FOUND: "FILE_NOT_FOUND";
4
+ readonly INVALID_LINE: "INVALID_LINE";
5
+ readonly GIT_BLAME_FAILED: "GIT_BLAME_FAILED";
6
+ readonly PR_NOT_FOUND: "PR_NOT_FOUND";
7
+ readonly UNKNOWN: "UNKNOWN";
8
+ readonly GIT_COMMAND_FAILED: "GIT_COMMAND_FAILED";
9
+ readonly GIT_TIMEOUT: "GIT_TIMEOUT";
10
+ readonly ANCESTRY_PATH_FAILED: "ANCESTRY_PATH_FAILED";
11
+ readonly PATCH_ID_NO_MATCH: "PATCH_ID_NO_MATCH";
12
+ readonly AST_PARSE_FAILED: "AST_PARSE_FAILED";
13
+ readonly AST_ENGINE_UNAVAILABLE: "AST_ENGINE_UNAVAILABLE";
14
+ readonly PLATFORM_UNKNOWN: "PLATFORM_UNKNOWN";
15
+ readonly CLI_NOT_INSTALLED: "CLI_NOT_INSTALLED";
16
+ readonly CLI_NOT_AUTHENTICATED: "CLI_NOT_AUTHENTICATED";
17
+ readonly API_RATE_LIMITED: "API_RATE_LIMITED";
18
+ readonly API_REQUEST_FAILED: "API_REQUEST_FAILED";
19
+ readonly GRAPHQL_NOT_SUPPORTED: "GRAPHQL_NOT_SUPPORTED";
20
+ readonly ENTERPRISE_VERSION_UNSUPPORTED: "ENTERPRISE_VERSION_UNSUPPORTED";
21
+ readonly ISSUE_NOT_FOUND: "ISSUE_NOT_FOUND";
22
+ readonly GRAPH_DEPTH_EXCEEDED: "GRAPH_DEPTH_EXCEEDED";
23
+ readonly GRAPH_CYCLE_DETECTED: "GRAPH_CYCLE_DETECTED";
24
+ readonly CACHE_CORRUPTED: "CACHE_CORRUPTED";
25
+ readonly INVALID_REMOTE_URL: "INVALID_REMOTE_URL";
26
+ };
27
+ export type LineLoreErrorCode = (typeof LineLoreErrorCode)[keyof typeof LineLoreErrorCode];
28
+ export declare class LineLoreError extends Error {
29
+ readonly code: LineLoreErrorCode;
30
+ readonly context?: Record<string, unknown>;
31
+ constructor(code: LineLoreErrorCode, message: string, context?: Record<string, unknown>);
32
+ }
@@ -0,0 +1,2 @@
1
+ import type { GitExecOptions, GitExecResult } from '../types/index.js';
2
+ export declare function gitExec(args: string[], options?: GitExecOptions): Promise<GitExecResult>;
@@ -0,0 +1,4 @@
1
+ import type { HealthReport } from '../types/index.js';
2
+ export declare function checkGitHealth(options?: {
3
+ cwd?: string;
4
+ }): Promise<HealthReport>;
@@ -0,0 +1,3 @@
1
+ export { gitExec } from './executor.js';
2
+ export { detectPlatform, getRemoteInfo, parseRemoteUrl } from './remote.js';
3
+ export { checkGitHealth } from './health.js';
@@ -0,0 +1,6 @@
1
+ import type { RemoteInfo } from '../types/index.js';
2
+ export declare function parseRemoteUrl(url: string): RemoteInfo;
3
+ export declare function detectPlatform(host: string): RemoteInfo['platform'];
4
+ export declare function getRemoteInfo(remoteName?: string, options?: {
5
+ cwd?: string;
6
+ }): Promise<RemoteInfo>;