@awi-protocol/sdk 0.1.1 → 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 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;
@@ -379,4 +407,4 @@ declare class LocalAXIRCompiler {
379
407
  private _status;
380
408
  }
381
409
 
382
- export { AWIClient, type AWIClientOptions, AWIError, type AXIRCompilationResult, type AXIREdge, type AXIRField, type AXIRHealingResult, type AXIRIntent, type AXIRIntentMapping, type AXIRNode, type AXIRWorkflow, AdvisoryExecutor, type AgentRequest, type AgentResponse, type AgentTier, type DelegationRequest, type ExecutionMetrics, type ExecutionMode, type ExtractionField, type ExtractionSpec, type FeedbackRequest, LocalAXIRCompiler, type LocalAXIRCompilerOptions, type PageType, type Recipe, type RecipeStatus, type RecipeStep, type RegistryEntry, type Selector, type SelectorCandidate, type SelectorSet, type ValidationRules, AWIClient as default };
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;
@@ -379,4 +407,4 @@ declare class LocalAXIRCompiler {
379
407
  private _status;
380
408
  }
381
409
 
382
- export { AWIClient, type AWIClientOptions, AWIError, type AXIRCompilationResult, type AXIREdge, type AXIRField, type AXIRHealingResult, type AXIRIntent, type AXIRIntentMapping, type AXIRNode, type AXIRWorkflow, AdvisoryExecutor, type AgentRequest, type AgentResponse, type AgentTier, type DelegationRequest, type ExecutionMetrics, type ExecutionMode, type ExtractionField, type ExtractionSpec, type FeedbackRequest, LocalAXIRCompiler, type LocalAXIRCompilerOptions, type PageType, type Recipe, type RecipeStatus, type RecipeStep, type RegistryEntry, type Selector, type SelectorCandidate, type SelectorSet, type ValidationRules, AWIClient as default };
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 };