@proteos/sdk 0.36.1 → 0.38.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/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -5
- package/dist/index.d.ts +60 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/connector/types.ts +2 -1
- package/src/conversation/types.ts +57 -0
- package/src/index.ts +2 -0
- package/src/workflow/types.ts +3 -0
package/package.json
CHANGED
package/src/connector/types.ts
CHANGED
|
@@ -165,7 +165,8 @@ export interface ListConnectorConnectionsQuery {
|
|
|
165
165
|
export interface ListResponse<T> {
|
|
166
166
|
data: T[]
|
|
167
167
|
meta: {
|
|
168
|
-
|
|
168
|
+
page: number
|
|
169
|
+
page_size: number
|
|
169
170
|
items_total: number
|
|
170
171
|
pages_total: number
|
|
171
172
|
}
|
|
@@ -397,11 +397,36 @@ export interface AgentListenerTriggerConfig {
|
|
|
397
397
|
phrases?: string[]
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
+
/**
|
|
401
|
+
* How the dispatcher immediately acknowledges a triggering message once the
|
|
402
|
+
* agent turn is queued: '' = none, 'reaction' places an emoji on the message
|
|
403
|
+
* (reaction-capable connections only), 'message' posts a short text.
|
|
404
|
+
*/
|
|
405
|
+
export type AgentListenerAcknowledgementType = '' | 'reaction' | 'message'
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Discriminated by the sibling acknowledgement_type; serialized as the bare
|
|
409
|
+
* variant, both fields optional here.
|
|
410
|
+
*/
|
|
411
|
+
export interface AgentListenerAcknowledgementConfig {
|
|
412
|
+
/** Reaction type: connector-native emoji token ("eyes", no colons). */
|
|
413
|
+
emoji?: string
|
|
414
|
+
/** Message type: the acknowledgement text. */
|
|
415
|
+
text?: string
|
|
416
|
+
}
|
|
417
|
+
|
|
400
418
|
export interface AgentListener {
|
|
401
419
|
id: string
|
|
402
420
|
org_id: string
|
|
403
421
|
connection_id: string
|
|
404
422
|
conversation_id: string
|
|
423
|
+
/**
|
|
424
|
+
* Optionally NARROWS a connection-bound listener to one room — the internal
|
|
425
|
+
* room id (`Room.id`), matched against the conversation's room at dispatch.
|
|
426
|
+
* Absent/empty ⇒ the whole connection. The most specific scope wins:
|
|
427
|
+
* conversation > room > connection; priority orders within a tier.
|
|
428
|
+
*/
|
|
429
|
+
room_id?: string
|
|
405
430
|
name: string
|
|
406
431
|
agent_key: string
|
|
407
432
|
trigger_type: AgentListenerTriggerType
|
|
@@ -412,6 +437,13 @@ export interface AgentListener {
|
|
|
412
437
|
* connected the trigger drives it normally. Empty/absent ⇒ no gate.
|
|
413
438
|
*/
|
|
414
439
|
wake_phrase?: string
|
|
440
|
+
/**
|
|
441
|
+
* Immediate platform acknowledgement of the triggering message, executed by
|
|
442
|
+
* the dispatcher once the agent turn is queued ('' = none). The agent is
|
|
443
|
+
* told not to acknowledge again.
|
|
444
|
+
*/
|
|
445
|
+
acknowledgement_type: AgentListenerAcknowledgementType
|
|
446
|
+
acknowledgement_config?: AgentListenerAcknowledgementConfig
|
|
415
447
|
/** The user the dispatcher acts as when driving the agent. */
|
|
416
448
|
acting_user: UserRef
|
|
417
449
|
is_enabled: boolean
|
|
@@ -511,12 +543,24 @@ export interface UpdateDraftRequest {
|
|
|
511
543
|
export interface CreateAgentListenerRequest {
|
|
512
544
|
connection_id?: string
|
|
513
545
|
conversation_id?: string
|
|
546
|
+
/**
|
|
547
|
+
* Only with `connection_id`: narrow the listener to one room. Pass the
|
|
548
|
+
* internal room id (`Room.id` from listRooms), NOT the provider channel id.
|
|
549
|
+
*/
|
|
550
|
+
room_id?: string
|
|
514
551
|
name: string
|
|
515
552
|
agent_key: string
|
|
516
553
|
trigger_type: AgentListenerTriggerType
|
|
517
554
|
trigger_config?: AgentListenerTriggerConfig
|
|
518
555
|
/** Gate the listener behind a wake word; omit or leave empty for no gate. */
|
|
519
556
|
wake_phrase?: string
|
|
557
|
+
/**
|
|
558
|
+
* Immediate platform acknowledgement; omit or '' for none. 'reaction'
|
|
559
|
+
* requires a reaction-capable connection and { emoji } in the config;
|
|
560
|
+
* 'message' requires { text }.
|
|
561
|
+
*/
|
|
562
|
+
acknowledgement_type?: AgentListenerAcknowledgementType
|
|
563
|
+
acknowledgement_config?: AgentListenerAcknowledgementConfig
|
|
520
564
|
/** A bare user id; the service wraps it into a person UserRef. */
|
|
521
565
|
acting_user_id: string
|
|
522
566
|
/** Omit to default to enabled. */
|
|
@@ -531,12 +575,24 @@ export interface CreateAgentListenerRequest {
|
|
|
531
575
|
}
|
|
532
576
|
|
|
533
577
|
export interface UpdateAgentListenerRequest {
|
|
578
|
+
/**
|
|
579
|
+
* Set to narrow the listener to a room (internal `Room.id`); pass "" to
|
|
580
|
+
* clear. Only valid on connection-scoped listeners — the connection/
|
|
581
|
+
* conversation target itself is fixed at creation.
|
|
582
|
+
*/
|
|
583
|
+
room_id?: string
|
|
534
584
|
name?: string
|
|
535
585
|
agent_key?: string
|
|
536
586
|
trigger_type?: AgentListenerTriggerType
|
|
537
587
|
trigger_config?: AgentListenerTriggerConfig
|
|
538
588
|
/** Set to gate the listener; pass "" to clear an existing wake phrase. */
|
|
539
589
|
wake_phrase?: string
|
|
590
|
+
/**
|
|
591
|
+
* Set to change the acknowledgement; pass '' to clear. A non-empty type
|
|
592
|
+
* requires acknowledgement_config in the same request.
|
|
593
|
+
*/
|
|
594
|
+
acknowledgement_type?: AgentListenerAcknowledgementType
|
|
595
|
+
acknowledgement_config?: AgentListenerAcknowledgementConfig
|
|
540
596
|
acting_user_id?: string
|
|
541
597
|
is_enabled?: boolean
|
|
542
598
|
/** Toggle whether the platform auto-forwards the agent's text reply. */
|
|
@@ -699,6 +755,7 @@ export interface ListMessagesQuery extends PaginationQuery {
|
|
|
699
755
|
export interface ListAgentListenersQuery extends PaginationQuery {
|
|
700
756
|
connection_id?: string
|
|
701
757
|
conversation_id?: string
|
|
758
|
+
room_id?: string
|
|
702
759
|
agent_key?: string
|
|
703
760
|
is_enabled?: boolean
|
|
704
761
|
}
|
package/src/index.ts
CHANGED
package/src/workflow/types.ts
CHANGED
|
@@ -609,6 +609,9 @@ export interface ExecutionTriggerContext {
|
|
|
609
609
|
// message
|
|
610
610
|
conversation_id?: string
|
|
611
611
|
channel?: string
|
|
612
|
+
// connector
|
|
613
|
+
connector_key?: string
|
|
614
|
+
connection_id?: string
|
|
612
615
|
// workflow (child executions)
|
|
613
616
|
parent_execution_id?: string
|
|
614
617
|
payload?: unknown
|