ruicode 0.88.0 → 0.92.0
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 +19 -42
- package/dist/binary.d.ts +2 -0
- package/dist/binary.js +15 -5
- package/dist/client.d.ts +16 -4
- package/dist/client.js +248 -20
- package/dist/errors.d.ts +29 -2
- package/dist/errors.js +31 -3
- package/dist/feed.d.ts +21 -9
- package/dist/feed.js +82 -99
- package/dist/follow.d.ts +84 -0
- package/dist/follow.js +237 -0
- package/dist/host-environment.d.ts +2 -0
- package/dist/host-environment.js +3 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/line.d.ts +45 -0
- package/dist/line.js +132 -0
- package/dist/rejections.d.ts +1 -0
- package/dist/rejections.js +52 -0
- package/dist/sessions.d.ts +28 -6
- package/dist/sessions.js +86 -18
- package/dist/transport.d.ts +2 -2
- package/dist/transport.js +2 -4
- package/dist/wire.d.ts +297 -120
- package/package.json +8 -4
- package/dist/notifications.d.ts +0 -16
- package/dist/notifications.js +0 -67
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ruicode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.92.0",
|
|
4
4
|
"description": "Start a Rui Host as a child process and talk to it over its local socket.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=22.6"
|
|
8
8
|
},
|
|
9
|
+
"os": [
|
|
10
|
+
"linux",
|
|
11
|
+
"darwin"
|
|
12
|
+
],
|
|
9
13
|
"exports": {
|
|
10
14
|
".": {
|
|
11
15
|
"types": "./dist/index.d.ts",
|
|
@@ -28,8 +32,8 @@
|
|
|
28
32
|
"mcp"
|
|
29
33
|
],
|
|
30
34
|
"optionalDependencies": {
|
|
31
|
-
"ruicode-linux-x64": "0.
|
|
32
|
-
"ruicode-linux-arm64": "0.
|
|
33
|
-
"ruicode-darwin-arm64": "0.
|
|
35
|
+
"ruicode-linux-x64": "0.92.0",
|
|
36
|
+
"ruicode-linux-arm64": "0.92.0",
|
|
37
|
+
"ruicode-darwin-arm64": "0.92.0"
|
|
34
38
|
}
|
|
35
39
|
}
|
package/dist/notifications.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare class SessionNotifications {
|
|
2
|
-
#private;
|
|
3
|
-
watch(session: string): WriteWatch;
|
|
4
|
-
fail(error: Error): void;
|
|
5
|
-
notify(session: string): void;
|
|
6
|
-
}
|
|
7
|
-
declare class WriteWatch {
|
|
8
|
-
#private;
|
|
9
|
-
revision: number;
|
|
10
|
-
constructor(release: () => void);
|
|
11
|
-
notify(): void;
|
|
12
|
-
wait(revision: number, signal: AbortSignal | undefined): Promise<void>;
|
|
13
|
-
fail(error: Error): void;
|
|
14
|
-
close(): void;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
package/dist/notifications.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export class SessionNotifications {
|
|
2
|
-
#sessions = new Map();
|
|
3
|
-
watch(session) {
|
|
4
|
-
let watches = this.#sessions.get(session);
|
|
5
|
-
if (!watches)
|
|
6
|
-
this.#sessions.set(session, (watches = new Set()));
|
|
7
|
-
const watch = new WriteWatch(() => {
|
|
8
|
-
if (watches.delete(watch) && watches.size === 0)
|
|
9
|
-
this.#sessions.delete(session);
|
|
10
|
-
});
|
|
11
|
-
watches.add(watch);
|
|
12
|
-
return watch;
|
|
13
|
-
}
|
|
14
|
-
fail(error) {
|
|
15
|
-
for (const watches of this.#sessions.values()) {
|
|
16
|
-
for (const watch of watches)
|
|
17
|
-
watch.fail(error);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
notify(session) {
|
|
21
|
-
for (const watch of this.#sessions.get(session) ?? [])
|
|
22
|
-
watch.notify();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
class WriteWatch {
|
|
26
|
-
revision = 0;
|
|
27
|
-
#release;
|
|
28
|
-
#wake;
|
|
29
|
-
#error;
|
|
30
|
-
constructor(release) {
|
|
31
|
-
this.#release = release;
|
|
32
|
-
}
|
|
33
|
-
notify() {
|
|
34
|
-
this.revision++;
|
|
35
|
-
this.#wake?.();
|
|
36
|
-
}
|
|
37
|
-
wait(revision, signal) {
|
|
38
|
-
return new Promise((resolve, reject) => {
|
|
39
|
-
if (signal?.aborted)
|
|
40
|
-
return resolve();
|
|
41
|
-
if (this.#error)
|
|
42
|
-
return reject(this.#error);
|
|
43
|
-
if (this.revision !== revision)
|
|
44
|
-
return resolve();
|
|
45
|
-
const done = (error) => {
|
|
46
|
-
signal?.removeEventListener("abort", abort);
|
|
47
|
-
this.#wake = undefined;
|
|
48
|
-
if (error)
|
|
49
|
-
reject(error);
|
|
50
|
-
else
|
|
51
|
-
resolve();
|
|
52
|
-
};
|
|
53
|
-
const abort = () => done();
|
|
54
|
-
this.#wake = done;
|
|
55
|
-
signal?.addEventListener("abort", abort, { once: true });
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
fail(error) {
|
|
59
|
-
this.#error = error;
|
|
60
|
-
this.#wake?.(error);
|
|
61
|
-
this.close();
|
|
62
|
-
}
|
|
63
|
-
close() {
|
|
64
|
-
this.#wake?.();
|
|
65
|
-
this.#release();
|
|
66
|
-
}
|
|
67
|
-
}
|