@alint-js/plugin 0.0.29 → 0.0.31

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 CHANGED
@@ -84,7 +84,7 @@ interface SourceText {
84
84
  text: string;
85
85
  }
86
86
  //#endregion
87
- //#region ../core/dist/types-CMLoj9J9.d.mts
87
+ //#region ../core/dist/types-CR_Grd6q.d.mts
88
88
  //#region src/config/types.d.ts
89
89
  type ModelSize = 'large' | 'medium' | 'small';
90
90
  interface RunnerCacheConfig {
@@ -95,7 +95,6 @@ interface RunnerConfig {
95
95
  /** Retries after the initial attempt for replay-safe agent failures. @default 2 */
96
96
  agentRetries?: number;
97
97
  cache?: boolean | RunnerCacheConfig;
98
- fileConcurrency?: number;
99
98
  ruleConcurrency?: number;
100
99
  stats?: boolean | RunnerStatsConfig;
101
100
  timeoutMs?: number;
@@ -302,9 +301,22 @@ interface RuleWithHandler {
302
301
  }
303
302
  type Target = DirectoryTarget | ProjectTarget | SourceTarget;
304
303
  //#endregion
304
+ //#region ../core/dist/agent.d.mts
305
+ //#region src/agent/retry.d.ts
306
+ /**
307
+ * Declares that the complete adapter invocation can be safely replayed.
308
+ * Adapters must not throw this after a tool or another externally visible side effect starts.
309
+ */
310
+ declare class RetryableAgentError extends Error {
311
+ constructor(message: string, options?: ErrorOptions);
312
+ }
313
+ declare function isRetryableAgentError(error: unknown): error is RetryableAgentError;
314
+ declare function defineTool(tool: AgentTool): AgentTool;
315
+ declare function requireAgent(context: Pick<RuleContext, 'agent' | 'id' | 'signal'>): AgentAdapter;
316
+ //#endregion
305
317
  //#region src/index.d.ts
306
318
  declare function defineConfig(config: readonly AlintConfigInput[]): AlintConfig;
307
319
  declare function definePlugin(plugin: PluginDefinition): PluginDefinition;
308
320
  declare function defineRule(rule: RuleDefinition): RuleDefinition;
309
321
  //#endregion
310
- export { type AlintConfig, type AlintConfigExtends, type AlintConfigInput, type AlintConfigItem, type AlintLinterOptions, type Awaitable, type ClassTarget, type DiagnosticDescriptor, type DiagnosticLocation, type DirectoryTarget, type EnabledRule, type FileTarget, type FunctionTarget, type IgnoreConfig, type LanguageContext, type LanguageDefinition, type LineRange, type ModelRequirement, type PluginDefinition, type ProcessedSource, type ProcessedSourceOrigin, type ProcessorContext, type ProcessorDefinition, type ProcessorPostprocessContext, type ProjectTarget, type ResolvedModel, type ResolvedProvider, type RuleCacheConfig, type RuleConfigEntry, type RuleContext, type RuleDefinition, type RuleHandlers, type RuleInferenceUsageRecord, type RuleRegistry, type RuleSeverity, type RuleSpecializedHandlers, type RuleWithHandler, type SourceFile, type SourceLocation, type SourcePosition, type SourceRange, type SourceRuntime, type SourceTarget, type SourceTargetKind, type SourceTargetOfKind, type SourceTargetOrigin, type SourceText, type Target, defineConfig, definePlugin, defineRule };
322
+ export { type AgentAdapter, type AgentRequest, type AgentResult, type AgentTool, type AgentUsage, type AlintConfig, type AlintConfigExtends, type AlintConfigInput, type AlintConfigItem, type AlintLinterOptions, type Awaitable, type ClassTarget, type DiagnosticDescriptor, type DiagnosticLocation, type DirectoryTarget, type EnabledRule, type FileTarget, type FunctionTarget, type IgnoreConfig, type LanguageContext, type LanguageDefinition, type LineRange, type ModelRequirement, type PluginDefinition, type ProcessedSource, type ProcessedSourceOrigin, type ProcessorContext, type ProcessorDefinition, type ProcessorPostprocessContext, type ProjectTarget, type ResolvedModel, type ResolvedProvider, RetryableAgentError, type RuleCacheConfig, type RuleConfigEntry, type RuleContext, type RuleDefinition, type RuleHandlers, type RuleInferenceUsageRecord, type RuleRegistry, type RuleSeverity, type RuleSpecializedHandlers, type RuleWithHandler, type SourceFile, type SourceLocation, type SourcePosition, type SourceRange, type SourceRuntime, type SourceTarget, type SourceTargetKind, type SourceTargetOfKind, type SourceTargetOrigin, type SourceText, type Target, defineConfig, definePlugin, defineRule, defineTool, isRetryableAgentError, requireAgent };
package/dist/index.mjs CHANGED
@@ -1,3 +1,29 @@
1
+ //#region ../core/dist/agent-weXkvGkc.mjs
2
+ /**
3
+ * Declares that the complete adapter invocation can be safely replayed.
4
+ * Adapters must not throw this after a tool or another externally visible side effect starts.
5
+ */
6
+ var RetryableAgentError = class extends Error {
7
+ constructor(message, options) {
8
+ super(message, options);
9
+ this.name = "RetryableAgentError";
10
+ }
11
+ };
12
+ function isRetryableAgentError(error) {
13
+ return error instanceof RetryableAgentError;
14
+ }
15
+ function defineTool(tool) {
16
+ return tool;
17
+ }
18
+ function requireAgent(context) {
19
+ if (!context.agent) throw new TypeError(`Rule "${context.id}" requires an agent, but none is configured. Set "agent" in alint config (e.g. agent: createApeiraAdapter()).`);
20
+ const agent = context.agent;
21
+ return async (request) => agent({
22
+ ...request,
23
+ signal: request.signal ?? context.signal
24
+ });
25
+ }
26
+ //#endregion
1
27
  //#region src/index.ts
2
28
  function defineConfig(config) {
3
29
  return config;
@@ -9,4 +35,4 @@ function defineRule(rule) {
9
35
  return rule;
10
36
  }
11
37
  //#endregion
12
- export { defineConfig, definePlugin, defineRule };
38
+ export { RetryableAgentError, defineConfig, definePlugin, defineRule, defineTool, isRetryableAgentError, requireAgent };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alint-js/plugin",
3
3
  "type": "module",
4
- "version": "0.0.29",
4
+ "version": "0.0.31",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.mts",
@@ -13,7 +13,7 @@
13
13
  "dist"
14
14
  ],
15
15
  "devDependencies": {
16
- "@alint-js/core": "0.0.29"
16
+ "@alint-js/core": "0.0.31"
17
17
  },
18
18
  "scripts": {
19
19
  "build": "tsdown",