@rivus/gateway 0.19.0 → 0.20.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.
@@ -1,194 +0,0 @@
1
- //#region src/core/application/background-session/authority/background-session-authority.ts
2
- const BACKGROUND_SESSION_START_TOOL_ID = "background.start";
3
- const BACKGROUND_SESSION_TOOL_PLUGIN_ID = "rivus-core";
4
- const BACKGROUND_SESSION_TOOL_VERSION = "1.0.0";
5
- const BACKGROUND_SESSION_TOOL_DIGESTS = {
6
- "background.list": "sha256:c935847595e406d55ca889875b38db66bb1d4d7a34d7b0fb2b85aecf9478c149",
7
- "background.send": "sha256:b7ed492e45c794dc286f7f66aca8d046082d11dfdc8787eaf5604765b68a7735",
8
- "background.start": "sha256:773690e47f6eef1f1b289216e94cf98e548382d6cffb7b2f034c3ed0635dfcbb",
9
- "background.status": "sha256:6aaa328d6cd97d8755a63abbe97286f1061fd2f238f68b1e576ed9a1d2b7e6b1",
10
- "background.stop": "sha256:aa0bfdf0c9394058bfcbd8662e7bedd59055f9ddad51c2a1bb61666bd67ebfcb",
11
- "background.wait": "sha256:4a0dc80e933ad3c99b6d58421ac9ef733157e39e0ac9b6ad87ac6e65ceaedaab"
12
- };
13
- function createBackgroundSessionToolContracts() {
14
- return [
15
- Object.freeze({
16
- description: "Start a background agent session. Use when the request must wait for external changes, observe over time, or continue working after the foreground run ends. Returns a stable session id immediately; the foreground response can finish here. The detached session continues with the granted Skills, CLI, Tools, Project Space, and Memory of this agent.",
17
- digest: BACKGROUND_SESSION_TOOL_DIGESTS["background.start"],
18
- id: "background.start",
19
- idempotency: "supported",
20
- inputSchema: Object.freeze({
21
- additionalProperties: false,
22
- properties: Object.freeze({
23
- displayName: {
24
- type: "string",
25
- maxLength: 200
26
- },
27
- prompt: {
28
- type: "string",
29
- minLength: 1,
30
- maxLength: 2e4
31
- }
32
- }),
33
- required: ["prompt"],
34
- type: "object"
35
- }),
36
- pluginId: BACKGROUND_SESSION_TOOL_PLUGIN_ID,
37
- risk: "mutate",
38
- version: BACKGROUND_SESSION_TOOL_VERSION
39
- }),
40
- Object.freeze({
41
- description: "Pause the current background session durably and end the current step. Call with delayMs to resume after a delay, with until to resume at an absolute ISO time, or with neither to wait for user input. After this call no further tool calls are accepted in this step.",
42
- digest: BACKGROUND_SESSION_TOOL_DIGESTS["background.wait"],
43
- id: "background.wait",
44
- idempotency: "supported",
45
- inputSchema: Object.freeze({
46
- additionalProperties: false,
47
- properties: Object.freeze({
48
- delayMs: {
49
- type: "integer",
50
- minimum: 1e3,
51
- maximum: 864e5
52
- },
53
- reason: {
54
- type: "string",
55
- maxLength: 500
56
- },
57
- until: {
58
- type: "string",
59
- maxLength: 64
60
- }
61
- }),
62
- type: "object"
63
- }),
64
- pluginId: BACKGROUND_SESSION_TOOL_PLUGIN_ID,
65
- risk: "mutate",
66
- version: BACKGROUND_SESSION_TOOL_VERSION
67
- }),
68
- Object.freeze({
69
- description: "List background sessions owned by this conversation, newest first. Optionally filter by phase and limit the number of results.",
70
- digest: BACKGROUND_SESSION_TOOL_DIGESTS["background.list"],
71
- id: "background.list",
72
- idempotency: "supported",
73
- inputSchema: Object.freeze({
74
- additionalProperties: false,
75
- properties: Object.freeze({
76
- limit: {
77
- type: "integer",
78
- minimum: 1,
79
- maximum: 50
80
- },
81
- phase: {
82
- enum: [
83
- "queued",
84
- "running",
85
- "waiting",
86
- "input-required",
87
- "stopping",
88
- "stopped",
89
- "completed",
90
- "failed",
91
- "reconciliation-required"
92
- ],
93
- type: "string"
94
- }
95
- }),
96
- type: "object"
97
- }),
98
- pluginId: BACKGROUND_SESSION_TOOL_PLUGIN_ID,
99
- risk: "observe",
100
- version: BACKGROUND_SESSION_TOOL_VERSION
101
- }),
102
- Object.freeze({
103
- description: "Return the current phase, step counts, wake time, and result of one background session owned by this conversation.",
104
- digest: BACKGROUND_SESSION_TOOL_DIGESTS["background.status"],
105
- id: "background.status",
106
- idempotency: "supported",
107
- inputSchema: Object.freeze({
108
- additionalProperties: false,
109
- properties: Object.freeze({ sessionId: {
110
- type: "string",
111
- minLength: 1,
112
- maxLength: 200
113
- } }),
114
- required: ["sessionId"],
115
- type: "object"
116
- }),
117
- pluginId: BACKGROUND_SESSION_TOOL_PLUGIN_ID,
118
- risk: "observe",
119
- version: BACKGROUND_SESSION_TOOL_VERSION
120
- }),
121
- Object.freeze({
122
- description: "Send new user instruction text to a background session owned by this conversation and wake it. The input is delivered exactly once in the next step.",
123
- digest: BACKGROUND_SESSION_TOOL_DIGESTS["background.send"],
124
- id: "background.send",
125
- idempotency: "supported",
126
- inputSchema: Object.freeze({
127
- additionalProperties: false,
128
- properties: Object.freeze({
129
- message: {
130
- type: "string",
131
- minLength: 1,
132
- maxLength: 2e4
133
- },
134
- sessionId: {
135
- type: "string",
136
- minLength: 1,
137
- maxLength: 200
138
- }
139
- }),
140
- required: ["message", "sessionId"],
141
- type: "object"
142
- }),
143
- pluginId: BACKGROUND_SESSION_TOOL_PLUGIN_ID,
144
- risk: "mutate",
145
- version: BACKGROUND_SESSION_TOOL_VERSION
146
- }),
147
- Object.freeze({
148
- description: "Stop a background session owned by this conversation. Persists the cancellation, aborts the active step and its owned process, and delivers a terminal notice.",
149
- digest: BACKGROUND_SESSION_TOOL_DIGESTS["background.stop"],
150
- id: "background.stop",
151
- idempotency: "supported",
152
- inputSchema: Object.freeze({
153
- additionalProperties: false,
154
- properties: Object.freeze({
155
- reason: {
156
- type: "string",
157
- maxLength: 500
158
- },
159
- sessionId: {
160
- type: "string",
161
- minLength: 1,
162
- maxLength: 200
163
- }
164
- }),
165
- required: ["sessionId"],
166
- type: "object"
167
- }),
168
- pluginId: BACKGROUND_SESSION_TOOL_PLUGIN_ID,
169
- risk: "mutate",
170
- version: BACKGROUND_SESSION_TOOL_VERSION
171
- })
172
- ];
173
- }
174
- function narrowBackgroundSessionDefinition(definition, digest) {
175
- const childToolIds = definition.toolGrantSet.toolIds.filter((id) => id !== BACKGROUND_SESSION_START_TOOL_ID);
176
- const toolGrantSet = Object.freeze({
177
- revision: grantRevision(digest, definition.toolGrantSet.revision, childToolIds),
178
- toolIds: Object.freeze(childToolIds)
179
- });
180
- return Object.freeze({
181
- ...definition,
182
- tools: Object.freeze(definition.tools.filter(({ id }) => id !== BACKGROUND_SESSION_START_TOOL_ID)),
183
- toolGrantSet
184
- });
185
- }
186
- function grantRevision(digest, parentRevision, toolIds) {
187
- return digest(JSON.stringify({
188
- parentRevision,
189
- toolIds: [...toolIds].sort()
190
- }));
191
- }
192
- //#endregion
193
- export { narrowBackgroundSessionDefinition as n, createBackgroundSessionToolContracts as t };
194
-
@@ -1 +0,0 @@
1
- export { createRivusDaemonProcess } from "@rivus/gateway/bootstrap/pi-feishu";