@rivus/agent 0.4.0 → 0.4.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/README.md CHANGED
@@ -1059,7 +1059,7 @@ const bootstrap = await Effect.runPromise(
1059
1059
  );
1060
1060
  ```
1061
1061
 
1062
- The configured preparation helper creates a blue streaming CardKit entity, replies to the inbound Feishu message, and binds the run to the card target before any stream action is published. The running card includes a “Stop generating” button carrying `{ rivus_action: "cancel_run", run_id, session_key }`; completed, failed, and cancelled cards remove it. The configured publisher coalesces consecutive `update_text` actions by run, flushes the latest text before a terminal action, and exposes `flush(runId?)` for explicit worker-driven flushing. `createConfiguredRivusDaemonBootstrap` adds the event log, history restore helper, status reporter, optional status transport, WebSocket transport, worker loop, and managed process around those same pieces; `restoreConfiguredRivusDaemonBootstrap` first replays that event log as restored harness events so read models and same-session loop input are hydrated after restart. Local tests can use `createInMemoryFeishuCardTargetRegistry`; daemon processes should prefer `createJsonFileFeishuCardTargetRegistry` so run-to-card bindings survive restarts and malformed registry files fail loudly instead of being treated as empty state.
1062
+ The configured preparation helper creates a blue streaming CardKit entity, replies to the inbound Feishu message, and binds the run to the card target before any stream action is published. The running card includes a “Stop generating” button carrying `{ rivus_action: "cancel_run", run_id, session_key }`; completed, failed, and cancelled cards remove it. The configured publisher coalesces consecutive `update_text` actions by run, flushes the latest text before a terminal action, and exposes `flush(runId?)` for explicit worker-driven flushing. `createConfiguredRivusDaemonBootstrap` flushes pending text at `config.feishu.streamMinIntervalMs` by default; pass `flushIntervalMs` only to override that cadence. It also adds the event log, history restore helper, status reporter, optional status transport, WebSocket transport, worker loop, and managed process around those same pieces; `restoreConfiguredRivusDaemonBootstrap` first replays that event log as restored harness events so read models and same-session loop input are hydrated after restart. Local tests can use `createInMemoryFeishuCardTargetRegistry`; daemon processes should prefer `createJsonFileFeishuCardTargetRegistry` so run-to-card bindings survive restarts and malformed registry files fail loudly instead of being treated as empty state.
1063
1063
 
1064
1064
  ## Design Notes
1065
1065
 
package/dist/index.js CHANGED
@@ -3131,7 +3131,7 @@ function createConfiguredRivusDaemonBootstrap(options) {
3131
3131
  ...options.initialEvents ? { initialEvents: options.initialEvents } : {},
3132
3132
  ...options.initialRunStates ? { initialRunStates: options.initialRunStates } : {},
3133
3133
  loop: options.loop,
3134
- ...periodicFlush ? { periodicFlush } : {},
3134
+ periodicFlush,
3135
3135
  prepareRun,
3136
3136
  publish: (action) => publisher.publish(action),
3137
3137
  runIds: options.runIds
@@ -3183,10 +3183,9 @@ function createConfiguredRivusDaemonBootstrap(options) {
3183
3183
  };
3184
3184
  }
3185
3185
  function createPeriodicFlush(options, publisher) {
3186
- if (options.flushIntervalMs === void 0) return;
3187
3186
  return createFeishuPeriodicFlush({
3188
3187
  flush: () => publisher.flush(),
3189
- intervalMs: options.flushIntervalMs,
3188
+ intervalMs: options.flushIntervalMs ?? options.config.feishu.streamMinIntervalMs,
3190
3189
  sleep: options.sleep
3191
3190
  });
3192
3191
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivus/agent",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "A local agent daemon core built around a usable agent harness and domain events.",
5
5
  "type": "module",
6
6
  "license": "MIT",