ruicode 0.74.2 → 0.74.4

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.
Files changed (2) hide show
  1. package/dist/feed.js +4 -12
  2. package/package.json +4 -4
package/dist/feed.js CHANGED
@@ -104,7 +104,7 @@ export function readContentBytes(link, session, entry) {
104
104
  export async function readContent(link, session, entry) {
105
105
  return (await readContentBytes(link, session, entry)).toString("utf8");
106
106
  }
107
- /** Waits `ms`, or less when `signal` aborts. */
107
+ /** Waits `ms`, or less when `signal` aborts; with no `ms`, waits only for the abort. */
108
108
  function pause(ms, signal) {
109
109
  return new Promise((resolve) => {
110
110
  if (signal?.aborted)
@@ -114,7 +114,7 @@ function pause(ms, signal) {
114
114
  signal?.removeEventListener("abort", done);
115
115
  resolve();
116
116
  };
117
- const timer = setTimeout(done, ms);
117
+ const timer = ms === undefined ? undefined : setTimeout(done, ms);
118
118
  signal?.addEventListener("abort", done, { once: true });
119
119
  });
120
120
  }
@@ -186,7 +186,8 @@ export async function* listActivity(link, session, options = {}) {
186
186
  if (receivedItems)
187
187
  wait = FIRST_POLL_MS;
188
188
  else if (idle) {
189
- await (watcher ? watcher.wait(revision, signal) : untilAbort(signal));
189
+ // A bare internal Link has no local writes to observe; cancellation still ends its idle wait.
190
+ await (watcher ? watcher.wait(revision, signal) : pause(undefined, signal));
190
191
  wait = FIRST_POLL_MS;
191
192
  }
192
193
  else {
@@ -202,15 +203,6 @@ export async function* listActivity(link, session, options = {}) {
202
203
  function dormant(kind) {
203
204
  return kind === "idle" || kind === "finished" || kind === "failed" || kind === "stopped";
204
205
  }
205
- /** A bare internal Link has no local writes to observe; cancellation still ends its idle wait. */
206
- function untilAbort(signal) {
207
- return new Promise((resolve) => {
208
- if (signal?.aborted)
209
- resolve();
210
- else
211
- signal?.addEventListener("abort", () => resolve(), { once: true });
212
- });
213
- }
214
206
  /** Search public feed text newest first. Empty budget-limited pages still advance. */
215
207
  export async function* searchActivity(link, session, query, options = {}) {
216
208
  const bytes = Buffer.byteLength(query, "utf8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ruicode",
3
- "version": "0.74.2",
3
+ "version": "0.74.4",
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": {
@@ -28,8 +28,8 @@
28
28
  "mcp"
29
29
  ],
30
30
  "optionalDependencies": {
31
- "ruicode-linux-x64": "0.74.2",
32
- "ruicode-linux-arm64": "0.74.2",
33
- "ruicode-darwin-arm64": "0.74.2"
31
+ "ruicode-linux-x64": "0.74.4",
32
+ "ruicode-linux-arm64": "0.74.4",
33
+ "ruicode-darwin-arm64": "0.74.4"
34
34
  }
35
35
  }