@rynx-ai/daemon 0.1.11-beta.26 → 0.1.11-beta.28
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.
|
@@ -10,8 +10,8 @@ import { accessSync, chmodSync, closeSync, existsSync, lstatSync, mkdirSync, mkd
|
|
|
10
10
|
import { constants as fsConstants } from "node:fs";
|
|
11
11
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
12
12
|
import { DatabaseSync } from "node:sqlite";
|
|
13
|
+
import extractZipArchive from "@electron-internal/extract-zip";
|
|
13
14
|
import { rynxHome } from "@rynx-ai/core";
|
|
14
|
-
import extractZipArchive from "extract-zip";
|
|
15
15
|
import { hasSqlitePrimaryCode, SQLITE_BUSY, SQLITE_LOCKED } from "./sqlite.js";
|
|
16
16
|
const BUILD_OWNER_FILE = ".rynx-cft-owner.json";
|
|
17
17
|
const STAGING_OWNER_FILE = ".rynx-cft-staging-owner.json";
|
package/dist/skills-catalog.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* plus the read-only detail/file helpers the Skills page uses.
|
|
6
6
|
*/
|
|
7
7
|
import { createHash, randomUUID } from "node:crypto";
|
|
8
|
-
import { cp, mkdir, mkdtemp, readdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
8
|
+
import { cp, lstat, mkdir, mkdtemp, readdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
9
9
|
import { tmpdir } from "node:os";
|
|
10
10
|
import path from "node:path";
|
|
11
|
-
import extractZipArchive from "extract-zip";
|
|
11
|
+
import extractZipArchive from "@electron-internal/extract-zip";
|
|
12
12
|
import { extractSkillFrontmatter, assertSkillPathComponent, installIntoCatalog, collectLocalSkillBundlesInWorker, collectSkillBundlesFromDirectory, scanLocalSkillCandidatesInWorker, rynxSkillsDir, rynxSkillArtifactDir, rynxSkillArtifactsDir, scanSkillsDir, readSkillMeta, writeSkillInstallInfo, } from "@rynx-ai/core";
|
|
13
13
|
/** A single file's contents are capped to keep responses small. */
|
|
14
14
|
const MAX_SKILL_FILE_BYTES = 256 * 1024;
|
|
@@ -55,21 +55,8 @@ export async function importCatalogSkillsFromArchive(filename, contentBase64) {
|
|
|
55
55
|
try {
|
|
56
56
|
await writeFile(archive, content);
|
|
57
57
|
await mkdir(extracted, { recursive: true });
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
await extractZipArchive(archive, {
|
|
61
|
-
dir: extracted,
|
|
62
|
-
onEntry: (entry) => {
|
|
63
|
-
entryCount += 1;
|
|
64
|
-
extractedBytes += entry.uncompressedSize;
|
|
65
|
-
if (entryCount > MAX_ARCHIVE_ENTRIES) {
|
|
66
|
-
throw new Error(`archive exceeds the ${MAX_ARCHIVE_ENTRIES}-entry limit`);
|
|
67
|
-
}
|
|
68
|
-
if (extractedBytes > MAX_ARCHIVE_EXTRACTED_BYTES) {
|
|
69
|
-
throw new Error("archive exceeds the 24 MB extracted-size limit");
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
});
|
|
58
|
+
await extractZipArchive(archive, { dir: extracted });
|
|
59
|
+
await assertExtractedArchiveLimits(extracted);
|
|
73
60
|
const collected = collectSkillBundlesFromDirectory(extracted);
|
|
74
61
|
if (collected.bundles.length === 0 && collected.failures.length === 0) {
|
|
75
62
|
return [{
|
|
@@ -88,6 +75,29 @@ export async function importCatalogSkillsFromArchive(filename, contentBase64) {
|
|
|
88
75
|
await rm(staging, { recursive: true, force: true });
|
|
89
76
|
}
|
|
90
77
|
}
|
|
78
|
+
async function assertExtractedArchiveLimits(root) {
|
|
79
|
+
let entryCount = 0;
|
|
80
|
+
let extractedBytes = 0;
|
|
81
|
+
const pending = [root];
|
|
82
|
+
while (pending.length > 0) {
|
|
83
|
+
const directory = pending.pop();
|
|
84
|
+
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
85
|
+
entryCount += 1;
|
|
86
|
+
if (entryCount > MAX_ARCHIVE_ENTRIES) {
|
|
87
|
+
throw new Error(`archive exceeds the ${MAX_ARCHIVE_ENTRIES}-entry limit`);
|
|
88
|
+
}
|
|
89
|
+
const absolute = path.join(directory, entry.name);
|
|
90
|
+
if (entry.isDirectory()) {
|
|
91
|
+
pending.push(absolute);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
extractedBytes += (await lstat(absolute)).size;
|
|
95
|
+
if (extractedBytes > MAX_ARCHIVE_EXTRACTED_BYTES) {
|
|
96
|
+
throw new Error("archive exceeds the 24 MB extracted-size limit");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
91
101
|
async function registerCollectedBundles(collected) {
|
|
92
102
|
const results = collected.failures.map((failure) => ({
|
|
93
103
|
status: "failed",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rynx-ai/daemon",
|
|
3
|
-
"version": "0.1.11-beta.
|
|
3
|
+
"version": "0.1.11-beta.28",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/rynx-ai/rynx.git",
|
|
@@ -46,21 +46,21 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"extract-zip": "
|
|
49
|
+
"@electron-internal/extract-zip": "1.0.5",
|
|
50
50
|
"pm2": "^6.0.0",
|
|
51
51
|
"tar": "^7.5.19",
|
|
52
52
|
"ws": "^8.21.0",
|
|
53
|
-
"@rynx-ai/emulator": "0.1.11-beta.
|
|
54
|
-
"@rynx-ai/plugin-runner": "0.1.11-beta.
|
|
55
|
-
"@rynx-ai/
|
|
56
|
-
"@rynx-ai/
|
|
57
|
-
"@rynx-ai/server": "0.1.11-beta.
|
|
58
|
-
"@rynx-ai/remote-runtime-client": "0.1.11-beta.
|
|
59
|
-
"@rynx-ai/
|
|
53
|
+
"@rynx-ai/emulator": "0.1.11-beta.28",
|
|
54
|
+
"@rynx-ai/plugin-runner": "0.1.11-beta.28",
|
|
55
|
+
"@rynx-ai/core": "0.1.11-beta.28",
|
|
56
|
+
"@rynx-ai/plugin-sdk": "0.1.11-beta.28",
|
|
57
|
+
"@rynx-ai/server": "0.1.11-beta.28",
|
|
58
|
+
"@rynx-ai/remote-runtime-client": "0.1.11-beta.28",
|
|
59
|
+
"@rynx-ai/protocol": "0.1.11-beta.28"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/ws": "^8.18.1",
|
|
63
|
-
"@rynx-ai/plugin-channel-lark": "0.1.11-beta.
|
|
63
|
+
"@rynx-ai/plugin-channel-lark": "0.1.11-beta.28"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "rm -rf dist bundled-plugins && tsc -p tsconfig.json && chmod +x dist/index-daemon.js && node ../../scripts/stage-bundled-plugins.mjs",
|