@alint-js/core 0.5.0 → 0.7.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.
@@ -1,2 +1,2 @@
1
- import { t as extractJsSourceTargets } from "./extract-CLXRRiJW.mjs";
1
+ import { t as extractJsSourceTargets } from "./extract-DhLFgRej.mjs";
2
2
  export { extractJsSourceTargets };
@@ -1,4 +1,4 @@
1
- import { b as RuleContext, z as ResolvedModel } from "./types-BK5CADYK.mjs";
1
+ import { H as ResolvedModel, x as RuleContext } from "./types-Cm5Z7Fll.mjs";
2
2
  import { GenericSchema, InferOutput } from "valibot";
3
3
  import { JsonSchema } from "@valibot/to-json-schema";
4
4
  import { Message } from "@xsai/shared-chat";
@@ -109,6 +109,7 @@ interface AlintConfigItem {
109
109
  files?: readonly (readonly string[] | string)[];
110
110
  ignore?: IgnoreConfig;
111
111
  ignores?: readonly string[];
112
+ integrations?: IntegrationsConfig;
112
113
  language?: string;
113
114
  languageOptions?: Record<string, unknown>;
114
115
  linterOptions?: AlintLinterOptions;
@@ -160,6 +161,9 @@ interface EnabledRule {
160
161
  interface IgnoreConfig {
161
162
  gitignore?: boolean;
162
163
  }
164
+ interface IntegrationsConfig {
165
+ stopGate?: StopGateConfig;
166
+ }
163
167
  interface LanguageDefinition {
164
168
  extensions?: readonly string[];
165
169
  extract: (file: SourceFile, context: LanguageContext) => Awaitable<SourceTarget[]>;
@@ -305,6 +309,12 @@ interface RuleWithHandler {
305
309
  onTargetProject?: never;
306
310
  onTargetWith: (target: Target) => Awaitable<void>;
307
311
  }
312
+ interface StopGateConfig {
313
+ enabled?: boolean;
314
+ target?: StopGateTarget;
315
+ timeoutMs?: number;
316
+ }
317
+ type StopGateTarget = 'all' | 'dirty-files';
308
318
  type Target = DirectoryTarget | PlannedSourceTarget | ProjectTarget;
309
319
  //#endregion
310
- export { RuleWithHandler as A, ResolvedProvider as B, RuleInferenceUsageRecord as C, RuleRegistry as D, RuleOptionsSchema as E, AgentTool as F, RunnerStatsConfig as G, ProviderDefinition as H, AgentUsage as I, SetupConfig as K, ModelRequirement as L, AgentAdapter as M, AgentRequest as N, RuleSeverity as O, AgentResult as P, ResolveModelOptions as R, RuleHandlers as S, RuleOptionsOutput as T, ProviderType as U, ModelSize as V, RunnerConfig as W, ProjectTargetEntry as _, AlintLinterOptions as a, RuleContext as b, DiagnosticLocation as c, IgnoreConfig as d, LanguageDefinition as f, ProjectTarget as g, ProjectFileEntry as h, AlintConfigItem as i, Target as j, RuleSpecializedHandlers as k, DirectoryTarget as l, ProcessorDefinition as m, AlintConfigExtends as n, Awaitable as o, PluginDefinition as p, SetupModelDefinition as q, AlintConfigInput as r, DiagnosticDescriptor as s, AlintConfig as t, EnabledRule as u, RuleCacheConfig as v, RuleOptionsInput as w, RuleDefinition as x, RuleConfigEntry as y, ResolvedModel as z };
320
+ export { RuleSpecializedHandlers as A, ModelRequirement as B, RuleHandlers as C, RuleOptionsSchema as D, RuleOptionsOutput as E, AgentAdapter as F, ProviderDefinition as G, ResolvedModel as H, AgentRequest as I, RunnerStatsConfig as J, ProviderType as K, AgentResult as L, StopGateConfig as M, StopGateTarget as N, RuleRegistry as O, Target as P, AgentTool as R, RuleDefinition as S, RuleOptionsInput as T, ResolvedProvider as U, ResolveModelOptions as V, ModelSize as W, SetupModelDefinition as X, SetupConfig as Y, ProjectTarget as _, AlintLinterOptions as a, RuleConfigEntry as b, DiagnosticLocation as c, IgnoreConfig as d, IntegrationsConfig as f, ProjectFileEntry as g, ProcessorDefinition as h, AlintConfigItem as i, RuleWithHandler as j, RuleSeverity as k, DirectoryTarget as l, PluginDefinition as m, AlintConfigExtends as n, Awaitable as o, LanguageDefinition as p, RunnerConfig as q, AlintConfigInput as r, DiagnosticDescriptor as s, AlintConfig as t, EnabledRule as u, ProjectTargetEntry as v, RuleInferenceUsageRecord as w, RuleContext as x, RuleCacheConfig as y, AgentUsage as z };
package/package.json CHANGED
@@ -1,7 +1,22 @@
1
1
  {
2
2
  "name": "@alint-js/core",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "0.7.0",
5
+ "description": "Public rule and plugin SDK and run engine for alint",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/moeru-ai/alint.git",
10
+ "directory": "packages/core"
11
+ },
12
+ "keywords": [
13
+ "alint",
14
+ "lint",
15
+ "linter",
16
+ "ai",
17
+ "code-analysis",
18
+ "sdk"
19
+ ],
5
20
  "exports": {
6
21
  ".": {
7
22
  "types": "./dist/index.d.mts",
@@ -39,9 +54,12 @@
39
54
  "minimatch": "^10.2.6",
40
55
  "oxc-parser": "^0.142.0",
41
56
  "pathe": "^2.0.3",
42
- "valibot": "^1.4.2"
57
+ "proper-lockfile": "4.1.2",
58
+ "valibot": "^1.4.2",
59
+ "@alint-js/utils": "0.7.0"
43
60
  },
44
61
  "devDependencies": {
62
+ "@types/proper-lockfile": "4.1.4",
45
63
  "effect": "^3.22.1",
46
64
  "sury": "^11.0.0-rc.0"
47
65
  },
@@ -1,7 +1,7 @@
1
+ import { createHash } from "node:crypto";
1
2
  import { readFile } from "node:fs/promises";
2
3
  import { extname } from "node:path";
3
4
  import { clamp } from "es-toolkit";
4
- import { createHash } from "node:crypto";
5
5
  import { parseSync } from "oxc-parser";
6
6
  //#region src/core/hash.ts
7
7
  function createStableHasher() {