@vostride/agent-qa-core 0.1.17 → 0.1.19
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 +211 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +206 -6
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -2115,6 +2115,7 @@ interface StepEventContext {
|
|
|
2115
2115
|
runId?: string;
|
|
2116
2116
|
parentRunId?: string | null;
|
|
2117
2117
|
suiteIndex?: number;
|
|
2118
|
+
suiteTotal?: number;
|
|
2118
2119
|
testIndex?: number;
|
|
2119
2120
|
stepIndex?: number;
|
|
2120
2121
|
stepId?: string;
|
|
@@ -2487,6 +2488,7 @@ declare class StdoutLiveReporter implements Reporter {
|
|
|
2487
2488
|
private activeRunId;
|
|
2488
2489
|
private activeParentRunId;
|
|
2489
2490
|
private activeSuiteIndex;
|
|
2491
|
+
private activeSuiteTotal;
|
|
2490
2492
|
private redactor?;
|
|
2491
2493
|
constructor(options?: StdoutLiveReporterOptions);
|
|
2492
2494
|
private emit;
|
|
@@ -3630,6 +3632,26 @@ declare function createAnalyticsRunReporter(options?: AnalyticsRunReporterOption
|
|
|
3630
3632
|
declare const AGENT_QA_VERSION: string;
|
|
3631
3633
|
declare function getAgentQaVersion(): string;
|
|
3632
3634
|
|
|
3635
|
+
declare const VERSION_CHECK_CACHE_TTL_MS: number;
|
|
3636
|
+
declare const VERSION_CHECK_TIMEOUT_MS = 5000;
|
|
3637
|
+
interface AgentQaUpdateStatus {
|
|
3638
|
+
installedVersion: string;
|
|
3639
|
+
latestVersion?: string;
|
|
3640
|
+
updateAvailable: boolean;
|
|
3641
|
+
checkedAt?: string;
|
|
3642
|
+
}
|
|
3643
|
+
type VersionCheckFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
3644
|
+
interface VersionCheckOptions {
|
|
3645
|
+
cachePath?: string;
|
|
3646
|
+
fetchImpl?: VersionCheckFetch;
|
|
3647
|
+
now?: () => Date;
|
|
3648
|
+
timeoutMs?: number;
|
|
3649
|
+
cacheTtlMs?: number;
|
|
3650
|
+
homeDir?: string;
|
|
3651
|
+
}
|
|
3652
|
+
declare function getAgentQaVersionCheckCachePath(homeDir?: string): string;
|
|
3653
|
+
declare function getAgentQaUpdateStatus(options?: VersionCheckOptions): Promise<AgentQaUpdateStatus>;
|
|
3654
|
+
|
|
3633
3655
|
declare const DEFAULT_AGENT_QA_RUNTIME_DIR = ".agent-qa";
|
|
3634
3656
|
declare const DEFAULT_AGENT_QA_ARTIFACTS_DIR = ".agent-qa/artifacts";
|
|
3635
3657
|
declare const DEFAULT_AGENT_QA_CACHE_DIR = ".agent-qa/cache";
|
|
@@ -3691,4 +3713,4 @@ declare function isMacPlatform(): boolean;
|
|
|
3691
3713
|
|
|
3692
3714
|
declare function isPathInsideDir(childPath: string, parentDir: string): boolean;
|
|
3693
3715
|
|
|
3694
|
-
export { AGENT_QA_POSTHOG_HOST, AGENT_QA_POSTHOG_KEY, AGENT_QA_VERSION, ANALYTICS_AGENT_PRODUCTS, ANALYTICS_DASHBOARD_ENTITY_TYPES, ANALYTICS_DASHBOARD_OUTCOMES, ANALYTICS_EVENT_NAMES, ANALYTICS_FAILURE_CATEGORIES, ANALYTICS_MCP_ERROR_CATEGORIES, ANALYTICS_MCP_HOST_KINDS, ANALYTICS_MCP_PATH_KINDS, ANALYTICS_MCP_PORT_KINDS, ANALYTICS_MCP_SERVER_STATES, ANALYTICS_MCP_TOOL_CATEGORIES, ANALYTICS_MCP_TOOL_STATUSES, ANALYTICS_MCP_TRANSPORTS, ANALYTICS_PLATFORMS, ANALYTICS_RUNNERS, ANALYTICS_RUNTIME_CONTEXTS, ANALYTICS_RUN_STATUSES, ANALYTICS_SUITE_EXECUTION_MODES, ANALYTICS_SURFACES, ANALYTICS_TRANSPORT_KINDS, ANALYTICS_TRIGGER_SOURCES, ANDROID_ROLE_MAP, ATTR_RUNNER, ATTR_TRIGGER, AUTH_STATE_HOOK_CONTAINER_STORAGE_STATE_PATH, AUTH_STATE_HOOK_JSON_ENV, AUTH_STATE_HOOK_STORAGE_STATE_FILENAME, AUTH_STATE_HOOK_STORAGE_STATE_PATH_ENV, AUTH_STATE_HOOK_WORKSPACE_DIR, AUTH_STATE_REDACTION_MARKER, AUTH_STATE_SCHEMA_VERSION, AUTH_STATE_SLUG_PATTERN, type AccessibilityCheck, type AccessibilityCheckOptions, AccessibilityConfigSchema, type AccessibilityViolation, type Action, type ActionCache, type ActionPlan, ActionPlanSchema, type ActionResult, AdapterLogDataSchema, AgentLogDataSchema, type AgentLoopConfig, type AgentPhase, type AgentQaConfig, AgentQaConfigSchema, type AlignOptions, type AnalyticsAgentProduct, type AnalyticsCapturePayload, type AnalyticsEventInput, type AnalyticsEventName, type AnalyticsEventProperties, type AnalyticsIdentity, type AnalyticsIdentityStore, type AnalyticsPostHogTransportFactoryOptions, AnalyticsRunReporter, type AnalyticsRunReporterOptions, type AnalyticsRuntimeContext, AnalyticsSchema, type AnalyticsService, type AnalyticsServiceConfig, type AnalyticsServiceOptions, type AnalyticsStandardPropertiesOptions, type AnalyticsSurface, type AnalyticsTransport, type AnalyticsTransportKind, type AppiumExecutableSource, type ArtifactRecord, type Asserter, AssertionEvaluator, type AssertionInput, type AssertionResult, AssertionResultSchema, type AssertionType, type AuthCredential, type AuthPluginBundle, type AuthPluginDeclaration, AuthPluginDeclarationSchema, type AuthProvider, AuthStateConfigSchema, type AuthStateMetadata, AuthStateMetadataSchema, AuthStateNameSchema, type AuthStateRedactionContext, type AuthStateTargetPlatform, AuthStateUseSchema, type AuthStore, type BaseObservation, BaseObservationSchema, type BetterSqlite3Database, type BrowserConfig, BrowserConfigSchema, type BuiltAnalyticsEvent, type BuiltAnalyticsEventProperties, CACHE_SCHEMA_VERSION, CacheConfigSchema, type CacheEntry, CacheLogDataSchema, type CaptureConfig, CaptureConfigSchema, type CaptureResult, CircuitBreaker, type CircuitBreakerConfig, type CompressOptions, type CompressResult, type ConsoleLogEntry, ConsoleReporter, type ConsoleReporterOptions, type CreateAuthFetchContext, type CreateAuthFetchOptions, type CuratorContext, CuratorResponseSchema, DEFAULT_AGENT_QA_ARTIFACTS_DIR, DEFAULT_AGENT_QA_AUTH_STATES_DIR, DEFAULT_AGENT_QA_CACHE_DIR, DEFAULT_AGENT_QA_RUNS_DB_PATH, DEFAULT_AGENT_QA_RUNTIME_DIR, DEFAULT_AGENT_QA_SCREENSHOTS_DIR, DEFAULT_AGENT_QA_VIDEOS_DIR, DEFAULT_MEMORY_DIR, type DashboardAuthMetadata, type DashboardAuthMode, DashboardConfigSchema, type DeviceConfig, DeviceProfileSchema, DurationString, EMPTY_POSTHOG_KEY_WARNING, type ElementInfo, type ExchangeCodeContext, ExplicitExtractor, type ExtractionMethod, ExtractionResultSchema, type ExtractorInput, type FarmMobileConfig, type FarmProvider, type FarmProviderConfig, type FarmWebConfig, FatalReporterError, FileActionCache, type FileAttachment, HealerLogDataSchema, type HealingAttempt, type HealingConfig, HealingConfigSchema, type HookDefinition, HookDefinitionSchema, type HookEvent, HookLogDataSchema, type HookOrchestrationResult, HookReferenceMigrationError, type HookResult, type HookResultEvent, type HookRuntime, type HooksFileConfig, HooksFileSchema, INTERNAL_ATTRIBUTE_PREFIX, IOS_ROLE_MAP, type ImageDimensions, JUnitReporter, type JUnitReporterOptions, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, KEY_MAP, LEGACY_AGENT_QA_DASHBOARD_DB_PATH, LLMAssertionEvaluator, type LLMAuthProviderPlugin, type LLMModelAdapter, LLMPlanner, type LLMProviderMode, LLMVariableExtractor, LLMVerifier, LOG_LEVEL_PRIORITY, type ListAuthStateMetadataInput, type LoadLLMAuthPluginsOptions, LocalMemoryProvider, LockManager, LogCaptureConfigSchema, type LogEntry, type LogLevel, LogManager, type LogSource, LogSourceDataSchemas, type LogStorage, LoggingConfigSchema, MOBILE_ONLY_ACTIONS, McpConfigSchema, type MemoryDelta, type MemoryDeltaAction, type MemoryIndexParams, type MemoryLog, type MemoryObservationSnapshot, type MemoryProvider, type MemoryQueryResult, MissingSecretError, type MobileAppState, MobileAppStateSchema, MobileElementResolver, type MobileNode, type MobilePlatform, type MobileRefMap, MobileSetupError, type MobileSetupErrorCategory, type MobileSetupErrorOptions, type MobileTransport, MobileUseOverrideSchema, MobileUseSchema, MockAnalyticsTransport, type ModelConfig, ModelConfigSchema, MultiReporter, NamedLLMConfigSchema, type NetworkLogEntry, NoopAnalyticsTransport, type NormalizedAuthStateUse, NullActionCache, type OAuthTokens, type ObservationFrontmatter, type ObserveOptions, type ParseError, type ParseResult, type ParsedMobileTree, type ParsedRunAttrFlags, type PlanResult, type Planner, type PlannerConfig, PlannerConfigSchema, PlannerLogDataSchema, type PlatformAdapter, type PlatformConfig, PluginsSchema, ProviderConfigSchema, type ProviderOptions, RUNTIME_IMAGE_MAP, RUN_ARTIFACT_SCHEMA_VERSION, RUN_ATTRIBUTE_KEY_MAX_LENGTH, RUN_ATTRIBUTE_VALUE_MAX_LENGTH, RecordingConfigSchema, type RegistryConfig, RegistrySchema, type RemoveAuthStateFilesInput, type RemoveAuthStateTargetInput, type Reporter, type ReporterEvent, type ResolveAnalyticsIdentityOptions, type ResolveAppiumExecutableOptions, type ResolveAuthStateForRunInput, type ResolveAuthStatePathsInput, type ResolveAuthStateRootInput, type ResolveMobileRunConfigInput, type ResolvedAppiumExecutable, type ResolvedAuthStateForRun, type ResolvedAuthStatePaths, type ResolvedLLMAuth, type ResolvedMobileApp, type ResolvedMobileAppInstall, type ResolvedMobileDevice, type ResolvedMobileRunConfig, type ResolvedWorkspaceFile, type ResolvedWorkspacePaths, type RunArtifactConfigSnapshot, type RunArtifactFinalizeInput, type RunArtifactKind, type RunArtifactMemoryDelta, type RunArtifactMemoryDeltaAction, type RunArtifactMemoryObservationSnapshot, type RunArtifactMemorySnapshot, type RunArtifactMetadata, type RunArtifactPayload, type RunArtifactReporterContext, type RunArtifactRuntimeSnapshot, type RunArtifactStageInput, type RunArtifactSuiteMemberSnapshot, type RunArtifactSuiteSourceSnapshot, type RunArtifactTerminalError, type RunArtifactTestSourceSnapshot, type RunAttributeRunner, type RunAttributeTrigger, type RunAttributes, type RunSuiteConfig, type RunSummary, type RunTestConfig, RunnerLogDataSchema, type SandboxRunnerOptions, type ScopedLogger, type ScreenState, type ScreenStateMetadata, SecretConfigError, type SecretFileMetadata, SecretRedactor, SecretStore, type SecretTemplate, type ServicesConfig, ServicesSchema, SizeString, type StartAuthContext, type StartAuthResult, StdoutLiveReporter, type StepAnnotation, type StepContext, type StepHashInputs, type StepPhaseEvent, type StepResult, type StepStatus, type StepTrace, type SuiteDefinition, SuiteDefinitionSchema, type SuiteObservation, type SuiteObservationFrontmatter, SuiteObservationSchema, type SuiteResult, type SuiteSummary, SuiteTestEntrySchema, TargetNameSchema, TargetSchema, type TestConfig, type TestDefinition, TestDefinitionSchema, type TestMeta, TestMetaSchema, type TestResult, type TestStatus, type TestStep, TestStepSchema, type TimeoutConfig, TimeoutConfigSchema, type TokenRefreshFn, type TokenUsage, type ToolCategory, type ToolDefinition, ToolRegistry, TransportSchema, type UseConfig, UseSchema, VALID_FILENAME_RE, type ValidationDiagnostic, type ValidationResult, type VariableExtractor, type VariableSource, VariableStore, type VerificationResult, VerificationResultSchema, type Verifier, type VerifyResult, WEB_ONLY_ACTIONS, type WorkspaceConfig, type WorkspaceFileKind, type WorkspaceFileRecord, WorkspaceSchema, type WriteAuthStateFilesInput, alignToWindow, applyWorkspaceHookReferenceMigration, auditWorkspaceHookReferenceMigration, browserstackProvider, buildAnalyticsEvent, buildAssertionPrompt, buildAuthStateHookEnv, buildExtractionPrompt, buildInternalRunAttributes, buildMemoryIndex, buildStepPrompt, buildSystemPrompt, buildTools, buildVerificationPrompt, captureAnalytics, captureFailureScreenshot, checkDockerAvailable, clearLLMAuthProviderPlugins, clearLoadedLLMAuthPluginModules, collectAllInjectedIds, compressScreenshot, computeFingerPositions, computePinch, computeSwipe, convertKeysForPlatform, createAnalyticsRunReporter, createAnalyticsService, createAsserter, createAuthFetch, createBetterSqlite3Database, createExtractor, createMemoryProvider, createModel, createWrappedModel, defaultRegistry, deprecateOnFailure, detectGlobOverlap, detectPlaywrightVersion, discoverWorkspaceFiles, ensureMemoryDirs, escapeXml, estimateTokens, executeStep, findBareVariables, findSecretTemplates, findUnresolvedTemplates, flushAnalytics, formatAppiumInstallGuidance, formatDiagnostics, formatDiagnosticsPlain, formatLogEntry, formatParseError, formatRunAttributesBlock, generateAnalyticsUserId, generateFailureSummary, generatePKCE, generateRunId, generateState, getAgentQaVersion, getAnalyticsIdentityPath, getAnalyticsService, getAuthPath, getCredential, getImageDimensions, getLLMAuthProviderPlugin, getProvider, getProviderOptions, hashScreenState, hashStepInstruction, interpolateSecretTemplates, interpolateVariables, isBetterSqlite3AbiMismatch, isBetterSqlite3NativeModuleError, isBetterSqlite3NodeGypSymlinkConflict, isMacPlatform, isPathInsideDir, isReservedAuthStateHookEnvKey, isWorkspacePathMatch, listAuthStateMetadata, listLLMAuthProviderPlugins, listObservations, listProviders, loadLLMAuthPlugins, localAppiumBinaryNames, mapMobileCapabilities, mapWebCapabilities, mergeRunAttributes, normalizeAuthStateUse, normalizeRole, parseAllTests, parseEnvFile, parseHookInline, parseHooksFile, parseMobileSource, parseObservation, parseRunAttrFlags, parseSuiteFile, parseTTL, parseTestFile, readAnalyticsIdentity, readAuth, readAuthStateMetadata, redactAuthStateString, redactAuthStateValue, redactSecretValue, registerAllProviders, registerLLMAuthProviderPlugin, registerLLMAuthProviderPlugins, registerProvider, removeAuth, removeAuthStateFiles, removeAuthStateTarget, resetAnalyticsServiceForTests, resolveAnalyticsAgentProduct, resolveAnalyticsIdentity, resolveAnalyticsStandardProperties, resolveAppiumExecutable, resolveAuthStateForRun, resolveAuthStatePaths, resolveAuthStateRoot, resolveBetterSqliteRebuildCommand, resolveFarmCredentials, resolveFileReferences, resolveLLMAuth, resolveMemoryRoot, resolveMobileRunConfig, resolveSecretTemplatesInValue, resolveWorkspaceFileTarget, resolveWorkspacePaths, runCurator, runHookInSandbox, runHooks, runSuite, runTest, runTestWithRetry, scanContent, serializeEnvFile, shouldAblate, sortRunAttributesForDisplay, stripHookInline, stripReservedAuthStateHookEnv, toolCallToActionPlan, toolSchemaMiddleware, truncateScreenState, validateConfig, validateFilename, validateFiles, validateProject, validateSuiteFile, validateTestFile, validateTrustedRunAttributes, validateUserRunAttributes, warnIfOutOfBounds, writeAnalyticsIdentity, writeAuth, writeAuthStateFiles, writeObservation };
|
|
3716
|
+
export { AGENT_QA_POSTHOG_HOST, AGENT_QA_POSTHOG_KEY, AGENT_QA_VERSION, ANALYTICS_AGENT_PRODUCTS, ANALYTICS_DASHBOARD_ENTITY_TYPES, ANALYTICS_DASHBOARD_OUTCOMES, ANALYTICS_EVENT_NAMES, ANALYTICS_FAILURE_CATEGORIES, ANALYTICS_MCP_ERROR_CATEGORIES, ANALYTICS_MCP_HOST_KINDS, ANALYTICS_MCP_PATH_KINDS, ANALYTICS_MCP_PORT_KINDS, ANALYTICS_MCP_SERVER_STATES, ANALYTICS_MCP_TOOL_CATEGORIES, ANALYTICS_MCP_TOOL_STATUSES, ANALYTICS_MCP_TRANSPORTS, ANALYTICS_PLATFORMS, ANALYTICS_RUNNERS, ANALYTICS_RUNTIME_CONTEXTS, ANALYTICS_RUN_STATUSES, ANALYTICS_SUITE_EXECUTION_MODES, ANALYTICS_SURFACES, ANALYTICS_TRANSPORT_KINDS, ANALYTICS_TRIGGER_SOURCES, ANDROID_ROLE_MAP, ATTR_RUNNER, ATTR_TRIGGER, AUTH_STATE_HOOK_CONTAINER_STORAGE_STATE_PATH, AUTH_STATE_HOOK_JSON_ENV, AUTH_STATE_HOOK_STORAGE_STATE_FILENAME, AUTH_STATE_HOOK_STORAGE_STATE_PATH_ENV, AUTH_STATE_HOOK_WORKSPACE_DIR, AUTH_STATE_REDACTION_MARKER, AUTH_STATE_SCHEMA_VERSION, AUTH_STATE_SLUG_PATTERN, type AccessibilityCheck, type AccessibilityCheckOptions, AccessibilityConfigSchema, type AccessibilityViolation, type Action, type ActionCache, type ActionPlan, ActionPlanSchema, type ActionResult, AdapterLogDataSchema, AgentLogDataSchema, type AgentLoopConfig, type AgentPhase, type AgentQaConfig, AgentQaConfigSchema, type AgentQaUpdateStatus, type AlignOptions, type AnalyticsAgentProduct, type AnalyticsCapturePayload, type AnalyticsEventInput, type AnalyticsEventName, type AnalyticsEventProperties, type AnalyticsIdentity, type AnalyticsIdentityStore, type AnalyticsPostHogTransportFactoryOptions, AnalyticsRunReporter, type AnalyticsRunReporterOptions, type AnalyticsRuntimeContext, AnalyticsSchema, type AnalyticsService, type AnalyticsServiceConfig, type AnalyticsServiceOptions, type AnalyticsStandardPropertiesOptions, type AnalyticsSurface, type AnalyticsTransport, type AnalyticsTransportKind, type AppiumExecutableSource, type ArtifactRecord, type Asserter, AssertionEvaluator, type AssertionInput, type AssertionResult, AssertionResultSchema, type AssertionType, type AuthCredential, type AuthPluginBundle, type AuthPluginDeclaration, AuthPluginDeclarationSchema, type AuthProvider, AuthStateConfigSchema, type AuthStateMetadata, AuthStateMetadataSchema, AuthStateNameSchema, type AuthStateRedactionContext, type AuthStateTargetPlatform, AuthStateUseSchema, type AuthStore, type BaseObservation, BaseObservationSchema, type BetterSqlite3Database, type BrowserConfig, BrowserConfigSchema, type BuiltAnalyticsEvent, type BuiltAnalyticsEventProperties, CACHE_SCHEMA_VERSION, CacheConfigSchema, type CacheEntry, CacheLogDataSchema, type CaptureConfig, CaptureConfigSchema, type CaptureResult, CircuitBreaker, type CircuitBreakerConfig, type CompressOptions, type CompressResult, type ConsoleLogEntry, ConsoleReporter, type ConsoleReporterOptions, type CreateAuthFetchContext, type CreateAuthFetchOptions, type CuratorContext, CuratorResponseSchema, DEFAULT_AGENT_QA_ARTIFACTS_DIR, DEFAULT_AGENT_QA_AUTH_STATES_DIR, DEFAULT_AGENT_QA_CACHE_DIR, DEFAULT_AGENT_QA_RUNS_DB_PATH, DEFAULT_AGENT_QA_RUNTIME_DIR, DEFAULT_AGENT_QA_SCREENSHOTS_DIR, DEFAULT_AGENT_QA_VIDEOS_DIR, DEFAULT_MEMORY_DIR, type DashboardAuthMetadata, type DashboardAuthMode, DashboardConfigSchema, type DeviceConfig, DeviceProfileSchema, DurationString, EMPTY_POSTHOG_KEY_WARNING, type ElementInfo, type ExchangeCodeContext, ExplicitExtractor, type ExtractionMethod, ExtractionResultSchema, type ExtractorInput, type FarmMobileConfig, type FarmProvider, type FarmProviderConfig, type FarmWebConfig, FatalReporterError, FileActionCache, type FileAttachment, HealerLogDataSchema, type HealingAttempt, type HealingConfig, HealingConfigSchema, type HookDefinition, HookDefinitionSchema, type HookEvent, HookLogDataSchema, type HookOrchestrationResult, HookReferenceMigrationError, type HookResult, type HookResultEvent, type HookRuntime, type HooksFileConfig, HooksFileSchema, INTERNAL_ATTRIBUTE_PREFIX, IOS_ROLE_MAP, type ImageDimensions, JUnitReporter, type JUnitReporterOptions, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, KEY_MAP, LEGACY_AGENT_QA_DASHBOARD_DB_PATH, LLMAssertionEvaluator, type LLMAuthProviderPlugin, type LLMModelAdapter, LLMPlanner, type LLMProviderMode, LLMVariableExtractor, LLMVerifier, LOG_LEVEL_PRIORITY, type ListAuthStateMetadataInput, type LoadLLMAuthPluginsOptions, LocalMemoryProvider, LockManager, LogCaptureConfigSchema, type LogEntry, type LogLevel, LogManager, type LogSource, LogSourceDataSchemas, type LogStorage, LoggingConfigSchema, MOBILE_ONLY_ACTIONS, McpConfigSchema, type MemoryDelta, type MemoryDeltaAction, type MemoryIndexParams, type MemoryLog, type MemoryObservationSnapshot, type MemoryProvider, type MemoryQueryResult, MissingSecretError, type MobileAppState, MobileAppStateSchema, MobileElementResolver, type MobileNode, type MobilePlatform, type MobileRefMap, MobileSetupError, type MobileSetupErrorCategory, type MobileSetupErrorOptions, type MobileTransport, MobileUseOverrideSchema, MobileUseSchema, MockAnalyticsTransport, type ModelConfig, ModelConfigSchema, MultiReporter, NamedLLMConfigSchema, type NetworkLogEntry, NoopAnalyticsTransport, type NormalizedAuthStateUse, NullActionCache, type OAuthTokens, type ObservationFrontmatter, type ObserveOptions, type ParseError, type ParseResult, type ParsedMobileTree, type ParsedRunAttrFlags, type PlanResult, type Planner, type PlannerConfig, PlannerConfigSchema, PlannerLogDataSchema, type PlatformAdapter, type PlatformConfig, PluginsSchema, ProviderConfigSchema, type ProviderOptions, RUNTIME_IMAGE_MAP, RUN_ARTIFACT_SCHEMA_VERSION, RUN_ATTRIBUTE_KEY_MAX_LENGTH, RUN_ATTRIBUTE_VALUE_MAX_LENGTH, RecordingConfigSchema, type RegistryConfig, RegistrySchema, type RemoveAuthStateFilesInput, type RemoveAuthStateTargetInput, type Reporter, type ReporterEvent, type ResolveAnalyticsIdentityOptions, type ResolveAppiumExecutableOptions, type ResolveAuthStateForRunInput, type ResolveAuthStatePathsInput, type ResolveAuthStateRootInput, type ResolveMobileRunConfigInput, type ResolvedAppiumExecutable, type ResolvedAuthStateForRun, type ResolvedAuthStatePaths, type ResolvedLLMAuth, type ResolvedMobileApp, type ResolvedMobileAppInstall, type ResolvedMobileDevice, type ResolvedMobileRunConfig, type ResolvedWorkspaceFile, type ResolvedWorkspacePaths, type RunArtifactConfigSnapshot, type RunArtifactFinalizeInput, type RunArtifactKind, type RunArtifactMemoryDelta, type RunArtifactMemoryDeltaAction, type RunArtifactMemoryObservationSnapshot, type RunArtifactMemorySnapshot, type RunArtifactMetadata, type RunArtifactPayload, type RunArtifactReporterContext, type RunArtifactRuntimeSnapshot, type RunArtifactStageInput, type RunArtifactSuiteMemberSnapshot, type RunArtifactSuiteSourceSnapshot, type RunArtifactTerminalError, type RunArtifactTestSourceSnapshot, type RunAttributeRunner, type RunAttributeTrigger, type RunAttributes, type RunSuiteConfig, type RunSummary, type RunTestConfig, RunnerLogDataSchema, type SandboxRunnerOptions, type ScopedLogger, type ScreenState, type ScreenStateMetadata, SecretConfigError, type SecretFileMetadata, SecretRedactor, SecretStore, type SecretTemplate, type ServicesConfig, ServicesSchema, SizeString, type StartAuthContext, type StartAuthResult, StdoutLiveReporter, type StepAnnotation, type StepContext, type StepHashInputs, type StepPhaseEvent, type StepResult, type StepStatus, type StepTrace, type SuiteDefinition, SuiteDefinitionSchema, type SuiteObservation, type SuiteObservationFrontmatter, SuiteObservationSchema, type SuiteResult, type SuiteSummary, SuiteTestEntrySchema, TargetNameSchema, TargetSchema, type TestConfig, type TestDefinition, TestDefinitionSchema, type TestMeta, TestMetaSchema, type TestResult, type TestStatus, type TestStep, TestStepSchema, type TimeoutConfig, TimeoutConfigSchema, type TokenRefreshFn, type TokenUsage, type ToolCategory, type ToolDefinition, ToolRegistry, TransportSchema, type UseConfig, UseSchema, VALID_FILENAME_RE, VERSION_CHECK_CACHE_TTL_MS, VERSION_CHECK_TIMEOUT_MS, type ValidationDiagnostic, type ValidationResult, type VariableExtractor, type VariableSource, VariableStore, type VerificationResult, VerificationResultSchema, type Verifier, type VerifyResult, type VersionCheckOptions, WEB_ONLY_ACTIONS, type WorkspaceConfig, type WorkspaceFileKind, type WorkspaceFileRecord, WorkspaceSchema, type WriteAuthStateFilesInput, alignToWindow, applyWorkspaceHookReferenceMigration, auditWorkspaceHookReferenceMigration, browserstackProvider, buildAnalyticsEvent, buildAssertionPrompt, buildAuthStateHookEnv, buildExtractionPrompt, buildInternalRunAttributes, buildMemoryIndex, buildStepPrompt, buildSystemPrompt, buildTools, buildVerificationPrompt, captureAnalytics, captureFailureScreenshot, checkDockerAvailable, clearLLMAuthProviderPlugins, clearLoadedLLMAuthPluginModules, collectAllInjectedIds, compressScreenshot, computeFingerPositions, computePinch, computeSwipe, convertKeysForPlatform, createAnalyticsRunReporter, createAnalyticsService, createAsserter, createAuthFetch, createBetterSqlite3Database, createExtractor, createMemoryProvider, createModel, createWrappedModel, defaultRegistry, deprecateOnFailure, detectGlobOverlap, detectPlaywrightVersion, discoverWorkspaceFiles, ensureMemoryDirs, escapeXml, estimateTokens, executeStep, findBareVariables, findSecretTemplates, findUnresolvedTemplates, flushAnalytics, formatAppiumInstallGuidance, formatDiagnostics, formatDiagnosticsPlain, formatLogEntry, formatParseError, formatRunAttributesBlock, generateAnalyticsUserId, generateFailureSummary, generatePKCE, generateRunId, generateState, getAgentQaUpdateStatus, getAgentQaVersion, getAgentQaVersionCheckCachePath, getAnalyticsIdentityPath, getAnalyticsService, getAuthPath, getCredential, getImageDimensions, getLLMAuthProviderPlugin, getProvider, getProviderOptions, hashScreenState, hashStepInstruction, interpolateSecretTemplates, interpolateVariables, isBetterSqlite3AbiMismatch, isBetterSqlite3NativeModuleError, isBetterSqlite3NodeGypSymlinkConflict, isMacPlatform, isPathInsideDir, isReservedAuthStateHookEnvKey, isWorkspacePathMatch, listAuthStateMetadata, listLLMAuthProviderPlugins, listObservations, listProviders, loadLLMAuthPlugins, localAppiumBinaryNames, mapMobileCapabilities, mapWebCapabilities, mergeRunAttributes, normalizeAuthStateUse, normalizeRole, parseAllTests, parseEnvFile, parseHookInline, parseHooksFile, parseMobileSource, parseObservation, parseRunAttrFlags, parseSuiteFile, parseTTL, parseTestFile, readAnalyticsIdentity, readAuth, readAuthStateMetadata, redactAuthStateString, redactAuthStateValue, redactSecretValue, registerAllProviders, registerLLMAuthProviderPlugin, registerLLMAuthProviderPlugins, registerProvider, removeAuth, removeAuthStateFiles, removeAuthStateTarget, resetAnalyticsServiceForTests, resolveAnalyticsAgentProduct, resolveAnalyticsIdentity, resolveAnalyticsStandardProperties, resolveAppiumExecutable, resolveAuthStateForRun, resolveAuthStatePaths, resolveAuthStateRoot, resolveBetterSqliteRebuildCommand, resolveFarmCredentials, resolveFileReferences, resolveLLMAuth, resolveMemoryRoot, resolveMobileRunConfig, resolveSecretTemplatesInValue, resolveWorkspaceFileTarget, resolveWorkspacePaths, runCurator, runHookInSandbox, runHooks, runSuite, runTest, runTestWithRetry, scanContent, serializeEnvFile, shouldAblate, sortRunAttributesForDisplay, stripHookInline, stripReservedAuthStateHookEnv, toolCallToActionPlan, toolSchemaMiddleware, truncateScreenState, validateConfig, validateFilename, validateFiles, validateProject, validateSuiteFile, validateTestFile, validateTrustedRunAttributes, validateUserRunAttributes, warnIfOutOfBounds, writeAnalyticsIdentity, writeAuth, writeAuthStateFiles, writeObservation };
|
package/dist/index.d.ts
CHANGED
|
@@ -2115,6 +2115,7 @@ interface StepEventContext {
|
|
|
2115
2115
|
runId?: string;
|
|
2116
2116
|
parentRunId?: string | null;
|
|
2117
2117
|
suiteIndex?: number;
|
|
2118
|
+
suiteTotal?: number;
|
|
2118
2119
|
testIndex?: number;
|
|
2119
2120
|
stepIndex?: number;
|
|
2120
2121
|
stepId?: string;
|
|
@@ -2487,6 +2488,7 @@ declare class StdoutLiveReporter implements Reporter {
|
|
|
2487
2488
|
private activeRunId;
|
|
2488
2489
|
private activeParentRunId;
|
|
2489
2490
|
private activeSuiteIndex;
|
|
2491
|
+
private activeSuiteTotal;
|
|
2490
2492
|
private redactor?;
|
|
2491
2493
|
constructor(options?: StdoutLiveReporterOptions);
|
|
2492
2494
|
private emit;
|
|
@@ -3630,6 +3632,26 @@ declare function createAnalyticsRunReporter(options?: AnalyticsRunReporterOption
|
|
|
3630
3632
|
declare const AGENT_QA_VERSION: string;
|
|
3631
3633
|
declare function getAgentQaVersion(): string;
|
|
3632
3634
|
|
|
3635
|
+
declare const VERSION_CHECK_CACHE_TTL_MS: number;
|
|
3636
|
+
declare const VERSION_CHECK_TIMEOUT_MS = 5000;
|
|
3637
|
+
interface AgentQaUpdateStatus {
|
|
3638
|
+
installedVersion: string;
|
|
3639
|
+
latestVersion?: string;
|
|
3640
|
+
updateAvailable: boolean;
|
|
3641
|
+
checkedAt?: string;
|
|
3642
|
+
}
|
|
3643
|
+
type VersionCheckFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
3644
|
+
interface VersionCheckOptions {
|
|
3645
|
+
cachePath?: string;
|
|
3646
|
+
fetchImpl?: VersionCheckFetch;
|
|
3647
|
+
now?: () => Date;
|
|
3648
|
+
timeoutMs?: number;
|
|
3649
|
+
cacheTtlMs?: number;
|
|
3650
|
+
homeDir?: string;
|
|
3651
|
+
}
|
|
3652
|
+
declare function getAgentQaVersionCheckCachePath(homeDir?: string): string;
|
|
3653
|
+
declare function getAgentQaUpdateStatus(options?: VersionCheckOptions): Promise<AgentQaUpdateStatus>;
|
|
3654
|
+
|
|
3633
3655
|
declare const DEFAULT_AGENT_QA_RUNTIME_DIR = ".agent-qa";
|
|
3634
3656
|
declare const DEFAULT_AGENT_QA_ARTIFACTS_DIR = ".agent-qa/artifacts";
|
|
3635
3657
|
declare const DEFAULT_AGENT_QA_CACHE_DIR = ".agent-qa/cache";
|
|
@@ -3691,4 +3713,4 @@ declare function isMacPlatform(): boolean;
|
|
|
3691
3713
|
|
|
3692
3714
|
declare function isPathInsideDir(childPath: string, parentDir: string): boolean;
|
|
3693
3715
|
|
|
3694
|
-
export { AGENT_QA_POSTHOG_HOST, AGENT_QA_POSTHOG_KEY, AGENT_QA_VERSION, ANALYTICS_AGENT_PRODUCTS, ANALYTICS_DASHBOARD_ENTITY_TYPES, ANALYTICS_DASHBOARD_OUTCOMES, ANALYTICS_EVENT_NAMES, ANALYTICS_FAILURE_CATEGORIES, ANALYTICS_MCP_ERROR_CATEGORIES, ANALYTICS_MCP_HOST_KINDS, ANALYTICS_MCP_PATH_KINDS, ANALYTICS_MCP_PORT_KINDS, ANALYTICS_MCP_SERVER_STATES, ANALYTICS_MCP_TOOL_CATEGORIES, ANALYTICS_MCP_TOOL_STATUSES, ANALYTICS_MCP_TRANSPORTS, ANALYTICS_PLATFORMS, ANALYTICS_RUNNERS, ANALYTICS_RUNTIME_CONTEXTS, ANALYTICS_RUN_STATUSES, ANALYTICS_SUITE_EXECUTION_MODES, ANALYTICS_SURFACES, ANALYTICS_TRANSPORT_KINDS, ANALYTICS_TRIGGER_SOURCES, ANDROID_ROLE_MAP, ATTR_RUNNER, ATTR_TRIGGER, AUTH_STATE_HOOK_CONTAINER_STORAGE_STATE_PATH, AUTH_STATE_HOOK_JSON_ENV, AUTH_STATE_HOOK_STORAGE_STATE_FILENAME, AUTH_STATE_HOOK_STORAGE_STATE_PATH_ENV, AUTH_STATE_HOOK_WORKSPACE_DIR, AUTH_STATE_REDACTION_MARKER, AUTH_STATE_SCHEMA_VERSION, AUTH_STATE_SLUG_PATTERN, type AccessibilityCheck, type AccessibilityCheckOptions, AccessibilityConfigSchema, type AccessibilityViolation, type Action, type ActionCache, type ActionPlan, ActionPlanSchema, type ActionResult, AdapterLogDataSchema, AgentLogDataSchema, type AgentLoopConfig, type AgentPhase, type AgentQaConfig, AgentQaConfigSchema, type AlignOptions, type AnalyticsAgentProduct, type AnalyticsCapturePayload, type AnalyticsEventInput, type AnalyticsEventName, type AnalyticsEventProperties, type AnalyticsIdentity, type AnalyticsIdentityStore, type AnalyticsPostHogTransportFactoryOptions, AnalyticsRunReporter, type AnalyticsRunReporterOptions, type AnalyticsRuntimeContext, AnalyticsSchema, type AnalyticsService, type AnalyticsServiceConfig, type AnalyticsServiceOptions, type AnalyticsStandardPropertiesOptions, type AnalyticsSurface, type AnalyticsTransport, type AnalyticsTransportKind, type AppiumExecutableSource, type ArtifactRecord, type Asserter, AssertionEvaluator, type AssertionInput, type AssertionResult, AssertionResultSchema, type AssertionType, type AuthCredential, type AuthPluginBundle, type AuthPluginDeclaration, AuthPluginDeclarationSchema, type AuthProvider, AuthStateConfigSchema, type AuthStateMetadata, AuthStateMetadataSchema, AuthStateNameSchema, type AuthStateRedactionContext, type AuthStateTargetPlatform, AuthStateUseSchema, type AuthStore, type BaseObservation, BaseObservationSchema, type BetterSqlite3Database, type BrowserConfig, BrowserConfigSchema, type BuiltAnalyticsEvent, type BuiltAnalyticsEventProperties, CACHE_SCHEMA_VERSION, CacheConfigSchema, type CacheEntry, CacheLogDataSchema, type CaptureConfig, CaptureConfigSchema, type CaptureResult, CircuitBreaker, type CircuitBreakerConfig, type CompressOptions, type CompressResult, type ConsoleLogEntry, ConsoleReporter, type ConsoleReporterOptions, type CreateAuthFetchContext, type CreateAuthFetchOptions, type CuratorContext, CuratorResponseSchema, DEFAULT_AGENT_QA_ARTIFACTS_DIR, DEFAULT_AGENT_QA_AUTH_STATES_DIR, DEFAULT_AGENT_QA_CACHE_DIR, DEFAULT_AGENT_QA_RUNS_DB_PATH, DEFAULT_AGENT_QA_RUNTIME_DIR, DEFAULT_AGENT_QA_SCREENSHOTS_DIR, DEFAULT_AGENT_QA_VIDEOS_DIR, DEFAULT_MEMORY_DIR, type DashboardAuthMetadata, type DashboardAuthMode, DashboardConfigSchema, type DeviceConfig, DeviceProfileSchema, DurationString, EMPTY_POSTHOG_KEY_WARNING, type ElementInfo, type ExchangeCodeContext, ExplicitExtractor, type ExtractionMethod, ExtractionResultSchema, type ExtractorInput, type FarmMobileConfig, type FarmProvider, type FarmProviderConfig, type FarmWebConfig, FatalReporterError, FileActionCache, type FileAttachment, HealerLogDataSchema, type HealingAttempt, type HealingConfig, HealingConfigSchema, type HookDefinition, HookDefinitionSchema, type HookEvent, HookLogDataSchema, type HookOrchestrationResult, HookReferenceMigrationError, type HookResult, type HookResultEvent, type HookRuntime, type HooksFileConfig, HooksFileSchema, INTERNAL_ATTRIBUTE_PREFIX, IOS_ROLE_MAP, type ImageDimensions, JUnitReporter, type JUnitReporterOptions, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, KEY_MAP, LEGACY_AGENT_QA_DASHBOARD_DB_PATH, LLMAssertionEvaluator, type LLMAuthProviderPlugin, type LLMModelAdapter, LLMPlanner, type LLMProviderMode, LLMVariableExtractor, LLMVerifier, LOG_LEVEL_PRIORITY, type ListAuthStateMetadataInput, type LoadLLMAuthPluginsOptions, LocalMemoryProvider, LockManager, LogCaptureConfigSchema, type LogEntry, type LogLevel, LogManager, type LogSource, LogSourceDataSchemas, type LogStorage, LoggingConfigSchema, MOBILE_ONLY_ACTIONS, McpConfigSchema, type MemoryDelta, type MemoryDeltaAction, type MemoryIndexParams, type MemoryLog, type MemoryObservationSnapshot, type MemoryProvider, type MemoryQueryResult, MissingSecretError, type MobileAppState, MobileAppStateSchema, MobileElementResolver, type MobileNode, type MobilePlatform, type MobileRefMap, MobileSetupError, type MobileSetupErrorCategory, type MobileSetupErrorOptions, type MobileTransport, MobileUseOverrideSchema, MobileUseSchema, MockAnalyticsTransport, type ModelConfig, ModelConfigSchema, MultiReporter, NamedLLMConfigSchema, type NetworkLogEntry, NoopAnalyticsTransport, type NormalizedAuthStateUse, NullActionCache, type OAuthTokens, type ObservationFrontmatter, type ObserveOptions, type ParseError, type ParseResult, type ParsedMobileTree, type ParsedRunAttrFlags, type PlanResult, type Planner, type PlannerConfig, PlannerConfigSchema, PlannerLogDataSchema, type PlatformAdapter, type PlatformConfig, PluginsSchema, ProviderConfigSchema, type ProviderOptions, RUNTIME_IMAGE_MAP, RUN_ARTIFACT_SCHEMA_VERSION, RUN_ATTRIBUTE_KEY_MAX_LENGTH, RUN_ATTRIBUTE_VALUE_MAX_LENGTH, RecordingConfigSchema, type RegistryConfig, RegistrySchema, type RemoveAuthStateFilesInput, type RemoveAuthStateTargetInput, type Reporter, type ReporterEvent, type ResolveAnalyticsIdentityOptions, type ResolveAppiumExecutableOptions, type ResolveAuthStateForRunInput, type ResolveAuthStatePathsInput, type ResolveAuthStateRootInput, type ResolveMobileRunConfigInput, type ResolvedAppiumExecutable, type ResolvedAuthStateForRun, type ResolvedAuthStatePaths, type ResolvedLLMAuth, type ResolvedMobileApp, type ResolvedMobileAppInstall, type ResolvedMobileDevice, type ResolvedMobileRunConfig, type ResolvedWorkspaceFile, type ResolvedWorkspacePaths, type RunArtifactConfigSnapshot, type RunArtifactFinalizeInput, type RunArtifactKind, type RunArtifactMemoryDelta, type RunArtifactMemoryDeltaAction, type RunArtifactMemoryObservationSnapshot, type RunArtifactMemorySnapshot, type RunArtifactMetadata, type RunArtifactPayload, type RunArtifactReporterContext, type RunArtifactRuntimeSnapshot, type RunArtifactStageInput, type RunArtifactSuiteMemberSnapshot, type RunArtifactSuiteSourceSnapshot, type RunArtifactTerminalError, type RunArtifactTestSourceSnapshot, type RunAttributeRunner, type RunAttributeTrigger, type RunAttributes, type RunSuiteConfig, type RunSummary, type RunTestConfig, RunnerLogDataSchema, type SandboxRunnerOptions, type ScopedLogger, type ScreenState, type ScreenStateMetadata, SecretConfigError, type SecretFileMetadata, SecretRedactor, SecretStore, type SecretTemplate, type ServicesConfig, ServicesSchema, SizeString, type StartAuthContext, type StartAuthResult, StdoutLiveReporter, type StepAnnotation, type StepContext, type StepHashInputs, type StepPhaseEvent, type StepResult, type StepStatus, type StepTrace, type SuiteDefinition, SuiteDefinitionSchema, type SuiteObservation, type SuiteObservationFrontmatter, SuiteObservationSchema, type SuiteResult, type SuiteSummary, SuiteTestEntrySchema, TargetNameSchema, TargetSchema, type TestConfig, type TestDefinition, TestDefinitionSchema, type TestMeta, TestMetaSchema, type TestResult, type TestStatus, type TestStep, TestStepSchema, type TimeoutConfig, TimeoutConfigSchema, type TokenRefreshFn, type TokenUsage, type ToolCategory, type ToolDefinition, ToolRegistry, TransportSchema, type UseConfig, UseSchema, VALID_FILENAME_RE, type ValidationDiagnostic, type ValidationResult, type VariableExtractor, type VariableSource, VariableStore, type VerificationResult, VerificationResultSchema, type Verifier, type VerifyResult, WEB_ONLY_ACTIONS, type WorkspaceConfig, type WorkspaceFileKind, type WorkspaceFileRecord, WorkspaceSchema, type WriteAuthStateFilesInput, alignToWindow, applyWorkspaceHookReferenceMigration, auditWorkspaceHookReferenceMigration, browserstackProvider, buildAnalyticsEvent, buildAssertionPrompt, buildAuthStateHookEnv, buildExtractionPrompt, buildInternalRunAttributes, buildMemoryIndex, buildStepPrompt, buildSystemPrompt, buildTools, buildVerificationPrompt, captureAnalytics, captureFailureScreenshot, checkDockerAvailable, clearLLMAuthProviderPlugins, clearLoadedLLMAuthPluginModules, collectAllInjectedIds, compressScreenshot, computeFingerPositions, computePinch, computeSwipe, convertKeysForPlatform, createAnalyticsRunReporter, createAnalyticsService, createAsserter, createAuthFetch, createBetterSqlite3Database, createExtractor, createMemoryProvider, createModel, createWrappedModel, defaultRegistry, deprecateOnFailure, detectGlobOverlap, detectPlaywrightVersion, discoverWorkspaceFiles, ensureMemoryDirs, escapeXml, estimateTokens, executeStep, findBareVariables, findSecretTemplates, findUnresolvedTemplates, flushAnalytics, formatAppiumInstallGuidance, formatDiagnostics, formatDiagnosticsPlain, formatLogEntry, formatParseError, formatRunAttributesBlock, generateAnalyticsUserId, generateFailureSummary, generatePKCE, generateRunId, generateState, getAgentQaVersion, getAnalyticsIdentityPath, getAnalyticsService, getAuthPath, getCredential, getImageDimensions, getLLMAuthProviderPlugin, getProvider, getProviderOptions, hashScreenState, hashStepInstruction, interpolateSecretTemplates, interpolateVariables, isBetterSqlite3AbiMismatch, isBetterSqlite3NativeModuleError, isBetterSqlite3NodeGypSymlinkConflict, isMacPlatform, isPathInsideDir, isReservedAuthStateHookEnvKey, isWorkspacePathMatch, listAuthStateMetadata, listLLMAuthProviderPlugins, listObservations, listProviders, loadLLMAuthPlugins, localAppiumBinaryNames, mapMobileCapabilities, mapWebCapabilities, mergeRunAttributes, normalizeAuthStateUse, normalizeRole, parseAllTests, parseEnvFile, parseHookInline, parseHooksFile, parseMobileSource, parseObservation, parseRunAttrFlags, parseSuiteFile, parseTTL, parseTestFile, readAnalyticsIdentity, readAuth, readAuthStateMetadata, redactAuthStateString, redactAuthStateValue, redactSecretValue, registerAllProviders, registerLLMAuthProviderPlugin, registerLLMAuthProviderPlugins, registerProvider, removeAuth, removeAuthStateFiles, removeAuthStateTarget, resetAnalyticsServiceForTests, resolveAnalyticsAgentProduct, resolveAnalyticsIdentity, resolveAnalyticsStandardProperties, resolveAppiumExecutable, resolveAuthStateForRun, resolveAuthStatePaths, resolveAuthStateRoot, resolveBetterSqliteRebuildCommand, resolveFarmCredentials, resolveFileReferences, resolveLLMAuth, resolveMemoryRoot, resolveMobileRunConfig, resolveSecretTemplatesInValue, resolveWorkspaceFileTarget, resolveWorkspacePaths, runCurator, runHookInSandbox, runHooks, runSuite, runTest, runTestWithRetry, scanContent, serializeEnvFile, shouldAblate, sortRunAttributesForDisplay, stripHookInline, stripReservedAuthStateHookEnv, toolCallToActionPlan, toolSchemaMiddleware, truncateScreenState, validateConfig, validateFilename, validateFiles, validateProject, validateSuiteFile, validateTestFile, validateTrustedRunAttributes, validateUserRunAttributes, warnIfOutOfBounds, writeAnalyticsIdentity, writeAuth, writeAuthStateFiles, writeObservation };
|
|
3716
|
+
export { AGENT_QA_POSTHOG_HOST, AGENT_QA_POSTHOG_KEY, AGENT_QA_VERSION, ANALYTICS_AGENT_PRODUCTS, ANALYTICS_DASHBOARD_ENTITY_TYPES, ANALYTICS_DASHBOARD_OUTCOMES, ANALYTICS_EVENT_NAMES, ANALYTICS_FAILURE_CATEGORIES, ANALYTICS_MCP_ERROR_CATEGORIES, ANALYTICS_MCP_HOST_KINDS, ANALYTICS_MCP_PATH_KINDS, ANALYTICS_MCP_PORT_KINDS, ANALYTICS_MCP_SERVER_STATES, ANALYTICS_MCP_TOOL_CATEGORIES, ANALYTICS_MCP_TOOL_STATUSES, ANALYTICS_MCP_TRANSPORTS, ANALYTICS_PLATFORMS, ANALYTICS_RUNNERS, ANALYTICS_RUNTIME_CONTEXTS, ANALYTICS_RUN_STATUSES, ANALYTICS_SUITE_EXECUTION_MODES, ANALYTICS_SURFACES, ANALYTICS_TRANSPORT_KINDS, ANALYTICS_TRIGGER_SOURCES, ANDROID_ROLE_MAP, ATTR_RUNNER, ATTR_TRIGGER, AUTH_STATE_HOOK_CONTAINER_STORAGE_STATE_PATH, AUTH_STATE_HOOK_JSON_ENV, AUTH_STATE_HOOK_STORAGE_STATE_FILENAME, AUTH_STATE_HOOK_STORAGE_STATE_PATH_ENV, AUTH_STATE_HOOK_WORKSPACE_DIR, AUTH_STATE_REDACTION_MARKER, AUTH_STATE_SCHEMA_VERSION, AUTH_STATE_SLUG_PATTERN, type AccessibilityCheck, type AccessibilityCheckOptions, AccessibilityConfigSchema, type AccessibilityViolation, type Action, type ActionCache, type ActionPlan, ActionPlanSchema, type ActionResult, AdapterLogDataSchema, AgentLogDataSchema, type AgentLoopConfig, type AgentPhase, type AgentQaConfig, AgentQaConfigSchema, type AgentQaUpdateStatus, type AlignOptions, type AnalyticsAgentProduct, type AnalyticsCapturePayload, type AnalyticsEventInput, type AnalyticsEventName, type AnalyticsEventProperties, type AnalyticsIdentity, type AnalyticsIdentityStore, type AnalyticsPostHogTransportFactoryOptions, AnalyticsRunReporter, type AnalyticsRunReporterOptions, type AnalyticsRuntimeContext, AnalyticsSchema, type AnalyticsService, type AnalyticsServiceConfig, type AnalyticsServiceOptions, type AnalyticsStandardPropertiesOptions, type AnalyticsSurface, type AnalyticsTransport, type AnalyticsTransportKind, type AppiumExecutableSource, type ArtifactRecord, type Asserter, AssertionEvaluator, type AssertionInput, type AssertionResult, AssertionResultSchema, type AssertionType, type AuthCredential, type AuthPluginBundle, type AuthPluginDeclaration, AuthPluginDeclarationSchema, type AuthProvider, AuthStateConfigSchema, type AuthStateMetadata, AuthStateMetadataSchema, AuthStateNameSchema, type AuthStateRedactionContext, type AuthStateTargetPlatform, AuthStateUseSchema, type AuthStore, type BaseObservation, BaseObservationSchema, type BetterSqlite3Database, type BrowserConfig, BrowserConfigSchema, type BuiltAnalyticsEvent, type BuiltAnalyticsEventProperties, CACHE_SCHEMA_VERSION, CacheConfigSchema, type CacheEntry, CacheLogDataSchema, type CaptureConfig, CaptureConfigSchema, type CaptureResult, CircuitBreaker, type CircuitBreakerConfig, type CompressOptions, type CompressResult, type ConsoleLogEntry, ConsoleReporter, type ConsoleReporterOptions, type CreateAuthFetchContext, type CreateAuthFetchOptions, type CuratorContext, CuratorResponseSchema, DEFAULT_AGENT_QA_ARTIFACTS_DIR, DEFAULT_AGENT_QA_AUTH_STATES_DIR, DEFAULT_AGENT_QA_CACHE_DIR, DEFAULT_AGENT_QA_RUNS_DB_PATH, DEFAULT_AGENT_QA_RUNTIME_DIR, DEFAULT_AGENT_QA_SCREENSHOTS_DIR, DEFAULT_AGENT_QA_VIDEOS_DIR, DEFAULT_MEMORY_DIR, type DashboardAuthMetadata, type DashboardAuthMode, DashboardConfigSchema, type DeviceConfig, DeviceProfileSchema, DurationString, EMPTY_POSTHOG_KEY_WARNING, type ElementInfo, type ExchangeCodeContext, ExplicitExtractor, type ExtractionMethod, ExtractionResultSchema, type ExtractorInput, type FarmMobileConfig, type FarmProvider, type FarmProviderConfig, type FarmWebConfig, FatalReporterError, FileActionCache, type FileAttachment, HealerLogDataSchema, type HealingAttempt, type HealingConfig, HealingConfigSchema, type HookDefinition, HookDefinitionSchema, type HookEvent, HookLogDataSchema, type HookOrchestrationResult, HookReferenceMigrationError, type HookResult, type HookResultEvent, type HookRuntime, type HooksFileConfig, HooksFileSchema, INTERNAL_ATTRIBUTE_PREFIX, IOS_ROLE_MAP, type ImageDimensions, JUnitReporter, type JUnitReporterOptions, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, KEY_MAP, LEGACY_AGENT_QA_DASHBOARD_DB_PATH, LLMAssertionEvaluator, type LLMAuthProviderPlugin, type LLMModelAdapter, LLMPlanner, type LLMProviderMode, LLMVariableExtractor, LLMVerifier, LOG_LEVEL_PRIORITY, type ListAuthStateMetadataInput, type LoadLLMAuthPluginsOptions, LocalMemoryProvider, LockManager, LogCaptureConfigSchema, type LogEntry, type LogLevel, LogManager, type LogSource, LogSourceDataSchemas, type LogStorage, LoggingConfigSchema, MOBILE_ONLY_ACTIONS, McpConfigSchema, type MemoryDelta, type MemoryDeltaAction, type MemoryIndexParams, type MemoryLog, type MemoryObservationSnapshot, type MemoryProvider, type MemoryQueryResult, MissingSecretError, type MobileAppState, MobileAppStateSchema, MobileElementResolver, type MobileNode, type MobilePlatform, type MobileRefMap, MobileSetupError, type MobileSetupErrorCategory, type MobileSetupErrorOptions, type MobileTransport, MobileUseOverrideSchema, MobileUseSchema, MockAnalyticsTransport, type ModelConfig, ModelConfigSchema, MultiReporter, NamedLLMConfigSchema, type NetworkLogEntry, NoopAnalyticsTransport, type NormalizedAuthStateUse, NullActionCache, type OAuthTokens, type ObservationFrontmatter, type ObserveOptions, type ParseError, type ParseResult, type ParsedMobileTree, type ParsedRunAttrFlags, type PlanResult, type Planner, type PlannerConfig, PlannerConfigSchema, PlannerLogDataSchema, type PlatformAdapter, type PlatformConfig, PluginsSchema, ProviderConfigSchema, type ProviderOptions, RUNTIME_IMAGE_MAP, RUN_ARTIFACT_SCHEMA_VERSION, RUN_ATTRIBUTE_KEY_MAX_LENGTH, RUN_ATTRIBUTE_VALUE_MAX_LENGTH, RecordingConfigSchema, type RegistryConfig, RegistrySchema, type RemoveAuthStateFilesInput, type RemoveAuthStateTargetInput, type Reporter, type ReporterEvent, type ResolveAnalyticsIdentityOptions, type ResolveAppiumExecutableOptions, type ResolveAuthStateForRunInput, type ResolveAuthStatePathsInput, type ResolveAuthStateRootInput, type ResolveMobileRunConfigInput, type ResolvedAppiumExecutable, type ResolvedAuthStateForRun, type ResolvedAuthStatePaths, type ResolvedLLMAuth, type ResolvedMobileApp, type ResolvedMobileAppInstall, type ResolvedMobileDevice, type ResolvedMobileRunConfig, type ResolvedWorkspaceFile, type ResolvedWorkspacePaths, type RunArtifactConfigSnapshot, type RunArtifactFinalizeInput, type RunArtifactKind, type RunArtifactMemoryDelta, type RunArtifactMemoryDeltaAction, type RunArtifactMemoryObservationSnapshot, type RunArtifactMemorySnapshot, type RunArtifactMetadata, type RunArtifactPayload, type RunArtifactReporterContext, type RunArtifactRuntimeSnapshot, type RunArtifactStageInput, type RunArtifactSuiteMemberSnapshot, type RunArtifactSuiteSourceSnapshot, type RunArtifactTerminalError, type RunArtifactTestSourceSnapshot, type RunAttributeRunner, type RunAttributeTrigger, type RunAttributes, type RunSuiteConfig, type RunSummary, type RunTestConfig, RunnerLogDataSchema, type SandboxRunnerOptions, type ScopedLogger, type ScreenState, type ScreenStateMetadata, SecretConfigError, type SecretFileMetadata, SecretRedactor, SecretStore, type SecretTemplate, type ServicesConfig, ServicesSchema, SizeString, type StartAuthContext, type StartAuthResult, StdoutLiveReporter, type StepAnnotation, type StepContext, type StepHashInputs, type StepPhaseEvent, type StepResult, type StepStatus, type StepTrace, type SuiteDefinition, SuiteDefinitionSchema, type SuiteObservation, type SuiteObservationFrontmatter, SuiteObservationSchema, type SuiteResult, type SuiteSummary, SuiteTestEntrySchema, TargetNameSchema, TargetSchema, type TestConfig, type TestDefinition, TestDefinitionSchema, type TestMeta, TestMetaSchema, type TestResult, type TestStatus, type TestStep, TestStepSchema, type TimeoutConfig, TimeoutConfigSchema, type TokenRefreshFn, type TokenUsage, type ToolCategory, type ToolDefinition, ToolRegistry, TransportSchema, type UseConfig, UseSchema, VALID_FILENAME_RE, VERSION_CHECK_CACHE_TTL_MS, VERSION_CHECK_TIMEOUT_MS, type ValidationDiagnostic, type ValidationResult, type VariableExtractor, type VariableSource, VariableStore, type VerificationResult, VerificationResultSchema, type Verifier, type VerifyResult, type VersionCheckOptions, WEB_ONLY_ACTIONS, type WorkspaceConfig, type WorkspaceFileKind, type WorkspaceFileRecord, WorkspaceSchema, type WriteAuthStateFilesInput, alignToWindow, applyWorkspaceHookReferenceMigration, auditWorkspaceHookReferenceMigration, browserstackProvider, buildAnalyticsEvent, buildAssertionPrompt, buildAuthStateHookEnv, buildExtractionPrompt, buildInternalRunAttributes, buildMemoryIndex, buildStepPrompt, buildSystemPrompt, buildTools, buildVerificationPrompt, captureAnalytics, captureFailureScreenshot, checkDockerAvailable, clearLLMAuthProviderPlugins, clearLoadedLLMAuthPluginModules, collectAllInjectedIds, compressScreenshot, computeFingerPositions, computePinch, computeSwipe, convertKeysForPlatform, createAnalyticsRunReporter, createAnalyticsService, createAsserter, createAuthFetch, createBetterSqlite3Database, createExtractor, createMemoryProvider, createModel, createWrappedModel, defaultRegistry, deprecateOnFailure, detectGlobOverlap, detectPlaywrightVersion, discoverWorkspaceFiles, ensureMemoryDirs, escapeXml, estimateTokens, executeStep, findBareVariables, findSecretTemplates, findUnresolvedTemplates, flushAnalytics, formatAppiumInstallGuidance, formatDiagnostics, formatDiagnosticsPlain, formatLogEntry, formatParseError, formatRunAttributesBlock, generateAnalyticsUserId, generateFailureSummary, generatePKCE, generateRunId, generateState, getAgentQaUpdateStatus, getAgentQaVersion, getAgentQaVersionCheckCachePath, getAnalyticsIdentityPath, getAnalyticsService, getAuthPath, getCredential, getImageDimensions, getLLMAuthProviderPlugin, getProvider, getProviderOptions, hashScreenState, hashStepInstruction, interpolateSecretTemplates, interpolateVariables, isBetterSqlite3AbiMismatch, isBetterSqlite3NativeModuleError, isBetterSqlite3NodeGypSymlinkConflict, isMacPlatform, isPathInsideDir, isReservedAuthStateHookEnvKey, isWorkspacePathMatch, listAuthStateMetadata, listLLMAuthProviderPlugins, listObservations, listProviders, loadLLMAuthPlugins, localAppiumBinaryNames, mapMobileCapabilities, mapWebCapabilities, mergeRunAttributes, normalizeAuthStateUse, normalizeRole, parseAllTests, parseEnvFile, parseHookInline, parseHooksFile, parseMobileSource, parseObservation, parseRunAttrFlags, parseSuiteFile, parseTTL, parseTestFile, readAnalyticsIdentity, readAuth, readAuthStateMetadata, redactAuthStateString, redactAuthStateValue, redactSecretValue, registerAllProviders, registerLLMAuthProviderPlugin, registerLLMAuthProviderPlugins, registerProvider, removeAuth, removeAuthStateFiles, removeAuthStateTarget, resetAnalyticsServiceForTests, resolveAnalyticsAgentProduct, resolveAnalyticsIdentity, resolveAnalyticsStandardProperties, resolveAppiumExecutable, resolveAuthStateForRun, resolveAuthStatePaths, resolveAuthStateRoot, resolveBetterSqliteRebuildCommand, resolveFarmCredentials, resolveFileReferences, resolveLLMAuth, resolveMemoryRoot, resolveMobileRunConfig, resolveSecretTemplatesInValue, resolveWorkspaceFileTarget, resolveWorkspacePaths, runCurator, runHookInSandbox, runHooks, runSuite, runTest, runTestWithRetry, scanContent, serializeEnvFile, shouldAblate, sortRunAttributesForDisplay, stripHookInline, stripReservedAuthStateHookEnv, toolCallToActionPlan, toolSchemaMiddleware, truncateScreenState, validateConfig, validateFilename, validateFiles, validateProject, validateSuiteFile, validateTestFile, validateTrustedRunAttributes, validateUserRunAttributes, warnIfOutOfBounds, writeAnalyticsIdentity, writeAuth, writeAuthStateFiles, writeObservation };
|
package/dist/index.js
CHANGED
|
@@ -6370,6 +6370,7 @@ var StdoutLiveReporter = class {
|
|
|
6370
6370
|
activeRunId;
|
|
6371
6371
|
activeParentRunId;
|
|
6372
6372
|
activeSuiteIndex;
|
|
6373
|
+
activeSuiteTotal;
|
|
6373
6374
|
redactor;
|
|
6374
6375
|
constructor(options = {}) {
|
|
6375
6376
|
this.active = options.active ?? process.env.AGENT_QA_LIVE_EVENTS === "true";
|
|
@@ -6387,10 +6388,12 @@ var StdoutLiveReporter = class {
|
|
|
6387
6388
|
const runId = context?.runId ?? this.activeRunId;
|
|
6388
6389
|
const parentRunId = context?.parentRunId ?? this.activeParentRunId;
|
|
6389
6390
|
const suiteIndex = context?.suiteIndex ?? this.activeSuiteIndex;
|
|
6391
|
+
const suiteTotal = context?.suiteTotal ?? this.activeSuiteTotal;
|
|
6390
6392
|
return {
|
|
6391
6393
|
...this.withRunId(event, runId),
|
|
6392
6394
|
...parentRunId ? { parentRunId } : {},
|
|
6393
6395
|
...typeof suiteIndex === "number" ? { suiteIndex } : {},
|
|
6396
|
+
...typeof suiteTotal === "number" ? { suiteTotal } : {},
|
|
6394
6397
|
...typeof context?.testIndex === "number" ? { testIndex: context.testIndex } : {},
|
|
6395
6398
|
...typeof context?.stepIndex === "number" ? { stepIndex: context.stepIndex } : {},
|
|
6396
6399
|
...context?.stepId ? { stepId: context.stepId } : {}
|
|
@@ -6400,6 +6403,7 @@ var StdoutLiveReporter = class {
|
|
|
6400
6403
|
this.activeRunId = context?.runId;
|
|
6401
6404
|
this.activeParentRunId = context?.parentRunId;
|
|
6402
6405
|
this.activeSuiteIndex = typeof context?.artifact?.suiteIndex === "number" ? context.artifact.suiteIndex : typeof context?.artifact?.runtime === "object" && context.artifact.runtime !== null && typeof context.artifact.runtime.suiteIndex === "number" ? context.artifact.runtime.suiteIndex : void 0;
|
|
6406
|
+
this.activeSuiteTotal = readSuiteTotal(context);
|
|
6403
6407
|
if (process.env.AGENT_QA_PARENT_RUN_ID) {
|
|
6404
6408
|
this.emit(this.withRunContext({
|
|
6405
6409
|
type: "retry-attempt",
|
|
@@ -6494,17 +6498,31 @@ var StdoutLiveReporter = class {
|
|
|
6494
6498
|
this.heartbeatInterval = null;
|
|
6495
6499
|
}
|
|
6496
6500
|
const runId = result.runId ?? this.activeRunId;
|
|
6497
|
-
this.emit(this.
|
|
6501
|
+
this.emit(this.withRunContext({
|
|
6498
6502
|
type: "test-complete",
|
|
6499
6503
|
testName: result.name,
|
|
6500
6504
|
status: result.status,
|
|
6501
6505
|
duration: result.duration
|
|
6502
|
-
}, runId));
|
|
6506
|
+
}, { runId }));
|
|
6503
6507
|
this.activeRunId = void 0;
|
|
6504
6508
|
this.activeParentRunId = void 0;
|
|
6505
6509
|
this.activeSuiteIndex = void 0;
|
|
6510
|
+
this.activeSuiteTotal = void 0;
|
|
6506
6511
|
}
|
|
6507
6512
|
};
|
|
6513
|
+
function readSuiteTotal(context) {
|
|
6514
|
+
const runtime = context?.artifact?.runtime;
|
|
6515
|
+
if (runtime && typeof runtime === "object") {
|
|
6516
|
+
const total = runtime.suiteTotal;
|
|
6517
|
+
if (typeof total === "number" && Number.isInteger(total) && total > 0) return total;
|
|
6518
|
+
}
|
|
6519
|
+
const source = context?.artifact?.source;
|
|
6520
|
+
if (source && typeof source === "object") {
|
|
6521
|
+
const members = source.members;
|
|
6522
|
+
if (Array.isArray(members) && members.length > 0) return members.length;
|
|
6523
|
+
}
|
|
6524
|
+
return void 0;
|
|
6525
|
+
}
|
|
6508
6526
|
|
|
6509
6527
|
// src/mobile/xml-parser.ts
|
|
6510
6528
|
import { XMLParser } from "fast-xml-parser";
|
|
@@ -7661,8 +7679,8 @@ function resolveModuleSpecifier(declaration, baseDir) {
|
|
|
7661
7679
|
const resolveImport = import.meta.resolve;
|
|
7662
7680
|
return resolveImport(packageName, parentUrl);
|
|
7663
7681
|
} catch {
|
|
7664
|
-
const
|
|
7665
|
-
return pathToFileURL(
|
|
7682
|
+
const require5 = createRequire(resolve3(baseDir, "agent-qa.config.yaml"));
|
|
7683
|
+
return pathToFileURL(require5.resolve(packageName)).href;
|
|
7666
7684
|
}
|
|
7667
7685
|
}
|
|
7668
7686
|
const pluginPath = pathDeclarationValue(declaration);
|
|
@@ -8008,8 +8026,8 @@ var BROWSER_MAP = {
|
|
|
8008
8026
|
};
|
|
8009
8027
|
function detectPlaywrightVersion() {
|
|
8010
8028
|
try {
|
|
8011
|
-
const
|
|
8012
|
-
const pkg =
|
|
8029
|
+
const require5 = createRequire2(import.meta.url);
|
|
8030
|
+
const pkg = require5("playwright-core/package.json");
|
|
8013
8031
|
return pkg.version;
|
|
8014
8032
|
} catch {
|
|
8015
8033
|
return "1.59.1";
|
|
@@ -9013,6 +9031,7 @@ async function runSuite(suite, testEntries, config) {
|
|
|
9013
9031
|
runtime: {
|
|
9014
9032
|
platform: config.platformConfig.platform,
|
|
9015
9033
|
suiteIndex: i,
|
|
9034
|
+
suiteTotal: testEntries.length,
|
|
9016
9035
|
parentSuiteId: suite["suite-id"] ?? suite.name
|
|
9017
9036
|
}
|
|
9018
9037
|
}
|
|
@@ -11324,6 +11343,183 @@ function createAnalyticsRunReporter(options = {}) {
|
|
|
11324
11343
|
return new AnalyticsRunReporter(options);
|
|
11325
11344
|
}
|
|
11326
11345
|
|
|
11346
|
+
// src/version-check/index.ts
|
|
11347
|
+
import { chmod as chmod2, mkdir as mkdir10, readFile as readFile18, writeFile as writeFile10 } from "fs/promises";
|
|
11348
|
+
import { createRequire as createRequire5 } from "module";
|
|
11349
|
+
import { homedir as homedir3 } from "os";
|
|
11350
|
+
import { dirname as dirname14, join as join11 } from "path";
|
|
11351
|
+
var require4 = createRequire5(import.meta.url);
|
|
11352
|
+
var AGENT_QA_NPM_REGISTRY_URL = "https://registry.npmjs.org/agent-qa";
|
|
11353
|
+
var VERSION_CHECK_CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
11354
|
+
var VERSION_CHECK_TIMEOUT_MS = 5e3;
|
|
11355
|
+
var semverApi;
|
|
11356
|
+
function getAgentQaVersionCheckCachePath(homeDir) {
|
|
11357
|
+
return join11(homeDir ?? homedir3(), ".agent-qa", "version-check.json");
|
|
11358
|
+
}
|
|
11359
|
+
async function getAgentQaUpdateStatus(options = {}) {
|
|
11360
|
+
const installedVersion = getInstalledVersion();
|
|
11361
|
+
try {
|
|
11362
|
+
return await getAgentQaUpdateStatusInternal(installedVersion, options);
|
|
11363
|
+
} catch {
|
|
11364
|
+
return createStatus(installedVersion);
|
|
11365
|
+
}
|
|
11366
|
+
}
|
|
11367
|
+
async function getAgentQaUpdateStatusInternal(installedVersion, options) {
|
|
11368
|
+
const semver = getSemverApi();
|
|
11369
|
+
if (!semver) {
|
|
11370
|
+
return createStatus(installedVersion);
|
|
11371
|
+
}
|
|
11372
|
+
const now = getNow(options.now);
|
|
11373
|
+
const nowMs = now.getTime();
|
|
11374
|
+
const nowIso = now.toISOString();
|
|
11375
|
+
const cacheTtlMs = getPositiveNumber(options.cacheTtlMs, VERSION_CHECK_CACHE_TTL_MS);
|
|
11376
|
+
const timeoutMs = getPositiveNumber(options.timeoutMs, VERSION_CHECK_TIMEOUT_MS);
|
|
11377
|
+
const cachePath = options.cachePath ?? getAgentQaVersionCheckCachePath(options.homeDir);
|
|
11378
|
+
const cache = await readVersionCheckCache(cachePath);
|
|
11379
|
+
const cachedLatestVersion = getValidVersion(cache?.latestVersion, semver);
|
|
11380
|
+
const checkedAtMs = getTimestamp(cache?.checkedAt);
|
|
11381
|
+
if (cachedLatestVersion && checkedAtMs !== void 0 && nowMs - checkedAtMs < cacheTtlMs) {
|
|
11382
|
+
return createStatus(installedVersion, semver, cachedLatestVersion, cache?.checkedAt);
|
|
11383
|
+
}
|
|
11384
|
+
const lastAttemptedAtMs = getTimestamp(cache?.lastAttemptedAt);
|
|
11385
|
+
if (lastAttemptedAtMs !== void 0 && nowMs - lastAttemptedAtMs < cacheTtlMs) {
|
|
11386
|
+
if (cachedLatestVersion && checkedAtMs !== void 0) {
|
|
11387
|
+
return createStatus(installedVersion, semver, cachedLatestVersion, cache?.checkedAt);
|
|
11388
|
+
}
|
|
11389
|
+
return createStatus(installedVersion);
|
|
11390
|
+
}
|
|
11391
|
+
const nextCache = { ...cache, lastAttemptedAt: nowIso };
|
|
11392
|
+
const refreshedLatestVersion = await fetchLatestVersion(options.fetchImpl, timeoutMs, semver);
|
|
11393
|
+
if (refreshedLatestVersion) {
|
|
11394
|
+
const refreshedCache = {
|
|
11395
|
+
latestVersion: refreshedLatestVersion,
|
|
11396
|
+
checkedAt: nowIso,
|
|
11397
|
+
lastAttemptedAt: nowIso
|
|
11398
|
+
};
|
|
11399
|
+
await writeVersionCheckCache(cachePath, refreshedCache);
|
|
11400
|
+
return createStatus(installedVersion, semver, refreshedLatestVersion, nowIso);
|
|
11401
|
+
}
|
|
11402
|
+
await writeVersionCheckCache(cachePath, nextCache);
|
|
11403
|
+
if (cachedLatestVersion && checkedAtMs !== void 0) {
|
|
11404
|
+
return createStatus(installedVersion, semver, cachedLatestVersion, cache?.checkedAt);
|
|
11405
|
+
}
|
|
11406
|
+
return createStatus(installedVersion);
|
|
11407
|
+
}
|
|
11408
|
+
function getInstalledVersion() {
|
|
11409
|
+
try {
|
|
11410
|
+
return getAgentQaVersion().trim() || "0.0.0";
|
|
11411
|
+
} catch {
|
|
11412
|
+
return "0.0.0";
|
|
11413
|
+
}
|
|
11414
|
+
}
|
|
11415
|
+
function getSemverApi() {
|
|
11416
|
+
if (semverApi) return semverApi;
|
|
11417
|
+
try {
|
|
11418
|
+
semverApi = require4("semver");
|
|
11419
|
+
return semverApi;
|
|
11420
|
+
} catch {
|
|
11421
|
+
return void 0;
|
|
11422
|
+
}
|
|
11423
|
+
}
|
|
11424
|
+
function getValidVersion(version, semver) {
|
|
11425
|
+
if (typeof version !== "string") return void 0;
|
|
11426
|
+
try {
|
|
11427
|
+
return semver.valid(version) ?? void 0;
|
|
11428
|
+
} catch {
|
|
11429
|
+
return void 0;
|
|
11430
|
+
}
|
|
11431
|
+
}
|
|
11432
|
+
function getTimestamp(value) {
|
|
11433
|
+
if (typeof value !== "string") return void 0;
|
|
11434
|
+
const timestamp = Date.parse(value);
|
|
11435
|
+
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
11436
|
+
}
|
|
11437
|
+
function getPositiveNumber(value, fallback) {
|
|
11438
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
11439
|
+
}
|
|
11440
|
+
function getNow(now) {
|
|
11441
|
+
try {
|
|
11442
|
+
const candidate = now?.();
|
|
11443
|
+
if (candidate instanceof Date && Number.isFinite(candidate.getTime())) {
|
|
11444
|
+
return candidate;
|
|
11445
|
+
}
|
|
11446
|
+
} catch {
|
|
11447
|
+
}
|
|
11448
|
+
return /* @__PURE__ */ new Date();
|
|
11449
|
+
}
|
|
11450
|
+
function createStatus(installedVersion, semver, latestVersion, checkedAt) {
|
|
11451
|
+
if (!latestVersion) {
|
|
11452
|
+
return {
|
|
11453
|
+
installedVersion,
|
|
11454
|
+
updateAvailable: false
|
|
11455
|
+
};
|
|
11456
|
+
}
|
|
11457
|
+
const installedSemver = semver ? getValidVersion(installedVersion, semver) : void 0;
|
|
11458
|
+
const updateAvailable = Boolean(
|
|
11459
|
+
installedSemver && semver && safeSemverGreaterThan(semver, latestVersion, installedSemver)
|
|
11460
|
+
);
|
|
11461
|
+
return {
|
|
11462
|
+
installedVersion,
|
|
11463
|
+
latestVersion,
|
|
11464
|
+
updateAvailable,
|
|
11465
|
+
checkedAt
|
|
11466
|
+
};
|
|
11467
|
+
}
|
|
11468
|
+
function safeSemverGreaterThan(semver, version, otherVersion) {
|
|
11469
|
+
try {
|
|
11470
|
+
return semver.gt(version, otherVersion);
|
|
11471
|
+
} catch {
|
|
11472
|
+
return false;
|
|
11473
|
+
}
|
|
11474
|
+
}
|
|
11475
|
+
async function readVersionCheckCache(cachePath) {
|
|
11476
|
+
try {
|
|
11477
|
+
const raw = await readFile18(cachePath, "utf-8");
|
|
11478
|
+
const parsed = JSON.parse(raw);
|
|
11479
|
+
if (!isRecord3(parsed)) return void 0;
|
|
11480
|
+
return {
|
|
11481
|
+
latestVersion: typeof parsed.latestVersion === "string" ? parsed.latestVersion : void 0,
|
|
11482
|
+
checkedAt: typeof parsed.checkedAt === "string" ? parsed.checkedAt : void 0,
|
|
11483
|
+
lastAttemptedAt: typeof parsed.lastAttemptedAt === "string" ? parsed.lastAttemptedAt : void 0
|
|
11484
|
+
};
|
|
11485
|
+
} catch {
|
|
11486
|
+
return void 0;
|
|
11487
|
+
}
|
|
11488
|
+
}
|
|
11489
|
+
async function writeVersionCheckCache(cachePath, cache) {
|
|
11490
|
+
try {
|
|
11491
|
+
await mkdir10(dirname14(cachePath), { recursive: true });
|
|
11492
|
+
await writeFile10(cachePath, JSON.stringify(cache, null, 2), {
|
|
11493
|
+
encoding: "utf-8",
|
|
11494
|
+
mode: 384
|
|
11495
|
+
});
|
|
11496
|
+
try {
|
|
11497
|
+
await chmod2(cachePath, 384);
|
|
11498
|
+
} catch {
|
|
11499
|
+
}
|
|
11500
|
+
} catch {
|
|
11501
|
+
}
|
|
11502
|
+
}
|
|
11503
|
+
async function fetchLatestVersion(fetchImpl, timeoutMs, semver) {
|
|
11504
|
+
try {
|
|
11505
|
+
const fetcher = fetchImpl ?? globalThis.fetch?.bind(globalThis);
|
|
11506
|
+
if (typeof fetcher !== "function") return void 0;
|
|
11507
|
+
const response = await fetcher(AGENT_QA_NPM_REGISTRY_URL, {
|
|
11508
|
+
headers: { accept: "application/json" },
|
|
11509
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
11510
|
+
});
|
|
11511
|
+
if (!response.ok) return void 0;
|
|
11512
|
+
const body = await response.json();
|
|
11513
|
+
if (!isRecord3(body) || !isRecord3(body["dist-tags"])) return void 0;
|
|
11514
|
+
return getValidVersion(body["dist-tags"].latest, semver);
|
|
11515
|
+
} catch {
|
|
11516
|
+
return void 0;
|
|
11517
|
+
}
|
|
11518
|
+
}
|
|
11519
|
+
function isRecord3(value) {
|
|
11520
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11521
|
+
}
|
|
11522
|
+
|
|
11327
11523
|
// src/index.ts
|
|
11328
11524
|
init_sqlite();
|
|
11329
11525
|
|
|
@@ -11491,6 +11687,8 @@ export {
|
|
|
11491
11687
|
TransportSchema,
|
|
11492
11688
|
UseSchema,
|
|
11493
11689
|
VALID_FILENAME_RE,
|
|
11690
|
+
VERSION_CHECK_CACHE_TTL_MS,
|
|
11691
|
+
VERSION_CHECK_TIMEOUT_MS,
|
|
11494
11692
|
VariableStore,
|
|
11495
11693
|
VerificationResultSchema,
|
|
11496
11694
|
WEB_ONLY_ACTIONS,
|
|
@@ -11554,7 +11752,9 @@ export {
|
|
|
11554
11752
|
generatePKCE,
|
|
11555
11753
|
generateRunId,
|
|
11556
11754
|
generateState,
|
|
11755
|
+
getAgentQaUpdateStatus,
|
|
11557
11756
|
getAgentQaVersion,
|
|
11757
|
+
getAgentQaVersionCheckCachePath,
|
|
11558
11758
|
getAnalyticsIdentityPath,
|
|
11559
11759
|
getAnalyticsService,
|
|
11560
11760
|
getAuthPath,
|