@cadenya/widgets 1.1.1 → 1.2.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.
- package/dist/types.d.ts +84 -25
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +13 -4
- package/src/types.ts +92 -25
package/dist/types.d.ts
CHANGED
|
@@ -214,7 +214,7 @@ export interface WidgetErrorEvent {
|
|
|
214
214
|
* strings. Tool arguments cross this boundary only when an enabled tool set
|
|
215
215
|
* overlay explicitly opts the matching tool in.
|
|
216
216
|
*/
|
|
217
|
-
export type WidgetEvent = WidgetEvent_UserMessage | WidgetEvent_AssistantMessage | WidgetEvent_ToolApprovalRequested | WidgetEvent_ToolApproved | WidgetEvent_ToolDenied | WidgetEvent_ToolCalled | WidgetEvent_ToolResult | WidgetEvent_ToolError | WidgetEvent_Error | WidgetEvent_Cancelled | WidgetEvent_TimedOut | WidgetEvent_Finalized;
|
|
217
|
+
export type WidgetEvent = WidgetEvent_UserMessage | WidgetEvent_AssistantMessage | WidgetEvent_ToolApprovalRequested | WidgetEvent_ToolApproved | WidgetEvent_ToolDenied | WidgetEvent_ToolCalled | WidgetEvent_ToolResult | WidgetEvent_ToolError | WidgetEvent_Error | WidgetEvent_Cancelled | WidgetEvent_TimedOut | WidgetEvent_Finalized | WidgetEvent_Heartbeat | WidgetEvent_StateChanged;
|
|
218
218
|
/**
|
|
219
219
|
* WidgetFinalizedEvent: the conversation's agent produced its structured
|
|
220
220
|
* output and the objective reached its terminal state. Only agents with an
|
|
@@ -229,6 +229,23 @@ export interface WidgetFinalizedEvent {
|
|
|
229
229
|
*/
|
|
230
230
|
output?: Record<string, unknown>;
|
|
231
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* WidgetHeartbeatEvent mirrors objective heartbeat liveness. It is live-only,
|
|
234
|
+
* absent from history, and never a reconnect checkpoint or state transition.
|
|
235
|
+
*/
|
|
236
|
+
export interface WidgetHeartbeatEvent {
|
|
237
|
+
}
|
|
238
|
+
export type WidgetObjectiveStateChangedEventFromState = 'WIDGET_OBJECTIVE_STATE_UNSPECIFIED' | 'WIDGET_OBJECTIVE_STATE_PENDING' | 'WIDGET_OBJECTIVE_STATE_RUNNING' | 'WIDGET_OBJECTIVE_STATE_WAITING' | 'WIDGET_OBJECTIVE_STATE_FAILED' | 'WIDGET_OBJECTIVE_STATE_CANCELLED' | 'WIDGET_OBJECTIVE_STATE_FINALIZED' | 'WIDGET_OBJECTIVE_STATE_TIMED_OUT';
|
|
239
|
+
export type WidgetObjectiveStateChangedEventToState = 'WIDGET_OBJECTIVE_STATE_UNSPECIFIED' | 'WIDGET_OBJECTIVE_STATE_PENDING' | 'WIDGET_OBJECTIVE_STATE_RUNNING' | 'WIDGET_OBJECTIVE_STATE_WAITING' | 'WIDGET_OBJECTIVE_STATE_FAILED' | 'WIDGET_OBJECTIVE_STATE_CANCELLED' | 'WIDGET_OBJECTIVE_STATE_FINALIZED' | 'WIDGET_OBJECTIVE_STATE_TIMED_OUT';
|
|
240
|
+
/**
|
|
241
|
+
* WidgetObjectiveStateChangedEvent mirrors a durable objective transition.
|
|
242
|
+
* Internal status messages are intentionally omitted. Pending/running maps
|
|
243
|
+
* to a responding conversation, waiting to open, and terminal states to closed.
|
|
244
|
+
*/
|
|
245
|
+
export interface WidgetObjectiveStateChangedEvent {
|
|
246
|
+
fromState: WidgetObjectiveStateChangedEventFromState;
|
|
247
|
+
toState: WidgetObjectiveStateChangedEventToState;
|
|
248
|
+
}
|
|
232
249
|
/**
|
|
233
250
|
* WidgetTimedOutEvent: the conversation timed out after inactivity. Terminal.
|
|
234
251
|
*/
|
|
@@ -327,8 +344,9 @@ export interface WidgetEvent_UserMessage {
|
|
|
327
344
|
type: 'userMessage';
|
|
328
345
|
userMessage: WidgetUserMessageEvent;
|
|
329
346
|
/**
|
|
330
|
-
* Unique event id (ULID).
|
|
331
|
-
* `Last-Event-ID
|
|
347
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
348
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
349
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
332
350
|
*/
|
|
333
351
|
id: string;
|
|
334
352
|
/**
|
|
@@ -341,8 +359,9 @@ export interface WidgetEvent_AssistantMessage {
|
|
|
341
359
|
type: 'assistantMessage';
|
|
342
360
|
assistantMessage: WidgetAssistantMessageEvent;
|
|
343
361
|
/**
|
|
344
|
-
* Unique event id (ULID).
|
|
345
|
-
* `Last-Event-ID
|
|
362
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
363
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
364
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
346
365
|
*/
|
|
347
366
|
id: string;
|
|
348
367
|
/**
|
|
@@ -355,8 +374,9 @@ export interface WidgetEvent_ToolApprovalRequested {
|
|
|
355
374
|
type: 'toolApprovalRequested';
|
|
356
375
|
toolApprovalRequested: WidgetToolApprovalRequestedEvent;
|
|
357
376
|
/**
|
|
358
|
-
* Unique event id (ULID).
|
|
359
|
-
* `Last-Event-ID
|
|
377
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
378
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
379
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
360
380
|
*/
|
|
361
381
|
id: string;
|
|
362
382
|
/**
|
|
@@ -369,8 +389,9 @@ export interface WidgetEvent_ToolApproved {
|
|
|
369
389
|
type: 'toolApproved';
|
|
370
390
|
toolApproved: WidgetToolApprovedEvent;
|
|
371
391
|
/**
|
|
372
|
-
* Unique event id (ULID).
|
|
373
|
-
* `Last-Event-ID
|
|
392
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
393
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
394
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
374
395
|
*/
|
|
375
396
|
id: string;
|
|
376
397
|
/**
|
|
@@ -383,8 +404,9 @@ export interface WidgetEvent_ToolDenied {
|
|
|
383
404
|
type: 'toolDenied';
|
|
384
405
|
toolDenied: WidgetToolDeniedEvent;
|
|
385
406
|
/**
|
|
386
|
-
* Unique event id (ULID).
|
|
387
|
-
* `Last-Event-ID
|
|
407
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
408
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
409
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
388
410
|
*/
|
|
389
411
|
id: string;
|
|
390
412
|
/**
|
|
@@ -397,8 +419,9 @@ export interface WidgetEvent_ToolCalled {
|
|
|
397
419
|
type: 'toolCalled';
|
|
398
420
|
toolCalled: WidgetToolCalledEvent;
|
|
399
421
|
/**
|
|
400
|
-
* Unique event id (ULID).
|
|
401
|
-
* `Last-Event-ID
|
|
422
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
423
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
424
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
402
425
|
*/
|
|
403
426
|
id: string;
|
|
404
427
|
/**
|
|
@@ -411,8 +434,9 @@ export interface WidgetEvent_ToolResult {
|
|
|
411
434
|
type: 'toolResult';
|
|
412
435
|
toolResult: WidgetToolResultEvent;
|
|
413
436
|
/**
|
|
414
|
-
* Unique event id (ULID).
|
|
415
|
-
* `Last-Event-ID
|
|
437
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
438
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
439
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
416
440
|
*/
|
|
417
441
|
id: string;
|
|
418
442
|
/**
|
|
@@ -425,8 +449,9 @@ export interface WidgetEvent_ToolError {
|
|
|
425
449
|
type: 'toolError';
|
|
426
450
|
toolError: WidgetToolErrorEvent;
|
|
427
451
|
/**
|
|
428
|
-
* Unique event id (ULID).
|
|
429
|
-
* `Last-Event-ID
|
|
452
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
453
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
454
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
430
455
|
*/
|
|
431
456
|
id: string;
|
|
432
457
|
/**
|
|
@@ -439,8 +464,9 @@ export interface WidgetEvent_Error {
|
|
|
439
464
|
type: 'error';
|
|
440
465
|
error: WidgetErrorEvent;
|
|
441
466
|
/**
|
|
442
|
-
* Unique event id (ULID).
|
|
443
|
-
* `Last-Event-ID
|
|
467
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
468
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
469
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
444
470
|
*/
|
|
445
471
|
id: string;
|
|
446
472
|
/**
|
|
@@ -453,8 +479,9 @@ export interface WidgetEvent_Cancelled {
|
|
|
453
479
|
type: 'cancelled';
|
|
454
480
|
cancelled: WidgetCancelledEvent;
|
|
455
481
|
/**
|
|
456
|
-
* Unique event id (ULID).
|
|
457
|
-
* `Last-Event-ID
|
|
482
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
483
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
484
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
458
485
|
*/
|
|
459
486
|
id: string;
|
|
460
487
|
/**
|
|
@@ -467,8 +494,9 @@ export interface WidgetEvent_TimedOut {
|
|
|
467
494
|
type: 'timedOut';
|
|
468
495
|
timedOut: WidgetTimedOutEvent;
|
|
469
496
|
/**
|
|
470
|
-
* Unique event id (ULID).
|
|
471
|
-
* `Last-Event-ID
|
|
497
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
498
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
499
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
472
500
|
*/
|
|
473
501
|
id: string;
|
|
474
502
|
/**
|
|
@@ -481,8 +509,39 @@ export interface WidgetEvent_Finalized {
|
|
|
481
509
|
type: 'finalized';
|
|
482
510
|
finalized: WidgetFinalizedEvent;
|
|
483
511
|
/**
|
|
484
|
-
* Unique event id (ULID).
|
|
485
|
-
* `Last-Event-ID
|
|
512
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
513
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
514
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
515
|
+
*/
|
|
516
|
+
id: string;
|
|
517
|
+
/**
|
|
518
|
+
* The conversation this event belongs to.
|
|
519
|
+
*/
|
|
520
|
+
conversationId: string;
|
|
521
|
+
createdAt: string;
|
|
522
|
+
}
|
|
523
|
+
export interface WidgetEvent_Heartbeat {
|
|
524
|
+
type: 'heartbeat';
|
|
525
|
+
heartbeat: WidgetHeartbeatEvent;
|
|
526
|
+
/**
|
|
527
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
528
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
529
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
530
|
+
*/
|
|
531
|
+
id: string;
|
|
532
|
+
/**
|
|
533
|
+
* The conversation this event belongs to.
|
|
534
|
+
*/
|
|
535
|
+
conversationId: string;
|
|
536
|
+
createdAt: string;
|
|
537
|
+
}
|
|
538
|
+
export interface WidgetEvent_StateChanged {
|
|
539
|
+
type: 'stateChanged';
|
|
540
|
+
stateChanged: WidgetObjectiveStateChangedEvent;
|
|
541
|
+
/**
|
|
542
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
543
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
544
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
486
545
|
*/
|
|
487
546
|
id: string;
|
|
488
547
|
/**
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,KAAK,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC3B,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,UAAU,C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dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,6CAA6C","sourcesContent":["// Generated by redwood. Do not edit by hand.\n\n/**\n * Approve tool call request. Responds to a toolApprovalRequested event.\n */\nexport interface ApproveToolCallRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * The tool call awaiting a decision, from the toolApprovalRequested event.\n */\n toolCallId?: string;\n}\n\n/**\n * Continue conversation request.\n */\nexport interface ContinueConversationRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * The visitor's next message.\n */\n message: string;\n}\n\n/**\n * Create conversation request. The session, tenant, subject, secrets, labels,\n * and pinned parameters all come from the presenting token's session — the\n * browser asserts nothing.\n */\nexport interface CreateConversationRequest {\n /**\n * The visitor's opening message.\n */\n message: string;\n}\n\n/**\n * Deny tool call request. Responds to a toolApprovalRequested event.\n */\nexport interface DenyToolCallRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * The tool call awaiting a decision, from the toolApprovalRequested event.\n */\n toolCallId?: string;\n}\n\n/**\n * Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.\n */\nexport interface GoogleProtobufAny {\n /**\n * The type of the serialized message.\n */\n '@type'?: string;\n}\n\n/**\n * Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.\n */\nexport type GoogleProtobufValue = unknown;\n\n/**\n * List conversation events response. Ordered oldest first.\n */\nexport interface ListConversationEventsResponse {\n items?: Array<WidgetEvent>;\n pagination?: Page;\n}\n\n/**\n * List conversations response. Ordered by last activity, newest first.\n */\nexport interface ListConversationsResponse {\n items?: Array<WidgetConversation>;\n pagination?: Page;\n}\n\n/**\n * Page carries pagination data for list responses. A deliberate local\n * duplicate of the api module's Page — this package imports nothing from\n * cadenya.api.v1 (see the workspace README).\n */\nexport interface Page {\n /**\n * Cursor for the next page. Empty when there are no further results.\n */\n nextCursor?: string;\n /**\n * Total number of items matching the request.\n */\n total?: number;\n}\n\n/**\n * Set tool call content request. Lets the embedding page supply the result\n * of a bare tool call (one whose tool set has no execution adapter) — the\n * widget-session flavor of the reverse-harness pattern, where client-side\n * logic executes the tool and reports the result back. The result then\n * reaches the conversation as a toolResult event.\n */\nexport interface SetToolCallContentRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * The bare tool call to supply content for.\n */\n toolCallId?: string;\n /**\n * The tool call's result content.\n */\n content: string;\n}\n\n/**\n * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).\n */\nexport interface Status {\n /**\n * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].\n */\n code?: number;\n /**\n * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.\n */\n message?: string;\n /**\n * A list of messages that carry the error details. There is a common set of message types for APIs to use.\n */\n details?: Array<GoogleProtobufAny>;\n}\n\n/**\n * Submit conversation feedback request — the visitor's rating of a\n * conversation, mirroring internal objective feedback in slimmed form. Flows\n * into the same feedback machinery that scores agent variations.\n */\nexport interface SubmitConversationFeedbackRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * A score between -1.0 and 1.0. -1.0 is the worst, 0.0 neutral, 1.0 the\n * best — a thumbs-down/up UI maps to -1.0/1.0.\n */\n score: number;\n /**\n * Optional comment explaining the feedback.\n */\n comment?: string;\n}\n\n/**\n * WidgetAssistantMessageEvent is a message from the agent. Content may\n * arrive incrementally: later events for the same turn replace earlier\n * partial content.\n */\nexport interface WidgetAssistantMessageEvent {\n content: string;\n}\n\n/**\n * WidgetCancelledEvent: the conversation was cancelled. Terminal.\n */\nexport interface WidgetCancelledEvent {\n}\n\n/**\n * WidgetConfig is the widget's presentation configuration, served to the\n * browser before any session exists. Contains nothing sensitive: the widget\n * is identified by the hostname, and the edge has already enforced the\n * origin allowlist by the time this is served.\n */\nexport interface WidgetConfig {\n /**\n * Display name shown in the widget header.\n */\n displayName: string;\n}\n\nexport type WidgetConversationState = 'STATE_UNSPECIFIED' | 'STATE_RESPONDING' | 'STATE_OPEN' | 'STATE_CLOSED';\n\n/**\n * WidgetConversation is one conversation between the session's visitor and\n * the widget's agent. Conversations are scoped by the presenting token to the\n * VISITOR: a session with a subject sees that subject's conversations on this\n * widget; a session without one sees only the conversations it created\n * itself. A conversation id from outside that scope is indistinguishable from\n * one that does not exist. Tenant is a management-side grouping only — it is\n * never a read scope on this surface.\n */\nexport interface WidgetConversation {\n id: string;\n state: WidgetConversationState;\n /**\n * Server-derived display title (e.g. from the opening message).\n */\n title?: string;\n createdAt: string;\n /**\n * When the conversation last saw a message or event.\n */\n lastActiveAt?: string;\n}\n\n/**\n * WidgetErrorEvent reports a visitor-safe conversation error. The message is\n * sanitized; internal error detail never reaches the widget.\n */\nexport interface WidgetErrorEvent {\n message: string;\n}\n\n/**\n * WidgetEvent is the visitor-facing event vocabulary. It MIRRORS the internal\n * conversation event variants — same granularity, same discriminator names —\n * with slimmed messages holding exactly what a widget UI needs. Internal\n * events map to these through an explicit, exhaustive server-side projection;\n * internal-only types (context compaction, memory reads, sub-agent\n * bookkeeping) have no widget variant and are dropped. Nothing here carries\n * tool configuration, server identities, operator details, or internal error\n * strings. Tool arguments cross this boundary only when an enabled tool set\n * overlay explicitly opts the matching tool in.\n */\nexport type WidgetEvent =\n | WidgetEvent_UserMessage\n | WidgetEvent_AssistantMessage\n | WidgetEvent_ToolApprovalRequested\n | WidgetEvent_ToolApproved\n | WidgetEvent_ToolDenied\n | WidgetEvent_ToolCalled\n | WidgetEvent_ToolResult\n | WidgetEvent_ToolError\n | WidgetEvent_Error\n | WidgetEvent_Cancelled\n | WidgetEvent_TimedOut\n | WidgetEvent_Finalized;\n\n/**\n * WidgetFinalizedEvent: the conversation's agent produced its structured\n * output and the objective reached its terminal state. Only agents with an\n * output definition finalize — such an agent ends the conversation after one\n * turn, so a widget bound to one should treat this as the answer, not a\n * message to keep chatting past.\n */\nexport interface WidgetFinalizedEvent {\n /**\n * The structured output the agent produced, matching the shape of the\n * agent's output definition schema.\n */\n output?: Record<string, unknown>;\n}\n\n/**\n * WidgetTimedOutEvent: the conversation timed out after inactivity. Terminal.\n */\nexport interface WidgetTimedOutEvent {\n}\n\n/**\n * WidgetToolApprovalRequestedEvent asks the visitor to approve or deny a\n * tool call before it runs. The tool reference lets the embedding UI render\n * a custom approval experience per tool; the visitor responds via the\n * approve/deny endpoints.\n */\nexport interface WidgetToolApprovalRequestedEvent {\n /**\n * The tool call awaiting a decision; pass it to the approve/deny endpoint.\n */\n toolCallId: string;\n tool: WidgetToolReference;\n}\n\n/**\n * WidgetToolApprovedEvent records that the pending tool call was approved.\n */\nexport interface WidgetToolApprovedEvent {\n toolCallId: string;\n}\n\n/**\n * WidgetToolCalledEvent reports that the agent invoked a tool.\n */\nexport interface WidgetToolCalledEvent {\n toolCallId: string;\n tool: WidgetToolReference;\n /**\n * The final arguments sent to the tool, after parameter actions were\n * applied. Present only when an enabled matching tool set overlay opts the\n * tool into exposing arguments in widget sessions. Arguments are omitted\n * by default because they may contain sensitive customer data.\n */\n arguments?: Record<string, unknown>;\n}\n\n/**\n * WidgetToolDeniedEvent records that the pending tool call was denied.\n */\nexport interface WidgetToolDeniedEvent {\n toolCallId: string;\n}\n\n/**\n * WidgetToolErrorEvent reports that a tool call failed. Internal error\n * detail never reaches the widget.\n */\nexport interface WidgetToolErrorEvent {\n toolCallId: string;\n tool: WidgetToolReference;\n}\n\n/**\n * WidgetToolReference identifies the tool involved in a tool event — enough\n * for the embedding UI to label the activity and to register custom\n * renderers keyed by the tool's id or the customer's own external id.\n * Deliberately omitted: tool configuration, adapter details, and any server\n * identity.\n */\nexport interface WidgetToolReference {\n /**\n * Cadenya's canonical tool id.\n */\n id: string;\n /**\n * The tool's external id in the customer's namespace, when set.\n */\n externalId?: string;\n /**\n * The tool's name as the workspace configured it (e.g. \"FetchOrderDetails\").\n */\n name: string;\n}\n\n/**\n * WidgetToolResultEvent reports that a tool call finished. Result content is\n * omitted by default and included only for tools the workspace has opted in\n * to sharing content with widget sessions.\n */\nexport interface WidgetToolResultEvent {\n toolCallId: string;\n tool: WidgetToolReference;\n /**\n * The tool's result, present only for tools opted in to sharing content\n * with widget sessions (a per-tool setting; default off). Arbitrary JSON\n * the embedding UI may render — chart data, cards, structured results.\n */\n content?: GoogleProtobufValue;\n}\n\n/**\n * WidgetUserMessageEvent is a message from the visitor.\n */\nexport interface WidgetUserMessageEvent {\n content: string;\n}\n\nexport interface WidgetEvent_UserMessage {\n type: 'userMessage';\n userMessage: WidgetUserMessageEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_AssistantMessage {\n type: 'assistantMessage';\n assistantMessage: WidgetAssistantMessageEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolApprovalRequested {\n type: 'toolApprovalRequested';\n toolApprovalRequested: WidgetToolApprovalRequestedEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolApproved {\n type: 'toolApproved';\n toolApproved: WidgetToolApprovedEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolDenied {\n type: 'toolDenied';\n toolDenied: WidgetToolDeniedEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolCalled {\n type: 'toolCalled';\n toolCalled: WidgetToolCalledEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolResult {\n type: 'toolResult';\n toolResult: WidgetToolResultEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolError {\n type: 'toolError';\n toolError: WidgetToolErrorEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_Error {\n type: 'error';\n error: WidgetErrorEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_Cancelled {\n type: 'cancelled';\n cancelled: WidgetCancelledEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_TimedOut {\n type: 'timedOut';\n timedOut: WidgetTimedOutEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_Finalized {\n type: 'finalized';\n finalized: WidgetFinalizedEvent;\n /**\n * Unique event id (ULID). Doubles as the SSE `id:` — replay it as\n * `Last-Event-ID` on reconnect to resume without duplication.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,6CAA6C","sourcesContent":["// Generated by redwood. Do not edit by hand.\n\n/**\n * Approve tool call request. Responds to a toolApprovalRequested event.\n */\nexport interface ApproveToolCallRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * The tool call awaiting a decision, from the toolApprovalRequested event.\n */\n toolCallId?: string;\n}\n\n/**\n * Continue conversation request.\n */\nexport interface ContinueConversationRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * The visitor's next message.\n */\n message: string;\n}\n\n/**\n * Create conversation request. The session, tenant, subject, secrets, labels,\n * and pinned parameters all come from the presenting token's session — the\n * browser asserts nothing.\n */\nexport interface CreateConversationRequest {\n /**\n * The visitor's opening message.\n */\n message: string;\n}\n\n/**\n * Deny tool call request. Responds to a toolApprovalRequested event.\n */\nexport interface DenyToolCallRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * The tool call awaiting a decision, from the toolApprovalRequested event.\n */\n toolCallId?: string;\n}\n\n/**\n * Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.\n */\nexport interface GoogleProtobufAny {\n /**\n * The type of the serialized message.\n */\n '@type'?: string;\n}\n\n/**\n * Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.\n */\nexport type GoogleProtobufValue = unknown;\n\n/**\n * List conversation events response. Ordered oldest first.\n */\nexport interface ListConversationEventsResponse {\n items?: Array<WidgetEvent>;\n pagination?: Page;\n}\n\n/**\n * List conversations response. Ordered by last activity, newest first.\n */\nexport interface ListConversationsResponse {\n items?: Array<WidgetConversation>;\n pagination?: Page;\n}\n\n/**\n * Page carries pagination data for list responses. A deliberate local\n * duplicate of the api module's Page — this package imports nothing from\n * cadenya.api.v1 (see the workspace README).\n */\nexport interface Page {\n /**\n * Cursor for the next page. Empty when there are no further results.\n */\n nextCursor?: string;\n /**\n * Total number of items matching the request.\n */\n total?: number;\n}\n\n/**\n * Set tool call content request. Lets the embedding page supply the result\n * of a bare tool call (one whose tool set has no execution adapter) — the\n * widget-session flavor of the reverse-harness pattern, where client-side\n * logic executes the tool and reports the result back. The result then\n * reaches the conversation as a toolResult event.\n */\nexport interface SetToolCallContentRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * The bare tool call to supply content for.\n */\n toolCallId?: string;\n /**\n * The tool call's result content.\n */\n content: string;\n}\n\n/**\n * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).\n */\nexport interface Status {\n /**\n * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].\n */\n code?: number;\n /**\n * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.\n */\n message?: string;\n /**\n * A list of messages that carry the error details. There is a common set of message types for APIs to use.\n */\n details?: Array<GoogleProtobufAny>;\n}\n\n/**\n * Submit conversation feedback request — the visitor's rating of a\n * conversation, mirroring internal objective feedback in slimmed form. Flows\n * into the same feedback machinery that scores agent variations.\n */\nexport interface SubmitConversationFeedbackRequest {\n /**\n * Conversation ID.\n */\n id?: string;\n /**\n * A score between -1.0 and 1.0. -1.0 is the worst, 0.0 neutral, 1.0 the\n * best — a thumbs-down/up UI maps to -1.0/1.0.\n */\n score: number;\n /**\n * Optional comment explaining the feedback.\n */\n comment?: string;\n}\n\n/**\n * WidgetAssistantMessageEvent is a message from the agent. Content may\n * arrive incrementally: later events for the same turn replace earlier\n * partial content.\n */\nexport interface WidgetAssistantMessageEvent {\n content: string;\n}\n\n/**\n * WidgetCancelledEvent: the conversation was cancelled. Terminal.\n */\nexport interface WidgetCancelledEvent {\n}\n\n/**\n * WidgetConfig is the widget's presentation configuration, served to the\n * browser before any session exists. Contains nothing sensitive: the widget\n * is identified by the hostname, and the edge has already enforced the\n * origin allowlist by the time this is served.\n */\nexport interface WidgetConfig {\n /**\n * Display name shown in the widget header.\n */\n displayName: string;\n}\n\nexport type WidgetConversationState = 'STATE_UNSPECIFIED' | 'STATE_RESPONDING' | 'STATE_OPEN' | 'STATE_CLOSED';\n\n/**\n * WidgetConversation is one conversation between the session's visitor and\n * the widget's agent. Conversations are scoped by the presenting token to the\n * VISITOR: a session with a subject sees that subject's conversations on this\n * widget; a session without one sees only the conversations it created\n * itself. A conversation id from outside that scope is indistinguishable from\n * one that does not exist. Tenant is a management-side grouping only — it is\n * never a read scope on this surface.\n */\nexport interface WidgetConversation {\n id: string;\n state: WidgetConversationState;\n /**\n * Server-derived display title (e.g. from the opening message).\n */\n title?: string;\n createdAt: string;\n /**\n * When the conversation last saw a message or event.\n */\n lastActiveAt?: string;\n}\n\n/**\n * WidgetErrorEvent reports a visitor-safe conversation error. The message is\n * sanitized; internal error detail never reaches the widget.\n */\nexport interface WidgetErrorEvent {\n message: string;\n}\n\n/**\n * WidgetEvent is the visitor-facing event vocabulary. It MIRRORS the internal\n * conversation event variants — same granularity, same discriminator names —\n * with slimmed messages holding exactly what a widget UI needs. Internal\n * events map to these through an explicit, exhaustive server-side projection;\n * internal-only types (context compaction, memory reads, sub-agent\n * bookkeeping) have no widget variant and are dropped. Nothing here carries\n * tool configuration, server identities, operator details, or internal error\n * strings. Tool arguments cross this boundary only when an enabled tool set\n * overlay explicitly opts the matching tool in.\n */\nexport type WidgetEvent =\n | WidgetEvent_UserMessage\n | WidgetEvent_AssistantMessage\n | WidgetEvent_ToolApprovalRequested\n | WidgetEvent_ToolApproved\n | WidgetEvent_ToolDenied\n | WidgetEvent_ToolCalled\n | WidgetEvent_ToolResult\n | WidgetEvent_ToolError\n | WidgetEvent_Error\n | WidgetEvent_Cancelled\n | WidgetEvent_TimedOut\n | WidgetEvent_Finalized\n | WidgetEvent_Heartbeat\n | WidgetEvent_StateChanged;\n\n/**\n * WidgetFinalizedEvent: the conversation's agent produced its structured\n * output and the objective reached its terminal state. Only agents with an\n * output definition finalize — such an agent ends the conversation after one\n * turn, so a widget bound to one should treat this as the answer, not a\n * message to keep chatting past.\n */\nexport interface WidgetFinalizedEvent {\n /**\n * The structured output the agent produced, matching the shape of the\n * agent's output definition schema.\n */\n output?: Record<string, unknown>;\n}\n\n/**\n * WidgetHeartbeatEvent mirrors objective heartbeat liveness. It is live-only,\n * absent from history, and never a reconnect checkpoint or state transition.\n */\nexport interface WidgetHeartbeatEvent {\n}\n\nexport type WidgetObjectiveStateChangedEventFromState = 'WIDGET_OBJECTIVE_STATE_UNSPECIFIED' | 'WIDGET_OBJECTIVE_STATE_PENDING' | 'WIDGET_OBJECTIVE_STATE_RUNNING' | 'WIDGET_OBJECTIVE_STATE_WAITING' | 'WIDGET_OBJECTIVE_STATE_FAILED' | 'WIDGET_OBJECTIVE_STATE_CANCELLED' | 'WIDGET_OBJECTIVE_STATE_FINALIZED' | 'WIDGET_OBJECTIVE_STATE_TIMED_OUT';\n\nexport type WidgetObjectiveStateChangedEventToState = 'WIDGET_OBJECTIVE_STATE_UNSPECIFIED' | 'WIDGET_OBJECTIVE_STATE_PENDING' | 'WIDGET_OBJECTIVE_STATE_RUNNING' | 'WIDGET_OBJECTIVE_STATE_WAITING' | 'WIDGET_OBJECTIVE_STATE_FAILED' | 'WIDGET_OBJECTIVE_STATE_CANCELLED' | 'WIDGET_OBJECTIVE_STATE_FINALIZED' | 'WIDGET_OBJECTIVE_STATE_TIMED_OUT';\n\n/**\n * WidgetObjectiveStateChangedEvent mirrors a durable objective transition.\n * Internal status messages are intentionally omitted. Pending/running maps\n * to a responding conversation, waiting to open, and terminal states to closed.\n */\nexport interface WidgetObjectiveStateChangedEvent {\n fromState: WidgetObjectiveStateChangedEventFromState;\n toState: WidgetObjectiveStateChangedEventToState;\n}\n\n/**\n * WidgetTimedOutEvent: the conversation timed out after inactivity. Terminal.\n */\nexport interface WidgetTimedOutEvent {\n}\n\n/**\n * WidgetToolApprovalRequestedEvent asks the visitor to approve or deny a\n * tool call before it runs. The tool reference lets the embedding UI render\n * a custom approval experience per tool; the visitor responds via the\n * approve/deny endpoints.\n */\nexport interface WidgetToolApprovalRequestedEvent {\n /**\n * The tool call awaiting a decision; pass it to the approve/deny endpoint.\n */\n toolCallId: string;\n tool: WidgetToolReference;\n}\n\n/**\n * WidgetToolApprovedEvent records that the pending tool call was approved.\n */\nexport interface WidgetToolApprovedEvent {\n toolCallId: string;\n}\n\n/**\n * WidgetToolCalledEvent reports that the agent invoked a tool.\n */\nexport interface WidgetToolCalledEvent {\n toolCallId: string;\n tool: WidgetToolReference;\n /**\n * The final arguments sent to the tool, after parameter actions were\n * applied. Present only when an enabled matching tool set overlay opts the\n * tool into exposing arguments in widget sessions. Arguments are omitted\n * by default because they may contain sensitive customer data.\n */\n arguments?: Record<string, unknown>;\n}\n\n/**\n * WidgetToolDeniedEvent records that the pending tool call was denied.\n */\nexport interface WidgetToolDeniedEvent {\n toolCallId: string;\n}\n\n/**\n * WidgetToolErrorEvent reports that a tool call failed. Internal error\n * detail never reaches the widget.\n */\nexport interface WidgetToolErrorEvent {\n toolCallId: string;\n tool: WidgetToolReference;\n}\n\n/**\n * WidgetToolReference identifies the tool involved in a tool event — enough\n * for the embedding UI to label the activity and to register custom\n * renderers keyed by the tool's id or the customer's own external id.\n * Deliberately omitted: tool configuration, adapter details, and any server\n * identity.\n */\nexport interface WidgetToolReference {\n /**\n * Cadenya's canonical tool id.\n */\n id: string;\n /**\n * The tool's external id in the customer's namespace, when set.\n */\n externalId?: string;\n /**\n * The tool's name as the workspace configured it (e.g. \"FetchOrderDetails\").\n */\n name: string;\n}\n\n/**\n * WidgetToolResultEvent reports that a tool call finished. Result content is\n * omitted by default and included only for tools the workspace has opted in\n * to sharing content with widget sessions.\n */\nexport interface WidgetToolResultEvent {\n toolCallId: string;\n tool: WidgetToolReference;\n /**\n * The tool's result, present only for tools opted in to sharing content\n * with widget sessions (a per-tool setting; default off). Arbitrary JSON\n * the embedding UI may render — chart data, cards, structured results.\n */\n content?: GoogleProtobufValue;\n}\n\n/**\n * WidgetUserMessageEvent is a message from the visitor.\n */\nexport interface WidgetUserMessageEvent {\n content: string;\n}\n\nexport interface WidgetEvent_UserMessage {\n type: 'userMessage';\n userMessage: WidgetUserMessageEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_AssistantMessage {\n type: 'assistantMessage';\n assistantMessage: WidgetAssistantMessageEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolApprovalRequested {\n type: 'toolApprovalRequested';\n toolApprovalRequested: WidgetToolApprovalRequestedEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolApproved {\n type: 'toolApproved';\n toolApproved: WidgetToolApprovedEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolDenied {\n type: 'toolDenied';\n toolDenied: WidgetToolDeniedEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolCalled {\n type: 'toolCalled';\n toolCalled: WidgetToolCalledEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolResult {\n type: 'toolResult';\n toolResult: WidgetToolResultEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_ToolError {\n type: 'toolError';\n toolError: WidgetToolErrorEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_Error {\n type: 'error';\n error: WidgetErrorEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_Cancelled {\n type: 'cancelled';\n cancelled: WidgetCancelledEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_TimedOut {\n type: 'timedOut';\n timedOut: WidgetTimedOutEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_Finalized {\n type: 'finalized';\n finalized: WidgetFinalizedEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_Heartbeat {\n type: 'heartbeat';\n heartbeat: WidgetHeartbeatEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\nexport interface WidgetEvent_StateChanged {\n type: 'stateChanged';\n stateChanged: WidgetObjectiveStateChangedEvent;\n /**\n * Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted\n * as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.\n * Transient heartbeats carry hb_ IDs in this payload only.\n */\n id: string;\n /**\n * The conversation this event belongs to.\n */\n conversationId: string;\n createdAt: string;\n}\n\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cadenya/widgets",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "The official TypeScript SDK for the CadenyaWidgets API",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -13,12 +13,21 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"sideEffects": false,
|
|
16
|
-
"publishConfig": {
|
|
17
|
-
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/cadenya/widgets-sdk"
|
|
22
|
+
},
|
|
18
23
|
"engines": {
|
|
19
24
|
"node": ">=18"
|
|
20
25
|
},
|
|
21
|
-
"files": [
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"src",
|
|
29
|
+
"api.md"
|
|
30
|
+
],
|
|
22
31
|
"scripts": {
|
|
23
32
|
"build": "tsc",
|
|
24
33
|
"typecheck": "tsc --noEmit"
|
package/src/types.ts
CHANGED
|
@@ -246,7 +246,9 @@ export type WidgetEvent =
|
|
|
246
246
|
| WidgetEvent_Error
|
|
247
247
|
| WidgetEvent_Cancelled
|
|
248
248
|
| WidgetEvent_TimedOut
|
|
249
|
-
| WidgetEvent_Finalized
|
|
249
|
+
| WidgetEvent_Finalized
|
|
250
|
+
| WidgetEvent_Heartbeat
|
|
251
|
+
| WidgetEvent_StateChanged;
|
|
250
252
|
|
|
251
253
|
/**
|
|
252
254
|
* WidgetFinalizedEvent: the conversation's agent produced its structured
|
|
@@ -263,6 +265,27 @@ export interface WidgetFinalizedEvent {
|
|
|
263
265
|
output?: Record<string, unknown>;
|
|
264
266
|
}
|
|
265
267
|
|
|
268
|
+
/**
|
|
269
|
+
* WidgetHeartbeatEvent mirrors objective heartbeat liveness. It is live-only,
|
|
270
|
+
* absent from history, and never a reconnect checkpoint or state transition.
|
|
271
|
+
*/
|
|
272
|
+
export interface WidgetHeartbeatEvent {
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export type WidgetObjectiveStateChangedEventFromState = 'WIDGET_OBJECTIVE_STATE_UNSPECIFIED' | 'WIDGET_OBJECTIVE_STATE_PENDING' | 'WIDGET_OBJECTIVE_STATE_RUNNING' | 'WIDGET_OBJECTIVE_STATE_WAITING' | 'WIDGET_OBJECTIVE_STATE_FAILED' | 'WIDGET_OBJECTIVE_STATE_CANCELLED' | 'WIDGET_OBJECTIVE_STATE_FINALIZED' | 'WIDGET_OBJECTIVE_STATE_TIMED_OUT';
|
|
276
|
+
|
|
277
|
+
export type WidgetObjectiveStateChangedEventToState = 'WIDGET_OBJECTIVE_STATE_UNSPECIFIED' | 'WIDGET_OBJECTIVE_STATE_PENDING' | 'WIDGET_OBJECTIVE_STATE_RUNNING' | 'WIDGET_OBJECTIVE_STATE_WAITING' | 'WIDGET_OBJECTIVE_STATE_FAILED' | 'WIDGET_OBJECTIVE_STATE_CANCELLED' | 'WIDGET_OBJECTIVE_STATE_FINALIZED' | 'WIDGET_OBJECTIVE_STATE_TIMED_OUT';
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* WidgetObjectiveStateChangedEvent mirrors a durable objective transition.
|
|
281
|
+
* Internal status messages are intentionally omitted. Pending/running maps
|
|
282
|
+
* to a responding conversation, waiting to open, and terminal states to closed.
|
|
283
|
+
*/
|
|
284
|
+
export interface WidgetObjectiveStateChangedEvent {
|
|
285
|
+
fromState: WidgetObjectiveStateChangedEventFromState;
|
|
286
|
+
toState: WidgetObjectiveStateChangedEventToState;
|
|
287
|
+
}
|
|
288
|
+
|
|
266
289
|
/**
|
|
267
290
|
* WidgetTimedOutEvent: the conversation timed out after inactivity. Terminal.
|
|
268
291
|
*/
|
|
@@ -370,8 +393,9 @@ export interface WidgetEvent_UserMessage {
|
|
|
370
393
|
type: 'userMessage';
|
|
371
394
|
userMessage: WidgetUserMessageEvent;
|
|
372
395
|
/**
|
|
373
|
-
* Unique event id (ULID).
|
|
374
|
-
* `Last-Event-ID
|
|
396
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
397
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
398
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
375
399
|
*/
|
|
376
400
|
id: string;
|
|
377
401
|
/**
|
|
@@ -385,8 +409,9 @@ export interface WidgetEvent_AssistantMessage {
|
|
|
385
409
|
type: 'assistantMessage';
|
|
386
410
|
assistantMessage: WidgetAssistantMessageEvent;
|
|
387
411
|
/**
|
|
388
|
-
* Unique event id (ULID).
|
|
389
|
-
* `Last-Event-ID
|
|
412
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
413
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
414
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
390
415
|
*/
|
|
391
416
|
id: string;
|
|
392
417
|
/**
|
|
@@ -400,8 +425,9 @@ export interface WidgetEvent_ToolApprovalRequested {
|
|
|
400
425
|
type: 'toolApprovalRequested';
|
|
401
426
|
toolApprovalRequested: WidgetToolApprovalRequestedEvent;
|
|
402
427
|
/**
|
|
403
|
-
* Unique event id (ULID).
|
|
404
|
-
* `Last-Event-ID
|
|
428
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
429
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
430
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
405
431
|
*/
|
|
406
432
|
id: string;
|
|
407
433
|
/**
|
|
@@ -415,8 +441,9 @@ export interface WidgetEvent_ToolApproved {
|
|
|
415
441
|
type: 'toolApproved';
|
|
416
442
|
toolApproved: WidgetToolApprovedEvent;
|
|
417
443
|
/**
|
|
418
|
-
* Unique event id (ULID).
|
|
419
|
-
* `Last-Event-ID
|
|
444
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
445
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
446
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
420
447
|
*/
|
|
421
448
|
id: string;
|
|
422
449
|
/**
|
|
@@ -430,8 +457,9 @@ export interface WidgetEvent_ToolDenied {
|
|
|
430
457
|
type: 'toolDenied';
|
|
431
458
|
toolDenied: WidgetToolDeniedEvent;
|
|
432
459
|
/**
|
|
433
|
-
* Unique event id (ULID).
|
|
434
|
-
* `Last-Event-ID
|
|
460
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
461
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
462
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
435
463
|
*/
|
|
436
464
|
id: string;
|
|
437
465
|
/**
|
|
@@ -445,8 +473,9 @@ export interface WidgetEvent_ToolCalled {
|
|
|
445
473
|
type: 'toolCalled';
|
|
446
474
|
toolCalled: WidgetToolCalledEvent;
|
|
447
475
|
/**
|
|
448
|
-
* Unique event id (ULID).
|
|
449
|
-
* `Last-Event-ID
|
|
476
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
477
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
478
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
450
479
|
*/
|
|
451
480
|
id: string;
|
|
452
481
|
/**
|
|
@@ -460,8 +489,9 @@ export interface WidgetEvent_ToolResult {
|
|
|
460
489
|
type: 'toolResult';
|
|
461
490
|
toolResult: WidgetToolResultEvent;
|
|
462
491
|
/**
|
|
463
|
-
* Unique event id (ULID).
|
|
464
|
-
* `Last-Event-ID
|
|
492
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
493
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
494
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
465
495
|
*/
|
|
466
496
|
id: string;
|
|
467
497
|
/**
|
|
@@ -475,8 +505,9 @@ export interface WidgetEvent_ToolError {
|
|
|
475
505
|
type: 'toolError';
|
|
476
506
|
toolError: WidgetToolErrorEvent;
|
|
477
507
|
/**
|
|
478
|
-
* Unique event id (ULID).
|
|
479
|
-
* `Last-Event-ID
|
|
508
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
509
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
510
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
480
511
|
*/
|
|
481
512
|
id: string;
|
|
482
513
|
/**
|
|
@@ -490,8 +521,9 @@ export interface WidgetEvent_Error {
|
|
|
490
521
|
type: 'error';
|
|
491
522
|
error: WidgetErrorEvent;
|
|
492
523
|
/**
|
|
493
|
-
* Unique event id (ULID).
|
|
494
|
-
* `Last-Event-ID
|
|
524
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
525
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
526
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
495
527
|
*/
|
|
496
528
|
id: string;
|
|
497
529
|
/**
|
|
@@ -505,8 +537,9 @@ export interface WidgetEvent_Cancelled {
|
|
|
505
537
|
type: 'cancelled';
|
|
506
538
|
cancelled: WidgetCancelledEvent;
|
|
507
539
|
/**
|
|
508
|
-
* Unique event id (ULID).
|
|
509
|
-
* `Last-Event-ID
|
|
540
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
541
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
542
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
510
543
|
*/
|
|
511
544
|
id: string;
|
|
512
545
|
/**
|
|
@@ -520,8 +553,9 @@ export interface WidgetEvent_TimedOut {
|
|
|
520
553
|
type: 'timedOut';
|
|
521
554
|
timedOut: WidgetTimedOutEvent;
|
|
522
555
|
/**
|
|
523
|
-
* Unique event id (ULID).
|
|
524
|
-
* `Last-Event-ID
|
|
556
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
557
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
558
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
525
559
|
*/
|
|
526
560
|
id: string;
|
|
527
561
|
/**
|
|
@@ -535,8 +569,41 @@ export interface WidgetEvent_Finalized {
|
|
|
535
569
|
type: 'finalized';
|
|
536
570
|
finalized: WidgetFinalizedEvent;
|
|
537
571
|
/**
|
|
538
|
-
* Unique event id (ULID).
|
|
539
|
-
* `Last-Event-ID
|
|
572
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
573
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
574
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
575
|
+
*/
|
|
576
|
+
id: string;
|
|
577
|
+
/**
|
|
578
|
+
* The conversation this event belongs to.
|
|
579
|
+
*/
|
|
580
|
+
conversationId: string;
|
|
581
|
+
createdAt: string;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
export interface WidgetEvent_Heartbeat {
|
|
585
|
+
type: 'heartbeat';
|
|
586
|
+
heartbeat: WidgetHeartbeatEvent;
|
|
587
|
+
/**
|
|
588
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
589
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
590
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
591
|
+
*/
|
|
592
|
+
id: string;
|
|
593
|
+
/**
|
|
594
|
+
* The conversation this event belongs to.
|
|
595
|
+
*/
|
|
596
|
+
conversationId: string;
|
|
597
|
+
createdAt: string;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
export interface WidgetEvent_StateChanged {
|
|
601
|
+
type: 'stateChanged';
|
|
602
|
+
stateChanged: WidgetObjectiveStateChangedEvent;
|
|
603
|
+
/**
|
|
604
|
+
* Unique event id (prefixed ULID). Only durable objevt_ IDs are emitted
|
|
605
|
+
* as SSE `id:` fields and accepted as Last-Event-ID reconnect cursors.
|
|
606
|
+
* Transient heartbeats carry hb_ IDs in this payload only.
|
|
540
607
|
*/
|
|
541
608
|
id: string;
|
|
542
609
|
/**
|