@rivus/agent 0.16.2 → 0.17.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.
Files changed (55) hide show
  1. package/LICENSE +669 -17
  2. package/README.md +25 -1080
  3. package/dist/cli.d.ts +1 -1
  4. package/dist/cli.js +12 -1234
  5. package/dist/index.d.ts +3 -7
  6. package/dist/index.js +3 -8
  7. package/dist/testing/index.d.ts +21 -50
  8. package/dist/testing/index.js +58 -89
  9. package/package.json +40 -104
  10. package/dist/acp.d.ts +0 -144
  11. package/dist/acp.js +0 -768
  12. package/dist/bootstrap/pi-feishu.d.ts +0 -20
  13. package/dist/bootstrap/pi-feishu.js +0 -4341
  14. package/dist/chunks/agent-loop.d.ts +0 -446
  15. package/dist/chunks/agent-loop.js +0 -158
  16. package/dist/chunks/background-session-authority.js +0 -230
  17. package/dist/chunks/background-session-control-input.js +0 -51
  18. package/dist/chunks/background-session-service.d.ts +0 -382
  19. package/dist/chunks/index.d.ts +0 -4448
  20. package/dist/chunks/pi-tool-proxy.d.ts +0 -120
  21. package/dist/chunks/pi.js +0 -406
  22. package/dist/chunks/rivus-agent-definition-resolver.js +0 -508
  23. package/dist/chunks/rivus-daemon-cli.js +0 -3839
  24. package/dist/chunks/rivus-model-management-wire.js +0 -344
  25. package/dist/chunks/rivus-plugin-testkit.d.ts +0 -214
  26. package/dist/chunks/rivus-plugin-testkit.js +0 -78
  27. package/dist/chunks/rivus-skill.d.ts +0 -95
  28. package/dist/chunks/rivus-tool.js +0 -158
  29. package/dist/chunks/sha256-digest.js +0 -7
  30. package/dist/chunks/src.js +0 -15313
  31. package/dist/mcp.d.ts +0 -92
  32. package/dist/mcp.js +0 -454
  33. package/dist/pi.d.ts +0 -129
  34. package/dist/pi.js +0 -3
  35. package/examples/a-share-briefing-analysis.mjs +0 -93
  36. package/examples/a-share-briefing-renderer.mjs +0 -257
  37. package/examples/a-share-index-evidence.mjs +0 -99
  38. package/examples/a-share-market-briefing.mjs +0 -83
  39. package/examples/a-share-market-date.mjs +0 -10
  40. package/examples/a-share-overseas-evidence.mjs +0 -86
  41. package/examples/a-share-policy-evidence.mjs +0 -145
  42. package/examples/a-share-provider-response.mjs +0 -21
  43. package/examples/a-share-sector-evidence.mjs +0 -70
  44. package/examples/acp-stdio-proxy.mjs +0 -58
  45. package/examples/current-weather.mjs +0 -117
  46. package/examples/html-drive-tools.mjs +0 -262
  47. package/examples/https-response-reader.mjs +0 -36
  48. package/examples/langfuse-drive-e2e.mjs +0 -175
  49. package/examples/pi-feishu-deployment.bootstrap.ts +0 -894
  50. package/examples/pi-feishu.bootstrap.ts +0 -242
  51. package/examples/rivus-agents.plugin.mjs +0 -290
  52. package/examples/rivus-langfuse-demo.config.json +0 -37
  53. package/examples/rivus-starter.plugin.mjs +0 -47
  54. package/examples/rivus.config.json +0 -114
  55. package/skills/runtime-management/SKILL.md +0 -65
package/dist/acp.d.ts DELETED
@@ -1,144 +0,0 @@
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
144
- 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 };