@rivus/agent 0.6.2 → 0.7.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 CHANGED
@@ -15,6 +15,7 @@ The first milestone is intentionally narrow: make the agent loop and agent harne
15
15
  - Multi-agent Host primitives with trusted Endpoint bindings, stable Runtime Generation/Instance identities, lazy per-instance Runtime pooling, isolated active-run gates, and restart restoration from persisted registry records.
16
16
  - Scoped Agent Memory with a single-writer append-only JSONL adapter, explicit Profile/Deployment grants, Host-bound tenant/subject/conversation/project/audience identity, and a provider-neutral `rivus_memory` Tool wired into the Pi manifest Runtime. Agent-private proposals survive process replacement; group invocations may access only Conversation and confirmed Project Memory, and Shared Profile reads expose only confirmed records. Bound Project Memory is recalled automatically with deterministic limits; durable confirmation UX, typed Shared Profile fields, full provenance/retention metadata, and durable Compaction are still separate work.
17
17
  - Manifest-driven fixed-time Agent Automations with daily or weekday-only schedules, stable Mandate/Tick identity, per-template Tool grant narrowing, isolated Runtime and invocation authority, a durable single-writer JSON Tick adapter that records the actual Agent Run, generated-before-delivery recovery, and idempotent proactive Feishu interactive-card delivery. The first Markdown heading becomes the card title while the remaining Markdown stays scannable in the card body. Revisioned Plugin State and the general Delivery Outbox remain composable domain primitives.
18
+ - Opt-in background Agent Sessions (`manifest.backgroundSessions`): the model decides from ordinary natural language that work should continue in the background, calls the generic `background.start` Host Tool, and the foreground Run and card end promptly. A deployment-owned supervisor runs bounded steps on an isolated Runtime lane per Agent with the exact Agent/Profile/Project Space/Skills/Memory policy and a grant narrowed to exclude `background.start`; sessions wait durably (`background.wait`), wake, receive user input once (`background.send`), stop safely, and survive daemon restart on the same stable session and Pi transcript. Progress and one terminal result are delivered idempotently to the trusted source conversation. The Runtime contains no business scenario, meeting, or job code — no pre-model intent router exists.
18
19
  - Peer Delegation and Subagent coordination primitives with explicit edges, hop/budget limits, monotonic ToolGrantSet intersection, isolated child authority, denied ambient sender/private-memory/Shell capabilities, and parent cancellation cascading.
19
20
  - `@rivus/agent/testing` Conformance TestKit with a reusable Fake Plugin and checks for registration/reference failures, ToolGrantSet expansion, and lifecycle disposal leaks.
20
21
  - Effect-based `AgentHarness` use case with result-oriented `prompt()`, turn-oriented `promptTurn()`, event-oriented `stream()`, text-oriented `streamText()`, event-handling `promptWithEvents()`, active-run/run/session state and transcript lookup APIs, and a default runtime factory.
@@ -125,6 +126,17 @@ For a manifest-driven multi-agent deployment, keep `rivus.config.json`, its lock
125
126
  }
126
127
  }
127
128
  ],
129
+ "backgroundSessions": {
130
+ "enabled": false,
131
+ "required": false,
132
+ "stepTimeoutMs": 300000,
133
+ "maxConcurrentSessions": 4,
134
+ "leaseMs": 30000,
135
+ "leaseRenewalIntervalMs": 10000,
136
+ "maxConsecutiveFailures": 3,
137
+ "retryBackoffMs": 30000,
138
+ "sessionLifetimeMs": 86400000
139
+ },
128
140
  "endpoints": [
129
141
  {
130
142
  "id": "research-feishu",
@@ -296,7 +296,16 @@ interface AutomationAgentInvocationOrigin {
296
296
  readonly tenantKey: "automation";
297
297
  readonly tickId: string;
298
298
  }
299
- type AgentInvocationOrigin = FeishuAgentInvocationOrigin | LocalCliAgentInvocationOrigin | AutomationAgentInvocationOrigin;
299
+ interface BackgroundSessionAgentInvocationOrigin {
300
+ readonly allowedActorOpenIds: ReadonlyArray<string>;
301
+ readonly endpointId: string;
302
+ readonly kind: "background-session";
303
+ readonly memory?: AgentMemoryInvocationIdentity;
304
+ readonly sessionId: string;
305
+ readonly sourceMessageId: string;
306
+ readonly tenantKey: string;
307
+ }
308
+ type AgentInvocationOrigin = FeishuAgentInvocationOrigin | LocalCliAgentInvocationOrigin | AutomationAgentInvocationOrigin | BackgroundSessionAgentInvocationOrigin;
300
309
  //#endregion
301
310
  //#region src/application/agent/agent-loop.d.ts
302
311
  interface AgentLoopInput {
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { D as loadRivusDeploymentManifest, G as validateRivusDeploymentManifest, H as loadMergedLocalEnvFile, T as resolveNodeRivusPluginModulePath, V as resolveFeishuEndpointCredentials, t as runRivusDaemonCli } from "./rivus-daemon-cli.js";
2
+ import { D as loadRivusDeploymentManifest, T as resolveNodeRivusPluginModulePath, X as resolveFeishuEndpointCredentials, Z as loadMergedLocalEnvFile, et as validateRivusDeploymentManifest, t as runRivusDaemonCli } from "./rivus-daemon-cli.js";
3
3
  import { Effect } from "effect";
4
4
  import { fileURLToPath, pathToFileURL } from "node:url";
5
5
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";