@lydia-agent/core 0.1.2 → 0.1.3
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.cjs +684 -11
- package/dist/index.d.cts +183 -1
- package/dist/index.d.ts +183 -1
- package/dist/index.js +678 -10
- package/package.json +12 -11
- package/skills/README.md +4 -4
- package/skills/docker/management.md +36 -36
- package/skills/git/advanced.md +43 -43
- package/skills/hello-world.md +15 -15
- package/skills/node/management.md +37 -37
- package/skills/system-health.md +15 -15
- package/skills/webapp-testing/LICENSE.txt +201 -201
- package/skills/webapp-testing/SKILL.md +95 -95
- package/skills/webapp-testing/examples/console_logging.py +34 -34
- package/skills/webapp-testing/examples/element_discovery.py +39 -39
- package/skills/webapp-testing/examples/static_html_automation.py +32 -32
- package/skills/webapp-testing/scripts/with_server.py +105 -105
- package/strategies/base-v1.yml +62 -62
package/dist/index.d.cts
CHANGED
|
@@ -2390,6 +2390,37 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
2390
2390
|
checkpointTtlHours?: number | undefined;
|
|
2391
2391
|
observationFrameTtlHours?: number | undefined;
|
|
2392
2392
|
}>>;
|
|
2393
|
+
browser: z.ZodDefault<z.ZodObject<{
|
|
2394
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2395
|
+
mode: z.ZodDefault<z.ZodEnum<["auto", "cdp", "headless", "remote"]>>;
|
|
2396
|
+
cdpPort: z.ZodDefault<z.ZodNumber>;
|
|
2397
|
+
remoteUrl: z.ZodDefault<z.ZodString>;
|
|
2398
|
+
chromePath: z.ZodDefault<z.ZodString>;
|
|
2399
|
+
launchHostBrowser: z.ZodDefault<z.ZodBoolean>;
|
|
2400
|
+
navigationTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
2401
|
+
actionTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
2402
|
+
downloadDir: z.ZodDefault<z.ZodString>;
|
|
2403
|
+
}, "strip", z.ZodTypeAny, {
|
|
2404
|
+
enabled: boolean;
|
|
2405
|
+
mode: "auto" | "cdp" | "headless" | "remote";
|
|
2406
|
+
cdpPort: number;
|
|
2407
|
+
remoteUrl: string;
|
|
2408
|
+
chromePath: string;
|
|
2409
|
+
launchHostBrowser: boolean;
|
|
2410
|
+
navigationTimeoutMs: number;
|
|
2411
|
+
actionTimeoutMs: number;
|
|
2412
|
+
downloadDir: string;
|
|
2413
|
+
}, {
|
|
2414
|
+
enabled?: boolean | undefined;
|
|
2415
|
+
mode?: "auto" | "cdp" | "headless" | "remote" | undefined;
|
|
2416
|
+
cdpPort?: number | undefined;
|
|
2417
|
+
remoteUrl?: string | undefined;
|
|
2418
|
+
chromePath?: string | undefined;
|
|
2419
|
+
launchHostBrowser?: boolean | undefined;
|
|
2420
|
+
navigationTimeoutMs?: number | undefined;
|
|
2421
|
+
actionTimeoutMs?: number | undefined;
|
|
2422
|
+
downloadDir?: string | undefined;
|
|
2423
|
+
}>>;
|
|
2393
2424
|
skills: z.ZodDefault<z.ZodObject<{
|
|
2394
2425
|
/** Maximum number of skills whose full content is injected into the prompt (default: 3) */
|
|
2395
2426
|
matchTopK: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2407,6 +2438,17 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
2407
2438
|
extraDirs?: string[] | undefined;
|
|
2408
2439
|
}>>;
|
|
2409
2440
|
}, "strip", z.ZodTypeAny, {
|
|
2441
|
+
browser: {
|
|
2442
|
+
enabled: boolean;
|
|
2443
|
+
mode: "auto" | "cdp" | "headless" | "remote";
|
|
2444
|
+
cdpPort: number;
|
|
2445
|
+
remoteUrl: string;
|
|
2446
|
+
chromePath: string;
|
|
2447
|
+
launchHostBrowser: boolean;
|
|
2448
|
+
navigationTimeoutMs: number;
|
|
2449
|
+
actionTimeoutMs: number;
|
|
2450
|
+
downloadDir: string;
|
|
2451
|
+
};
|
|
2410
2452
|
llm: {
|
|
2411
2453
|
provider: "anthropic" | "openai" | "ollama" | "mock" | "auto";
|
|
2412
2454
|
defaultModel: string;
|
|
@@ -2467,6 +2509,17 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
2467
2509
|
extraDirs: string[];
|
|
2468
2510
|
};
|
|
2469
2511
|
}, {
|
|
2512
|
+
browser?: {
|
|
2513
|
+
enabled?: boolean | undefined;
|
|
2514
|
+
mode?: "auto" | "cdp" | "headless" | "remote" | undefined;
|
|
2515
|
+
cdpPort?: number | undefined;
|
|
2516
|
+
remoteUrl?: string | undefined;
|
|
2517
|
+
chromePath?: string | undefined;
|
|
2518
|
+
launchHostBrowser?: boolean | undefined;
|
|
2519
|
+
navigationTimeoutMs?: number | undefined;
|
|
2520
|
+
actionTimeoutMs?: number | undefined;
|
|
2521
|
+
downloadDir?: string | undefined;
|
|
2522
|
+
} | undefined;
|
|
2470
2523
|
llm?: {
|
|
2471
2524
|
provider?: "anthropic" | "openai" | "ollama" | "mock" | "auto" | undefined;
|
|
2472
2525
|
defaultModel?: string | undefined;
|
|
@@ -2682,6 +2735,7 @@ declare class Agent extends EventEmitter {
|
|
|
2682
2735
|
private currentInput?;
|
|
2683
2736
|
private currentTaskCreatedAt?;
|
|
2684
2737
|
private builtinServerSpecs;
|
|
2738
|
+
private browserServer?;
|
|
2685
2739
|
private options;
|
|
2686
2740
|
private computerUseAdapter;
|
|
2687
2741
|
private computerUseOrchestrator;
|
|
@@ -2732,6 +2786,8 @@ declare class Agent extends EventEmitter {
|
|
|
2732
2786
|
private parseCheckpointFrameIds;
|
|
2733
2787
|
private executeToolWithComputerUseOrchestration;
|
|
2734
2788
|
private resolveCanonicalComputerUseAction;
|
|
2789
|
+
private attachInternalBrowserSessionArg;
|
|
2790
|
+
private closeBrowserAutomationSession;
|
|
2735
2791
|
private inferComputerUseDomain;
|
|
2736
2792
|
private formatComputerUseFailure;
|
|
2737
2793
|
private toDisplayText;
|
|
@@ -2812,6 +2868,132 @@ declare class InteractionServer extends EventEmitter {
|
|
|
2812
2868
|
resolve(id: string, response: string): boolean;
|
|
2813
2869
|
}
|
|
2814
2870
|
|
|
2871
|
+
type BrowserDriverMode = 'auto' | 'cdp' | 'headless' | 'remote';
|
|
2872
|
+
type ResolvedBrowserDriverMode = Exclude<BrowserDriverMode, 'auto'>;
|
|
2873
|
+
interface BrowserRuntimeConfig {
|
|
2874
|
+
enabled: boolean;
|
|
2875
|
+
mode: BrowserDriverMode;
|
|
2876
|
+
cdpPort: number;
|
|
2877
|
+
remoteUrl: string;
|
|
2878
|
+
chromePath: string;
|
|
2879
|
+
launchHostBrowser: boolean;
|
|
2880
|
+
navigationTimeoutMs: number;
|
|
2881
|
+
actionTimeoutMs: number;
|
|
2882
|
+
downloadDir: string;
|
|
2883
|
+
}
|
|
2884
|
+
interface BrowserNavigateArgs {
|
|
2885
|
+
url: string;
|
|
2886
|
+
waitUntil?: 'load' | 'domcontentloaded' | 'networkidle' | 'commit';
|
|
2887
|
+
timeoutMs?: number;
|
|
2888
|
+
}
|
|
2889
|
+
interface BrowserClickArgs {
|
|
2890
|
+
selector: string;
|
|
2891
|
+
timeoutMs?: number;
|
|
2892
|
+
}
|
|
2893
|
+
interface BrowserTypeArgs {
|
|
2894
|
+
selector: string;
|
|
2895
|
+
text: string;
|
|
2896
|
+
clearExisting?: boolean;
|
|
2897
|
+
timeoutMs?: number;
|
|
2898
|
+
}
|
|
2899
|
+
interface BrowserSelectArgs {
|
|
2900
|
+
selector: string;
|
|
2901
|
+
value: string | string[];
|
|
2902
|
+
timeoutMs?: number;
|
|
2903
|
+
}
|
|
2904
|
+
interface BrowserWaitForArgs {
|
|
2905
|
+
selector: string;
|
|
2906
|
+
state?: 'attached' | 'detached' | 'visible' | 'hidden';
|
|
2907
|
+
timeoutMs?: number;
|
|
2908
|
+
}
|
|
2909
|
+
interface BrowserExtractTextArgs {
|
|
2910
|
+
selector: string;
|
|
2911
|
+
timeoutMs?: number;
|
|
2912
|
+
}
|
|
2913
|
+
interface BrowserScreenshotArgs {
|
|
2914
|
+
fullPage?: boolean;
|
|
2915
|
+
timeoutMs?: number;
|
|
2916
|
+
}
|
|
2917
|
+
interface BrowserDownloadArgs {
|
|
2918
|
+
selector?: string;
|
|
2919
|
+
url?: string;
|
|
2920
|
+
saveAs?: string;
|
|
2921
|
+
timeoutMs?: number;
|
|
2922
|
+
}
|
|
2923
|
+
interface BrowserUploadArgs {
|
|
2924
|
+
selector: string;
|
|
2925
|
+
path: string;
|
|
2926
|
+
timeoutMs?: number;
|
|
2927
|
+
}
|
|
2928
|
+
interface BrowserToolResult {
|
|
2929
|
+
text: string;
|
|
2930
|
+
imageBase64?: string;
|
|
2931
|
+
mediaType?: string;
|
|
2932
|
+
artifactPath?: string;
|
|
2933
|
+
downloadPath?: string;
|
|
2934
|
+
metadata?: Record<string, unknown>;
|
|
2935
|
+
}
|
|
2936
|
+
interface BrowserToolRuntime {
|
|
2937
|
+
navigate(sessionId: string, args: BrowserNavigateArgs): Promise<BrowserToolResult>;
|
|
2938
|
+
click(sessionId: string, args: BrowserClickArgs): Promise<BrowserToolResult>;
|
|
2939
|
+
type(sessionId: string, args: BrowserTypeArgs): Promise<BrowserToolResult>;
|
|
2940
|
+
select(sessionId: string, args: BrowserSelectArgs): Promise<BrowserToolResult>;
|
|
2941
|
+
waitFor(sessionId: string, args: BrowserWaitForArgs): Promise<BrowserToolResult>;
|
|
2942
|
+
extractText(sessionId: string, args: BrowserExtractTextArgs): Promise<BrowserToolResult>;
|
|
2943
|
+
screenshot(sessionId: string, args: BrowserScreenshotArgs): Promise<BrowserToolResult>;
|
|
2944
|
+
download(sessionId: string, args: BrowserDownloadArgs): Promise<BrowserToolResult>;
|
|
2945
|
+
upload(sessionId: string, args: BrowserUploadArgs): Promise<BrowserToolResult>;
|
|
2946
|
+
closeSession(sessionId: string): Promise<BrowserToolResult>;
|
|
2947
|
+
getResolvedMode(): ResolvedBrowserDriverMode | null;
|
|
2948
|
+
dispose(): Promise<void>;
|
|
2949
|
+
}
|
|
2950
|
+
interface BrowserToolError extends Error {
|
|
2951
|
+
code: 'BROWSER_TIMEOUT' | 'ELEMENT_NOT_FOUND' | 'ELEMENT_NOT_INTERACTABLE' | 'NAVIGATION_BLOCKED' | 'DOWNLOAD_FAILED' | 'UPLOAD_FAILED' | 'SESSION_CLOSED' | 'CAPABILITY_UNAVAILABLE' | 'UNKNOWN';
|
|
2952
|
+
retryable: boolean;
|
|
2953
|
+
}
|
|
2954
|
+
declare function createBrowserToolError(code: BrowserToolError['code'], message: string, retryable?: boolean): BrowserToolError;
|
|
2955
|
+
declare function createDefaultBrowserRuntimeConfig(partial?: Partial<BrowserRuntimeConfig>): BrowserRuntimeConfig;
|
|
2956
|
+
declare class BrowserAutomationManager implements BrowserToolRuntime {
|
|
2957
|
+
private readonly config;
|
|
2958
|
+
private readonly sessions;
|
|
2959
|
+
private browser;
|
|
2960
|
+
private resolvedMode;
|
|
2961
|
+
private attemptedHostLaunch;
|
|
2962
|
+
constructor(config?: Partial<BrowserRuntimeConfig>);
|
|
2963
|
+
getResolvedMode(): ResolvedBrowserDriverMode | null;
|
|
2964
|
+
navigate(sessionId: string, args: BrowserNavigateArgs): Promise<BrowserToolResult>;
|
|
2965
|
+
click(sessionId: string, args: BrowserClickArgs): Promise<BrowserToolResult>;
|
|
2966
|
+
type(sessionId: string, args: BrowserTypeArgs): Promise<BrowserToolResult>;
|
|
2967
|
+
select(sessionId: string, args: BrowserSelectArgs): Promise<BrowserToolResult>;
|
|
2968
|
+
waitFor(sessionId: string, args: BrowserWaitForArgs): Promise<BrowserToolResult>;
|
|
2969
|
+
extractText(sessionId: string, args: BrowserExtractTextArgs): Promise<BrowserToolResult>;
|
|
2970
|
+
screenshot(sessionId: string, args: BrowserScreenshotArgs): Promise<BrowserToolResult>;
|
|
2971
|
+
download(sessionId: string, args: BrowserDownloadArgs): Promise<BrowserToolResult>;
|
|
2972
|
+
upload(sessionId: string, args: BrowserUploadArgs): Promise<BrowserToolResult>;
|
|
2973
|
+
closeSession(sessionId: string): Promise<BrowserToolResult>;
|
|
2974
|
+
dispose(): Promise<void>;
|
|
2975
|
+
private getPage;
|
|
2976
|
+
private ensureBrowser;
|
|
2977
|
+
private connectCdpOrThrow;
|
|
2978
|
+
private connectRemoteOrThrow;
|
|
2979
|
+
private connectHeadless;
|
|
2980
|
+
private isCdpReachable;
|
|
2981
|
+
private launchHostChrome;
|
|
2982
|
+
private resolveChromeBinary;
|
|
2983
|
+
private saveDownload;
|
|
2984
|
+
}
|
|
2985
|
+
declare function normalizeBrowserRuntimeError(error: unknown): BrowserToolError;
|
|
2986
|
+
|
|
2987
|
+
declare class BrowserServer {
|
|
2988
|
+
readonly server: Server;
|
|
2989
|
+
private readonly runtime;
|
|
2990
|
+
constructor(config?: Partial<BrowserRuntimeConfig>, runtime?: BrowserToolRuntime);
|
|
2991
|
+
closeSession(sessionId: string): Promise<void>;
|
|
2992
|
+
dispose(): Promise<void>;
|
|
2993
|
+
private setupHandlers;
|
|
2994
|
+
private ok;
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2815
2997
|
interface McpServerConfig {
|
|
2816
2998
|
id: string;
|
|
2817
2999
|
type: 'stdio' | 'in-memory';
|
|
@@ -3431,4 +3613,4 @@ declare class ComputerUseSessionOrchestrator extends EventEmitter {
|
|
|
3431
3613
|
private normalizeError;
|
|
3432
3614
|
}
|
|
3433
3615
|
|
|
3434
|
-
export { Agent, type AgentContext, type AgentOptions, AnthropicProvider, BasicStrategyGate, COMPUTER_USE_ERROR_CODES, type CanonicalComputerUseAction, type Checkpoint, type ComputerUseActionEnvelope, type ComputerUseAdapterContext, type ComputerUseAdapterResult, type ComputerUseCapabilityAdapter, type ComputerUseCheckpoint, type ComputerUseDomain, type ComputerUseError, type ComputerUseErrorCode, type ComputerUseRiskLevel, ComputerUseSessionOrchestrator, type ComputerUseSessionSummary, type ComputerUseSessionSummaryRecord, ConfigLoader, ConfigSchema, type ContentBlock, ContentBlockSchema, type CreateLLMOptions, type DispatchCanonicalActionRequest, type DispatchCanonicalActionResult, type DynamicSkill, type Episode, type EvaluationMetrics, type EvaluationResult, type EvaluationSummary, EvolutionLimitValidator, type ExecutionSummary, type Fact, FallbackProvider, FeedbackCollector, FileSystemServer, type GateResult, type GateValidator, GitServer, type ILLMProvider, type IStrategy, type ImageContent, ImageContentSchema, type Intent, IntentAnalyzer, type IntentProfile, IntentProfileSchema, IntentSchema, type InteractionRequest, InteractionServer, type LLMRequest, LLMRequestSchema, type LLMResponse, LLMResponseSchema, type LydiaConfig, McpCanonicalCapabilityAdapter, McpClientManager, type McpServerConfig, McpServerSchema, MemoryManager, type MemoryManagerOptions, MemoryServer, type Message, MessageSchema, MockProvider, type ObservationArtifactKind, type ObservationBlock, type ObservationFrame, type ObservationFrameRecord, OllamaProvider, OpenAIProvider, type ReplayDeterminismMismatch, type ReplayDeterminismResult, ReplayLLMProvider, ReplayManager, ReplayMcpClientManager, ReplayPerformanceValidator, type ReviewFinding, ReviewManager, type ReviewOptions, type ReviewRequest, type ReviewSummary, type RiskAssessment, type RiskLevel, RiskSafetyValidator, type Role, RoleSchema, type RoutedStrategy, type ShadowPromotionDecision, ShadowRouter, ShellServer, SimplePlanner, type Skill, type SkillContext, SkillLoader, type SkillMeta, SkillMetaSchema, SkillParser, SkillRegistry, SkillSchema, SkillWatcher, type StaticSkill, StaticSkillSchema, type Step, type StepResult, StepSchema, type StepStatus, StepStatusSchema, type StepType, StepTypeSchema, type Strategy, StrategyApprovalService, type StrategyBranch, StrategyBranchManager, type StrategyComparison, type StrategyConfig, StrategyConstraintsSchema, type StrategyEpisodeSummary, StrategyEvaluator, StrategyEvolutionLimitsSchema, StrategyExecutionSchema, StrategyMetadataSchema, StrategyPlanningSchema, StrategyPreferencesSchema, StrategyPromptsSchema, type StrategyProposal, StrategyRegistry, StrategyReviewer, StrategySchema, StrategySystemSchema, StrategyUpdateGate, type StreamChunk, SyntaxValidator, type Task, type TaskContext, type TaskFeedback, type TaskFeedbackRecord, type TaskReport, type TaskReportRecord, TaskReporter, TaskSchema, type TaskStatus, TaskStatusSchema, type TextContent, TextContentSchema, type ThinkingContent, ThinkingContentSchema, type TokenUsage, TokenUsageSchema, type ToolDefinition, ToolDefinitionSchema, type ToolResultContent, ToolResultContentSchema, type ToolUseContent, ToolUseContentSchema, type Trace, type UpsertComputerUseSessionSummaryInput, type ValidationResult, assessRisk, createLLMFromConfig, getSkillContent, hasContent, isCanonicalComputerUseTool, isComputerUseErrorCode, isDynamicSkill, listCanonicalComputerUseActions, normalizeComputerUseError, resolveCanonicalComputerUseToolName };
|
|
3616
|
+
export { Agent, type AgentContext, type AgentOptions, AnthropicProvider, BasicStrategyGate, BrowserAutomationManager, type BrowserClickArgs, type BrowserDownloadArgs, type BrowserDriverMode, type BrowserExtractTextArgs, type BrowserNavigateArgs, type BrowserRuntimeConfig, type BrowserScreenshotArgs, type BrowserSelectArgs, BrowserServer, type BrowserToolError, type BrowserToolResult, type BrowserToolRuntime, type BrowserTypeArgs, type BrowserUploadArgs, type BrowserWaitForArgs, COMPUTER_USE_ERROR_CODES, type CanonicalComputerUseAction, type Checkpoint, type ComputerUseActionEnvelope, type ComputerUseAdapterContext, type ComputerUseAdapterResult, type ComputerUseCapabilityAdapter, type ComputerUseCheckpoint, type ComputerUseDomain, type ComputerUseError, type ComputerUseErrorCode, type ComputerUseRiskLevel, ComputerUseSessionOrchestrator, type ComputerUseSessionSummary, type ComputerUseSessionSummaryRecord, ConfigLoader, ConfigSchema, type ContentBlock, ContentBlockSchema, type CreateLLMOptions, type DispatchCanonicalActionRequest, type DispatchCanonicalActionResult, type DynamicSkill, type Episode, type EvaluationMetrics, type EvaluationResult, type EvaluationSummary, EvolutionLimitValidator, type ExecutionSummary, type Fact, FallbackProvider, FeedbackCollector, FileSystemServer, type GateResult, type GateValidator, GitServer, type ILLMProvider, type IStrategy, type ImageContent, ImageContentSchema, type Intent, IntentAnalyzer, type IntentProfile, IntentProfileSchema, IntentSchema, type InteractionRequest, InteractionServer, type LLMRequest, LLMRequestSchema, type LLMResponse, LLMResponseSchema, type LydiaConfig, McpCanonicalCapabilityAdapter, McpClientManager, type McpServerConfig, McpServerSchema, MemoryManager, type MemoryManagerOptions, MemoryServer, type Message, MessageSchema, MockProvider, type ObservationArtifactKind, type ObservationBlock, type ObservationFrame, type ObservationFrameRecord, OllamaProvider, OpenAIProvider, type ReplayDeterminismMismatch, type ReplayDeterminismResult, ReplayLLMProvider, ReplayManager, ReplayMcpClientManager, ReplayPerformanceValidator, type ResolvedBrowserDriverMode, type ReviewFinding, ReviewManager, type ReviewOptions, type ReviewRequest, type ReviewSummary, type RiskAssessment, type RiskLevel, RiskSafetyValidator, type Role, RoleSchema, type RoutedStrategy, type ShadowPromotionDecision, ShadowRouter, ShellServer, SimplePlanner, type Skill, type SkillContext, SkillLoader, type SkillMeta, SkillMetaSchema, SkillParser, SkillRegistry, SkillSchema, SkillWatcher, type StaticSkill, StaticSkillSchema, type Step, type StepResult, StepSchema, type StepStatus, StepStatusSchema, type StepType, StepTypeSchema, type Strategy, StrategyApprovalService, type StrategyBranch, StrategyBranchManager, type StrategyComparison, type StrategyConfig, StrategyConstraintsSchema, type StrategyEpisodeSummary, StrategyEvaluator, StrategyEvolutionLimitsSchema, StrategyExecutionSchema, StrategyMetadataSchema, StrategyPlanningSchema, StrategyPreferencesSchema, StrategyPromptsSchema, type StrategyProposal, StrategyRegistry, StrategyReviewer, StrategySchema, StrategySystemSchema, StrategyUpdateGate, type StreamChunk, SyntaxValidator, type Task, type TaskContext, type TaskFeedback, type TaskFeedbackRecord, type TaskReport, type TaskReportRecord, TaskReporter, TaskSchema, type TaskStatus, TaskStatusSchema, type TextContent, TextContentSchema, type ThinkingContent, ThinkingContentSchema, type TokenUsage, TokenUsageSchema, type ToolDefinition, ToolDefinitionSchema, type ToolResultContent, ToolResultContentSchema, type ToolUseContent, ToolUseContentSchema, type Trace, type UpsertComputerUseSessionSummaryInput, type ValidationResult, assessRisk, createBrowserToolError, createDefaultBrowserRuntimeConfig, createLLMFromConfig, getSkillContent, hasContent, isCanonicalComputerUseTool, isComputerUseErrorCode, isDynamicSkill, listCanonicalComputerUseActions, normalizeBrowserRuntimeError, normalizeComputerUseError, resolveCanonicalComputerUseToolName };
|
package/dist/index.d.ts
CHANGED
|
@@ -2390,6 +2390,37 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
2390
2390
|
checkpointTtlHours?: number | undefined;
|
|
2391
2391
|
observationFrameTtlHours?: number | undefined;
|
|
2392
2392
|
}>>;
|
|
2393
|
+
browser: z.ZodDefault<z.ZodObject<{
|
|
2394
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2395
|
+
mode: z.ZodDefault<z.ZodEnum<["auto", "cdp", "headless", "remote"]>>;
|
|
2396
|
+
cdpPort: z.ZodDefault<z.ZodNumber>;
|
|
2397
|
+
remoteUrl: z.ZodDefault<z.ZodString>;
|
|
2398
|
+
chromePath: z.ZodDefault<z.ZodString>;
|
|
2399
|
+
launchHostBrowser: z.ZodDefault<z.ZodBoolean>;
|
|
2400
|
+
navigationTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
2401
|
+
actionTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
2402
|
+
downloadDir: z.ZodDefault<z.ZodString>;
|
|
2403
|
+
}, "strip", z.ZodTypeAny, {
|
|
2404
|
+
enabled: boolean;
|
|
2405
|
+
mode: "auto" | "cdp" | "headless" | "remote";
|
|
2406
|
+
cdpPort: number;
|
|
2407
|
+
remoteUrl: string;
|
|
2408
|
+
chromePath: string;
|
|
2409
|
+
launchHostBrowser: boolean;
|
|
2410
|
+
navigationTimeoutMs: number;
|
|
2411
|
+
actionTimeoutMs: number;
|
|
2412
|
+
downloadDir: string;
|
|
2413
|
+
}, {
|
|
2414
|
+
enabled?: boolean | undefined;
|
|
2415
|
+
mode?: "auto" | "cdp" | "headless" | "remote" | undefined;
|
|
2416
|
+
cdpPort?: number | undefined;
|
|
2417
|
+
remoteUrl?: string | undefined;
|
|
2418
|
+
chromePath?: string | undefined;
|
|
2419
|
+
launchHostBrowser?: boolean | undefined;
|
|
2420
|
+
navigationTimeoutMs?: number | undefined;
|
|
2421
|
+
actionTimeoutMs?: number | undefined;
|
|
2422
|
+
downloadDir?: string | undefined;
|
|
2423
|
+
}>>;
|
|
2393
2424
|
skills: z.ZodDefault<z.ZodObject<{
|
|
2394
2425
|
/** Maximum number of skills whose full content is injected into the prompt (default: 3) */
|
|
2395
2426
|
matchTopK: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2407,6 +2438,17 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
2407
2438
|
extraDirs?: string[] | undefined;
|
|
2408
2439
|
}>>;
|
|
2409
2440
|
}, "strip", z.ZodTypeAny, {
|
|
2441
|
+
browser: {
|
|
2442
|
+
enabled: boolean;
|
|
2443
|
+
mode: "auto" | "cdp" | "headless" | "remote";
|
|
2444
|
+
cdpPort: number;
|
|
2445
|
+
remoteUrl: string;
|
|
2446
|
+
chromePath: string;
|
|
2447
|
+
launchHostBrowser: boolean;
|
|
2448
|
+
navigationTimeoutMs: number;
|
|
2449
|
+
actionTimeoutMs: number;
|
|
2450
|
+
downloadDir: string;
|
|
2451
|
+
};
|
|
2410
2452
|
llm: {
|
|
2411
2453
|
provider: "anthropic" | "openai" | "ollama" | "mock" | "auto";
|
|
2412
2454
|
defaultModel: string;
|
|
@@ -2467,6 +2509,17 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
2467
2509
|
extraDirs: string[];
|
|
2468
2510
|
};
|
|
2469
2511
|
}, {
|
|
2512
|
+
browser?: {
|
|
2513
|
+
enabled?: boolean | undefined;
|
|
2514
|
+
mode?: "auto" | "cdp" | "headless" | "remote" | undefined;
|
|
2515
|
+
cdpPort?: number | undefined;
|
|
2516
|
+
remoteUrl?: string | undefined;
|
|
2517
|
+
chromePath?: string | undefined;
|
|
2518
|
+
launchHostBrowser?: boolean | undefined;
|
|
2519
|
+
navigationTimeoutMs?: number | undefined;
|
|
2520
|
+
actionTimeoutMs?: number | undefined;
|
|
2521
|
+
downloadDir?: string | undefined;
|
|
2522
|
+
} | undefined;
|
|
2470
2523
|
llm?: {
|
|
2471
2524
|
provider?: "anthropic" | "openai" | "ollama" | "mock" | "auto" | undefined;
|
|
2472
2525
|
defaultModel?: string | undefined;
|
|
@@ -2682,6 +2735,7 @@ declare class Agent extends EventEmitter {
|
|
|
2682
2735
|
private currentInput?;
|
|
2683
2736
|
private currentTaskCreatedAt?;
|
|
2684
2737
|
private builtinServerSpecs;
|
|
2738
|
+
private browserServer?;
|
|
2685
2739
|
private options;
|
|
2686
2740
|
private computerUseAdapter;
|
|
2687
2741
|
private computerUseOrchestrator;
|
|
@@ -2732,6 +2786,8 @@ declare class Agent extends EventEmitter {
|
|
|
2732
2786
|
private parseCheckpointFrameIds;
|
|
2733
2787
|
private executeToolWithComputerUseOrchestration;
|
|
2734
2788
|
private resolveCanonicalComputerUseAction;
|
|
2789
|
+
private attachInternalBrowserSessionArg;
|
|
2790
|
+
private closeBrowserAutomationSession;
|
|
2735
2791
|
private inferComputerUseDomain;
|
|
2736
2792
|
private formatComputerUseFailure;
|
|
2737
2793
|
private toDisplayText;
|
|
@@ -2812,6 +2868,132 @@ declare class InteractionServer extends EventEmitter {
|
|
|
2812
2868
|
resolve(id: string, response: string): boolean;
|
|
2813
2869
|
}
|
|
2814
2870
|
|
|
2871
|
+
type BrowserDriverMode = 'auto' | 'cdp' | 'headless' | 'remote';
|
|
2872
|
+
type ResolvedBrowserDriverMode = Exclude<BrowserDriverMode, 'auto'>;
|
|
2873
|
+
interface BrowserRuntimeConfig {
|
|
2874
|
+
enabled: boolean;
|
|
2875
|
+
mode: BrowserDriverMode;
|
|
2876
|
+
cdpPort: number;
|
|
2877
|
+
remoteUrl: string;
|
|
2878
|
+
chromePath: string;
|
|
2879
|
+
launchHostBrowser: boolean;
|
|
2880
|
+
navigationTimeoutMs: number;
|
|
2881
|
+
actionTimeoutMs: number;
|
|
2882
|
+
downloadDir: string;
|
|
2883
|
+
}
|
|
2884
|
+
interface BrowserNavigateArgs {
|
|
2885
|
+
url: string;
|
|
2886
|
+
waitUntil?: 'load' | 'domcontentloaded' | 'networkidle' | 'commit';
|
|
2887
|
+
timeoutMs?: number;
|
|
2888
|
+
}
|
|
2889
|
+
interface BrowserClickArgs {
|
|
2890
|
+
selector: string;
|
|
2891
|
+
timeoutMs?: number;
|
|
2892
|
+
}
|
|
2893
|
+
interface BrowserTypeArgs {
|
|
2894
|
+
selector: string;
|
|
2895
|
+
text: string;
|
|
2896
|
+
clearExisting?: boolean;
|
|
2897
|
+
timeoutMs?: number;
|
|
2898
|
+
}
|
|
2899
|
+
interface BrowserSelectArgs {
|
|
2900
|
+
selector: string;
|
|
2901
|
+
value: string | string[];
|
|
2902
|
+
timeoutMs?: number;
|
|
2903
|
+
}
|
|
2904
|
+
interface BrowserWaitForArgs {
|
|
2905
|
+
selector: string;
|
|
2906
|
+
state?: 'attached' | 'detached' | 'visible' | 'hidden';
|
|
2907
|
+
timeoutMs?: number;
|
|
2908
|
+
}
|
|
2909
|
+
interface BrowserExtractTextArgs {
|
|
2910
|
+
selector: string;
|
|
2911
|
+
timeoutMs?: number;
|
|
2912
|
+
}
|
|
2913
|
+
interface BrowserScreenshotArgs {
|
|
2914
|
+
fullPage?: boolean;
|
|
2915
|
+
timeoutMs?: number;
|
|
2916
|
+
}
|
|
2917
|
+
interface BrowserDownloadArgs {
|
|
2918
|
+
selector?: string;
|
|
2919
|
+
url?: string;
|
|
2920
|
+
saveAs?: string;
|
|
2921
|
+
timeoutMs?: number;
|
|
2922
|
+
}
|
|
2923
|
+
interface BrowserUploadArgs {
|
|
2924
|
+
selector: string;
|
|
2925
|
+
path: string;
|
|
2926
|
+
timeoutMs?: number;
|
|
2927
|
+
}
|
|
2928
|
+
interface BrowserToolResult {
|
|
2929
|
+
text: string;
|
|
2930
|
+
imageBase64?: string;
|
|
2931
|
+
mediaType?: string;
|
|
2932
|
+
artifactPath?: string;
|
|
2933
|
+
downloadPath?: string;
|
|
2934
|
+
metadata?: Record<string, unknown>;
|
|
2935
|
+
}
|
|
2936
|
+
interface BrowserToolRuntime {
|
|
2937
|
+
navigate(sessionId: string, args: BrowserNavigateArgs): Promise<BrowserToolResult>;
|
|
2938
|
+
click(sessionId: string, args: BrowserClickArgs): Promise<BrowserToolResult>;
|
|
2939
|
+
type(sessionId: string, args: BrowserTypeArgs): Promise<BrowserToolResult>;
|
|
2940
|
+
select(sessionId: string, args: BrowserSelectArgs): Promise<BrowserToolResult>;
|
|
2941
|
+
waitFor(sessionId: string, args: BrowserWaitForArgs): Promise<BrowserToolResult>;
|
|
2942
|
+
extractText(sessionId: string, args: BrowserExtractTextArgs): Promise<BrowserToolResult>;
|
|
2943
|
+
screenshot(sessionId: string, args: BrowserScreenshotArgs): Promise<BrowserToolResult>;
|
|
2944
|
+
download(sessionId: string, args: BrowserDownloadArgs): Promise<BrowserToolResult>;
|
|
2945
|
+
upload(sessionId: string, args: BrowserUploadArgs): Promise<BrowserToolResult>;
|
|
2946
|
+
closeSession(sessionId: string): Promise<BrowserToolResult>;
|
|
2947
|
+
getResolvedMode(): ResolvedBrowserDriverMode | null;
|
|
2948
|
+
dispose(): Promise<void>;
|
|
2949
|
+
}
|
|
2950
|
+
interface BrowserToolError extends Error {
|
|
2951
|
+
code: 'BROWSER_TIMEOUT' | 'ELEMENT_NOT_FOUND' | 'ELEMENT_NOT_INTERACTABLE' | 'NAVIGATION_BLOCKED' | 'DOWNLOAD_FAILED' | 'UPLOAD_FAILED' | 'SESSION_CLOSED' | 'CAPABILITY_UNAVAILABLE' | 'UNKNOWN';
|
|
2952
|
+
retryable: boolean;
|
|
2953
|
+
}
|
|
2954
|
+
declare function createBrowserToolError(code: BrowserToolError['code'], message: string, retryable?: boolean): BrowserToolError;
|
|
2955
|
+
declare function createDefaultBrowserRuntimeConfig(partial?: Partial<BrowserRuntimeConfig>): BrowserRuntimeConfig;
|
|
2956
|
+
declare class BrowserAutomationManager implements BrowserToolRuntime {
|
|
2957
|
+
private readonly config;
|
|
2958
|
+
private readonly sessions;
|
|
2959
|
+
private browser;
|
|
2960
|
+
private resolvedMode;
|
|
2961
|
+
private attemptedHostLaunch;
|
|
2962
|
+
constructor(config?: Partial<BrowserRuntimeConfig>);
|
|
2963
|
+
getResolvedMode(): ResolvedBrowserDriverMode | null;
|
|
2964
|
+
navigate(sessionId: string, args: BrowserNavigateArgs): Promise<BrowserToolResult>;
|
|
2965
|
+
click(sessionId: string, args: BrowserClickArgs): Promise<BrowserToolResult>;
|
|
2966
|
+
type(sessionId: string, args: BrowserTypeArgs): Promise<BrowserToolResult>;
|
|
2967
|
+
select(sessionId: string, args: BrowserSelectArgs): Promise<BrowserToolResult>;
|
|
2968
|
+
waitFor(sessionId: string, args: BrowserWaitForArgs): Promise<BrowserToolResult>;
|
|
2969
|
+
extractText(sessionId: string, args: BrowserExtractTextArgs): Promise<BrowserToolResult>;
|
|
2970
|
+
screenshot(sessionId: string, args: BrowserScreenshotArgs): Promise<BrowserToolResult>;
|
|
2971
|
+
download(sessionId: string, args: BrowserDownloadArgs): Promise<BrowserToolResult>;
|
|
2972
|
+
upload(sessionId: string, args: BrowserUploadArgs): Promise<BrowserToolResult>;
|
|
2973
|
+
closeSession(sessionId: string): Promise<BrowserToolResult>;
|
|
2974
|
+
dispose(): Promise<void>;
|
|
2975
|
+
private getPage;
|
|
2976
|
+
private ensureBrowser;
|
|
2977
|
+
private connectCdpOrThrow;
|
|
2978
|
+
private connectRemoteOrThrow;
|
|
2979
|
+
private connectHeadless;
|
|
2980
|
+
private isCdpReachable;
|
|
2981
|
+
private launchHostChrome;
|
|
2982
|
+
private resolveChromeBinary;
|
|
2983
|
+
private saveDownload;
|
|
2984
|
+
}
|
|
2985
|
+
declare function normalizeBrowserRuntimeError(error: unknown): BrowserToolError;
|
|
2986
|
+
|
|
2987
|
+
declare class BrowserServer {
|
|
2988
|
+
readonly server: Server;
|
|
2989
|
+
private readonly runtime;
|
|
2990
|
+
constructor(config?: Partial<BrowserRuntimeConfig>, runtime?: BrowserToolRuntime);
|
|
2991
|
+
closeSession(sessionId: string): Promise<void>;
|
|
2992
|
+
dispose(): Promise<void>;
|
|
2993
|
+
private setupHandlers;
|
|
2994
|
+
private ok;
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2815
2997
|
interface McpServerConfig {
|
|
2816
2998
|
id: string;
|
|
2817
2999
|
type: 'stdio' | 'in-memory';
|
|
@@ -3431,4 +3613,4 @@ declare class ComputerUseSessionOrchestrator extends EventEmitter {
|
|
|
3431
3613
|
private normalizeError;
|
|
3432
3614
|
}
|
|
3433
3615
|
|
|
3434
|
-
export { Agent, type AgentContext, type AgentOptions, AnthropicProvider, BasicStrategyGate, COMPUTER_USE_ERROR_CODES, type CanonicalComputerUseAction, type Checkpoint, type ComputerUseActionEnvelope, type ComputerUseAdapterContext, type ComputerUseAdapterResult, type ComputerUseCapabilityAdapter, type ComputerUseCheckpoint, type ComputerUseDomain, type ComputerUseError, type ComputerUseErrorCode, type ComputerUseRiskLevel, ComputerUseSessionOrchestrator, type ComputerUseSessionSummary, type ComputerUseSessionSummaryRecord, ConfigLoader, ConfigSchema, type ContentBlock, ContentBlockSchema, type CreateLLMOptions, type DispatchCanonicalActionRequest, type DispatchCanonicalActionResult, type DynamicSkill, type Episode, type EvaluationMetrics, type EvaluationResult, type EvaluationSummary, EvolutionLimitValidator, type ExecutionSummary, type Fact, FallbackProvider, FeedbackCollector, FileSystemServer, type GateResult, type GateValidator, GitServer, type ILLMProvider, type IStrategy, type ImageContent, ImageContentSchema, type Intent, IntentAnalyzer, type IntentProfile, IntentProfileSchema, IntentSchema, type InteractionRequest, InteractionServer, type LLMRequest, LLMRequestSchema, type LLMResponse, LLMResponseSchema, type LydiaConfig, McpCanonicalCapabilityAdapter, McpClientManager, type McpServerConfig, McpServerSchema, MemoryManager, type MemoryManagerOptions, MemoryServer, type Message, MessageSchema, MockProvider, type ObservationArtifactKind, type ObservationBlock, type ObservationFrame, type ObservationFrameRecord, OllamaProvider, OpenAIProvider, type ReplayDeterminismMismatch, type ReplayDeterminismResult, ReplayLLMProvider, ReplayManager, ReplayMcpClientManager, ReplayPerformanceValidator, type ReviewFinding, ReviewManager, type ReviewOptions, type ReviewRequest, type ReviewSummary, type RiskAssessment, type RiskLevel, RiskSafetyValidator, type Role, RoleSchema, type RoutedStrategy, type ShadowPromotionDecision, ShadowRouter, ShellServer, SimplePlanner, type Skill, type SkillContext, SkillLoader, type SkillMeta, SkillMetaSchema, SkillParser, SkillRegistry, SkillSchema, SkillWatcher, type StaticSkill, StaticSkillSchema, type Step, type StepResult, StepSchema, type StepStatus, StepStatusSchema, type StepType, StepTypeSchema, type Strategy, StrategyApprovalService, type StrategyBranch, StrategyBranchManager, type StrategyComparison, type StrategyConfig, StrategyConstraintsSchema, type StrategyEpisodeSummary, StrategyEvaluator, StrategyEvolutionLimitsSchema, StrategyExecutionSchema, StrategyMetadataSchema, StrategyPlanningSchema, StrategyPreferencesSchema, StrategyPromptsSchema, type StrategyProposal, StrategyRegistry, StrategyReviewer, StrategySchema, StrategySystemSchema, StrategyUpdateGate, type StreamChunk, SyntaxValidator, type Task, type TaskContext, type TaskFeedback, type TaskFeedbackRecord, type TaskReport, type TaskReportRecord, TaskReporter, TaskSchema, type TaskStatus, TaskStatusSchema, type TextContent, TextContentSchema, type ThinkingContent, ThinkingContentSchema, type TokenUsage, TokenUsageSchema, type ToolDefinition, ToolDefinitionSchema, type ToolResultContent, ToolResultContentSchema, type ToolUseContent, ToolUseContentSchema, type Trace, type UpsertComputerUseSessionSummaryInput, type ValidationResult, assessRisk, createLLMFromConfig, getSkillContent, hasContent, isCanonicalComputerUseTool, isComputerUseErrorCode, isDynamicSkill, listCanonicalComputerUseActions, normalizeComputerUseError, resolveCanonicalComputerUseToolName };
|
|
3616
|
+
export { Agent, type AgentContext, type AgentOptions, AnthropicProvider, BasicStrategyGate, BrowserAutomationManager, type BrowserClickArgs, type BrowserDownloadArgs, type BrowserDriverMode, type BrowserExtractTextArgs, type BrowserNavigateArgs, type BrowserRuntimeConfig, type BrowserScreenshotArgs, type BrowserSelectArgs, BrowserServer, type BrowserToolError, type BrowserToolResult, type BrowserToolRuntime, type BrowserTypeArgs, type BrowserUploadArgs, type BrowserWaitForArgs, COMPUTER_USE_ERROR_CODES, type CanonicalComputerUseAction, type Checkpoint, type ComputerUseActionEnvelope, type ComputerUseAdapterContext, type ComputerUseAdapterResult, type ComputerUseCapabilityAdapter, type ComputerUseCheckpoint, type ComputerUseDomain, type ComputerUseError, type ComputerUseErrorCode, type ComputerUseRiskLevel, ComputerUseSessionOrchestrator, type ComputerUseSessionSummary, type ComputerUseSessionSummaryRecord, ConfigLoader, ConfigSchema, type ContentBlock, ContentBlockSchema, type CreateLLMOptions, type DispatchCanonicalActionRequest, type DispatchCanonicalActionResult, type DynamicSkill, type Episode, type EvaluationMetrics, type EvaluationResult, type EvaluationSummary, EvolutionLimitValidator, type ExecutionSummary, type Fact, FallbackProvider, FeedbackCollector, FileSystemServer, type GateResult, type GateValidator, GitServer, type ILLMProvider, type IStrategy, type ImageContent, ImageContentSchema, type Intent, IntentAnalyzer, type IntentProfile, IntentProfileSchema, IntentSchema, type InteractionRequest, InteractionServer, type LLMRequest, LLMRequestSchema, type LLMResponse, LLMResponseSchema, type LydiaConfig, McpCanonicalCapabilityAdapter, McpClientManager, type McpServerConfig, McpServerSchema, MemoryManager, type MemoryManagerOptions, MemoryServer, type Message, MessageSchema, MockProvider, type ObservationArtifactKind, type ObservationBlock, type ObservationFrame, type ObservationFrameRecord, OllamaProvider, OpenAIProvider, type ReplayDeterminismMismatch, type ReplayDeterminismResult, ReplayLLMProvider, ReplayManager, ReplayMcpClientManager, ReplayPerformanceValidator, type ResolvedBrowserDriverMode, type ReviewFinding, ReviewManager, type ReviewOptions, type ReviewRequest, type ReviewSummary, type RiskAssessment, type RiskLevel, RiskSafetyValidator, type Role, RoleSchema, type RoutedStrategy, type ShadowPromotionDecision, ShadowRouter, ShellServer, SimplePlanner, type Skill, type SkillContext, SkillLoader, type SkillMeta, SkillMetaSchema, SkillParser, SkillRegistry, SkillSchema, SkillWatcher, type StaticSkill, StaticSkillSchema, type Step, type StepResult, StepSchema, type StepStatus, StepStatusSchema, type StepType, StepTypeSchema, type Strategy, StrategyApprovalService, type StrategyBranch, StrategyBranchManager, type StrategyComparison, type StrategyConfig, StrategyConstraintsSchema, type StrategyEpisodeSummary, StrategyEvaluator, StrategyEvolutionLimitsSchema, StrategyExecutionSchema, StrategyMetadataSchema, StrategyPlanningSchema, StrategyPreferencesSchema, StrategyPromptsSchema, type StrategyProposal, StrategyRegistry, StrategyReviewer, StrategySchema, StrategySystemSchema, StrategyUpdateGate, type StreamChunk, SyntaxValidator, type Task, type TaskContext, type TaskFeedback, type TaskFeedbackRecord, type TaskReport, type TaskReportRecord, TaskReporter, TaskSchema, type TaskStatus, TaskStatusSchema, type TextContent, TextContentSchema, type ThinkingContent, ThinkingContentSchema, type TokenUsage, TokenUsageSchema, type ToolDefinition, ToolDefinitionSchema, type ToolResultContent, ToolResultContentSchema, type ToolUseContent, ToolUseContentSchema, type Trace, type UpsertComputerUseSessionSummaryInput, type ValidationResult, assessRisk, createBrowserToolError, createDefaultBrowserRuntimeConfig, createLLMFromConfig, getSkillContent, hasContent, isCanonicalComputerUseTool, isComputerUseErrorCode, isDynamicSkill, listCanonicalComputerUseActions, normalizeBrowserRuntimeError, normalizeComputerUseError, resolveCanonicalComputerUseToolName };
|