@alumnium/core 0.0.0-stage → 0.24.0-alpha.2

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.
Files changed (137) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +2 -2
  3. package/package.json +75 -4
  4. package/src/AgentKind.d.ts +11 -0
  5. package/src/AppId.d.ts +8 -0
  6. package/src/Env.d.ts +122 -0
  7. package/src/FileStore/FileStore.d.ts +148 -0
  8. package/src/FileStore/GlobalFileStorePaths.d.ts +15 -0
  9. package/src/Http.d.ts +3 -0
  10. package/src/Model.d.ts +72 -0
  11. package/src/NavigationPolicy.d.ts +39 -0
  12. package/src/accessibility/AccessibilityElement.d.ts +17 -0
  13. package/src/accessibility/BaseAccessibilityTree.d.ts +28 -0
  14. package/src/accessibility/ChromiumAccessibilityTree.d.ts +24 -0
  15. package/src/agents.d.ts +10 -0
  16. package/src/bundle.d.ts +1 -0
  17. package/src/cli/CliCommand.d.ts +39 -0
  18. package/src/client/Alumni.d.ts +56 -0
  19. package/src/client/Area.d.ts +27 -0
  20. package/src/client/Cache.d.ts +10 -0
  21. package/src/client/errors/AssertionError.d.ts +7 -0
  22. package/src/client/result.d.ts +9 -0
  23. package/src/clients/ApiModels.d.ts +107 -0
  24. package/src/clients/Client.d.ts +109 -0
  25. package/src/clients/HttpClient.d.ts +37 -0
  26. package/src/clients/NativeClient.d.ts +51 -0
  27. package/src/clients/index.d.ts +4 -0
  28. package/src/clients/typecasting.d.ts +10 -0
  29. package/src/drivers/BaseDriver.d.ts +78 -0
  30. package/src/drivers/Driver.d.ts +82 -0
  31. package/src/drivers/DriverId.d.ts +13 -0
  32. package/src/drivers/PageWaiter.d.ts +22 -0
  33. package/src/drivers/SimulatorWindow.d.ts +6 -0
  34. package/src/drivers/keys.d.ts +16 -0
  35. package/src/drivers/scripts/bundledScripts.d.ts +2 -0
  36. package/src/drivers/scripts/scripts.d.ts +1 -0
  37. package/src/index.cjs +72 -0
  38. package/src/index.cjs.map +10 -0
  39. package/src/index.d.ts +36 -0
  40. package/src/index.js +58 -0
  41. package/src/index.js.map +10 -0
  42. package/src/internal.cjs +9290 -0
  43. package/src/internal.cjs.map +118 -0
  44. package/src/internal.d.ts +75 -0
  45. package/src/internal.js +8885 -0
  46. package/src/internal.js.map +116 -0
  47. package/src/llm/AiSdk.d.ts +34 -0
  48. package/src/llm/LanguageModel.d.ts +6 -0
  49. package/src/llm/llmSchema.d.ts +43 -0
  50. package/src/llm/loadAi.d.ts +9 -0
  51. package/src/llm/providerUtils.d.ts +29 -0
  52. package/src/mcp/McpMode.d.ts +6 -0
  53. package/src/package.d.ts +2 -0
  54. package/src/pythonic/index.d.ts +1 -0
  55. package/src/pythonic/pythonicFormat.d.ts +4 -0
  56. package/src/pythonic/pythonicSplitlines.d.ts +4 -0
  57. package/src/server/CacheFactory.d.ts +6 -0
  58. package/src/server/LlmFactory.d.ts +18 -0
  59. package/src/server/accessibility/AccessibilityTreeDiff.d.ts +7 -0
  60. package/src/server/accessibility/BaseServerAccessibilityTree.d.ts +64 -0
  61. package/src/server/accessibility/ServerChromiumAccessibilityTree.d.ts +38 -0
  62. package/src/server/accessibility/ServerMaestroAccessibilityTree.d.ts +26 -0
  63. package/src/server/accessibility/ServerUIAutomator2AccessibilityTree.d.ts +24 -0
  64. package/src/server/accessibility/ServerXCUITestAccessibilityTree.d.ts +25 -0
  65. package/src/server/accessibility/ServerXcodeAccessibilityTree.d.ts +11 -0
  66. package/src/server/agents/ActorAgent.d.ts +29 -0
  67. package/src/server/agents/Agent.d.ts +26 -0
  68. package/src/server/agents/AreaAgent.d.ts +36 -0
  69. package/src/server/agents/BaseAgent.d.ts +74 -0
  70. package/src/server/agents/ChangesAnalyzerAgent.d.ts +18 -0
  71. package/src/server/agents/LocatorAgent.d.ts +31 -0
  72. package/src/server/agents/PlannerAgent.d.ts +46 -0
  73. package/src/server/agents/RetrieverAgent.d.ts +47 -0
  74. package/src/server/agents/prompts/bundledPrompts.d.ts +2 -0
  75. package/src/server/agents/prompts/prompts.d.ts +22 -0
  76. package/src/server/cache/CacheMiddleware.d.ts +5 -0
  77. package/src/server/cache/CacheStore.d.ts +15 -0
  78. package/src/server/cache/ChainedCache.d.ts +17 -0
  79. package/src/server/cache/ElementsCache/ActorAgentElementsCache.d.ts +17 -0
  80. package/src/server/cache/ElementsCache/BaseAgentElementsCache.d.ts +38 -0
  81. package/src/server/cache/ElementsCache/ElementsCache.d.ts +70 -0
  82. package/src/server/cache/ElementsCache/ElementsCacheMask.d.ts +13 -0
  83. package/src/server/cache/ElementsCache/ElementsCacheToolCalls.d.ts +5 -0
  84. package/src/server/cache/ElementsCache/ElementsCacheTree.d.ts +24 -0
  85. package/src/server/cache/ElementsCache/PlannerAgentElementsCache.d.ts +15 -0
  86. package/src/server/cache/NullCache.d.ts +15 -0
  87. package/src/server/cache/ResponseCache.d.ts +26 -0
  88. package/src/server/cache/ServerCache.d.ts +40 -0
  89. package/src/server/serverSchema.d.ts +265 -0
  90. package/src/server/session/Session.d.ts +74 -0
  91. package/src/server/session/SessionContext.d.ts +20 -0
  92. package/src/server/session/SessionId.d.ts +7 -0
  93. package/src/server/session/SessionManager.d.ts +52 -0
  94. package/src/telemetry/Instrumentation.d.ts +4 -0
  95. package/src/telemetry/Logger.d.ts +33 -0
  96. package/src/telemetry/LoggerSchema.d.ts +58 -0
  97. package/src/telemetry/Telemetry.d.ts +11 -0
  98. package/src/telemetry/Tracer.d.ts +545 -0
  99. package/src/telemetry/loadTelemetry.d.ts +20 -0
  100. package/src/tools/BaseTool.d.ts +14 -0
  101. package/src/tools/ClickTool.d.ts +10 -0
  102. package/src/tools/DragAndDropTool.d.ts +11 -0
  103. package/src/tools/DragSliderTool.d.ts +11 -0
  104. package/src/tools/ExecuteJavascriptTool.d.ts +10 -0
  105. package/src/tools/Field.d.ts +39 -0
  106. package/src/tools/HoverTool.d.ts +16 -0
  107. package/src/tools/NavigateBackTool.d.ts +6 -0
  108. package/src/tools/NavigateToUrlTool.d.ts +10 -0
  109. package/src/tools/PressKeyTool.d.ts +11 -0
  110. package/src/tools/PrintToPdfTool.d.ts +10 -0
  111. package/src/tools/ScrollTool.d.ts +10 -0
  112. package/src/tools/SwitchToNextTabTool.d.ts +6 -0
  113. package/src/tools/SwitchToPreviousTabTool.d.ts +6 -0
  114. package/src/tools/ToolDefinition.d.ts +9 -0
  115. package/src/tools/TypeTool.d.ts +11 -0
  116. package/src/tools/UploadTool.d.ts +18 -0
  117. package/src/tools/WaitForElementTool.d.ts +11 -0
  118. package/src/tools/WaitTool.d.ts +10 -0
  119. package/src/tools/index.d.ts +20 -0
  120. package/src/tools/toolToSchemaConverter.d.ts +5 -0
  121. package/src/tree/Tree.d.ts +22 -0
  122. package/src/tree/TreeFactory.d.ts +23 -0
  123. package/src/tree/dev/TreeDevDrill.d.ts +48 -0
  124. package/src/tree/dev/TreeDevDrillError.d.ts +10 -0
  125. package/src/tree/dev/TreeDevDrillStore.d.ts +159 -0
  126. package/src/typeUtils.d.ts +37 -0
  127. package/src/utils/fs.d.ts +19 -0
  128. package/src/utils/index.d.ts +2 -0
  129. package/src/utils/logFormat.d.ts +34 -0
  130. package/src/utils/process.d.ts +19 -0
  131. package/src/utils/retry.d.ts +13 -0
  132. package/src/utils/schema.d.ts +9 -0
  133. package/src/utils/string.d.ts +6 -0
  134. package/src/utils/timers.d.ts +1 -0
  135. package/src/utils/typesScan.d.ts +85 -0
  136. package/src/xml/Xml.d.ts +24 -0
  137. package/src/xml/XmlRenderer.d.ts +25 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Alexey Rodionov, Tatiana Shepeleva
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
1
+ # @alumnium/core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Alumnium core: Alumni, agents, environment, telemetry, storage, accessibility trees, tools and driver contracts. See [the main `alumnium` package page](https://www.npmjs.com/package/alumnium) for more details.
package/package.json CHANGED
@@ -1,6 +1,77 @@
1
1
  {
2
2
  "name": "@alumnium/core",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.24.0-alpha.2",
4
+ "description": "Alumnium core: Alumni, agents, environment, telemetry, storage, accessibility trees, tools and driver contracts",
5
+ "license": "MIT",
6
+ "author": "Alex Rodionov <p0deje@gmail.com>",
7
+ "contributors": [
8
+ "Alex Rodionov <p0deje@gmail.com>",
9
+ "Sasha Koss <koss@nocorp.me>",
10
+ "Tatiana Shepeleva <tati.shep@gmail.com>"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/alumnium-hq/alumnium.git"
15
+ },
16
+ "files": [
17
+ "src",
18
+ "README.md",
19
+ "LICENSE.md"
20
+ ],
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "import": {
25
+ "types": "./src/index.d.ts",
26
+ "default": "./src/index.js"
27
+ },
28
+ "require": {
29
+ "types": "./src/index.d.ts",
30
+ "default": "./src/index.cjs"
31
+ }
32
+ },
33
+ "./internal": {
34
+ "import": {
35
+ "types": "./src/internal.d.ts",
36
+ "default": "./src/internal.js"
37
+ },
38
+ "require": {
39
+ "types": "./src/internal.d.ts",
40
+ "default": "./src/internal.cjs"
41
+ }
42
+ }
43
+ },
44
+ "dependencies": {
45
+ "@ai-sdk/provider": "^4.0.7",
46
+ "@js-fns/canon": "^0.2.0",
47
+ "@js-fns/xxhash": "^0.1.0",
48
+ "@logtape/file": "^2.0.2",
49
+ "@logtape/logtape": "^2.0.2",
50
+ "@opentelemetry/api": "^1.9.1",
51
+ "alwaysly": "^0.4.0",
52
+ "cac": "^7.0.0",
53
+ "case-anything": "^3.1.2",
54
+ "diff": "^8.0.3",
55
+ "domelementtype": "^3.0.0",
56
+ "domhandler": "^6.0.0",
57
+ "domutils": "^3.2.2",
58
+ "filenamify": "^7.0.1",
59
+ "htmlparser2": "^11.0.0",
60
+ "nanoid": "^5.1.9",
61
+ "picocolors": "^1.1.1",
62
+ "smollit": "^0.2.0",
63
+ "zod": "^4.4.1"
64
+ },
65
+ "peerDependencies": {
66
+ "@alumnium/telemetry": "0.24.0-alpha.2",
67
+ "ai": "^7.0.78"
68
+ },
69
+ "peerDependenciesMeta": {
70
+ "@alumnium/telemetry": {
71
+ "optional": true
72
+ },
73
+ "ai": {
74
+ "optional": true
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Kinds of Alumnium agents. Kept free of agent implementations so lightweight
3
+ * modules (e.g. telemetry) can reference them without pulling in the agents.
4
+ */
5
+ export type AgentKind =
6
+ | "actor"
7
+ | "area"
8
+ | "changes-analyzer"
9
+ | "locator"
10
+ | "planner"
11
+ | "retriever";
package/src/AppId.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import z from "zod";
2
+ export declare const AppId: z.core.$ZodBranded<
3
+ z.ZodPipe<z.ZodCatch<z.ZodString>, z.ZodTransform<string, string>>,
4
+ "AppId",
5
+ "out"
6
+ >;
7
+ export type AppId = z.infer<typeof AppId>;
8
+ export declare const UNKNOWN_APP_ID: AppId;
package/src/Env.d.ts ADDED
@@ -0,0 +1,122 @@
1
+ import { Model } from "./Model.ts";
2
+ import { LoggerSchema } from "./telemetry/LoggerSchema.ts";
3
+ export declare namespace Env {
4
+ type VarsRecord = Record<string, unknown>;
5
+ interface InspectResult {
6
+ vars: VarsRecord;
7
+ valid: boolean;
8
+ }
9
+ type Var = keyof typeof Env;
10
+ }
11
+ export declare const Env: {
12
+ readonly ALUMNIUM_CACHE: "filesystem" | "sqlite" | boolean;
13
+ readonly ALUMNIUM_CACHE_PATH: string | undefined;
14
+ readonly ALUMNIUM_CHANGE_ANALYSIS: boolean;
15
+ /**
16
+ * Pre-installed Cursor SDK node_modules tree for compiled binaries in
17
+ * air-gapped environments; skips the download-on-first-use install.
18
+ */
19
+ readonly ALUMNIUM_CURSOR_SDK_DIR: string | undefined;
20
+ readonly ALUMNIUM_DELAY: number;
21
+ readonly ALUMNIUM_EXCLUDE_ATTRIBUTES: any[];
22
+ readonly ALUMNIUM_FULL_PAGE_SCREENSHOT: boolean;
23
+ readonly ALUMNIUM_LOG_LEVEL:
24
+ | "debug"
25
+ | "error"
26
+ | "fatal"
27
+ | "info"
28
+ | "trace"
29
+ | "warning";
30
+ readonly ALUMNIUM_LOG_PATH: string | undefined;
31
+ readonly ALUMNIUM_LOG_FILENAME: string | undefined;
32
+ readonly ALUMNIUM_LOG_DEBUG_EXTRA: (
33
+ | "ai-sdk"
34
+ | "all"
35
+ | "env"
36
+ | "http"
37
+ | "reasoning"
38
+ | "scenarios"
39
+ | "tree"
40
+ )[];
41
+ readonly ALUMNIUM_LOG_OBJECTS_DEPTH: number;
42
+ readonly ALUMNIUM_LOG_MAX_STR_LENGTH: number;
43
+ readonly ALUMNIUM_PRUNE_LOGS: boolean;
44
+ readonly ALUMNIUM_LOG_BUFFER_SIZE: number;
45
+ readonly ALUMNIUM_LOG_FLUSH_INTERVAL: number;
46
+ readonly ALUMNIUM_TRACE: boolean;
47
+ readonly ALUMNIUM_DRIVER:
48
+ | "appium-android"
49
+ | "appium-ios"
50
+ | "cloakbrowser"
51
+ | "maestro"
52
+ | "playwright"
53
+ | "selenium"
54
+ | "xcode";
55
+ readonly ALUMNIUM_APPIUM_SERVER: string;
56
+ readonly ALUMNIUM_MAESTRO_PATH: string | undefined;
57
+ readonly ALUMNIUM_MAESTRO_OS: "android" | "ios";
58
+ readonly ALUMNIUM_XCODE_AUTO_APPROVE: boolean;
59
+ readonly ANDROID_HOME: string | undefined;
60
+ readonly ANDROID_SDK_ROOT: string | undefined;
61
+ readonly ALUMNIUM_MODEL: Model;
62
+ readonly ALUMNIUM_MCP_MODE: "agentic" | "direct";
63
+ readonly ALUMNIUM_MCP_RECORD_VIDEOS: boolean;
64
+ readonly ALUMNIUM_MCP_TRACE_SCREENSHOTS: boolean;
65
+ readonly ALUMNIUM_MCP_TRACE_SNAPSHOTS: boolean;
66
+ readonly ALUMNIUM_MCP_ARTIFACTS_DIR: string | undefined;
67
+ readonly ALUMNIUM_MCP_PROFILES_DIR: string | undefined;
68
+ readonly ALUMNIUM_SERVER_URL: string | undefined;
69
+ readonly ALUMNIUM_SERVER_DAEMONIZE: boolean;
70
+ readonly ALUMNIUM_SERVER_PID_PATH: string | undefined;
71
+ readonly ALUMNIUM_MODEL_RETRIES: number;
72
+ readonly ALUMNIUM_MODEL_TIMEOUT: number;
73
+ readonly ALUMNIUM_OLLAMA_URL: string | undefined;
74
+ readonly LANGCHAIN_CODEX_LITTERBOX_UPLOAD: boolean;
75
+ readonly ALUMNIUM_PLANNER: boolean;
76
+ readonly ALUMNIUM_RETRIES: number;
77
+ readonly ALUMNIUM_NO_RETRY: boolean;
78
+ readonly ALUMNIUM_STORE_DIR: string;
79
+ readonly ALUMNIUM_PLAYWRIGHT_HEADLESS: boolean;
80
+ readonly ALUMNIUM_SELENIUM_BROWSER_VERSION: string | undefined;
81
+ readonly ALUMNIUM_TEST_MAX_CONCURRENCY: number;
82
+ readonly ALUMNIUM_TEST_RETRY_COUNT: number;
83
+ readonly ALUMNIUM_TEST_RETRY_DELAY: number;
84
+ readonly ALUMNIUM_DEV_DATA_TYPES_SCAN: boolean;
85
+ readonly ALUMNIUM_DEV_CAPTURE_TREES: boolean;
86
+ readonly ALUMNIUM_DEV_DRILL_TEST_TREES: boolean;
87
+ readonly ALUMNIUM_TEST_PASS_THRESHOLD_PCT: number;
88
+ readonly ALUMNIUM_EVAL_TRIAL_COUNT: number;
89
+ readonly ALUMNIUM_EVAL_RUN_TIMEOUT_MIN: number;
90
+ readonly ALUMNIUM_EVAL_MAX_CONCURRENCY: number;
91
+ readonly ALUMNIUM_EVAL_SESSION_NAME: string | undefined;
92
+ readonly ALUMNIUM_EVAL_SESSION_PATH: string | undefined;
93
+ readonly ALUMNIUM_EVAL_SESSION_TRIM_INPUT: number | false;
94
+ readonly ALUMNIUM_EVAL_THRESHOLD_PCT: number;
95
+ readonly ANTHROPIC_API_KEY: string | undefined;
96
+ readonly AWS_ACCESS_KEY: string | undefined;
97
+ readonly AWS_REGION_NAME: string;
98
+ readonly AWS_SECRET_KEY: string | undefined;
99
+ readonly AZURE_FOUNDRY_API_KEY: string | undefined;
100
+ readonly AZURE_FOUNDRY_TARGET_URI: string | undefined;
101
+ readonly AZURE_OPENAI_API_KEY: string | undefined;
102
+ readonly AZURE_OPENAI_DEFAULT_HEADERS: Record<string, string> | undefined;
103
+ readonly AZURE_OPENAI_ENDPOINT: string | undefined;
104
+ readonly CURSOR_API_KEY: string | undefined;
105
+ readonly DEEPSEEK_API_KEY: string | undefined;
106
+ readonly GOOGLE_API_KEY: string | undefined;
107
+ readonly MISTRAL_API_KEY: string | undefined;
108
+ readonly OLLAMA_HOST: string | undefined;
109
+ readonly OPENAI_API_KEY: string | undefined;
110
+ readonly OPENAI_CUSTOM_URL: string | undefined;
111
+ readonly OPENAI_DEFAULT_HEADERS: Record<string, string> | undefined;
112
+ readonly OPENROUTER_API_KEY: string | undefined;
113
+ readonly XAI_API_KEY: string | undefined;
114
+ readonly LT_USERNAME: string | undefined;
115
+ readonly LT_ACCESS_KEY: string | undefined;
116
+ readonly CI: boolean;
117
+ readonly GITHUB_ACTIONS: boolean;
118
+ readonly VITEST_WORKER_ID: number | undefined;
119
+ reset(): void;
120
+ init(logger: LoggerSchema.Like): Env.InspectResult;
121
+ log: boolean;
122
+ };
@@ -0,0 +1,148 @@
1
+ import type z from "zod";
2
+ export declare namespace FileStore {
3
+ type DirGetter = () => string;
4
+ }
5
+ /**
6
+ * File system-based store for state persistence, caching, artifacts, etc.
7
+ */
8
+ export declare class FileStore {
9
+ protected static DYNAMIC_DIR_SYMBOL: symbol;
10
+ /**
11
+ * Creates a new FileStore instance for the specified directory. When the
12
+ * `dir` parameter is `FileStore.DYNAMIC_DIR_SYMBOL`, the store is expected to
13
+ * implement dynamic directory resolution by overriding the `dir` getter.
14
+ *
15
+ * @param dir Directory path for the store or `FileStore.DYNAMIC_DIR_SYMBOL` for dynamic resolution.
16
+ */
17
+ constructor(dir: string | typeof FileStore.DYNAMIC_DIR_SYMBOL);
18
+ protected defineDir(get: FileStore.DirGetter): void;
19
+ /**
20
+ * Store directory path.
21
+ */
22
+ get dir(): string;
23
+ /**
24
+ * Resolves a relative path against the store's directory. It doesn't create
25
+ * the directory structure or check for file existence.
26
+ *
27
+ * @param relPath Store-relative path
28
+ * @returns Resolved absolute path.
29
+ */
30
+ resolve(relPath: string): string;
31
+ /**
32
+ * Ensures that a file exists at the specified relative path, creating any
33
+ * necessary directories. Returns the resolved file path.
34
+ *
35
+ * @param relPath Store-relative file path
36
+ * @returns The resolved file path.
37
+ */
38
+ ensureFilePath(relPath: string): Promise<string>;
39
+ /**
40
+ * Ensures that a directory exists at the specified relative path, creating it
41
+ * if necessary. Returns the resolved directory path.
42
+ *
43
+ * @param relPath Store-relative directory path
44
+ * @returns The resolved directory path.
45
+ */
46
+ ensureDir(relPath: string): Promise<string>;
47
+ /**
48
+ * Writes JSON-serializable data to a file at the specified relative path,
49
+ * ensuring that the directory structure exists. Returns the resolved file path
50
+ * after writing.
51
+ *
52
+ * @param relPath Store-relative file path
53
+ * @param data JSON-serializable data to write to the file.
54
+ * @returns The resolved file path.
55
+ */
56
+ writeJson(relPath: string, data: unknown): Promise<string>;
57
+ /**
58
+ * Writes data to a file at the specified relative path, ensuring that the
59
+ * directory structure exists. Returns the resolved file path after writing.
60
+ *
61
+ * @param relPath Store-relative file path
62
+ * @param data Data to write to the file.
63
+ * @returns The resolved file path.
64
+ */
65
+ writeFile(relPath: string, data: Buffer | string): Promise<string>;
66
+ /**
67
+ * Reads file content as a string from the specified relative path. If
68
+ * the file doesn't exist, it returns null.
69
+ */
70
+ readText(relPath: string): Promise<string | null>;
71
+ /**
72
+ * Reads file content as JSON from the specified relative path. If
73
+ * the file doesn't exist, it returns null.
74
+ */
75
+ readJson<Type>(
76
+ relPath: string,
77
+ Schema?: z.Schema<Type>,
78
+ ): Promise<Type | null>;
79
+ /**
80
+ * Removes the store directory.
81
+ */
82
+ clear(): Promise<void>;
83
+ /**
84
+ * Removes a single file at the specified relative path. Doesn't throw if
85
+ * the file doesn't exist.
86
+ *
87
+ * @param relPath Store-relative file path
88
+ */
89
+ remove(relPath: string): Promise<void>;
90
+ /**
91
+ * Renames (moves) a file from one store-relative path to another.
92
+ *
93
+ * @param fromRelPath Store-relative source file path
94
+ * @param toRelPath Store-relative destination file path
95
+ */
96
+ rename(fromRelPath: string, toRelPath: string): Promise<void>;
97
+ /**
98
+ * Returns the last-modified time (in milliseconds since epoch) of the file
99
+ * at the specified relative path, or `null` if it doesn't exist.
100
+ *
101
+ * @param relPath Store-relative file path
102
+ */
103
+ mtime(relPath: string): Promise<number | null>;
104
+ /**
105
+ * Creates a sub-store under the current store directory. The subdirectory is
106
+ * resolved from the specified relative (to the current store directory) path.
107
+ *
108
+ * @param subDir Relative subdirectory path.
109
+ * @returns FileStore instance for the resolved subdirectory.
110
+ */
111
+ subStore(subDir: string): FileStore;
112
+ /**
113
+ * Creates a sub-store under the global store directory. The subdirectory can
114
+ * be configured via environment variable or resolved from the specified
115
+ * relative (to the global store directory `.alumnium`) path.
116
+ *
117
+ * @param envDir Environment variable value, e.g. `Env.ALUMNIUM_MCP_ARTIFACTS_DIR`.
118
+ * @param defaultDir Default subdirectory under global store, e.g. `artifacts`.
119
+ * @param nestedDir Optional nested directory under the resolved subdirectory, e.g. driver ID.
120
+ * @returns FileStore instance for the resolved directory.
121
+ */
122
+ static subStore(
123
+ envDir: string | undefined,
124
+ defaultDir: string,
125
+ nestedDir?: string,
126
+ ): FileStore;
127
+ /**
128
+ * Creates a store at a path relative to the current working directory.
129
+ *
130
+ * @param nestedDir Optional directory under the current working directory.
131
+ * @returns FileStore instance for the resolved directory.
132
+ */
133
+ static cwdRelStore(nestedDir?: string): FileStore;
134
+ /**
135
+ * Resolves a subdirectory path under the global store directory, allowing
136
+ * override via environment variable.
137
+ *
138
+ * @param envDir Environment variable value, e.g. `Env.ALUMNIUM_MCP_ARTIFACTS_DIR`.
139
+ * @param defaultDir Default subdirectory under global store, e.g. `artifacts`.
140
+ * @param nestedDir Optional nested directory under the resolved subdirectory, e.g. driver ID.
141
+ * @returns Resolved path.
142
+ */
143
+ static subResolve(
144
+ envDir: string | undefined,
145
+ defaultDir: string,
146
+ nestedDir?: string,
147
+ ): string;
148
+ }
@@ -0,0 +1,15 @@
1
+ export declare abstract class GlobalFileStorePaths {
2
+ /**
3
+ * Returns the global store directory path, which can be overridden via
4
+ * the `ALUMNIUM_STORE_DIR` environment variable. It defaults to `.alumnium`.
5
+ * @returns The global store directory path.
6
+ */
7
+ static get globalDir(): string;
8
+ /**
9
+ * Resolves a subdirectory path under the global store directory.
10
+ *
11
+ * @param dir Relative subdirectory path.
12
+ * @returns The resolved path.
13
+ */
14
+ static globalSubDir(dir: string): string;
15
+ }
package/src/Http.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export declare namespace Http {
2
+ type Method = "GET" | "POST" | "PUT" | "DELETE";
3
+ }
package/src/Model.d.ts ADDED
@@ -0,0 +1,72 @@
1
+ import z from "zod";
2
+ export declare namespace Model {
3
+ type Provider = z.infer<typeof ModelProvider>;
4
+ type Dev = z.infer<typeof ModelDev>;
5
+ }
6
+ export interface Model {
7
+ provider: Model.Provider;
8
+ name: string;
9
+ }
10
+ declare const ModelProvider: z.ZodEnum<{
11
+ anthropic: "anthropic";
12
+ aws_anthropic: "aws_anthropic";
13
+ aws_meta: "aws_meta";
14
+ azure_foundry: "azure_foundry";
15
+ azure_openai: "azure_openai";
16
+ codex: "codex";
17
+ cursor: "cursor";
18
+ deepseek: "deepseek";
19
+ google: "google";
20
+ mistralai: "mistralai";
21
+ ollama: "ollama";
22
+ openai: "openai";
23
+ openrouter: "openrouter";
24
+ xai: "xai";
25
+ }>;
26
+ declare const ModelDev: z.ZodEnum<{
27
+ anthropic: "anthropic";
28
+ deepseek: "deepseek";
29
+ google: "google";
30
+ meta: "meta";
31
+ mistralai: "mistralai";
32
+ ollama: "ollama";
33
+ openai: "openai";
34
+ xai: "xai";
35
+ }>;
36
+ export declare const defaultModelProvider: Model.Provider;
37
+ export declare const Model: {
38
+ Provider: z.ZodEnum<{
39
+ anthropic: "anthropic";
40
+ aws_anthropic: "aws_anthropic";
41
+ aws_meta: "aws_meta";
42
+ azure_foundry: "azure_foundry";
43
+ azure_openai: "azure_openai";
44
+ codex: "codex";
45
+ cursor: "cursor";
46
+ deepseek: "deepseek";
47
+ google: "google";
48
+ mistralai: "mistralai";
49
+ ollama: "ollama";
50
+ openai: "openai";
51
+ openrouter: "openrouter";
52
+ xai: "xai";
53
+ }>;
54
+ Dev: z.ZodEnum<{
55
+ anthropic: "anthropic";
56
+ deepseek: "deepseek";
57
+ google: "google";
58
+ meta: "meta";
59
+ mistralai: "mistralai";
60
+ ollama: "ollama";
61
+ openai: "openai";
62
+ xai: "xai";
63
+ }>;
64
+ "new"(
65
+ providerStr: string | Model.Provider,
66
+ nameStr: string | undefined,
67
+ ): Model;
68
+ parse(modelStr: string): Model;
69
+ toString(modelId: Model): string;
70
+ defaultProviderModel(provider: Model.Provider): string;
71
+ };
72
+ export {};
@@ -0,0 +1,39 @@
1
+ export declare class NavigationPolicyConfigError extends Error {
2
+ constructor(
3
+ field: keyof NavigationPolicy.Options,
4
+ value: string,
5
+ cause: unknown,
6
+ );
7
+ }
8
+ /** Thrown by {@link NavigationPolicy.check} when a URL is blocked. */
9
+ export declare class NavigationBlockedError extends Error {
10
+ constructor(url: string, reason: string);
11
+ }
12
+ export declare namespace NavigationPolicy {
13
+ interface Options {
14
+ allowedDomains?: string[] | undefined;
15
+ deniedDomains?: string[] | undefined;
16
+ allowedFilePaths?: string[] | undefined;
17
+ }
18
+ interface Evaluation {
19
+ allowed: boolean;
20
+ reason?: string;
21
+ }
22
+ }
23
+ /**
24
+ * Per-session allowlist/denylist for navigation targets. Patterns are case-insensitive regexes
25
+ * matched against the hostname and the full URL.
26
+ *
27
+ * - Without `allowedDomains`: everything is allowed except denylist matches.
28
+ * - With `allowedDomains`: only allowlist matches are allowed (an allowlist match beats a
29
+ * denylist match).
30
+ *
31
+ * `allowedFilePaths` overrides both for matching `file://` URLs.
32
+ */
33
+ export declare class NavigationPolicy {
34
+ #private;
35
+ private constructor();
36
+ static create(options: NavigationPolicy.Options): NavigationPolicy;
37
+ evaluate(url: string): NavigationPolicy.Evaluation;
38
+ check(url: string): void;
39
+ }
@@ -0,0 +1,17 @@
1
+ export interface AccessibilityElement {
2
+ id?: number | undefined;
3
+ backendNodeId?: number | undefined;
4
+ name?: string | undefined;
5
+ label?: string | undefined;
6
+ type?: string | undefined;
7
+ value?: string | undefined;
8
+ index?: number | undefined;
9
+ androidResourceId?: string | undefined;
10
+ androidClass?: string | undefined;
11
+ androidText?: string | undefined;
12
+ androidContentDesc?: string | undefined;
13
+ androidBounds?: string | undefined;
14
+ maestroBounds?: string | undefined;
15
+ frame?: object | undefined;
16
+ frameChain?: number[] | undefined;
17
+ }
@@ -0,0 +1,28 @@
1
+ import { FileStore } from "../FileStore/FileStore.ts";
2
+ import type { AccessibilityElement } from "./AccessibilityElement.ts";
3
+ export declare abstract class BaseAccessibilityTree<Source = unknown> {
4
+ #private;
5
+ static sourceIdFor(
6
+ this: void,
7
+ kind: string,
8
+ source: unknown,
9
+ ): BaseAccessibilityTree.SourceId;
10
+ protected get kind(): string;
11
+ constructor(source: Source);
12
+ abstract toStr(): string;
13
+ abstract elementById(id: number): AccessibilityElement;
14
+ abstract scopeToArea(rawId: number): BaseAccessibilityTree<Source>;
15
+ protected set xml(xml: string);
16
+ protected get xml(): string | null;
17
+ static devTreesStore: FileStore;
18
+ static devSourceIdForXml(
19
+ xml: string,
20
+ ): BaseAccessibilityTree.SourceId | undefined;
21
+ }
22
+ export declare namespace BaseAccessibilityTree {
23
+ type SourceId = string & {
24
+ [sourceIdBrand]: never;
25
+ };
26
+ }
27
+ declare const sourceIdBrand: unique symbol;
28
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { AccessibilityElement } from "./AccessibilityElement.ts";
2
+ import { BaseAccessibilityTree } from "./BaseAccessibilityTree.ts";
3
+ export declare class ChromiumAccessibilityTree extends BaseAccessibilityTree<
4
+ Record<string, unknown> | string
5
+ > {
6
+ #private;
7
+ private nextRawId;
8
+ protected get kind(): string;
9
+ constructor(
10
+ cdpResponseOrXml: Record<string, unknown> | string,
11
+ frameMap?: Record<number, object>,
12
+ );
13
+ /** Convert CDP response to raw XML format preserving all data. */
14
+ toStr(): string;
15
+ /**
16
+ * Find element by raw_id and return its properties for element finding.
17
+ *
18
+ * @param rawId The raw_id to search for
19
+ * @returns AccessibilityElement with backend_node_id set
20
+ */
21
+ elementById(rawId: number): AccessibilityElement;
22
+ /** Scope the tree to a smaller subtree identified by raw_id. */
23
+ scopeToArea(rawId: number): ChromiumAccessibilityTree;
24
+ }
@@ -0,0 +1,10 @@
1
+ export * from "./clients/NativeClient.ts";
2
+ export * from "./server/agents/ActorAgent.ts";
3
+ export * from "./server/agents/AreaAgent.ts";
4
+ export * from "./server/agents/ChangesAnalyzerAgent.ts";
5
+ export * from "./server/agents/LocatorAgent.ts";
6
+ export * from "./server/agents/PlannerAgent.ts";
7
+ export * from "./server/agents/RetrieverAgent.ts";
8
+ export * from "./server/cache/ElementsCache/ElementsCacheTree.ts";
9
+ export * from "./server/session/Session.ts";
10
+ export * from "./server/session/SessionManager.ts";
@@ -0,0 +1 @@
1
+ export declare function isSingleFileExecutable(): boolean;
@@ -0,0 +1,39 @@
1
+ import type { CAC } from "cac";
2
+ import { z } from "zod";
3
+ export declare namespace CliCommand {
4
+ interface DefineProps<ArgsSchema extends z.ZodObject> {
5
+ name: string;
6
+ description: string;
7
+ Args: ArgsSchema;
8
+ action: NoInfer<ActionFn<z.infer<ArgsSchema>>>;
9
+ }
10
+ interface Definition<Args> {
11
+ name: string;
12
+ description: string;
13
+ action: ActionFn<Args>;
14
+ register: (cli: CAC) => void;
15
+ cli?: CAC | undefined;
16
+ }
17
+ type ActionFn<Args> = (props: ActionProps<Args>) => Promise<void>;
18
+ interface ActionProps<Args> {
19
+ args: Args;
20
+ logFilenameHint: string;
21
+ }
22
+ }
23
+ export declare abstract class CliCommand {
24
+ static define<ArgsSchema extends z.ZodObject>(
25
+ props: CliCommand.DefineProps<ArgsSchema>,
26
+ ): CliCommand.Definition<z.infer<ArgsSchema>>;
27
+ static option: z.core.$ZodRegistry<
28
+ {
29
+ name: string;
30
+ syntax: string;
31
+ description: string;
32
+ },
33
+ z.core.$ZodType<
34
+ unknown,
35
+ unknown,
36
+ z.core.$ZodTypeInternals<unknown, unknown>
37
+ >
38
+ >;
39
+ }