@rivus/agent 0.16.2 → 0.16.6

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/dist/acp.d.ts CHANGED
@@ -1,144 +1,2 @@
1
- import { a as AgentLoopInput, t as AgentLoop } from "./chunks/agent-loop.js";
2
- import * as acp from "@agentclientprotocol/sdk";
3
-
4
- //#region src/adapters/acp/runtime/acp-agent-loop.d.ts
5
- type AcpToolCallStatus = "pending" | "in_progress" | "completed" | "failed";
6
- interface AcpSessionUpdate {
7
- readonly content?: unknown;
8
- readonly name?: string | null;
9
- readonly rawInput?: unknown;
10
- readonly rawOutput?: unknown;
11
- readonly sessionUpdate: string;
12
- readonly status?: AcpToolCallStatus | null;
13
- readonly title?: string | null;
14
- readonly toolCallId?: string;
15
- readonly [key: string]: unknown;
16
- }
17
- interface AcpPromptResult {
18
- readonly stopReason: string;
19
- }
20
- interface AcpAgentSession {
21
- cancel(options?: {
22
- readonly preserveSession?: boolean;
23
- }): Promise<void> | void;
24
- prompt(text: string, onUpdate: (update: AcpSessionUpdate) => void): Promise<AcpPromptResult>;
25
- dispose?(): Promise<void> | void;
26
- invalidate?(): Promise<void> | void;
27
- }
28
- //#endregion
29
- //#region src/adapters/acp/runtime/acp-permission-policy.d.ts
30
- interface AcpPermissionOption {
31
- readonly kind: "allow_once" | "allow_always" | "reject_once" | "reject_always";
32
- readonly name: string;
33
- readonly optionId: string;
34
- }
35
- interface AcpPermissionToolCall {
36
- readonly toolCallId: string;
37
- readonly title?: string;
38
- readonly rawInput?: unknown;
39
- }
40
- interface AcpPermissionRequest {
41
- readonly options: ReadonlyArray<AcpPermissionOption>;
42
- readonly sessionId: string;
43
- readonly toolCall: AcpPermissionToolCall;
44
- }
45
- interface AcpPermissionSelection {
46
- readonly optionId: string;
47
- }
48
- type AcpPermissionDecision = {
49
- readonly outcome: "cancelled";
50
- } | {
51
- readonly optionId: string;
52
- readonly outcome: "selected";
53
- };
54
- type AcpPermissionPolicy = (request: AcpPermissionRequest) => Promise<AcpPermissionSelection | undefined> | AcpPermissionSelection | undefined;
55
- interface AcpSessionPermissionContext {
56
- readonly sessionKey: string;
57
- }
58
- type AcpSessionPermissionPolicy = (request: AcpPermissionRequest, context: AcpSessionPermissionContext) => Promise<AcpPermissionSelection | undefined> | AcpPermissionSelection | undefined;
59
- declare function decideAcpPermission(request: AcpPermissionRequest, policy?: AcpPermissionPolicy): Promise<AcpPermissionDecision>;
60
- //#endregion
61
- //#region src/adapters/acp/runtime/acp-permission-bridge.d.ts
62
- interface AcpPermissionBridge {
63
- readonly policy: AcpSessionPermissionPolicy;
64
- bind(sessionKey: string, policy: AcpPermissionPolicy): () => void;
65
- }
66
- declare function createAcpPermissionBridge(): AcpPermissionBridge;
67
- //#endregion
68
- //#region src/adapters/acp/runtime/acp-session-store.d.ts
69
- interface AcpSessionRecord {
70
- readonly sessionId: string;
71
- }
72
- interface AcpSessionStore {
73
- delete(sessionKey: string): Promise<void>;
74
- load(sessionKey: string): Promise<AcpSessionRecord | undefined>;
75
- save(sessionKey: string, record: AcpSessionRecord): Promise<void>;
76
- }
77
- interface JsonAcpSessionStoreOptions {
78
- readonly filePath: string;
79
- }
80
- /**
81
- * A small deployment-owned store for ACP provider session identities.
82
- * The file contains no prompts or credentials, only session-key bindings.
83
- */
84
- declare function createJsonAcpSessionStore(options: JsonAcpSessionStoreOptions): AcpSessionStore;
85
- //#endregion
86
- //#region src/adapters/acp/runtime/acp-stdio-agent-loop.d.ts
87
- interface AcpMcpServerEnvironmentVariable {
88
- readonly name: string;
89
- readonly value: string;
90
- }
91
- interface AcpMcpServer {
92
- readonly args: ReadonlyArray<string>;
93
- readonly command: string;
94
- readonly env: ReadonlyArray<AcpMcpServerEnvironmentVariable>;
95
- readonly name: string;
96
- }
97
- declare class AcpSessionResumeUnavailable extends Error {
98
- readonly sessionId: string;
99
- readonly name = "AcpSessionResumeUnavailable";
100
- constructor(sessionId: string);
101
- }
102
- declare class AcpSessionResumeFailed extends Error {
103
- readonly sessionId: string;
104
- readonly cause: unknown;
105
- readonly name = "AcpSessionResumeFailed";
106
- constructor(sessionId: string, cause: unknown);
107
- }
108
- //#endregion
109
- //#region src/adapters/compatibility/agent-execution/acp/acp-runtime.d.ts
110
- interface AcpAgentLoopOptions {
111
- readonly cancellationSettleTimeoutMs?: number;
112
- readonly disposeSessionAfterRun?: boolean;
113
- readonly resolveSession: (input: AgentLoopInput) => Promise<AcpAgentSession> | AcpAgentSession;
114
- }
115
- interface AcpAgentServerOptions {
116
- readonly loop: AgentLoop;
117
- readonly workingDirectory: string;
118
- readonly agentName?: string;
119
- readonly permissionBridge?: AcpPermissionBridge;
120
- }
121
- interface AcpStdioAgentLoopOptions {
122
- readonly command: string;
123
- readonly workingDirectory: string;
124
- readonly mcpServers?: (input: AgentLoopInput) => ReadonlyArray<AcpMcpServer>;
125
- /** Persist provider session IDs so a restarted ACP child can load/resume them. */
126
- readonly sessionStore?: AcpSessionStore;
127
- readonly permissionPolicy?: AcpSessionPermissionPolicy;
128
- readonly environment?: Readonly<Record<string, string>>;
129
- readonly arguments?: ReadonlyArray<string>;
130
- readonly clientName?: string;
131
- readonly initializationTimeoutMs?: number;
132
- readonly terminationTimeoutMs?: number;
133
- readonly onStderr?: (text: string) => void;
134
- }
135
- interface AcpStdioAgentLoopHandle {
136
- readonly loop: AgentLoop;
137
- dispose(): Promise<void>;
138
- }
139
- declare function createAcpAgentLoop(options: AcpAgentLoopOptions): AgentLoop;
140
- declare function createAcpAgentServer(options: AcpAgentServerOptions): acp.AgentApp;
141
- declare function serveAcpAgentOnStdio(app: acp.AgentApp): Promise<void>;
142
- declare function createAcpStdioAgentLoop(options: AcpStdioAgentLoopOptions): AcpStdioAgentLoopHandle;
143
- //#endregion
1
+ import { AcpAgentSession, AcpPermissionBridge, AcpPermissionDecision, AcpPermissionOption, AcpPermissionPolicy, AcpPermissionRequest, AcpPermissionSelection, AcpPermissionToolCall, AcpPromptResult, AcpSessionPermissionContext, AcpSessionPermissionPolicy, AcpSessionRecord, AcpSessionResumeFailed, AcpSessionResumeUnavailable, AcpSessionStore, AcpSessionUpdate, AcpToolCallStatus, JsonAcpSessionStoreOptions, LegacyAcpAgentLoopOptions as AcpAgentLoopOptions, LegacyAcpAgentServerOptions as AcpAgentServerOptions, LegacyAcpStdioAgentLoopHandle as AcpStdioAgentLoopHandle, LegacyAcpStdioAgentLoopOptions as AcpStdioAgentLoopOptions, createAcpPermissionBridge, createJsonAcpSessionStore, createLegacyAcpAgentLoop as createAcpAgentLoop, createLegacyAcpAgentServer as createAcpAgentServer, createLegacyAcpStdioAgentLoop as createAcpStdioAgentLoop, decideAcpPermission, serveLegacyAcpAgentOnStdio as serveAcpAgentOnStdio } from "@rivus/runtime/acp";
144
2
  export { type AcpAgentLoopOptions, type AcpAgentServerOptions, type AcpAgentSession, type AcpPermissionBridge, type AcpPermissionDecision, type AcpPermissionOption, type AcpPermissionPolicy, type AcpPermissionRequest, type AcpPermissionSelection, type AcpPermissionToolCall, type AcpPromptResult, type AcpSessionPermissionContext, type AcpSessionPermissionPolicy, type AcpSessionRecord, AcpSessionResumeFailed, AcpSessionResumeUnavailable, type AcpSessionStore, type AcpSessionUpdate, type AcpStdioAgentLoopHandle, type AcpStdioAgentLoopOptions, type AcpToolCallStatus, type JsonAcpSessionStoreOptions, createAcpAgentLoop, createAcpAgentServer, createAcpPermissionBridge, createAcpStdioAgentLoop, createJsonAcpSessionStore, decideAcpPermission, serveAcpAgentOnStdio };