@sylphai/adal-cli 1.8.18-beta.2 → 1.8.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/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # @sylphai/adal-cli (no longer published here)
2
+
3
+ AdaL is no longer distributed through npm. This package only prints how to
4
+ switch to the standalone installer.
5
+
6
+ 1. Remove the npm version:
7
+
8
+ ```bash
9
+ npm uninstall -g @sylphai/adal-cli
10
+ ```
11
+
12
+ 2. Install the standalone version.
13
+
14
+ macOS / Linux:
15
+
16
+ ```bash
17
+ curl -fsSL https://adal.sylph.ai/install.sh | bash
18
+ ```
19
+
20
+ Windows (PowerShell):
21
+
22
+ ```powershell
23
+ irm https://adal.sylph.ai/install/windows | iex
24
+ ```
25
+
26
+ 3. Open a new terminal and run `adal`.
27
+
28
+ Your settings, sessions and login live in `~/.adal` and carry over. The
29
+ standalone version updates itself.
30
+
31
+ Docs: https://docs.sylph.ai
package/bin/adal-cli.js CHANGED
@@ -1,190 +1,46 @@
1
1
  #!/usr/bin/env node
2
-
3
- /**
4
- * Main entry point for @sylphai/adal-cli (v2 - with caching)
5
- * This wrapper uses cached platform package path for better performance
6
- */
7
-
8
- const { spawn, spawnSync } = require('child_process');
9
- const path = require('path');
10
- const fs = require('fs');
11
- const os = require('os');
12
-
13
- // Determine current platform
14
- const platform = os.platform();
15
- const arch = os.arch();
16
-
17
- // Detect Linux libc flavour. Musl npm packages are intentionally not
18
- // published, so musl Linux remains unsupported through the npm installer.
19
- function detectLinuxLibc() {
20
- if (platform !== 'linux') return null;
21
- if (fs.existsSync('/etc/alpine-release')) return 'musl';
22
- try {
23
- const out = spawnSync('ldd', ['--version'], { encoding: 'utf8' });
24
- if (/musl/i.test((out.stdout || '') + (out.stderr || ''))) return 'musl';
25
- } catch (_) {}
26
- return 'glibc';
27
- }
28
-
29
- const libc = detectLinuxLibc();
30
-
31
- // Map Node.js platform/arch (+ libc on Linux) to our package naming
32
- const platformMap = {
33
- 'darwin-arm64': '@sylphai/adal-cli-darwin-arm64',
34
- 'darwin-x64': '@sylphai/adal-cli-darwin-x64',
35
- 'linux-x64': '@sylphai/adal-cli-linux-x64',
36
- 'linux-arm64': '@sylphai/adal-cli-linux-arm64',
37
- 'win32-x64': '@sylphai/adal-cli-win32-x64',
38
- 'win32-ia32': '@sylphai/adal-cli-win32-x64', // Use x64 for 32-bit Windows too
39
- };
40
-
41
- const platformKey = libc === 'musl' ? `${platform}-${arch}-musl` : `${platform}-${arch}`;
42
- const packageName = platformMap[platformKey];
43
-
44
- if (!packageName) {
45
- console.error(`❌ Unsupported platform: ${platform}-${arch}`);
46
- console.error('');
47
- console.error('AdaL CLI currently supports:');
48
- console.error(' • macOS (Apple Silicon)');
49
- console.error(' • macOS (Intel)');
50
- console.error(' • Linux (x64, glibc)');
51
- console.error(' • Linux (arm64)');
52
- console.error(' • Windows (x64)');
53
- console.error('');
54
- console.error('📖 For more details, see: https://adal-cli-docs.onrender.com/troubleshooting/installation');
55
- console.error('');
56
- console.error('If you need support for a different platform, please open an issue:');
57
- console.error(' https://github.com/SylphAI-Inc/adal/issues');
58
- process.exit(1);
59
- }
60
-
61
- // Cache file location
62
- const cacheDir = path.join(__dirname, '..', '.cache');
63
- const cacheFile = path.join(cacheDir, 'platform-path.json');
64
-
65
- // Try to load cached path first
66
- function loadCachedPath() {
67
- try {
68
- if (fs.existsSync(cacheFile)) {
69
- const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));
70
- // Verify the cached path still exists AND points to wrapper (not adal-cli.js)
71
- const expectedWrapper = platform === 'win32' ? 'adal.cmd' : 'adal';
72
- if (cache.path && fs.existsSync(cache.path)) {
73
- // CRITICAL: Reject cache if it points to adal-cli.js (stale Bun migration cache)
74
- if (cache.path.endsWith('adal-cli.js')) {
75
- // Stale cache from before Bun migration - must find wrapper instead
76
- return null;
77
- }
78
- // Verify path ends with expected wrapper name
79
- if (!cache.path.endsWith(expectedWrapper)) {
80
- return null;
81
- }
82
- // Check if it's been less than 30 days since last cache
83
- const cacheAge = Date.now() - cache.timestamp;
84
- if (cacheAge < 30 * 24 * 60 * 60 * 1000) { // 30 days in milliseconds
85
- return cache.path;
86
- }
87
- }
88
- }
89
- } catch (e) {
90
- // Cache read failed, will find path normally
91
- }
92
- return null;
93
- }
94
-
95
- // Save path to cache
96
- function saveCachedPath(platformPath) {
97
- const expectedWrapper = platform === 'win32' ? 'adal.cmd' : 'adal';
98
- try {
99
- if (!fs.existsSync(cacheDir)) {
100
- fs.mkdirSync(cacheDir, { recursive: true });
101
- }
102
- fs.writeFileSync(cacheFile, JSON.stringify({
103
- path: platformPath,
104
- platform: platformKey,
105
- package: packageName,
106
- wrapperType: expectedWrapper,
107
- timestamp: Date.now()
108
- }, null, 2));
109
- } catch (e) {
110
- // Cache write failed, not critical
111
- }
112
- }
113
-
114
- // Find the platform-specific package
115
- function findPlatformPackage() {
116
- // Try cached path first
117
- const cachedPath = loadCachedPath();
118
- if (cachedPath) {
119
- // Double-check the cached path still works
120
- if (fs.existsSync(cachedPath)) {
121
- return cachedPath;
122
- }
123
- // Cached path is stale, will search again and update cache
124
- }
125
-
126
- // If no cache or cache is stale, search for the package
127
- // Look for the 'adal' wrapper script (not adal-cli.js) which uses bundled Bun
128
- const wrapperName = platform === 'win32' ? 'adal.cmd' : 'adal';
129
- const possiblePaths = [
130
- // When installed globally - platform package is in main package's node_modules
131
- path.join(__dirname, '..', 'node_modules', packageName, wrapperName),
132
- // When installed locally in a project
133
- path.join(process.cwd(), 'node_modules', packageName, wrapperName),
134
- // Alternative: sibling in global node_modules (flat install)
135
- path.join(__dirname, '..', '..', '..', packageName, wrapperName),
136
- ];
137
-
138
- for (const testPath of possiblePaths) {
139
- if (fs.existsSync(testPath)) {
140
- saveCachedPath(testPath); // Cache the found path
141
- return testPath;
142
- }
143
- }
144
-
145
- // Try using require.resolve as last resort
146
- try {
147
- const packagePath = require.resolve(`${packageName}/package.json`);
148
- const platformBinary = path.join(path.dirname(packagePath), wrapperName);
149
- if (fs.existsSync(platformBinary)) {
150
- saveCachedPath(platformBinary); // Cache the found path
151
- return platformBinary;
152
- }
153
- } catch (e) {
154
- // Package not found
155
- }
156
-
157
- return null;
2
+ 'use strict';
3
+
4
+ // Final npm release of AdaL: this package does not contain the CLI.
5
+ // It prints the migration steps and exits 1 so scripts notice too.
6
+
7
+ const isWindows = process.platform === 'win32';
8
+ const isBeta = 'stable' === 'beta';
9
+ const useColor = Boolean(process.stderr.isTTY) && !process.env.NO_COLOR;
10
+ const bold = (s) => (useColor ? `\x1b[1m${s}\x1b[0m` : s);
11
+ const cyan = (s) => (useColor ? `\x1b[36m${s}\x1b[0m` : s);
12
+ const dim = (s) => (useColor ? `\x1b[2m${s}\x1b[0m` : s);
13
+
14
+ const unixInstall = isBeta
15
+ ? 'curl -fsSL https://adal.sylph.ai/install.sh | bash -s -- --version beta'
16
+ : 'curl -fsSL https://adal.sylph.ai/install.sh | bash';
17
+ const windowsInstall = isBeta
18
+ ? '$v="beta"; irm https://adal.sylph.ai/install/windows | iex'
19
+ : 'irm https://adal.sylph.ai/install/windows | iex';
20
+
21
+ const lines = [
22
+ '',
23
+ bold('AdaL is no longer distributed through npm.'),
24
+ 'This npm version does not run AdaL anymore. Switch to the standalone version',
25
+ 'in two commands. Your settings, sessions and login in ~/.adal carry over.',
26
+ '',
27
+ bold('1. Remove the npm version:'),
28
+ ' ' + cyan('npm uninstall -g @sylphai/adal-cli'),
29
+ '',
30
+ bold('2. Install the standalone version:'),
31
+ ];
32
+ if (isWindows) {
33
+ lines.push(' PowerShell: ' + cyan(windowsInstall));
34
+ } else {
35
+ lines.push(' ' + cyan(unixInstall));
158
36
  }
159
-
160
- const platformBinary = findPlatformPackage();
161
-
162
- if (!platformBinary) {
163
- console.error(`❌ Platform package ${packageName} not found!`);
164
- console.error('');
165
- console.error('The platform-specific package should be installed automatically.');
166
- console.error('If it\'s not, you can install it manually:');
167
- console.error(` npm install ${packageName}`);
168
- console.error('');
169
- console.error('If you\'re using npm < 7, optional dependencies might not install automatically.');
170
- console.error('Please upgrade npm or install the platform package manually.');
171
- process.exit(1);
172
- }
173
-
174
- // Execute the platform-specific wrapper (uses bundled Bun runtime)
175
- const child = spawn(platformBinary, process.argv.slice(2), {
176
- stdio: 'inherit',
177
- env: process.env,
178
- shell: platform === 'win32', // Windows needs shell for .cmd files
179
- });
180
-
181
- // Forward the exit code
182
- child.on('exit', (code) => {
183
- process.exit(code || 0);
184
- });
185
-
186
- // Handle errors
187
- child.on('error', (error) => {
188
- console.error(`❌ Failed to execute platform binary: ${error.message}`);
189
- process.exit(1);
190
- });
37
+ lines.push(
38
+ '',
39
+ bold('3. Open a new terminal and run ') + cyan('adal'),
40
+ '',
41
+ dim('The standalone version updates itself. Docs: https://docs.sylph.ai'),
42
+ ''
43
+ );
44
+
45
+ process.stderr.write(lines.join('\n') + '\n');
46
+ process.exit(1);
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@sylphai/adal-cli-darwin-arm64",
3
+ "version": "1.8.19",
4
+ "description": "Restart stand-in inside the @sylphai/adal-cli migration stub. Not AdaL.",
5
+ "license": "SylphAI Proprietary"
6
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ # Stand-in for the Bun runtime an old npm AdaL restarts from after updating.
3
+ # Runs the migration stub instead. See build-tombstone-package.sh.
4
+ exec node "$(dirname "$0")/../../../../bin/adal-cli.js"
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@sylphai/adal-cli-darwin-x64",
3
+ "version": "1.8.19",
4
+ "description": "Restart stand-in inside the @sylphai/adal-cli migration stub. Not AdaL.",
5
+ "license": "SylphAI Proprietary"
6
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ # Stand-in for the Bun runtime an old npm AdaL restarts from after updating.
3
+ # Runs the migration stub instead. See build-tombstone-package.sh.
4
+ exec node "$(dirname "$0")/../../../../bin/adal-cli.js"
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@sylphai/adal-cli-linux-arm64",
3
+ "version": "1.8.19",
4
+ "description": "Restart stand-in inside the @sylphai/adal-cli migration stub. Not AdaL.",
5
+ "license": "SylphAI Proprietary"
6
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ # Stand-in for the Bun runtime an old npm AdaL restarts from after updating.
3
+ # Runs the migration stub instead. See build-tombstone-package.sh.
4
+ exec node "$(dirname "$0")/../../../../bin/adal-cli.js"
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@sylphai/adal-cli-linux-x64",
3
+ "version": "1.8.19",
4
+ "description": "Restart stand-in inside the @sylphai/adal-cli migration stub. Not AdaL.",
5
+ "license": "SylphAI Proprietary"
6
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ # Stand-in for the Bun runtime an old npm AdaL restarts from after updating.
3
+ # Runs the migration stub instead. See build-tombstone-package.sh.
4
+ exec node "$(dirname "$0")/../../../../bin/adal-cli.js"
package/package.json CHANGED
@@ -1,33 +1,27 @@
1
1
  {
2
2
  "name": "@sylphai/adal-cli",
3
- "version": "1.8.18-beta.2",
4
- "description": "AI-powered CLI for development and research tasks",
3
+ "version": "1.8.19",
4
+ "description": "AdaL is no longer distributed through npm. Install it with: curl -fsSL https://adal.sylph.ai/install.sh | bash",
5
5
  "bin": {
6
6
  "adal": "bin/adal-cli.js"
7
7
  },
8
- "scripts": {
9
- "postinstall": "node lib/setup-cache.js"
10
- },
11
- "optionalDependencies": {
12
- "@sylphai/adal-cli-darwin-arm64": "1.8.18-beta.2",
13
- "@sylphai/adal-cli-darwin-x64": "1.8.18-beta.2",
14
- "@sylphai/adal-cli-linux-x64": "1.8.18-beta.2",
15
- "@sylphai/adal-cli-linux-arm64": "1.8.18-beta.2",
16
- "@sylphai/adal-cli-win32-x64": "1.8.18-beta.2"
17
- },
18
8
  "files": [
19
9
  "bin/",
20
- "lib/",
21
- "CHANGELOG.md"
10
+ "README.md"
11
+ ],
12
+ "dependencies": {
13
+ "@sylphai/adal-cli-darwin-arm64": "1.8.19",
14
+ "@sylphai/adal-cli-darwin-x64": "1.8.19",
15
+ "@sylphai/adal-cli-linux-x64": "1.8.19",
16
+ "@sylphai/adal-cli-linux-arm64": "1.8.19"
17
+ },
18
+ "bundleDependencies": [
19
+ "@sylphai/adal-cli-darwin-arm64",
20
+ "@sylphai/adal-cli-darwin-x64",
21
+ "@sylphai/adal-cli-linux-x64",
22
+ "@sylphai/adal-cli-linux-arm64"
22
23
  ],
23
- "keywords": ["ai", "cli", "development", "research", "assistant"],
24
24
  "author": "SylphAI",
25
25
  "license": "SylphAI Proprietary",
26
- "repository": {
27
- "type": "git",
28
- "url": "https://github.com/SylphAI-Inc/adal-cli.git"
29
- },
30
- "engines": {
31
- "node": ">=20.0.0"
32
- }
26
+ "homepage": "https://docs.sylph.ai"
33
27
  }
package/CHANGELOG.md DELETED
@@ -1,575 +0,0 @@
1
- # Changelog
2
- All notable changes to AdaL CLI will be documented in this file.
3
-
4
- ## [1.8.10] - 2026-09-25
5
-
6
- - **Social listening** — figure out what people are saying in SNS. ask AdaL questions : "What is trending in AI this week?" or "What are people saying about AdaL?"
7
- - **New models: Claude Opus 5.5, Grok 4.7, GPT-6 Sol, GPT-6 Luna**
8
- - **Prevent models stopping awkwardly** — whenever a model stops awkwardly before finishing the task, Jev detects and nudges the agent.
9
- - **Better compaction** — conversation summarization was rebuilt to retain more information
10
- - **`/compact` takes direction** — `/compact keep the API design details` tells AdaL what to hold on to when it condenses the conversation.
11
- - **Edge browser support** — AdaL browser use now finds Microsoft Edge and can bring your existing Edge profiles along, alongside Chrome.
12
-
13
- ## [1.8.4] - 2026-09-17
14
-
15
- - **Use your own endpoint with BYOAK** — connect AdaL to your own gateway or self-hosted endpoint. [Learn how to set it up.](https://docs.sylph.ai/features/bring-your-own-api-key#custom-endpoint)
16
- - **Write like a human** — a new capability that removes telltale AI writing patterns from anything AdaL drafts for people to read. Just ask AdaL to **“write like a human.”**
17
- - **Weekly usage in `/usage`** — see your current weekly usage and when your limit resets.
18
- - **A better student discount experience** — clearer steps make it easier for eligible students to claim the discount.
19
- - **Clickable pull requests in the footer** — open the current PR directly from its footer link.
20
- - **More reliable tool calls** — improved tool-call stability across several models.
21
- - AdaL now launches on older x64 processors that previously could not start it.
22
-
23
- ## [1.8.0] - 2026-09-11
24
-
25
- - **Capabilities** - AdaL's built-in skillsets that replace agent modes. A capability loads automatically when a task calls for it, and multiple can be active in one session. Check what's loaded with `/capabilities`.
26
- - **Browser Use v2** — browser use is now a capability, so there's no mode switch — just tell AdaL to **"open a browser."**
27
- - Faster, more reliable browser tools for autonomous multi-step tasks.
28
- — Click "Bring my logins & passwords" on the welcome page and your existing Chrome sessions carry over.
29
- - Supports multiple browser windows in parallel — one per session — so parallel tasks don't interfere with each other.
30
- - **AdaL Autonomy Auditor** — a new capability that lets you unlock true autonomy in your codebase. It brings our team's own playbook for agent-ready codebases to yours. Ask AdaL to **"audit our codebase for autonomy."**
31
- - Video (Preview) - a new capability that lets you magically deliver a full production-grade ready-for-upload video with animation, subtitles, audio. Tell AdaL to **"create a video"** Still in preview.
32
- - **Full multimodal support** of image, video, audio models. Type `/model` to figure out which models we are serving
33
- - **New model: GPT-6 Astra, Fable 5.1** - OpenAI and Anthropic's newest flagship models.
34
-
35
- ## [1.7.4] - 2026-09-03
36
-
37
- - **Smarter skill discovery** — the agent searches the @skills hub (https://atskills.one) on its own when a task calls for specialist knowledge. Matched skills show a card you can view, save, or install inline.
38
- - **@Skills Hub launched** — discover, install, and manage reusable agent skills from the CLI or the full marketplace at https://atskills.one. Copy a skill path from the site, paste it in the CLI. Install less, automate more.
39
- - **Native Smart Worktree Support** - ask the agent to create a worktree and open a PR, the agent would create a worktree by itself without messing up the local filesystem
40
- - New models: Claude Fable 5.1, Gemini 3.8 Flash, Muse Spark 1.3
41
- - `/model` now shows available image and video generation models so you can see exactly what the agent uses for creative work.
42
- - Auto-update no longer interrupts running sessions — old versions are cleaned up only after every process using them has exited.
43
-
44
- ## [1.7.3] - 2026-08-28
45
-
46
- - **@Skills Hub launched** — discover, install, and manage reusable agent skills from the CLI or the full marketplace at https://atskills.one. Copy a skill path from the site, paste it in the CLI. Install less, automate more.
47
- - Optimized first launch startup speed - don't need to wait for too long for starting AdaL
48
- - New models: DeepSeek V4 Flash Vision (recommended), GLM-5.3 Flash, Qwen 3.8 Flash
49
- - More reliable image generation and tool use — arguments are validated before execution, preventing silent failures.
50
- - `/resume` now shows when each session was last active and how many messages it contains.
51
-
52
- ## [1.7.2] - 2026-08-20
53
-
54
- - **@Skills Hub launched** — discover, install, and manage reusable agent skills from the CLI or the full marketplace at https://atskills.one. Copy a skill path from the site, paste it in the CLI. Install less, automate more.
55
- - New models: GLM-5.3 (recommended flagship) and Qwen 3.8 Max (50% off through August)
56
- - Smarter cache reminders — the compaction nudge only fires when your context is actually filling up, not on every turn
57
- - Softer Default Dark theme with readable text selection across all themes
58
- - Credit usage warnings alert you before hitting your weekly limit
59
- - Session resume correctly tracks context size — `/compact` triggers reliably after resuming large sessions
60
- - Skills search returns relevant results for multi-word queries
61
-
62
- ## [1.7.1] - 2026-08-17
63
-
64
- - **@Skills Hub launched** — discover, install, and manage reusable agent skills from the CLI or the full marketplace at https://atskills.one. Copy a skill path from the site, paste it in the CLI. Install less, automate more.
65
- - Faster optimized booting time of the app
66
- - Enhanced onboarding flow of the website and app
67
-
68
- ## [1.7.0] - 2026-08-13
69
-
70
- - **@Skills Hub is live** — explore the full marketplace at https://atskills.one, discover, install, publish, and manage reusable agent skills right from the CLI or marketplace. Just copy paste the skills path from the website into the CLI. Install less. Automate more.
71
- - New model: Grok 4.6, Deepseek V4 Pro
72
-
73
- ## [1.6.3] - 2026-08-08
74
-
75
- - Fixed screen cutoff : All dialogs now scroll smoothly on any terminal size, with a height-adaptive layout
76
- - New Terminal Dark and Terminal Light themes — transparent background lets your terminal's own colors show through
77
- - Long lines in diffs, code blocks, and tool output no longer get cut off — proper character-level wrapping everywhere
78
- - Footer now shows your connection mode (BYOAK or ChatGPT Subscription) so you always know which key is active
79
- - Premium model warning appears after switching to high-cost models like Claude Opus or GPT-5.6 Sol
80
- - New model: Muse Spark 1.2 available in the model switcher
81
-
82
- ## [1.5.7] - 2026-08-04
83
-
84
- - `/resume` loads instantly even with large session histories, and adapts to any terminal size
85
- - Bring Your Own API Key now works for all providers — MiniMax, ZAI, DeepSeek, Kimi, XAI, Qwen, and Meta join the lineup
86
- - New model: Qwen 3.8 Max available in the model switcher
87
- - Right-edge rendering cleaned up — no more gray strip or uneven message padding
88
- - Up-arrow recall now shows what you actually typed, not expanded file contents
89
- - `/web` no longer 404s after recent internal build changes
90
-
91
- ## [1.5.6] - 2026-08-01
92
-
93
- - Each model now remembers its own reasoning effort level — switching models no longer resets your preference
94
- - Free-tier sessions self-heal after hitting a model restriction instead of staying stuck
95
- - Desktop applies updates automatically before launch — no more running stale builds
96
-
97
- ## [1.5.5] - 2026-07-30
98
-
99
- - Improved stability of UI
100
- - Default model upgraded to Claude Sonnet 5
101
- - Fixed issue where desktop first-time signup was not possible
102
- - `/effort` now takes effect on Gemini models; image generation migrated to Google's latest endpoints
103
-
104
- ## [1.5.4] - 2026-07-29
105
-
106
- - Optimized Memory Usage
107
- - Improved stability of UI
108
- - Backend auto-recovers mid-session crashes instead of leaving you stuck
109
-
110
- ## [1.5.3] - 2026-07-24
111
-
112
- - Added Claude Opus 5 — Anthropic's most capable model for complex agentic coding
113
- - Browser no longer steals focus when AdaL drives it; a control banner keeps you informed
114
- - Faster startup speed
115
- - `/permissions` works while the agent is streaming
116
-
117
- ## [1.5.2] - 2026-07-23
118
-
119
- - New UI : Made Easier and Simpler
120
- - Improved stability of UI
121
- - Qwen models now work correctly across all installation methods
122
-
123
- ## [1.5.1] - 2026-07-21
124
-
125
- - New UI : Made Easier and Simpler
126
- - Tool progress indicators recover correctly after interrupted responses
127
- - Fixed a rare freeze when searching very large codebases
128
-
129
- ## [1.5.0] - 2026-07-20
130
-
131
- - New UI : Made Easier and Simpler
132
- - Tool calls now fold into compact expandable sections — Click or use Ctrl+R to toggle
133
- - Reasoning effort level now displayed in the footer for supported models
134
- - Model picker simplified to a single Recommended section for faster selection
135
- - Kimi K3 (1M context) now available via `/model`
136
- - GPT-5.6 Terra is the new default model
137
-
138
- ## [1.4.6] - 2026-07-12
139
-
140
- - OpenAI GPT-5.6 family now available — Sol (frontier), Terra (balanced), and Luna (high-volume) via `/model`
141
- - Muse Spark reasoning steps now display correctly in conversations
142
- - Web and desktop apps rebuilt for faster startup and more reliable sessions
143
-
144
- ## [1.4.5] - 2026-07-09
145
-
146
- - Bug fix: Engineer mode workers now receive tasks instantly and reliably
147
- - xAI Grok 4.5 and Meta Muse Spark 1.1 now available via `/model`
148
- - Muse Spark 1.1 reasoning steps now stream live in the conversation
149
-
150
- ## [1.4.4] - 2026-07-09
151
-
152
- - xAI Grok 4.5 and Meta Muse Spark 1.1 now available via `/model`
153
-
154
- ## [1.4.3] - 2026-07-08
155
-
156
- - More reliable agent responses on longer conversations
157
-
158
- ## [1.4.2] - 2026-07-07
159
-
160
- - Engineer mode now launches seamlessly into tmux with no manual setup required
161
- - More reliable engineer mode for installations
162
-
163
- ## [1.4.1] - 2026-07-04
164
-
165
- - Smarter engineer mode — delegate tasks to supervised parallel workers with `--mode engineer`. The agent now adapts its process depth to match task complexity, skipping unnecessary steps on simple tasks and adding rigor on complex ones
166
- - More reliable conversations when using ZAI models with image-heavy history
167
-
168
- ## [1.4.0] - 2026-07-04
169
-
170
- - Engineer mode — delegate tasks to supervised parallel workers with `--mode engineer`
171
- - Multi-model consulting — the agent can now query multiple AI models in parallel and synthesize their answers for better results
172
- - More reliable installation and first-run experience across all platforms
173
- - Smoother onboarding flow
174
-
175
- ## [1.3.0] - 2026-07-01
176
-
177
- - AdaL Agent SDK — Python SDK for embedding AdaL's agent runtime in your applications. https://github.com/SylphAI-Inc/adal-sdk
178
- - Custom system prompt - Override system role prompt for your customized use case https://docs.sylph.ai/features/custom-system-prompt
179
- - Custom tools — define Python tools in `<project>/.adal/tools.py` and AdaL picks them up automatically https://docs.sylph.ai/features/custom-tools
180
- - Claude Sonnet 5 now available via `/model` — Anthropic's latest flagship with 1M context and extended thinking
181
- - New AdaL Pink theme (dark + light) — brand-colored theme available in `/theme`
182
-
183
- ## [1.2.4] - 2026-06-12
184
-
185
- - Claude Fable 5 now available via `/model` — Anthropic's new flagship with extended thinking
186
- - Desktop Home is workspace-first — pick a folder and press Enter to jump straight into a session
187
- - Improved light theme readability for code blocks and diffs across CLI and Web
188
- - File path actions in rendered markdown — click to open the source file or jump to Review
189
- - Side-by-side diff viewer now shows `+`/`−` markers for clearer change tracking
190
- - Desktop Review tab resumes reliably after reconnect — no more stale fallback states
191
- - File operations (delete, rename, move) in the Desktop file tree work correctly for all path formats
192
- - More accurate file-count badge on the current PR section
193
-
194
- ## [1.2.3] - 2026-06-03
195
-
196
- - Claude Opus 4.8 now available via `/model` — 1M context window with extended thinking
197
- - New `--thinking-effort` flag in headless mode (`adal -q`) — control reasoning depth per invocation from scripts and CI
198
- - Dotfiles (`.env`, `.adal`, `.vscode`) now visible in the Desktop and Web file tree sidebar
199
- - `/agent` is now the single command for all agent configuration — cleaner, one entry point
200
- - Unified `/compact` behavior across CLI, Desktop, and Web
201
- - Desktop sessions stay alive through screen sleep, lid close, and window minimize
202
- - Smarter browser automation — recovers automatically from stuck page sessions instead of giving up
203
-
204
- ## [1.2.2] - 2026-05-28
205
-
206
- - New `/agent` command — switch between Coding, Deep Research, and Browser Use modes from a single dialog
207
- - Shift+Tab now cycles through all permission modes: Strict → Accept Edits → YOLO
208
- - Tab key now toggles Plan mode only when in Coding mode
209
- - More reliable agent responses — eliminated a class of premature turn stops
210
- - Cleaner command cancellation — child processes no longer linger after Ctrl+C
211
- - Desktop: Full image support — paste, drag-and-drop, or send image-only queries
212
- - More reliable `/resume` — sessions restore cleanly without stale state errors
213
- - Removed deprecated Gemini 3 Pro from the model list
214
-
215
- ## [1.2.1] - 2026-05-23
216
-
217
- - Gemini 3.5 Flash model now available via `/model`
218
- - CLI: Context breakdown details now visible to all users in `/stats` session statistics
219
- - Desktop: Marked desktop as preview in header
220
- - Desktop: Seamless `/ide` handoff — Desktop app stays connected without backend interruption
221
- - Desktop: Clickable file paths in chat messages — click any inline path to open it in the file viewer
222
- - Desktop: Improved file viewer with better media previews and smart link navigation
223
- - Desktop: Smoother Desktop updates — progress shown in-app instead of native modal dialogs
224
- - Desktop: More reliable sessions after auto-updates (no more stale certificate errors)
225
-
226
- ## [1.2.0] - 2026-05-20
227
-
228
- - (Preview) [Desktop App](https://docs.sylph.ai/getting-started/desktop-app) now available - download app and open with icon or `/ide` command
229
- - (Preview) Self-Review Agent available in Desktop App - open your PR and the agent auto-clusters and explains huge reviews for you
230
- - Smarter multi-turn conversations with extended thinking models
231
- - More reliable command execution with clearer error reporting when shell commands fail
232
- - Images you paste or upload persist correctly when resuming or switching sessions
233
-
234
- ## [1.1.4] - 2026-05-15
235
-
236
- - (Preview) `/ide` command now available - open your session in the browser with one keystroke
237
- - (Preview) self-review agent feature now available in `/ide` - open your PR and the agent auto-clusters and explains huge reviews for you
238
- - More reliable auto-updates on Windows
239
- - Improved instruction following and tool accuracy across all models
240
- - Improved cross-platform reliability on Windows with non-UTF-8 locales
241
-
242
- ## [1.1.3] - 2026-05-09
243
-
244
- - Unified tool expand/collapse toggle for cleaner message display
245
- - Faster first-query response times
246
- - Improved token tracking accuracy for all Chat Completions providers
247
- - Subagents run more reliably across providers
248
-
249
- ## [1.1.1] - 2026-05-05
250
-
251
- - Improved subagent performance and token efficiency
252
- - Fixed Anthropic multiple image input inconsistencies
253
- - Added support for reading SVG files
254
- - Added a native installer for Windows users
255
- - Added Browser Use mode; press Tab to toggle among Plan, Deep Research, and Browser Use modes
256
-
257
- ## [1.0.9] - 2026-05-01
258
-
259
- - Improved the UX of image gen with GPT and Gemini models
260
- - Fixed the windows crash bugs reported and improved product reliability
261
-
262
- ## [1.0.8] - 2026-04-25
263
-
264
- - Fixed image generation error and improved product reliability
265
-
266
- ## [1.0.7] - 2026-04-25
267
-
268
- - Added GPT-5.5 model support
269
- - First week 50%-off promotion for new models include GPT, DeepSeek, KIMI and Claude
270
-
271
- ## [1.0.6] - 2026-04-24
272
-
273
- - Fixed known issues in new model clients(DeepSeek & KIMI)
274
-
275
- ## [1.0.5] - 2026-04-24
276
-
277
- - Added GPT Image 2 support for image generation
278
- - Added DeepSeek V4 Flash&Pro models
279
- - Added KIMI 2.6 model
280
- - Minor UX polish and bug fixes
281
-
282
- ## [1.0.4] - 2026-04-20
283
-
284
- - Added support for Claude Opus 4.7 models
285
- - Minor UX polish and bug fixes
286
-
287
- ## [1.0.3] - 2026-04-16
288
-
289
- - Added Cron Agent support and interactive `/cron` management in the CLI
290
- - Fixed ChatGPT subscription streaming issues
291
- - Fixed Anthropic model image input handling
292
- - Improved error message handling
293
-
294
- ## [1.0.2] - 2026-04-03
295
-
296
- - Improved error messages display
297
- - Improved image generation requests stability
298
-
299
- ## [1.0.1] - 2026-03-31
300
-
301
- - Optimized the running memory of the AdaL session process
302
- - Improved Claude model requests stability
303
- - Added worktree info in exit UX if applicable
304
-
305
- ## [1.0.0] - 2026-03-27
306
-
307
- - Introduced Deep Research, a dedicated mode for investigating complex tasks and delivering structured reports (Tab to toggle)
308
- - Added Linux ARM64 support
309
- - Fixed Linux lagging issue
310
- - Enabled long-running agent execution when YOLO mode is toggled via /permissions
311
- - Improved streaming error handling and auto-retry
312
- - Added terminal notifications when AdaL needs user attention
313
- - Improved MCP user experience with smoother authentication and stable connections
314
- - Added a `--resume` flag for resuming previous sessions by ID
315
- - Resolved an issue affecting skill installation
316
- - Fixed slash-prefixed messages can't be queued mid-turn
317
- - Fetch tool display enrichment
318
- - Fixed an issue on WSL where pressing i for more info could fail silently
319
- - Improved chat history display with progressive loading
320
- - Fixed resumed-session display issues for subagents
321
- - Simplified compression report display
322
- - AdaL Web: Improved feature parity with AdaL CLI
323
- - AdaL Web: a redesigned UI
324
- - AdaL Web: added file view support
325
- - AdaL Web: Fixed browser not auto-opening on WSL
326
-
327
- ## [0.9.9] - 2026-03-18
328
- - Added MiniMax M2.7 and M2.7 Highspeed models
329
- - Added YOLO mode to auto-approve all tools and bash commands (/permissions)
330
-
331
- ## [0.9.8] - 2026-03-17
332
- - Improved Claude streaming reliability with fewer timeout errors
333
- - Improved error messages for rate limits for clarity
334
-
335
- ## [0.9.7] - 2026-03-16
336
- - Added GLM-5-Turbo from Z.ai
337
- - Reduced TimeoutError for Claude Opus models to allow long responses to pass
338
-
339
- ## [0.9.6] - 2026-03-14
340
- - Fixed MCP servers incorrectly showing as "not ready" after successful authentication
341
-
342
- ## [0.9.5] - 2026-03-11
343
- - Improved reliability for GLM requests
344
-
345
- ## [0.9.4] - 2026-03-11
346
- - Improved image generation reliability
347
- - Fixed incorrect mapping of queued @file references to images
348
- - Corrected hidden-line counts in diff view
349
- - Resolved a plugin install issue affecting some marketplace sources
350
- - Consolidated `adal --help` information
351
- - Renamed `adal workspace` to `adal worktree` and simplified its usage
352
- - Added `--model` support for headless mode to specify models
353
- - Added a clear "Text-only" capability indicator in model selection for non-vision models
354
- - Minor UI improvements for assistant messages
355
-
356
- ## [0.9.3] - 2026-03-07
357
- - Terminal tab title now shows AdaL
358
- - Bug fix in edit file path resolution
359
-
360
- ## [0.9.2] - 2026-03-06
361
- - Improved subagent performance
362
- - Added automatic subagent folding after completion
363
- - Further optimized prompt caching
364
- - Added @ autocomplete directory suggestions
365
- - Refined /model panel UI
366
-
367
- ## [0.9.1] - 2026-03-05
368
- - Added GPT-5.4 in ChatGPT subscription
369
- - Optimized cache hit rate
370
- - Optimized error self-recovery and subagent performance
371
- - AdaL Web: aligned stream/subagent behavior with AdaL CLI
372
-
373
- ## [0.9.0] - 2026-03-05
374
- - Added subagent support to improve AdaL's efficiency and performance
375
- - Optimized prompt caching to make AdaL 2x cost-effective
376
- - Added GPT-5.3 Codex and GPT-5.4 from OpenAI and set GPT-5.3 Codex as the current default model
377
- - Added GLM-5, GLM-4.7 FlashX and 3 more models from Zai
378
- - Upgraded image generation to Nano Banana 2 and enabled image editing
379
- - Memory optimization improvements for smoother long sessions
380
- - Corrected the effective input context window for all OpenAI models from 400k to 272k
381
- - Bug fixes in Ollama local model support
382
- - Refined /model panel metadata, pricing display, and selector UX
383
- - Removed /auth and merged auth details into /about
384
- - Keyboard shortcuts now respond to both lowercase and uppercase keys
385
- - Slash autocomplete completes commands without auto-running, allowing arguments to be added before execution
386
- - Fixed and optimized scrollbar behavior
387
- - Added context percentage display in the footer
388
- - Fixed inaccurate line counts in “click to expand”
389
-
390
- ## [0.8.5] - 2026-02-28
391
- - Fixed GPT models via ChatGPT subscription returning "Unsupported parameter" errors
392
-
393
- ## [0.8.4] - 2026-02-27
394
- - Fixed GPT models crashing during long sessions
395
- - Improved context window utilization to enable longer conversations before compaction
396
- - Deprecated older OpenAI models (GPT-4.1, o4-mini, standard GPT-5/5.1) and prioritized Codex variants
397
- - Added GPT-5.2 Codex as a recommended model
398
-
399
- ## [0.8.3] - 2026-02-25
400
- - Added image generation tool via Google Gemini's Nano Banana
401
- - Supported using ChatGPT subscription in adal to use OpenAI models
402
- - Added headless mode to run adal in non-interactive CLI execution (`adal -q "query"`)
403
- - Supported select text to copy on all major platforms and terminals
404
- - Supported copy images from screenshots
405
- - Unified design on click to expand and collapse
406
- - Move status notification to display on the same row as the loading indicator for a more compact UI layout
407
-
408
- ## [0.8.2] - 2026-02-21
409
- - Faster MCP startup
410
- - Sync MCP tools when switching models
411
-
412
- ## [0.8.1] - 2026-02-21
413
- - Added read image tool to analyze images directly
414
- - Improved file editing with fewer retries and more reliable edits
415
- - Local model support via ollama (preview)
416
-
417
- ## [0.8.0] - 2026-02-19
418
- - Improved agentic tool use and communication across all models
419
- - New models - Google: Gemini 3.1 Pro
420
- - New models - MiniMax: M2.5 and M2.5 Highspeed
421
- - New models - Anthropic: Claude Sonnet 4.6
422
- - New models — OpenAI: GPT-5.2 Codex and 9 more
423
- - Redesigned /model dialog with provider-specific sections
424
- - Supported click to expand and collapse for lengthy display
425
- - Improved diff view with inline change highlighting
426
- - Overlay-style floating header on the top right corner
427
- - New theme selection with configurable terminal background
428
- - New user query UI design
429
- - Improved bash confirmation dialog layout
430
- - AdaL Web: real-time git branch updates and auto-refresh file explorer on branch change
431
- - AdaL Web: diff viewer in the sidebar for reviewing changes
432
-
433
- ## [0.7.1] - 2026-02-12
434
- - Improved @ search by skipping autocomplete when a space follows @
435
- - Fixed file editing issues on Windows
436
- - Reduced hallucination and improved error self-recovery
437
- - Bash confirmation dialog now shows agent description for better context
438
- - AdaL Web: smart scrolling with automatic scroll-to-bottom on query submission
439
- - AdaL Web: added AGENTS.md creation in the sidebar
440
-
441
- ## [0.7.0] - 2026-02-10
442
- - AdaL Web (Preview): a new browser-based interface for AdaL that can access core capabilities (`adal --web`)
443
- - Blazing-fast file search performance
444
- - Smarter auto-retry for model provider issues
445
- - Recommended models section in /model for quick access to top picks
446
-
447
- ## [0.6.3] - 2026-02-05
448
- - Added Claude Opus 4.6 (1M context window)
449
- - Always-on adaptive thinking that removes the thinking toggle
450
- - Loading indicator UI improvements
451
- - Model tags and display name cleanup
452
-
453
- ## [0.6.2] - 2026-02-05
454
- - Added Claude Opus 4.6 day 1 support (/model)
455
- - Improved error handling and retry experience
456
- - Smoother tool cancellation experience
457
- - Improved workspace management to enable parallel development
458
- - Optimized UI display for input area and toggle displays
459
-
460
- ## [0.6.1] - 2026-02-02
461
- - Simplified thinking mode from 3 modes to 2 modes (on/off)
462
- - Better scrolling experience with automatic scroll-to-bottom on query submission
463
- - Automatic retry logic for network errors
464
- - Better error handling and recovery
465
- - Minor bug fixes
466
-
467
- ## [0.6.0] - 2026-01-31
468
- - Parallel tool calls for ~50% faster execution and lower token cost
469
- - Lightning-fast memory compaction averaging 8s with more effective context retention
470
- - Better error handling with faster failure on context overflow
471
- - More accurate @ reference search navigation
472
- - Improved agent memory management
473
- - Improved session resume with consistent thinking content and message counts
474
- - Skills auto-update and improved UI
475
- - Supported using skills CLI to install skills to AdaL
476
- - Changed default model to Claude Opus 4.5
477
- - Clearer /init onboarding experience
478
- - Added 'i' keyboard shortcut in dialogs to open documentation
479
- - Supported Mermaid diagram rendering
480
- - Fixed table border misalignment and code block highlighting in answer rendering
481
- - Added current model name below the input box
482
-
483
- ## [0.5.4] - 2026-01-28
484
- - Minor bug fixes for compaction and session resume
485
-
486
- ## [0.5.3] - 2026-01-27
487
- - Faster @ reference search navigation
488
- - Workspace management to enable parallel development
489
- - Visual separator marker showing where compaction occurred when resuming sessions
490
- - Ctrl+R (thought toggle) and Ctrl+C (cancel/exit) now work when dialogs are open
491
- - Show changelog after auto update
492
-
493
- ## [0.5.2] - 2026-01-24
494
- - Thinking mode on by default
495
- - Better view when resuming sessions
496
- - Removed redundant aliases for a tidier command palette
497
- - Added spinner for bash tool execution display
498
- - Clearer plan mode separators in message history
499
- - Unified notification toasts for copy actions
500
- - Theme improvements
501
- - Other minor bug fixes
502
-
503
- ## [0.5.1] - 2026-01-15
504
- - Improved scrolling experience across all platforms
505
- - Smarter code display with automatic line wrapping in diffs and code blocks
506
- - Fixed known bugs in /model and /theme selections
507
- - Consolidated keyboard shortcuts and slash commands
508
- - Use Ctrl+C to cancel streaming anytime
509
- - Git-aware file operations that preserve history, better multi-line commit messages
510
-
511
- ## [0.5.0] - 2026-01-13
512
- - New UI: more stable, no flashing, no flickering, faster performance throughout the session
513
- - Improved input experience: cursor navigation, Shift+Enter for multi-line input, better query history navigation via up/down arrow
514
- - New logo and header design
515
- - Simplified /theme
516
- - Better markdown formatting and table rendering
517
- - Enhanced image understanding
518
- - Improved /compact
519
- - Enhanced /changelog with more history and link to documentation
520
- - Fixed auto-edit UI not updating after Shift+Tab or option selection during edit confirmations
521
-
522
- ## [0.4.0] - 2026-01-07
523
- - Supported more Linux distributions
524
- - Added Plan Mode (Ctrl+P) for planning-first workflows
525
- - Added google-gemini-3-flash-preview (/model)
526
- - Removed google-gemini-flash-2.5 and gpt-4o
527
-
528
- ## [0.3.5] - 2026-01-05
529
- - Faster query response
530
- - Supported more general web content for websearch, including images, places, and more
531
- - Fixed issues of fetching URL content
532
- - Fixed the "unknown slash command" issues
533
- - Improved bug reporting (/bug)
534
- - Enhanced file path handling
535
-
536
- ## [0.3.4] - 2026-01-01
537
- - Full support for skills (/skills): plugins/marketplace, personal and project skills
538
- - Improved branch display with cleaner format showing directory and branch
539
- - More robust auto-compact
540
- - Faster and more token efficient manual compact (/compact)
541
- - Added GPT-4o model support with robust output parsing
542
- - Enhanced error recovery
543
- - Other minor bug fixes and improvements
544
-
545
- ## [0.3.3] - 2025-12-24
546
- - More reliable file editing
547
- - Reduced UI flickering
548
- - Cleaner explanation and answer display
549
-
550
- ## [0.3.2] - 2025-12-22
551
- - Improved URL content fetch success rate
552
-
553
- ## [0.3.1] - 2025-12-22
554
- - Faster bash command display with real-time updates
555
- - Cleaner and more readable answer formatting
556
- - Improved URL content extraction and processing
557
- - Faster web search
558
- - Better file editing experience
559
- - Improved the UI stability
560
- - Enhanced /help with clearer guidance
561
- - Other minor improvements and bug fixes
562
-
563
- ## [0.3.0] - 2025-12-15
564
- - Reduced token usage by ~20%
565
- - Full history HTML view (/stats): export and view complete conversation history in HTML format
566
- - Unified input behavior: consistent copy/paste experience across texts, files, and images
567
- - Improved session resume (/resume): better state preservation and recovery
568
- - Faster response time: optimized agent execution
569
- - Integrated Claude Opus 4.5 into model pool (/model)
570
- - Other minor bug fixes
571
-
572
- ## [0.2.3] - 2025-12-04
573
- - Fixed known streaming bugs
574
- - Improved user experience
575
-
@@ -1,64 +0,0 @@
1
- /**
2
- * Platform resolver utilities
3
- * Can be used programmatically to find the correct platform package
4
- */
5
-
6
- const os = require('os');
7
- const path = require('path');
8
- const fs = require('fs');
9
- const { spawnSync } = require('child_process');
10
-
11
- const platformMap = {
12
- 'darwin-arm64': '@sylphai/adal-cli-darwin-arm64',
13
- 'darwin-x64': '@sylphai/adal-cli-darwin-x64',
14
- 'linux-x64': '@sylphai/adal-cli-linux-x64',
15
- 'linux-arm64': '@sylphai/adal-cli-linux-arm64',
16
- 'win32-x64': '@sylphai/adal-cli-win32-x64',
17
- 'win32-ia32': '@sylphai/adal-cli-win32-x64',
18
- };
19
-
20
- // Detect Linux libc flavour. Keep in sync with the same helper in
21
- // bin/adal-cli.js and lib/setup-cache.js.
22
- function detectLinuxLibc(platform) {
23
- if (platform !== 'linux') return null;
24
- if (fs.existsSync('/etc/alpine-release')) return 'musl';
25
- try {
26
- const out = spawnSync('ldd', ['--version'], { encoding: 'utf8' });
27
- if (/musl/i.test((out.stdout || '') + (out.stderr || ''))) return 'musl';
28
- } catch (_) {}
29
- return 'glibc';
30
- }
31
-
32
- function getCurrentPlatformPackage() {
33
- const platform = os.platform();
34
- const arch = os.arch();
35
- const libc = detectLinuxLibc(platform);
36
- const platformKey = libc === 'musl' ? `${platform}-${arch}-musl` : `${platform}-${arch}`;
37
- return platformMap[platformKey];
38
- }
39
-
40
- function isPlatformSupported() {
41
- return getCurrentPlatformPackage() !== undefined;
42
- }
43
-
44
- function getCachedPath() {
45
- const cacheFile = path.join(__dirname, '..', '.cache', 'platform-path.json');
46
- try {
47
- if (fs.existsSync(cacheFile)) {
48
- const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));
49
- if (cache.path && fs.existsSync(cache.path)) {
50
- return cache;
51
- }
52
- }
53
- } catch (e) {
54
- // Cache read failed
55
- }
56
- return null;
57
- }
58
-
59
- module.exports = {
60
- getCurrentPlatformPackage,
61
- isPlatformSupported,
62
- getCachedPath,
63
- platformMap,
64
- };
@@ -1,116 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Post-install script to pre-cache the platform package path
5
- * This runs during npm install to find and cache the platform package location
6
- */
7
-
8
- const path = require('path');
9
- const fs = require('fs');
10
- const os = require('os');
11
- const { spawnSync } = require('child_process');
12
-
13
- // Determine current platform
14
- const platform = os.platform();
15
- const arch = os.arch();
16
-
17
- // Detect Linux libc flavour — same logic as bin/adal-cli.js. Keep these
18
- // two in sync: postinstall caches the wrong path if libc detection differs
19
- // from runtime.
20
- function detectLinuxLibc() {
21
- if (platform !== 'linux') return null;
22
- if (fs.existsSync('/etc/alpine-release')) return 'musl';
23
- try {
24
- const out = spawnSync('ldd', ['--version'], { encoding: 'utf8' });
25
- if (/musl/i.test((out.stdout || '') + (out.stderr || ''))) return 'musl';
26
- } catch (_) {}
27
- return 'glibc';
28
- }
29
-
30
- const libc = detectLinuxLibc();
31
-
32
- const platformMap = {
33
- 'darwin-arm64': '@sylphai/adal-cli-darwin-arm64',
34
- 'darwin-x64': '@sylphai/adal-cli-darwin-x64',
35
- 'linux-x64': '@sylphai/adal-cli-linux-x64',
36
- 'linux-arm64': '@sylphai/adal-cli-linux-arm64',
37
- 'win32-x64': '@sylphai/adal-cli-win32-x64',
38
- 'win32-ia32': '@sylphai/adal-cli-win32-x64',
39
- };
40
-
41
- const platformKey = libc === 'musl' ? `${platform}-${arch}-musl` : `${platform}-${arch}`;
42
- const packageName = platformMap[platformKey];
43
-
44
- if (!packageName) {
45
- // Unsupported platform, skip caching
46
- process.exit(0);
47
- }
48
-
49
- // Cache file location
50
- const cacheDir = path.join(__dirname, '..', '.cache');
51
- const cacheFile = path.join(cacheDir, 'platform-path.json');
52
-
53
- // Find the platform package during installation
54
- function findAndCachePlatformPackage() {
55
- // Look for wrapper script (uses bundled Bun), not adal-cli.js
56
- const wrapperName = platform === 'win32' ? 'adal.cmd' : 'adal';
57
- const possiblePaths = [
58
- // When installed globally - platform package is in main package's node_modules
59
- path.join(__dirname, '..', 'node_modules', packageName, wrapperName),
60
- // When installed locally in a project
61
- path.join(process.cwd(), 'node_modules', packageName, wrapperName),
62
- // Alternative: sibling in global node_modules (flat install)
63
- path.join(__dirname, '..', '..', '..', packageName, wrapperName),
64
- ];
65
-
66
- for (const testPath of possiblePaths) {
67
- if (fs.existsSync(testPath)) {
68
- // Found the platform wrapper, cache it
69
- try {
70
- if (!fs.existsSync(cacheDir)) {
71
- fs.mkdirSync(cacheDir, { recursive: true });
72
- }
73
- fs.writeFileSync(cacheFile, JSON.stringify({
74
- path: testPath,
75
- platform: platformKey,
76
- package: packageName,
77
- wrapperType: wrapperName,
78
- timestamp: Date.now(),
79
- installedAt: new Date().toISOString()
80
- }, null, 2));
81
- console.log(`✅ Cached platform wrapper path: ${packageName}/${wrapperName}`);
82
- } catch (e) {
83
- // Cache write failed, not critical
84
- console.log(`⚠️ Could not cache platform wrapper path: ${e.message}`);
85
- }
86
- return;
87
- }
88
- }
89
-
90
- // Try using require.resolve as last resort
91
- try {
92
- const packagePath = require.resolve(`${packageName}/package.json`);
93
- const platformBinary = path.join(path.dirname(packagePath), wrapperName);
94
- if (fs.existsSync(platformBinary)) {
95
- // Cache the found path
96
- if (!fs.existsSync(cacheDir)) {
97
- fs.mkdirSync(cacheDir, { recursive: true });
98
- }
99
- fs.writeFileSync(cacheFile, JSON.stringify({
100
- path: platformBinary,
101
- platform: platformKey,
102
- package: packageName,
103
- wrapperType: wrapperName,
104
- timestamp: Date.now(),
105
- installedAt: new Date().toISOString()
106
- }, null, 2));
107
- console.log(`✅ Cached platform wrapper path: ${packageName}/${wrapperName}`);
108
- }
109
- } catch (e) {
110
- // Platform package not found during install, will be found at runtime
111
- console.log(`⚠️ Platform package ${packageName} not found during install, will detect at runtime`);
112
- }
113
- }
114
-
115
- // Run the caching
116
- findAndCachePlatformPackage();