lemmafit 0.3.0 → 0.3.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.
- package/cli/download-dafny2js.js +2 -1
- package/cli/verify-hook.js +2 -2
- package/lib/daemon-client.js +11 -1
- package/lib/daemon.js +9 -4
- package/lib/download-dafny.js +1 -0
- package/package.json +1 -1
package/cli/download-dafny2js.js
CHANGED
|
@@ -18,6 +18,7 @@ const PLATFORM_RIDS = {
|
|
|
18
18
|
'linux-x64': 'linux-x64',
|
|
19
19
|
'linux-arm64': 'linux-arm64',
|
|
20
20
|
'win32-x64': 'win-x64',
|
|
21
|
+
'win32-arm64': 'win-x64',
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
function getPlatformKey() {
|
|
@@ -25,7 +26,7 @@ function getPlatformKey() {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
function guessRid(platformKey) {
|
|
28
|
-
return PLATFORM_RIDS[platformKey] ||
|
|
29
|
+
return PLATFORM_RIDS[platformKey] || platformKey;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
function printBuildInstructions(rid) {
|
package/cli/verify-hook.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
const path = require('path');
|
|
19
19
|
const fs = require('fs');
|
|
20
20
|
const { initLog, log } = require('../lib/log');
|
|
21
|
-
const { requestDaemon } = require('../lib/daemon-client');
|
|
21
|
+
const { requestDaemon, getIpcPath } = require('../lib/daemon-client');
|
|
22
22
|
|
|
23
23
|
async function readStdin() {
|
|
24
24
|
const chunks = [];
|
|
@@ -132,7 +132,7 @@ async function main() {
|
|
|
132
132
|
let status;
|
|
133
133
|
|
|
134
134
|
try {
|
|
135
|
-
const sockPath = path.join(projectDir, 'lemmafit', '.vibe'
|
|
135
|
+
const sockPath = getIpcPath(path.join(projectDir, 'lemmafit', '.vibe'));
|
|
136
136
|
status = await requestDaemon(sockPath, { action: 'verify' });
|
|
137
137
|
log('verify', 'Used daemon (socket)');
|
|
138
138
|
} catch (err) {
|
package/lib/daemon-client.js
CHANGED
|
@@ -5,6 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const net = require('net');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const crypto = require('crypto');
|
|
10
|
+
|
|
11
|
+
function getIpcPath(vibeDir) {
|
|
12
|
+
if (process.platform === 'win32') {
|
|
13
|
+
const hash = crypto.createHash('md5').update(vibeDir).digest('hex').slice(0, 8);
|
|
14
|
+
return '\\\\.\\pipe\\lemmafit-daemon-' + hash;
|
|
15
|
+
}
|
|
16
|
+
return path.join(vibeDir, 'daemon.sock');
|
|
17
|
+
}
|
|
8
18
|
|
|
9
19
|
function requestDaemon(sockPath, message, timeoutMs = 60000) {
|
|
10
20
|
return new Promise((resolve, reject) => {
|
|
@@ -51,4 +61,4 @@ function requestDaemon(sockPath, message, timeoutMs = 60000) {
|
|
|
51
61
|
});
|
|
52
62
|
}
|
|
53
63
|
|
|
54
|
-
module.exports = { requestDaemon };
|
|
64
|
+
module.exports = { requestDaemon, getIpcPath };
|
package/lib/daemon.js
CHANGED
|
@@ -12,6 +12,7 @@ const os = require('os');
|
|
|
12
12
|
const { spawn } = require('child_process');
|
|
13
13
|
const WebSocket = require('ws');
|
|
14
14
|
const { spawnClaude } = require('./spawn-claude');
|
|
15
|
+
const { getIpcPath } = require('./daemon-client');
|
|
15
16
|
|
|
16
17
|
class Daemon {
|
|
17
18
|
constructor(projectDir, options = {}) {
|
|
@@ -913,10 +914,12 @@ class Daemon {
|
|
|
913
914
|
}
|
|
914
915
|
|
|
915
916
|
startSocketServer() {
|
|
916
|
-
const sockPath =
|
|
917
|
+
const sockPath = getIpcPath(this.vibeDir);
|
|
917
918
|
|
|
918
|
-
// Clean up stale socket from previous crash
|
|
919
|
-
|
|
919
|
+
// Clean up stale socket from previous crash (Unix only)
|
|
920
|
+
if (process.platform !== 'win32') {
|
|
921
|
+
try { fs.unlinkSync(sockPath); } catch {}
|
|
922
|
+
}
|
|
920
923
|
|
|
921
924
|
this._socketServer = net.createServer((conn) => {
|
|
922
925
|
let buffer = '';
|
|
@@ -952,7 +955,9 @@ class Daemon {
|
|
|
952
955
|
|
|
953
956
|
// Cleanup on exit
|
|
954
957
|
const cleanup = () => {
|
|
955
|
-
|
|
958
|
+
if (process.platform !== 'win32') {
|
|
959
|
+
try { fs.unlinkSync(sockPath); } catch {}
|
|
960
|
+
}
|
|
956
961
|
process.exit();
|
|
957
962
|
};
|
|
958
963
|
process.on('SIGINT', cleanup);
|
package/lib/download-dafny.js
CHANGED
|
@@ -18,6 +18,7 @@ const PLATFORM_ASSETS = {
|
|
|
18
18
|
'linux-x64': `dafny-${DAFNY_VERSION}-x64-ubuntu-22.04.zip`,
|
|
19
19
|
'linux-arm64': `dafny-${DAFNY_VERSION}-arm64-ubuntu-22.04.zip`,
|
|
20
20
|
'win32-x64': `dafny-${DAFNY_VERSION}-x64-windows-2019.zip`,
|
|
21
|
+
'win32-arm64': `dafny-${DAFNY_VERSION}-x64-windows-2019.zip`,
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
function getPlatformKey() {
|