@alint-js/plugin 0.0.30 → 0.0.32
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 +14 -1
- package/dist/index.mjs +27 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -301,9 +301,22 @@ interface RuleWithHandler {
|
|
|
301
301
|
}
|
|
302
302
|
type Target = DirectoryTarget | ProjectTarget | SourceTarget;
|
|
303
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
|
|
304
317
|
//#region src/index.d.ts
|
|
305
318
|
declare function defineConfig(config: readonly AlintConfigInput[]): AlintConfig;
|
|
306
319
|
declare function definePlugin(plugin: PluginDefinition): PluginDefinition;
|
|
307
320
|
declare function defineRule(rule: RuleDefinition): RuleDefinition;
|
|
308
321
|
//#endregion
|
|
309
|
-
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.
|
|
4
|
+
"version": "0.0.32",
|
|
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.
|
|
16
|
+
"@alint-js/core": "0.0.32"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsdown",
|