@rynx-ai/daemon 0.1.11-beta.11 → 0.1.11-beta.13
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/bundled-plugins/plugins/lark/dist/runtime.js +5992 -5987
- package/bundled-plugins/plugins/lark/dist/settings.js +5981 -5976
- package/bundled-plugins/plugins/lark/package.json +1 -1
- package/dist/chrome-for-testing-store.js +4 -4
- package/dist/control-link-store.js +4 -3
- package/dist/daemon-owner.js +4 -7
- package/dist/db.d.ts +2 -2
- package/dist/db.js +4 -5
- package/dist/migrations/cleanup-legacy-sessions.js +4 -3
- package/dist/plugin-cli.js +2 -1
- package/dist/plugin-installer.js +3 -2
- package/dist/plugin-marketplace.js +2 -1
- package/dist/remote-runtime-access-store.d.ts +2 -2
- package/dist/remote-runtime-access-store.js +6 -9
- package/dist/remote-runtime-target-store.d.ts +2 -2
- package/dist/remote-runtime-target-store.js +6 -6
- package/dist/session-emulator-binding-store.js +4 -6
- package/dist/session-fork-store.js +24 -8
- package/dist/session-launch-operations.js +6 -5
- package/dist/session-log-store.js +2 -1
- package/dist/session-meta-store.js +3 -2
- package/dist/session-portal-grant-store.js +2 -1
- package/dist/session-resource-store.js +3 -2
- package/dist/skills-catalog.js +4 -7
- package/dist/sqlite.d.ts +22 -0
- package/dist/sqlite.js +57 -0
- package/package.json +10 -11
package/dist/sqlite.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type DatabaseSync, type StatementSync } from "node:sqlite";
|
|
2
|
+
type SQLiteInput = null | number | bigint | string | NodeJS.ArrayBufferView;
|
|
3
|
+
type SQLiteParameter = SQLiteInput | Record<string, SQLiteInput>;
|
|
4
|
+
type SQLiteOutput = null | number | bigint | string | Uint8Array;
|
|
5
|
+
export type SQLiteTransaction<Args extends unknown[], Result> = ((...args: Args) => Result) & {
|
|
6
|
+
deferred: (...args: Args) => Result;
|
|
7
|
+
immediate: (...args: Args) => Result;
|
|
8
|
+
exclusive: (...args: Args) => Result;
|
|
9
|
+
};
|
|
10
|
+
/** Wrap a synchronous operation in a SQLite transaction. Nested calls use savepoints. */
|
|
11
|
+
export declare function transaction<Args extends unknown[], Result>(connection: DatabaseSync, operation: (...args: Args) => Result): SQLiteTransaction<Args, Result>;
|
|
12
|
+
/** Return only the first column from a native statement, matching scalar-query intent. */
|
|
13
|
+
export declare function scalar(statement: StatementSync): {
|
|
14
|
+
get(...parameters: SQLiteParameter[]): SQLiteOutput | undefined;
|
|
15
|
+
all(...parameters: SQLiteParameter[]): SQLiteOutput[];
|
|
16
|
+
};
|
|
17
|
+
/** Match a primary SQLite result code, including extended result codes. */
|
|
18
|
+
export declare function hasSqlitePrimaryCode(error: unknown, primaryCode: number): boolean;
|
|
19
|
+
export declare const SQLITE_BUSY = 5;
|
|
20
|
+
export declare const SQLITE_LOCKED = 6;
|
|
21
|
+
export declare const SQLITE_CONSTRAINT = 19;
|
|
22
|
+
export {};
|
package/dist/sqlite.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
let nextSavepointId = 0;
|
|
2
|
+
/** Wrap a synchronous operation in a SQLite transaction. Nested calls use savepoints. */
|
|
3
|
+
export function transaction(connection, operation) {
|
|
4
|
+
const run = (mode, args) => {
|
|
5
|
+
if (connection.isTransaction) {
|
|
6
|
+
const savepoint = `rynx_transaction_${++nextSavepointId}`;
|
|
7
|
+
connection.exec(`SAVEPOINT ${savepoint}`);
|
|
8
|
+
try {
|
|
9
|
+
const result = operation(...args);
|
|
10
|
+
connection.exec(`RELEASE SAVEPOINT ${savepoint}`);
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
if (connection.isTransaction) {
|
|
15
|
+
connection.exec(`ROLLBACK TO SAVEPOINT ${savepoint}`);
|
|
16
|
+
connection.exec(`RELEASE SAVEPOINT ${savepoint}`);
|
|
17
|
+
}
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
connection.exec(`BEGIN ${mode}`);
|
|
22
|
+
try {
|
|
23
|
+
const result = operation(...args);
|
|
24
|
+
connection.exec("COMMIT");
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (connection.isTransaction)
|
|
29
|
+
connection.exec("ROLLBACK");
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const wrapped = ((...args) => run("DEFERRED", args));
|
|
34
|
+
wrapped.deferred = (...args) => run("DEFERRED", args);
|
|
35
|
+
wrapped.immediate = (...args) => run("IMMEDIATE", args);
|
|
36
|
+
wrapped.exclusive = (...args) => run("EXCLUSIVE", args);
|
|
37
|
+
return wrapped;
|
|
38
|
+
}
|
|
39
|
+
/** Return only the first column from a native statement, matching scalar-query intent. */
|
|
40
|
+
export function scalar(statement) {
|
|
41
|
+
statement.setReturnArrays(true);
|
|
42
|
+
const arrayStatement = statement;
|
|
43
|
+
return {
|
|
44
|
+
get: (...parameters) => arrayStatement.get(...parameters)?.[0],
|
|
45
|
+
all: (...parameters) => arrayStatement.all(...parameters).map((row) => row[0]),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Match a primary SQLite result code, including extended result codes. */
|
|
49
|
+
export function hasSqlitePrimaryCode(error, primaryCode) {
|
|
50
|
+
if (!error || typeof error !== "object" || !("errcode" in error))
|
|
51
|
+
return false;
|
|
52
|
+
const errcode = error.errcode;
|
|
53
|
+
return typeof errcode === "number" && (errcode & 0xff) === primaryCode;
|
|
54
|
+
}
|
|
55
|
+
export const SQLITE_BUSY = 5;
|
|
56
|
+
export const SQLITE_LOCKED = 6;
|
|
57
|
+
export const SQLITE_CONSTRAINT = 19;
|
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.13",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/rynx-ai/rynx.git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"description": "Rynx resident control-plane service and standalone lifecycle implementation.",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=22"
|
|
12
|
+
"node": ">=22.16"
|
|
13
13
|
},
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -42,22 +42,21 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"better-sqlite3": "^12.11.1",
|
|
46
45
|
"extract-zip": "2.0.1",
|
|
47
46
|
"pm2": "^6.0.0",
|
|
48
47
|
"tar": "^7.5.19",
|
|
49
48
|
"ws": "^8.21.0",
|
|
50
|
-
"@rynx-ai/core": "0.1.11-beta.
|
|
51
|
-
"@rynx-ai/emulator": "0.1.11-beta.
|
|
52
|
-
"@rynx-ai/plugin-runner": "0.1.11-beta.
|
|
53
|
-
"@rynx-ai/plugin-sdk": "0.1.11-beta.
|
|
54
|
-
"@rynx-ai/protocol": "0.1.11-beta.
|
|
55
|
-
"@rynx-ai/remote-runtime-client": "0.1.11-beta.
|
|
56
|
-
"@rynx-ai/server": "0.1.11-beta.
|
|
49
|
+
"@rynx-ai/core": "0.1.11-beta.13",
|
|
50
|
+
"@rynx-ai/emulator": "0.1.11-beta.13",
|
|
51
|
+
"@rynx-ai/plugin-runner": "0.1.11-beta.13",
|
|
52
|
+
"@rynx-ai/plugin-sdk": "0.1.11-beta.13",
|
|
53
|
+
"@rynx-ai/protocol": "0.1.11-beta.13",
|
|
54
|
+
"@rynx-ai/remote-runtime-client": "0.1.11-beta.13",
|
|
55
|
+
"@rynx-ai/server": "0.1.11-beta.13"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
58
|
"@types/ws": "^8.18.1",
|
|
60
|
-
"@rynx-ai/plugin-channel-lark": "0.1.11-beta.
|
|
59
|
+
"@rynx-ai/plugin-channel-lark": "0.1.11-beta.13"
|
|
61
60
|
},
|
|
62
61
|
"scripts": {
|
|
63
62
|
"build": "rm -rf dist bundled-plugins && tsc -p tsconfig.json && chmod +x dist/index-daemon.js && node ../../scripts/stage-bundled-plugins.mjs",
|