@pushwoosh/rpc-gateway-ai-assistant 0.1.271 → 0.1.273

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/data.js CHANGED
@@ -1,6 +1,248 @@
1
1
  /* eslint-disable */
2
2
  /* Autogenerated code */
3
3
  export const data = {
4
+ "pushwoosh.agentrunner.v1.AgentRunner": {
5
+ "type": "S",
6
+ "key": "agentRunner",
7
+ "methods": {}
8
+ },
9
+ "pushwoosh.agentrunner.v1.TurnRequest": {
10
+ "type": "I",
11
+ "fields": {
12
+ "start": {
13
+ "type": "pushwoosh.agentrunner.v1.StartTurn"
14
+ },
15
+ "toolResult": {
16
+ "type": "pushwoosh.agentrunner.v1.ToolResult"
17
+ }
18
+ },
19
+ "oneofs": {
20
+ "payload": {
21
+ "oneof": [
22
+ "start",
23
+ "toolResult"
24
+ ]
25
+ }
26
+ }
27
+ },
28
+ "pushwoosh.agentrunner.v1.StartTurn": {
29
+ "type": "I",
30
+ "fields": {
31
+ "systemPrompt": {
32
+ "type": "pushwoosh.agentrunner.v1.SystemPrompt"
33
+ },
34
+ "history": {
35
+ "type": "pushwoosh.agentrunner.v1.HistoryMessage",
36
+ "array": true
37
+ },
38
+ "tools": {
39
+ "type": "pushwoosh.agentrunner.v1.ToolDef",
40
+ "array": true
41
+ },
42
+ "model": {
43
+ "type": "string"
44
+ },
45
+ "maxTurns": {
46
+ "type": "number"
47
+ },
48
+ "chatId": {
49
+ "type": "number"
50
+ }
51
+ }
52
+ },
53
+ "pushwoosh.agentrunner.v1.SystemPrompt": {
54
+ "type": "I",
55
+ "fields": {
56
+ "static": {
57
+ "type": "string"
58
+ },
59
+ "dynamic": {
60
+ "type": "string",
61
+ "array": true
62
+ }
63
+ }
64
+ },
65
+ "pushwoosh.agentrunner.v1.HistoryRole": {
66
+ "type": "E",
67
+ "values": [
68
+ "HISTORY_ROLE_UNSPECIFIED",
69
+ "HISTORY_ROLE_USER",
70
+ "HISTORY_ROLE_ASSISTANT",
71
+ "HISTORY_ROLE_TOOL_REQUEST",
72
+ "HISTORY_ROLE_TOOL_RESULT",
73
+ "HISTORY_ROLE_CONTEXT_COMPACT"
74
+ ]
75
+ },
76
+ "pushwoosh.agentrunner.v1.HistoryMessage": {
77
+ "type": "I",
78
+ "fields": {
79
+ "role": {
80
+ "type": "pushwoosh.agentrunner.v1.HistoryRole"
81
+ },
82
+ "text": {
83
+ "type": "string"
84
+ },
85
+ "toolCalls": {
86
+ "type": "pushwoosh.agentrunner.v1.ToolCall",
87
+ "array": true
88
+ },
89
+ "toolResult": {
90
+ "type": "pushwoosh.agentrunner.v1.ToolResult"
91
+ }
92
+ }
93
+ },
94
+ "pushwoosh.agentrunner.v1.ToolDef": {
95
+ "type": "I",
96
+ "fields": {
97
+ "name": {
98
+ "type": "string"
99
+ },
100
+ "description": {
101
+ "type": "string"
102
+ },
103
+ "inputSchemaJson": {
104
+ "type": "string"
105
+ }
106
+ }
107
+ },
108
+ "pushwoosh.agentrunner.v1.ToolCall": {
109
+ "type": "I",
110
+ "fields": {
111
+ "id": {
112
+ "type": "string"
113
+ },
114
+ "name": {
115
+ "type": "string"
116
+ },
117
+ "argsJson": {
118
+ "type": "string"
119
+ }
120
+ }
121
+ },
122
+ "pushwoosh.agentrunner.v1.ToolResult": {
123
+ "type": "I",
124
+ "fields": {
125
+ "id": {
126
+ "type": "string"
127
+ },
128
+ "content": {
129
+ "type": "string"
130
+ },
131
+ "isError": {
132
+ "type": "boolean"
133
+ }
134
+ }
135
+ },
136
+ "pushwoosh.agentrunner.v1.TurnEvent": {
137
+ "type": "I",
138
+ "fields": {
139
+ "delta": {
140
+ "type": "pushwoosh.agentrunner.v1.StreamDelta"
141
+ },
142
+ "assistantMessage": {
143
+ "type": "pushwoosh.agentrunner.v1.AssistantMessage"
144
+ },
145
+ "toolCall": {
146
+ "type": "pushwoosh.agentrunner.v1.ToolCall"
147
+ },
148
+ "done": {
149
+ "type": "pushwoosh.agentrunner.v1.TurnDone"
150
+ }
151
+ },
152
+ "oneofs": {
153
+ "payload": {
154
+ "oneof": [
155
+ "delta",
156
+ "assistantMessage",
157
+ "toolCall",
158
+ "done"
159
+ ]
160
+ }
161
+ }
162
+ },
163
+ "pushwoosh.agentrunner.v1.StreamEvent": {
164
+ "type": "E",
165
+ "values": [
166
+ "STREAM_EVENT_UNSPECIFIED",
167
+ "STREAM_EVENT_MESSAGE_START",
168
+ "STREAM_EVENT_CONTENT_BLOCK_START",
169
+ "STREAM_EVENT_TEXT_DELTA",
170
+ "STREAM_EVENT_TOOL_USE_START",
171
+ "STREAM_EVENT_TOOL_USE_DELTA",
172
+ "STREAM_EVENT_TOOL_USE_RESULT",
173
+ "STREAM_EVENT_CONTENT_BLOCK_STOP",
174
+ "STREAM_EVENT_MESSAGE_DELTA",
175
+ "STREAM_EVENT_MESSAGE_STOP",
176
+ "STREAM_EVENT_THINKING_DELTA",
177
+ "STREAM_EVENT_ERROR"
178
+ ]
179
+ },
180
+ "pushwoosh.agentrunner.v1.StreamDelta": {
181
+ "type": "I",
182
+ "fields": {
183
+ "type": {
184
+ "type": "pushwoosh.agentrunner.v1.StreamEvent"
185
+ },
186
+ "content": {
187
+ "type": "string"
188
+ }
189
+ }
190
+ },
191
+ "pushwoosh.agentrunner.v1.AssistantMessage": {
192
+ "type": "I",
193
+ "fields": {
194
+ "text": {
195
+ "type": "string"
196
+ },
197
+ "toolCalls": {
198
+ "type": "pushwoosh.agentrunner.v1.ToolCall",
199
+ "array": true
200
+ },
201
+ "usage": {
202
+ "type": "pushwoosh.agentrunner.v1.Usage"
203
+ },
204
+ "thinking": {
205
+ "type": "string"
206
+ }
207
+ }
208
+ },
209
+ "pushwoosh.agentrunner.v1.Usage": {
210
+ "type": "I",
211
+ "fields": {
212
+ "model": {
213
+ "type": "string"
214
+ },
215
+ "inputTokens": {
216
+ "type": "number"
217
+ },
218
+ "outputTokens": {
219
+ "type": "number"
220
+ },
221
+ "cacheCreationInputTokens": {
222
+ "type": "number"
223
+ },
224
+ "cacheReadInputTokens": {
225
+ "type": "number"
226
+ }
227
+ }
228
+ },
229
+ "pushwoosh.agentrunner.v1.TurnDone": {
230
+ "type": "I",
231
+ "fields": {
232
+ "stopReason": {
233
+ "type": "string"
234
+ },
235
+ "error": {
236
+ "type": "string"
237
+ },
238
+ "turns": {
239
+ "type": "number"
240
+ },
241
+ "turnCapHit": {
242
+ "type": "boolean"
243
+ }
244
+ }
245
+ },
4
246
  "pushwoosh.aibuilder.v1.DocumentBlockType": {
5
247
  "type": "E",
6
248
  "values": [
package/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
+ import { AgentRunner as pushwoosh_agentrunner_v1_AgentRunner } from './pushwoosh_agentrunner_v1';
1
2
  import { AiGenService as pushwoosh_aigen_v1_AiGenService } from './pushwoosh_aigen_v1';
2
3
  import { AssistantService as pushwoosh_accounts_assistant_v1_AssistantService } from './pushwoosh_accounts_assistant_v1';
3
4
  import { TemplatesService as pushwoosh_templates_v1_TemplatesService } from './pushwoosh_templates_v1';
4
5
  import { VibeMlService as pushwoosh_vibeml_v1_VibeMlService } from './pushwoosh_vibeml_v1';
5
6
  export type API = {
7
+ agentRunner: pushwoosh_agentrunner_v1_AgentRunner;
6
8
  aiGen: pushwoosh_aigen_v1_AiGenService;
7
9
  assistant: pushwoosh_accounts_assistant_v1_AssistantService;
8
10
  templates: pushwoosh_templates_v1_TemplatesService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.271",
3
+ "version": "0.1.273",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -0,0 +1,128 @@
1
+ /**
2
+ * AgentRunner is the Go ↔ Node-sidecar contract for the Claude Agent SDK loop.
3
+ * Loopback only — never on a Service port.
4
+ */
5
+ export interface AgentRunner {
6
+ }
7
+ export type TurnRequest_payload_start = {
8
+ type: 'start';
9
+ data: StartTurn;
10
+ };
11
+ export type TurnRequest_payload_toolResult = {
12
+ type: 'toolResult';
13
+ data: ToolResult;
14
+ };
15
+ export type TurnRequest_payload = TurnRequest_payload_start | TurnRequest_payload_toolResult;
16
+ export type TurnRequest = {
17
+ payload: TurnRequest_payload;
18
+ };
19
+ export type StartTurn = {
20
+ systemPrompt: SystemPrompt;
21
+ /**
22
+ * History as persisted, oldest first. How the runner seeds a session from it is its
23
+ * own business — that decision must not need a wire change.
24
+ */
25
+ history: HistoryMessage[];
26
+ tools: ToolDef[];
27
+ model: string;
28
+ maxTurns: number;
29
+ /** Correlation only: the runner never reads the chat, it just labels its logs. */
30
+ chatId: number;
31
+ };
32
+ /**
33
+ * Split because the split is what makes cross-session caching possible: joined into one
34
+ * string, the SDK treats the whole prompt as session-specific.
35
+ */
36
+ export type SystemPrompt = {
37
+ /** identical for every chat and account */
38
+ static: string;
39
+ /** per-chat / per-account blocks, never cached */
40
+ dynamic: string[];
41
+ };
42
+ export type HistoryRole = 'HISTORY_ROLE_UNSPECIFIED' | 'HISTORY_ROLE_USER' | 'HISTORY_ROLE_ASSISTANT'
43
+ /** assistant turn that called tools */
44
+ | 'HISTORY_ROLE_TOOL_REQUEST' | 'HISTORY_ROLE_TOOL_RESULT'
45
+ /** supersedes everything before it */
46
+ | 'HISTORY_ROLE_CONTEXT_COMPACT';
47
+ export type HistoryMessage = {
48
+ role: HistoryRole;
49
+ /** USER / ASSISTANT / CONTEXT_COMPACT */
50
+ text: string;
51
+ /** TOOL_REQUEST */
52
+ toolCalls: ToolCall[];
53
+ /** TOOL_RESULT */
54
+ toolResult: ToolResult;
55
+ };
56
+ /**
57
+ * ToolDef carries the schema verbatim as JSON: it is what the MCP server the
58
+ * runner stands up advertises, and Go stays the only owner of the tool surface.
59
+ */
60
+ export type ToolDef = {
61
+ name: string;
62
+ description: string;
63
+ inputSchemaJson: string;
64
+ };
65
+ export type ToolCall = {
66
+ id: string;
67
+ name: string;
68
+ argsJson: string;
69
+ };
70
+ export type ToolResult = {
71
+ id: string;
72
+ content: string;
73
+ isError: boolean;
74
+ };
75
+ export type TurnEvent_payload_delta = {
76
+ type: 'delta';
77
+ data: StreamDelta;
78
+ };
79
+ export type TurnEvent_payload_assistantMessage = {
80
+ type: 'assistantMessage';
81
+ data: AssistantMessage;
82
+ };
83
+ export type TurnEvent_payload_toolCall = {
84
+ type: 'toolCall';
85
+ data: ToolCall;
86
+ };
87
+ export type TurnEvent_payload_done = {
88
+ type: 'done';
89
+ data: TurnDone;
90
+ };
91
+ export type TurnEvent_payload = TurnEvent_payload_delta | TurnEvent_payload_assistantMessage | TurnEvent_payload_toolCall | TurnEvent_payload_done;
92
+ export type TurnEvent = {
93
+ payload: TurnEvent_payload;
94
+ };
95
+ /**
96
+ * Projection of the client-facing StreamEventType, mapped in one place in Go
97
+ * (TestRunnerEnumsMapExhaustively), minus the events no runner can produce.
98
+ */
99
+ export type StreamEvent = 'STREAM_EVENT_UNSPECIFIED' | 'STREAM_EVENT_MESSAGE_START' | 'STREAM_EVENT_CONTENT_BLOCK_START' | 'STREAM_EVENT_TEXT_DELTA' | 'STREAM_EVENT_TOOL_USE_START' | 'STREAM_EVENT_TOOL_USE_DELTA' | 'STREAM_EVENT_TOOL_USE_RESULT' | 'STREAM_EVENT_CONTENT_BLOCK_STOP' | 'STREAM_EVENT_MESSAGE_DELTA' | 'STREAM_EVENT_MESSAGE_STOP' | 'STREAM_EVENT_THINKING_DELTA' | 'STREAM_EVENT_ERROR';
100
+ export type StreamDelta = {
101
+ type: StreamEvent;
102
+ content: string;
103
+ };
104
+ /**
105
+ * AssistantMessage is the whole model turn, sent once it is complete. Go persists
106
+ * this instead of re-accumulating deltas, and records usage against it.
107
+ */
108
+ export type AssistantMessage = {
109
+ text: string;
110
+ toolCalls: ToolCall[];
111
+ usage: Usage;
112
+ /** mirrored to Mattermost, never persisted, never streamed */
113
+ thinking: string;
114
+ };
115
+ export type Usage = {
116
+ model: string;
117
+ inputTokens: number;
118
+ outputTokens: number;
119
+ cacheCreationInputTokens: number;
120
+ cacheReadInputTokens: number;
121
+ };
122
+ export type TurnDone = {
123
+ stopReason: string;
124
+ /** empty on success */
125
+ error: string;
126
+ turns: number;
127
+ turnCapHit: boolean;
128
+ };
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ /* Autogenerated code */
3
+ export {};