@awi-protocol/sdk 0.1.0 → 0.2.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.mts +37 -9
- package/dist/index.d.ts +37 -9
- package/dist/index.js +364 -89
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +363 -95
- package/dist/index.mjs.map +1 -1
- package/package.json +29 -50
- package/src/compiler/grammar/axir-schema.gbnf +97 -0
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
type ExecutionMode = 'proxy' | 'advisory';
|
|
7
7
|
type RecipeStatus = 'candidate' | 'active' | 'suspended' | 'deprecated';
|
|
8
|
-
type AgentTier = 'free' | 'pro' | 'enterprise';
|
|
9
8
|
interface AgentRequest {
|
|
10
9
|
target: string;
|
|
11
10
|
params: Record<string, unknown>;
|
|
@@ -155,12 +154,6 @@ interface ExecutionMetrics {
|
|
|
155
154
|
* Supports proxy mode (server executes browser) and advisory mode (returns blueprint).
|
|
156
155
|
*/
|
|
157
156
|
|
|
158
|
-
declare class AWIError extends Error {
|
|
159
|
-
code: string;
|
|
160
|
-
statusCode: number;
|
|
161
|
-
details?: Record<string, unknown>;
|
|
162
|
-
constructor(code: string, message: string, statusCode: number, details?: Record<string, unknown>);
|
|
163
|
-
}
|
|
164
157
|
declare class AWIClient {
|
|
165
158
|
private endpoint;
|
|
166
159
|
private certificate;
|
|
@@ -343,6 +336,41 @@ interface AXIRHealingResult {
|
|
|
343
336
|
reasoning?: string;
|
|
344
337
|
}
|
|
345
338
|
|
|
339
|
+
interface CompileOptions {
|
|
340
|
+
intent: string;
|
|
341
|
+
params?: Record<string, unknown>;
|
|
342
|
+
domain?: string;
|
|
343
|
+
}
|
|
344
|
+
declare class AXIRCompiler {
|
|
345
|
+
private $;
|
|
346
|
+
private intent;
|
|
347
|
+
private params;
|
|
348
|
+
private domain;
|
|
349
|
+
constructor(html: string, options: CompileOptions);
|
|
350
|
+
compile(): AXIRCompilationResult;
|
|
351
|
+
private simplifyDOM;
|
|
352
|
+
private identifyRegions;
|
|
353
|
+
private analyzeSearchRegion;
|
|
354
|
+
private isPagination;
|
|
355
|
+
private routeIntent;
|
|
356
|
+
private findLargestRegion;
|
|
357
|
+
private buildWorkflow;
|
|
358
|
+
private mapType;
|
|
359
|
+
private inferEdge;
|
|
360
|
+
private inferPageType;
|
|
361
|
+
private generateSelectors;
|
|
362
|
+
private buildCandidates;
|
|
363
|
+
private generateFields;
|
|
364
|
+
private inferFieldName;
|
|
365
|
+
private inferTransform;
|
|
366
|
+
private bestSelector;
|
|
367
|
+
private generateContainerSelector;
|
|
368
|
+
private mapIntents;
|
|
369
|
+
private slugify;
|
|
370
|
+
private escape;
|
|
371
|
+
private q;
|
|
372
|
+
}
|
|
373
|
+
|
|
346
374
|
interface LocalAXIRCompilerOptions {
|
|
347
375
|
modelPath?: string;
|
|
348
376
|
modelUrl?: string;
|
|
@@ -363,7 +391,7 @@ declare class LocalAXIRCompiler {
|
|
|
363
391
|
private grammar;
|
|
364
392
|
private ready;
|
|
365
393
|
constructor(options?: LocalAXIRCompilerOptions);
|
|
366
|
-
compile(domHTML: string, a11yTree: string, intent: string, params?: Record<string, unknown>): Promise<AXIRCompilationResult>;
|
|
394
|
+
compile(domHTML: string, a11yTree: string | undefined, intent: string, params?: Record<string, unknown>): Promise<AXIRCompilationResult>;
|
|
367
395
|
heal(domHTML: string, brokenSelector: string, semanticIntent: string): Promise<AXIRHealingResult>;
|
|
368
396
|
isModelCached(): boolean;
|
|
369
397
|
clearCache(): void;
|
|
@@ -379,4 +407,4 @@ declare class LocalAXIRCompiler {
|
|
|
379
407
|
private _status;
|
|
380
408
|
}
|
|
381
409
|
|
|
382
|
-
export { AWIClient, type
|
|
410
|
+
export { AWIClient, type AXIRCompilationResult, AXIRCompiler, type AXIREdge, type AXIRField, type AXIRHealingResult, type AXIRIntentMapping, type AXIRNode, type AXIRWorkflow, AdvisoryExecutor, type AgentRequest, type AgentResponse, type CompileOptions, type DelegationRequest, type ExtractionField, type FeedbackRequest, LocalAXIRCompiler, type LocalAXIRCompilerOptions, type Recipe, type RecipeStep, type SelectorCandidate };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
type ExecutionMode = 'proxy' | 'advisory';
|
|
7
7
|
type RecipeStatus = 'candidate' | 'active' | 'suspended' | 'deprecated';
|
|
8
|
-
type AgentTier = 'free' | 'pro' | 'enterprise';
|
|
9
8
|
interface AgentRequest {
|
|
10
9
|
target: string;
|
|
11
10
|
params: Record<string, unknown>;
|
|
@@ -155,12 +154,6 @@ interface ExecutionMetrics {
|
|
|
155
154
|
* Supports proxy mode (server executes browser) and advisory mode (returns blueprint).
|
|
156
155
|
*/
|
|
157
156
|
|
|
158
|
-
declare class AWIError extends Error {
|
|
159
|
-
code: string;
|
|
160
|
-
statusCode: number;
|
|
161
|
-
details?: Record<string, unknown>;
|
|
162
|
-
constructor(code: string, message: string, statusCode: number, details?: Record<string, unknown>);
|
|
163
|
-
}
|
|
164
157
|
declare class AWIClient {
|
|
165
158
|
private endpoint;
|
|
166
159
|
private certificate;
|
|
@@ -343,6 +336,41 @@ interface AXIRHealingResult {
|
|
|
343
336
|
reasoning?: string;
|
|
344
337
|
}
|
|
345
338
|
|
|
339
|
+
interface CompileOptions {
|
|
340
|
+
intent: string;
|
|
341
|
+
params?: Record<string, unknown>;
|
|
342
|
+
domain?: string;
|
|
343
|
+
}
|
|
344
|
+
declare class AXIRCompiler {
|
|
345
|
+
private $;
|
|
346
|
+
private intent;
|
|
347
|
+
private params;
|
|
348
|
+
private domain;
|
|
349
|
+
constructor(html: string, options: CompileOptions);
|
|
350
|
+
compile(): AXIRCompilationResult;
|
|
351
|
+
private simplifyDOM;
|
|
352
|
+
private identifyRegions;
|
|
353
|
+
private analyzeSearchRegion;
|
|
354
|
+
private isPagination;
|
|
355
|
+
private routeIntent;
|
|
356
|
+
private findLargestRegion;
|
|
357
|
+
private buildWorkflow;
|
|
358
|
+
private mapType;
|
|
359
|
+
private inferEdge;
|
|
360
|
+
private inferPageType;
|
|
361
|
+
private generateSelectors;
|
|
362
|
+
private buildCandidates;
|
|
363
|
+
private generateFields;
|
|
364
|
+
private inferFieldName;
|
|
365
|
+
private inferTransform;
|
|
366
|
+
private bestSelector;
|
|
367
|
+
private generateContainerSelector;
|
|
368
|
+
private mapIntents;
|
|
369
|
+
private slugify;
|
|
370
|
+
private escape;
|
|
371
|
+
private q;
|
|
372
|
+
}
|
|
373
|
+
|
|
346
374
|
interface LocalAXIRCompilerOptions {
|
|
347
375
|
modelPath?: string;
|
|
348
376
|
modelUrl?: string;
|
|
@@ -363,7 +391,7 @@ declare class LocalAXIRCompiler {
|
|
|
363
391
|
private grammar;
|
|
364
392
|
private ready;
|
|
365
393
|
constructor(options?: LocalAXIRCompilerOptions);
|
|
366
|
-
compile(domHTML: string, a11yTree: string, intent: string, params?: Record<string, unknown>): Promise<AXIRCompilationResult>;
|
|
394
|
+
compile(domHTML: string, a11yTree: string | undefined, intent: string, params?: Record<string, unknown>): Promise<AXIRCompilationResult>;
|
|
367
395
|
heal(domHTML: string, brokenSelector: string, semanticIntent: string): Promise<AXIRHealingResult>;
|
|
368
396
|
isModelCached(): boolean;
|
|
369
397
|
clearCache(): void;
|
|
@@ -379,4 +407,4 @@ declare class LocalAXIRCompiler {
|
|
|
379
407
|
private _status;
|
|
380
408
|
}
|
|
381
409
|
|
|
382
|
-
export { AWIClient, type
|
|
410
|
+
export { AWIClient, type AXIRCompilationResult, AXIRCompiler, type AXIREdge, type AXIRField, type AXIRHealingResult, type AXIRIntentMapping, type AXIRNode, type AXIRWorkflow, AdvisoryExecutor, type AgentRequest, type AgentResponse, type CompileOptions, type DelegationRequest, type ExtractionField, type FeedbackRequest, LocalAXIRCompiler, type LocalAXIRCompilerOptions, type Recipe, type RecipeStep, type SelectorCandidate };
|