@pushwoosh/rpc-gateway-ai-assistant 0.1.582 → 0.1.584

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/commonTypes.d.ts CHANGED
@@ -7,12 +7,16 @@ export type JsonValue = string | number | boolean | null | JsonValue[] | {
7
7
  export type JsonObject = {
8
8
  [key: string]: JsonValue;
9
9
  };
10
- export type RpcMethod<Req, Res> = ((request: Req) => Promise<Res>) & {
11
- safe(request: Req): Promise<[{
10
+ /** Per-call options accepted by every method. */
11
+ export type RpcCallOptions = {
12
+ signal?: AbortSignal;
13
+ };
14
+ export type RpcMethod<Req, Res> = ((request: Req, options?: RpcCallOptions) => Promise<Res>) & {
15
+ safe(request: Req, options?: RpcCallOptions): Promise<[{
12
16
  error: unknown;
13
17
  }, null] | [null, Res]>;
14
18
  };
15
- export type RpcMethodV3<Req, Res, Err> = ((request: Req) => Promise<Res>) & {
16
- safe(request: Req): Promise<[Err, null] | [null, Res]>;
19
+ export type RpcMethodV3<Req, Res, Err> = ((request: Req, options?: RpcCallOptions) => Promise<Res>) & {
20
+ safe(request: Req, options?: RpcCallOptions): Promise<[Err, null] | [null, Res]>;
17
21
  parseError(e: unknown): Err;
18
22
  };
package/data.js CHANGED
@@ -6,359 +6,6 @@ export const data = {
6
6
  "key": "agentRunner",
7
7
  "methods": {}
8
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
- "session": {
52
- "type": "pushwoosh.agentrunner.v1.SdkSession"
53
- }
54
- }
55
- },
56
- "pushwoosh.agentrunner.v1.SdkSession": {
57
- "type": "I",
58
- "fields": {
59
- "sessionId": {
60
- "type": "string"
61
- },
62
- "lines": {
63
- "type": "string",
64
- "array": true
65
- }
66
- }
67
- },
68
- "pushwoosh.agentrunner.v1.SystemPrompt": {
69
- "type": "I",
70
- "fields": {
71
- "static": {
72
- "type": "string"
73
- },
74
- "dynamic": {
75
- "type": "string",
76
- "array": true
77
- }
78
- }
79
- },
80
- "pushwoosh.agentrunner.v1.HistoryRole": {
81
- "type": "E",
82
- "values": [
83
- "HISTORY_ROLE_UNSPECIFIED",
84
- "HISTORY_ROLE_USER",
85
- "HISTORY_ROLE_ASSISTANT",
86
- "HISTORY_ROLE_TOOL_REQUEST",
87
- "HISTORY_ROLE_TOOL_RESULT",
88
- "HISTORY_ROLE_CONTEXT_COMPACT"
89
- ]
90
- },
91
- "pushwoosh.agentrunner.v1.HistoryMessage": {
92
- "type": "I",
93
- "fields": {
94
- "role": {
95
- "type": "pushwoosh.agentrunner.v1.HistoryRole"
96
- },
97
- "text": {
98
- "type": "string"
99
- },
100
- "toolCalls": {
101
- "type": "pushwoosh.agentrunner.v1.ToolCall",
102
- "array": true
103
- },
104
- "toolResult": {
105
- "type": "pushwoosh.agentrunner.v1.ToolResult"
106
- }
107
- }
108
- },
109
- "pushwoosh.agentrunner.v1.ToolDef": {
110
- "type": "I",
111
- "fields": {
112
- "name": {
113
- "type": "string"
114
- },
115
- "description": {
116
- "type": "string"
117
- },
118
- "inputSchemaJson": {
119
- "type": "string"
120
- },
121
- "deferred": {
122
- "type": "boolean"
123
- }
124
- }
125
- },
126
- "pushwoosh.agentrunner.v1.ToolCall": {
127
- "type": "I",
128
- "fields": {
129
- "id": {
130
- "type": "string"
131
- },
132
- "name": {
133
- "type": "string"
134
- },
135
- "argsJson": {
136
- "type": "string"
137
- }
138
- }
139
- },
140
- "pushwoosh.agentrunner.v1.ToolResult": {
141
- "type": "I",
142
- "fields": {
143
- "id": {
144
- "type": "string"
145
- },
146
- "content": {
147
- "type": "string"
148
- },
149
- "isError": {
150
- "type": "boolean"
151
- }
152
- }
153
- },
154
- "pushwoosh.agentrunner.v1.TurnEvent": {
155
- "type": "I",
156
- "fields": {
157
- "delta": {
158
- "type": "pushwoosh.agentrunner.v1.StreamDelta"
159
- },
160
- "assistantMessage": {
161
- "type": "pushwoosh.agentrunner.v1.AssistantMessage"
162
- },
163
- "toolCall": {
164
- "type": "pushwoosh.agentrunner.v1.ToolCall"
165
- },
166
- "done": {
167
- "type": "pushwoosh.agentrunner.v1.TurnDone"
168
- },
169
- "sessionAppend": {
170
- "type": "pushwoosh.agentrunner.v1.SessionAppend"
171
- },
172
- "rateLimit": {
173
- "type": "pushwoosh.agentrunner.v1.RateLimit"
174
- },
175
- "messageStarted": {
176
- "type": "pushwoosh.agentrunner.v1.Usage"
177
- }
178
- },
179
- "oneofs": {
180
- "payload": {
181
- "oneof": [
182
- "delta",
183
- "assistantMessage",
184
- "toolCall",
185
- "done",
186
- "sessionAppend",
187
- "rateLimit",
188
- "messageStarted"
189
- ]
190
- }
191
- }
192
- },
193
- "pushwoosh.agentrunner.v1.StreamEvent": {
194
- "type": "E",
195
- "values": [
196
- "STREAM_EVENT_UNSPECIFIED",
197
- "STREAM_EVENT_MESSAGE_START",
198
- "STREAM_EVENT_CONTENT_BLOCK_START",
199
- "STREAM_EVENT_TEXT_DELTA",
200
- "STREAM_EVENT_TOOL_USE_START",
201
- "STREAM_EVENT_TOOL_USE_DELTA",
202
- "STREAM_EVENT_TOOL_USE_RESULT",
203
- "STREAM_EVENT_CONTENT_BLOCK_STOP",
204
- "STREAM_EVENT_MESSAGE_DELTA",
205
- "STREAM_EVENT_MESSAGE_STOP",
206
- "STREAM_EVENT_THINKING_DELTA",
207
- "STREAM_EVENT_ERROR"
208
- ]
209
- },
210
- "pushwoosh.agentrunner.v1.StreamDelta": {
211
- "type": "I",
212
- "fields": {
213
- "type": {
214
- "type": "pushwoosh.agentrunner.v1.StreamEvent"
215
- },
216
- "content": {
217
- "type": "string"
218
- }
219
- }
220
- },
221
- "pushwoosh.agentrunner.v1.AssistantMessage": {
222
- "type": "I",
223
- "fields": {
224
- "text": {
225
- "type": "string"
226
- },
227
- "toolCalls": {
228
- "type": "pushwoosh.agentrunner.v1.ToolCall",
229
- "array": true
230
- },
231
- "usage": {
232
- "type": "pushwoosh.agentrunner.v1.Usage"
233
- },
234
- "thinking": {
235
- "type": "string"
236
- },
237
- "messageId": {
238
- "type": "string"
239
- }
240
- }
241
- },
242
- "pushwoosh.agentrunner.v1.SessionAppend": {
243
- "type": "I",
244
- "fields": {
245
- "sessionId": {
246
- "type": "string"
247
- },
248
- "lines": {
249
- "type": "string",
250
- "array": true
251
- }
252
- }
253
- },
254
- "pushwoosh.agentrunner.v1.RateLimit": {
255
- "type": "I",
256
- "fields": {
257
- "status": {
258
- "type": "string"
259
- },
260
- "window": {
261
- "type": "string"
262
- },
263
- "utilization": {
264
- "type": "number"
265
- },
266
- "resetsAt": {
267
- "type": "number"
268
- },
269
- "overageStatus": {
270
- "type": "string"
271
- },
272
- "usingOverage": {
273
- "type": "boolean"
274
- },
275
- "overageDisabledReason": {
276
- "type": "string"
277
- }
278
- }
279
- },
280
- "pushwoosh.agentrunner.v1.GetQuotaRequest": {
281
- "type": "I",
282
- "fields": {}
283
- },
284
- "pushwoosh.agentrunner.v1.Quota": {
285
- "type": "I",
286
- "fields": {
287
- "windows": {
288
- "type": "pushwoosh.agentrunner.v1.QuotaWindow",
289
- "array": true
290
- },
291
- "overageStatus": {
292
- "type": "string"
293
- },
294
- "overageDisabledReason": {
295
- "type": "string"
296
- },
297
- "checkedAt": {
298
- "type": "number"
299
- },
300
- "error": {
301
- "type": "string"
302
- }
303
- }
304
- },
305
- "pushwoosh.agentrunner.v1.QuotaWindow": {
306
- "type": "I",
307
- "fields": {
308
- "window": {
309
- "type": "string"
310
- },
311
- "utilizationPercent": {
312
- "type": "number"
313
- },
314
- "resetsAt": {
315
- "type": "number"
316
- },
317
- "status": {
318
- "type": "string"
319
- }
320
- }
321
- },
322
- "pushwoosh.agentrunner.v1.Usage": {
323
- "type": "I",
324
- "fields": {
325
- "model": {
326
- "type": "string"
327
- },
328
- "inputTokens": {
329
- "type": "number"
330
- },
331
- "outputTokens": {
332
- "type": "number"
333
- },
334
- "cacheCreationInputTokens": {
335
- "type": "number"
336
- },
337
- "cacheReadInputTokens": {
338
- "type": "number"
339
- }
340
- }
341
- },
342
- "pushwoosh.agentrunner.v1.TurnDone": {
343
- "type": "I",
344
- "fields": {
345
- "stopReason": {
346
- "type": "string"
347
- },
348
- "error": {
349
- "type": "string"
350
- },
351
- "turns": {
352
- "type": "number"
353
- },
354
- "turnCapHit": {
355
- "type": "boolean"
356
- },
357
- "usage": {
358
- "type": "pushwoosh.agentrunner.v1.Usage"
359
- }
360
- }
361
- },
362
9
  "pushwoosh.aibuilder.v1.DocumentBlockType": {
363
10
  "type": "E",
364
11
  "values": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.582",
3
+ "version": "0.1.584",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -1,4 +1,4 @@
1
- import { RpcMethod } from './commonTypes';
1
+ import { RpcMethod, RpcCallOptions } from './commonTypes';
2
2
  /** Role represents the sender of a message */
3
3
  export type Role = 'ROLE_UNSPECIFIED' | 'ROLE_USER' | 'ROLE_ASSISTANT'
4
4
  /** Assistant message with tool calls (renamed for DB limit) */
@@ -534,19 +534,11 @@ export interface AssistantService {
534
534
  * Follow a turn still answering; ends with the turn's own status. NotFound: its events expired,
535
535
  * Aborted: its pod died, FailedPrecondition: too long to follow live — reload the chat.
536
536
  */
537
- AttachTurn(request: AttachTurnRequest, options?: {
538
- signal?: AbortSignal;
539
- }): Promise<AsyncIterable<InferenceResponse>>;
537
+ AttachTurn(request: AttachTurnRequest, options?: RpcCallOptions): Promise<AsyncIterable<InferenceResponse>>;
540
538
  /** Stream AI inference responses */
541
- StreamInference(request: InferenceRequest, options?: {
542
- signal?: AbortSignal;
543
- }): Promise<AsyncIterable<InferenceResponse>>;
544
- StreamInferenceGemini(request: InferenceRequest, options?: {
545
- signal?: AbortSignal;
546
- }): Promise<AsyncIterable<InferenceResponse>>;
547
- StreamInferenceChatGPT(request: InferenceRequest, options?: {
548
- signal?: AbortSignal;
549
- }): Promise<AsyncIterable<InferenceResponse>>;
539
+ StreamInference(request: InferenceRequest, options?: RpcCallOptions): Promise<AsyncIterable<InferenceResponse>>;
540
+ StreamInferenceGemini(request: InferenceRequest, options?: RpcCallOptions): Promise<AsyncIterable<InferenceResponse>>;
541
+ StreamInferenceChatGPT(request: InferenceRequest, options?: RpcCallOptions): Promise<AsyncIterable<InferenceResponse>>;
550
542
  /**
551
543
  * StreamInferenceLLM is the self-hosted LLM (Qwen) inference endpoint. It is
552
544
  * one of two providers that can run the onboarding agent — the frontend
@@ -554,24 +546,14 @@ export interface AssistantService {
554
546
  * (Claude) by choosing the endpoint. Every turn, including the opening one,
555
547
  * carries a real user message; an empty message is rejected. See is_onboarding.
556
548
  */
557
- StreamInferenceLLM(request: InferenceRequest, options?: {
558
- signal?: AbortSignal;
559
- }): Promise<AsyncIterable<InferenceResponse>>;
549
+ StreamInferenceLLM(request: InferenceRequest, options?: RpcCallOptions): Promise<AsyncIterable<InferenceResponse>>;
560
550
  ListProposals: AssistantService_ListProposals;
561
551
  CountPendingProposals: AssistantService_CountPendingProposals;
562
552
  /** Applies decisions, executes accepted calls, writes a proposal_result row and continues the turn. */
563
- DecideProposals(request: DecideProposalsRequest, options?: {
564
- signal?: AbortSignal;
565
- }): Promise<AsyncIterable<InferenceResponse>>;
566
- DecideProposalsGemini(request: DecideProposalsRequest, options?: {
567
- signal?: AbortSignal;
568
- }): Promise<AsyncIterable<InferenceResponse>>;
569
- DecideProposalsLLM(request: DecideProposalsRequest, options?: {
570
- signal?: AbortSignal;
571
- }): Promise<AsyncIterable<InferenceResponse>>;
572
- DecideProposalsChatGPT(request: DecideProposalsRequest, options?: {
573
- signal?: AbortSignal;
574
- }): Promise<AsyncIterable<InferenceResponse>>;
553
+ DecideProposals(request: DecideProposalsRequest, options?: RpcCallOptions): Promise<AsyncIterable<InferenceResponse>>;
554
+ DecideProposalsGemini(request: DecideProposalsRequest, options?: RpcCallOptions): Promise<AsyncIterable<InferenceResponse>>;
555
+ DecideProposalsLLM(request: DecideProposalsRequest, options?: RpcCallOptions): Promise<AsyncIterable<InferenceResponse>>;
556
+ DecideProposalsChatGPT(request: DecideProposalsRequest, options?: RpcCallOptions): Promise<AsyncIterable<InferenceResponse>>;
575
557
  GetConsent: AssistantService_GetConsent;
576
558
  GiveConsent: AssistantService_GiveConsent;
577
559
  CompactifyContext: AssistantService_CompactifyContext;
@@ -4,214 +4,3 @@
4
4
  */
5
5
  export interface AgentRunner {
6
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
- * A prior SDK session, when Go has one. Absent means seed from `history`, which stays
33
- * the fallback for every failure on this path.
34
- */
35
- session: SdkSession;
36
- };
37
- /**
38
- * SdkSession is the CLI's own transcript, verbatim and opaque: Go stores the lines and
39
- * hands them back, the runner is the only side that parses them.
40
- */
41
- export type SdkSession = {
42
- sessionId: string;
43
- /** JSONL, one entry per line, oldest first */
44
- lines: string[];
45
- };
46
- /**
47
- * Split because the split is what makes cross-session caching possible: joined into one
48
- * string, the SDK treats the whole prompt as session-specific.
49
- */
50
- export type SystemPrompt = {
51
- /** identical for every chat and account */
52
- static: string;
53
- /** per-chat / per-account blocks, never cached */
54
- dynamic: string[];
55
- };
56
- export type HistoryRole = 'HISTORY_ROLE_UNSPECIFIED' | 'HISTORY_ROLE_USER' | 'HISTORY_ROLE_ASSISTANT'
57
- /** assistant turn that called tools */
58
- | 'HISTORY_ROLE_TOOL_REQUEST' | 'HISTORY_ROLE_TOOL_RESULT'
59
- /** supersedes everything before it */
60
- | 'HISTORY_ROLE_CONTEXT_COMPACT';
61
- export type HistoryMessage = {
62
- role: HistoryRole;
63
- /** USER / ASSISTANT / CONTEXT_COMPACT */
64
- text: string;
65
- /** TOOL_REQUEST */
66
- toolCalls: ToolCall[];
67
- /** TOOL_RESULT */
68
- toolResult: ToolResult;
69
- };
70
- /**
71
- * ToolDef carries the schema verbatim as JSON: it is what the MCP server the
72
- * runner stands up advertises, and Go stays the only owner of the tool surface.
73
- */
74
- export type ToolDef = {
75
- name: string;
76
- description: string;
77
- inputSchemaJson: string;
78
- /**
79
- * Keep the schema out of the cached prompt prefix; the model reaches it through ToolSearch.
80
- * False = pinned, so a caller that never sets it gets today's behaviour.
81
- */
82
- deferred: boolean;
83
- };
84
- export type ToolCall = {
85
- id: string;
86
- name: string;
87
- argsJson: string;
88
- };
89
- export type ToolResult = {
90
- id: string;
91
- content: string;
92
- isError: boolean;
93
- };
94
- export type TurnEvent_payload_delta = {
95
- type: 'delta';
96
- data: StreamDelta;
97
- };
98
- export type TurnEvent_payload_assistantMessage = {
99
- type: 'assistantMessage';
100
- data: AssistantMessage;
101
- };
102
- export type TurnEvent_payload_toolCall = {
103
- type: 'toolCall';
104
- data: ToolCall;
105
- };
106
- export type TurnEvent_payload_done = {
107
- type: 'done';
108
- data: TurnDone;
109
- };
110
- export type TurnEvent_payload_sessionAppend = {
111
- type: 'sessionAppend';
112
- data: SessionAppend;
113
- };
114
- export type TurnEvent_payload_rateLimit = {
115
- type: 'rateLimit';
116
- data: RateLimit;
117
- };
118
- export type TurnEvent_payload_messageStarted = {
119
- type: 'messageStarted';
120
- data: Usage;
121
- };
122
- export type TurnEvent_payload = TurnEvent_payload_delta | TurnEvent_payload_assistantMessage | TurnEvent_payload_toolCall | TurnEvent_payload_done | TurnEvent_payload_sessionAppend | TurnEvent_payload_rateLimit | TurnEvent_payload_messageStarted;
123
- export type TurnEvent = {
124
- payload: TurnEvent_payload;
125
- };
126
- /**
127
- * Projection of the client-facing StreamEventType, mapped in one place in Go
128
- * (TestRunnerEnumsMapExhaustively), minus the events no runner can produce.
129
- */
130
- 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';
131
- export type StreamDelta = {
132
- type: StreamEvent;
133
- content: string;
134
- };
135
- /**
136
- * AssistantMessage is one SDK assistant message: usually a single content block of a model
137
- * turn, the SDK splits a response that way. Go persists this instead of re-accumulating deltas.
138
- */
139
- export type AssistantMessage = {
140
- text: string;
141
- toolCalls: ToolCall[];
142
- usage: Usage;
143
- /** mirrored to Mattermost, never persisted, never streamed */
144
- thinking: string;
145
- /** The API response this block belongs to: blocks sharing it are one model turn. */
146
- messageId: string;
147
- };
148
- /**
149
- * SessionAppend carries transcript lines the SDK wrote during this turn, in write order. A
150
- * session_id Go has not seen replaces the stored session: that is how a fresh session resets it.
151
- */
152
- export type SessionAppend = {
153
- sessionId: string;
154
- lines: string[];
155
- };
156
- /**
157
- * RateLimit is the CLI's view of the subscription's windows — the only place the remaining
158
- * allowance is visible to us at all, and it arrives only on a subscription profile.
159
- */
160
- export type RateLimit = {
161
- /** allowed | allowed_warning | rejected */
162
- status: string;
163
- /** five_hour | seven_day | seven_day_opus | … */
164
- window: string;
165
- /** percent of the window spent */
166
- utilization: number;
167
- /** unix seconds; 0 when the CLI did not say */
168
- resetsAt: number;
169
- /** allowed | allowed_warning | rejected: an allowed one serves a rejected window */
170
- overageStatus: string;
171
- /** this request was served on overage */
172
- usingOverage: boolean;
173
- /** why overage is off, e.g. overage_not_provisioned */
174
- overageDisabledReason: string;
175
- };
176
- export type GetQuotaRequest = {};
177
- /**
178
- * Quota is read off the response headers of a one-token ping: unlike RateLimit, it carries
179
- * every window's utilization whether or not the CLI would have warned about it.
180
- */
181
- export type Quota = {
182
- windows: QuotaWindow[];
183
- /** allowed | allowed_warning | rejected */
184
- overageStatus: string;
185
- /** e.g. out_of_credits */
186
- overageDisabledReason: string;
187
- /** unix seconds of the last successful ping; 0 = none yet */
188
- checkedAt: number;
189
- /** the last ping's failure, empty when it succeeded */
190
- error: string;
191
- };
192
- export type QuotaWindow = {
193
- /** five_hour | seven_day | … */
194
- window: string;
195
- /** 0..100 */
196
- utilizationPercent: number;
197
- /** unix seconds */
198
- resetsAt: number;
199
- /** allowed | allowed_warning | rejected */
200
- status: string;
201
- };
202
- export type Usage = {
203
- model: string;
204
- inputTokens: number;
205
- outputTokens: number;
206
- cacheCreationInputTokens: number;
207
- cacheReadInputTokens: number;
208
- };
209
- export type TurnDone = {
210
- stopReason: string;
211
- /** empty on success */
212
- error: string;
213
- turns: number;
214
- turnCapHit: boolean;
215
- /** Turn totals from result.modelUsage; AssistantMessage.usage is a message_start snapshot. */
216
- usage: Usage;
217
- };
@@ -1,4 +1,4 @@
1
- import { RpcMethod, JsonObject } from './commonTypes';
1
+ import { RpcMethod, RpcCallOptions, JsonObject } from './commonTypes';
2
2
  import { AiBuilderDocument as pushwoosh_aibuilder_v1_AiBuilderDocument } from './pushwoosh_aibuilder_v1';
3
3
  import { DocumentSettings as pushwoosh_aibuilder_v1_DocumentSettings } from './pushwoosh_aibuilder_v1';
4
4
  import { TextVariantStyle as pushwoosh_aibuilder_v1_TextVariantStyle } from './pushwoosh_aibuilder_v1';
@@ -43,9 +43,7 @@ export type AiGenService_GenerateArticleAnnotations = RpcMethod<AiGenArticleAnno
43
43
  * schema break.
44
44
  */
45
45
  export interface AiGenService {
46
- Generate(request: AiGenRequest, options?: {
47
- signal?: AbortSignal;
48
- }): Promise<AsyncIterable<AiGenEvent>>;
46
+ Generate(request: AiGenRequest, options?: RpcCallOptions): Promise<AsyncIterable<AiGenEvent>>;
49
47
  /**
50
48
  * RenderHtml renders an existing AiBuilderDocument into a finished,
51
49
  * self-contained HTML document. The model writes the whole HTML — a
@@ -63,9 +61,7 @@ export interface AiGenService {
63
61
  * corner treatment are sampled by a vision-capable provider.
64
62
  * llm_provider / llm_model are the same dev-only overrides as Generate.
65
63
  */
66
- RenderHtml(request: AiGenHtmlRequest, options?: {
67
- signal?: AbortSignal;
68
- }): Promise<AsyncIterable<AiGenHtmlEvent>>;
64
+ RenderHtml(request: AiGenHtmlRequest, options?: RpcCallOptions): Promise<AsyncIterable<AiGenHtmlEvent>>;
69
65
  /**
70
66
  * ExtractStyle samples a visual style from a single image: a colour
71
67
  * palette (keyed by semantic role) plus typography hints (body /