loki-mode-sdk 9.22.12 → 9.23.1
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/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loki-mode-sdk",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.23.1",
|
|
4
4
|
"description": "TypeScript SDK for Loki Mode - autonomous multi-agent development platform",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist/",
|
|
9
|
+
"scripts/normalize-package-permissions.mjs",
|
|
9
10
|
"README.md",
|
|
10
11
|
"LICENSE"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
14
|
"build": "tsc",
|
|
15
|
+
"prepack": "node scripts/normalize-package-permissions.mjs .",
|
|
14
16
|
"prepublishOnly": "npm run build",
|
|
15
17
|
"test": "node --test tests/client.test.js"
|
|
16
18
|
},
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { chmod, lstat } from 'node:fs/promises';
|
|
3
|
+
import { dirname, resolve } from 'node:path';
|
|
4
|
+
|
|
5
|
+
const packageRoot = resolve(process.argv[2] ?? '.');
|
|
6
|
+
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
7
|
+
const packResult = JSON.parse(execFileSync(npmCommand, [
|
|
8
|
+
'pack', '--dry-run', '--json', '--ignore-scripts',
|
|
9
|
+
], {
|
|
10
|
+
cwd: packageRoot,
|
|
11
|
+
encoding: 'utf8',
|
|
12
|
+
stdio: ['ignore', 'pipe', 'inherit'],
|
|
13
|
+
}));
|
|
14
|
+
const packageFiles = packResult[0]?.files?.map(({ path }) => resolve(packageRoot, path)) ?? [];
|
|
15
|
+
|
|
16
|
+
if (packageFiles.length === 0) {
|
|
17
|
+
throw new Error('npm pack dry-run returned an empty package inventory');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
await chmod(packageRoot, 0o755);
|
|
21
|
+
for (const filePath of packageFiles) {
|
|
22
|
+
const entry = await lstat(filePath);
|
|
23
|
+
if (entry.isSymbolicLink()) continue;
|
|
24
|
+
if (entry.isDirectory()) {
|
|
25
|
+
await chmod(filePath, 0o755);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const { mode } = entry;
|
|
29
|
+
await chmod(filePath, mode & 0o111 ? 0o755 : 0o644);
|
|
30
|
+
|
|
31
|
+
for (let directory = dirname(filePath); directory !== packageRoot; directory = dirname(directory)) {
|
|
32
|
+
await chmod(directory, 0o755);
|
|
33
|
+
}
|
|
34
|
+
}
|