getricky 0.1.39 → 0.1.41

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.
@@ -3318,9 +3318,9 @@ export type Workflow = {
3318
3318
  type: 'conversation' | 'scheduled';
3319
3319
  definition: {
3320
3320
  /**
3321
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers the conversations of its channels (only those assigned to `coverage.assigned_user_ids` when given) and no assignee moves; when each period starts it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
3321
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
3322
3322
  */
3323
- trigger: 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_away' | 'team_message_unanswered' | 'call_received';
3323
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
3324
3324
  /**
3325
3325
  * Channels it listens to. See `GET /channels`.
3326
3326
  */
@@ -3360,29 +3360,34 @@ export type Workflow = {
3360
3360
  text_contains?: string;
3361
3361
  };
3362
3362
  /**
3363
- * When a `team_away` workflow covers: one period, or every week outside the team's hours.
3363
+ * When an `at_time` workflow runs; required for it and only for it.
3364
3364
  */
3365
- coverage?: {
3365
+ at_time?: {
3366
3366
  /**
3367
- * When the team goes away, for one period; with `ends_at`.
3367
+ * Quarter hour it runs, `HH:MM`.
3368
3368
  */
3369
- starts_at?: string;
3369
+ time: string;
3370
3370
  /**
3371
- * When the team is back, for one period; with `starts_at`.
3371
+ * IANA time zone of `time` and `weekdays`.
3372
3372
  */
3373
- ends_at?: string;
3373
+ timezone: string;
3374
3374
  /**
3375
- * The team's hours, instead of `starts_at` and `ends_at`: the agent covers every week outside them, each closing starting a period.
3375
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
3376
3376
  */
3377
- team_hours?: BusinessHours;
3377
+ weekdays: Array<number>;
3378
+ };
3379
+ /**
3380
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
3381
+ */
3382
+ conversation_filters?: {
3378
3383
  /**
3379
- * Covers only the conversations assigned to these members; omitted, every conversation of its channels. See `GET /members`.
3384
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
3380
3385
  */
3381
3386
  assigned_user_ids?: Array<string>;
3382
3387
  /**
3383
- * What the agent tells customers meanwhile.
3388
+ * Only open conversations.
3384
3389
  */
3385
- notice: string | null;
3390
+ only_open: boolean;
3386
3391
  };
3387
3392
  /**
3388
3393
  * When it runs; null runs at any hour.
@@ -3403,7 +3408,7 @@ export type Workflow = {
3403
3408
  */
3404
3409
  entry: string;
3405
3410
  /**
3406
- * One step. `close_conversation`, `end`, `answer_call` and `decline_call` finish the flow; every other step continues at its target.
3411
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
3407
3412
  */
3408
3413
  steps: Array<{
3409
3414
  /**
@@ -3590,6 +3595,30 @@ export type Workflow = {
3590
3595
  * In a `call_received` workflow: Ricky rejects the call and sends this text to the caller's WhatsApp chat.
3591
3596
  */
3592
3597
  text: string;
3598
+ } | {
3599
+ /**
3600
+ * Step ID: letters, digits, `_` or `-`, up to 64.
3601
+ */
3602
+ id: string;
3603
+ /**
3604
+ * Step to run next; null ends the flow.
3605
+ */
3606
+ next: string | null;
3607
+ kind: 'turn_on_ai';
3608
+ /**
3609
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
3610
+ */
3611
+ agent_id: string;
3612
+ } | {
3613
+ /**
3614
+ * Step ID: letters, digits, `_` or `-`, up to 64.
3615
+ */
3616
+ id: string;
3617
+ /**
3618
+ * Step to run next; null ends the flow.
3619
+ */
3620
+ next: string | null;
3621
+ kind: 'turn_off_ai';
3593
3622
  }>;
3594
3623
  };
3595
3624
  } | {
@@ -4991,9 +5020,9 @@ export type CreateWorkflow = {
4991
5020
  */
4992
5021
  definition: {
4993
5022
  /**
4994
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers the conversations of its channels (only those assigned to `coverage.assigned_user_ids` when given) and no assignee moves; when each period starts it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5023
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
4995
5024
  */
4996
- trigger: 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_away' | 'team_message_unanswered' | 'call_received';
5025
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
4997
5026
  /**
4998
5027
  * Channels it listens to. See `GET /channels`.
4999
5028
  */
@@ -5033,29 +5062,34 @@ export type CreateWorkflow = {
5033
5062
  text_contains?: string;
5034
5063
  };
5035
5064
  /**
5036
- * When a `team_away` workflow covers: one period, or every week outside the team's hours.
5065
+ * When an `at_time` workflow runs; required for it and only for it.
5037
5066
  */
5038
- coverage?: {
5067
+ at_time?: {
5039
5068
  /**
5040
- * When the team goes away, for one period; with `ends_at`.
5069
+ * Quarter hour it runs, `HH:MM`.
5041
5070
  */
5042
- starts_at?: string;
5071
+ time: string;
5043
5072
  /**
5044
- * When the team is back, for one period; with `starts_at`.
5073
+ * IANA time zone of `time` and `weekdays`.
5045
5074
  */
5046
- ends_at?: string;
5075
+ timezone: string;
5047
5076
  /**
5048
- * The team's hours, instead of `starts_at` and `ends_at`: the agent covers every week outside them, each closing starting a period.
5077
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
5049
5078
  */
5050
- team_hours?: BusinessHoursInput;
5079
+ weekdays: Array<number>;
5080
+ };
5081
+ /**
5082
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
5083
+ */
5084
+ conversation_filters?: {
5051
5085
  /**
5052
- * Covers only the conversations assigned to these members; omitted, every conversation of its channels. See `GET /members`.
5086
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
5053
5087
  */
5054
5088
  assigned_user_ids?: Array<string>;
5055
5089
  /**
5056
- * What the agent tells customers meanwhile.
5090
+ * Only open conversations.
5057
5091
  */
5058
- notice: string | null;
5092
+ only_open: boolean;
5059
5093
  };
5060
5094
  /**
5061
5095
  * When it runs; null runs at any hour.
@@ -5076,7 +5110,7 @@ export type CreateWorkflow = {
5076
5110
  */
5077
5111
  entry: string;
5078
5112
  /**
5079
- * One step. `close_conversation`, `end`, `answer_call` and `decline_call` finish the flow; every other step continues at its target.
5113
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
5080
5114
  */
5081
5115
  steps: Array<{
5082
5116
  /**
@@ -5263,6 +5297,30 @@ export type CreateWorkflow = {
5263
5297
  * In a `call_received` workflow: Ricky rejects the call and sends this text to the caller's WhatsApp chat.
5264
5298
  */
5265
5299
  text: string;
5300
+ } | {
5301
+ /**
5302
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5303
+ */
5304
+ id: string;
5305
+ /**
5306
+ * Step to run next; null ends the flow.
5307
+ */
5308
+ next: string | null;
5309
+ kind: 'turn_on_ai';
5310
+ /**
5311
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
5312
+ */
5313
+ agent_id: string;
5314
+ } | {
5315
+ /**
5316
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5317
+ */
5318
+ id: string;
5319
+ /**
5320
+ * Step to run next; null ends the flow.
5321
+ */
5322
+ next: string | null;
5323
+ kind: 'turn_off_ai';
5266
5324
  }>;
5267
5325
  };
5268
5326
  };
@@ -5280,9 +5338,9 @@ export type UpdateWorkflow = {
5280
5338
  */
5281
5339
  definition?: {
5282
5340
  /**
5283
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers the conversations of its channels (only those assigned to `coverage.assigned_user_ids` when given) and no assignee moves; when each period starts it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5341
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5284
5342
  */
5285
- trigger: 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_away' | 'team_message_unanswered' | 'call_received';
5343
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
5286
5344
  /**
5287
5345
  * Channels it listens to. See `GET /channels`.
5288
5346
  */
@@ -5322,29 +5380,34 @@ export type UpdateWorkflow = {
5322
5380
  text_contains?: string;
5323
5381
  };
5324
5382
  /**
5325
- * When a `team_away` workflow covers: one period, or every week outside the team's hours.
5383
+ * When an `at_time` workflow runs; required for it and only for it.
5326
5384
  */
5327
- coverage?: {
5385
+ at_time?: {
5328
5386
  /**
5329
- * When the team goes away, for one period; with `ends_at`.
5387
+ * Quarter hour it runs, `HH:MM`.
5330
5388
  */
5331
- starts_at?: string;
5389
+ time: string;
5332
5390
  /**
5333
- * When the team is back, for one period; with `starts_at`.
5391
+ * IANA time zone of `time` and `weekdays`.
5334
5392
  */
5335
- ends_at?: string;
5393
+ timezone: string;
5336
5394
  /**
5337
- * The team's hours, instead of `starts_at` and `ends_at`: the agent covers every week outside them, each closing starting a period.
5395
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
5338
5396
  */
5339
- team_hours?: BusinessHoursInput;
5397
+ weekdays: Array<number>;
5398
+ };
5399
+ /**
5400
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
5401
+ */
5402
+ conversation_filters?: {
5340
5403
  /**
5341
- * Covers only the conversations assigned to these members; omitted, every conversation of its channels. See `GET /members`.
5404
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
5342
5405
  */
5343
5406
  assigned_user_ids?: Array<string>;
5344
5407
  /**
5345
- * What the agent tells customers meanwhile.
5408
+ * Only open conversations.
5346
5409
  */
5347
- notice: string | null;
5410
+ only_open: boolean;
5348
5411
  };
5349
5412
  /**
5350
5413
  * When it runs; null runs at any hour.
@@ -5365,7 +5428,7 @@ export type UpdateWorkflow = {
5365
5428
  */
5366
5429
  entry: string;
5367
5430
  /**
5368
- * One step. `close_conversation`, `end`, `answer_call` and `decline_call` finish the flow; every other step continues at its target.
5431
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
5369
5432
  */
5370
5433
  steps: Array<{
5371
5434
  /**
@@ -5552,6 +5615,30 @@ export type UpdateWorkflow = {
5552
5615
  * In a `call_received` workflow: Ricky rejects the call and sends this text to the caller's WhatsApp chat.
5553
5616
  */
5554
5617
  text: string;
5618
+ } | {
5619
+ /**
5620
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5621
+ */
5622
+ id: string;
5623
+ /**
5624
+ * Step to run next; null ends the flow.
5625
+ */
5626
+ next: string | null;
5627
+ kind: 'turn_on_ai';
5628
+ /**
5629
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
5630
+ */
5631
+ agent_id: string;
5632
+ } | {
5633
+ /**
5634
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5635
+ */
5636
+ id: string;
5637
+ /**
5638
+ * Step to run next; null ends the flow.
5639
+ */
5640
+ next: string | null;
5641
+ kind: 'turn_off_ai';
5555
5642
  }>;
5556
5643
  };
5557
5644
  };
@@ -3318,9 +3318,9 @@ export type Workflow = {
3318
3318
  type: 'conversation' | 'scheduled';
3319
3319
  definition: {
3320
3320
  /**
3321
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers the conversations of its channels (only those assigned to `coverage.assigned_user_ids` when given) and no assignee moves; when each period starts it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
3321
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
3322
3322
  */
3323
- trigger: 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_away' | 'team_message_unanswered' | 'call_received';
3323
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
3324
3324
  /**
3325
3325
  * Channels it listens to. See `GET /channels`.
3326
3326
  */
@@ -3360,29 +3360,34 @@ export type Workflow = {
3360
3360
  text_contains?: string;
3361
3361
  };
3362
3362
  /**
3363
- * When a `team_away` workflow covers: one period, or every week outside the team's hours.
3363
+ * When an `at_time` workflow runs; required for it and only for it.
3364
3364
  */
3365
- coverage?: {
3365
+ at_time?: {
3366
3366
  /**
3367
- * When the team goes away, for one period; with `ends_at`.
3367
+ * Quarter hour it runs, `HH:MM`.
3368
3368
  */
3369
- starts_at?: string;
3369
+ time: string;
3370
3370
  /**
3371
- * When the team is back, for one period; with `starts_at`.
3371
+ * IANA time zone of `time` and `weekdays`.
3372
3372
  */
3373
- ends_at?: string;
3373
+ timezone: string;
3374
3374
  /**
3375
- * The team's hours, instead of `starts_at` and `ends_at`: the agent covers every week outside them, each closing starting a period.
3375
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
3376
3376
  */
3377
- team_hours?: BusinessHours;
3377
+ weekdays: Array<number>;
3378
+ };
3379
+ /**
3380
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
3381
+ */
3382
+ conversation_filters?: {
3378
3383
  /**
3379
- * Covers only the conversations assigned to these members; omitted, every conversation of its channels. See `GET /members`.
3384
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
3380
3385
  */
3381
3386
  assigned_user_ids?: Array<string>;
3382
3387
  /**
3383
- * What the agent tells customers meanwhile.
3388
+ * Only open conversations.
3384
3389
  */
3385
- notice: string | null;
3390
+ only_open: boolean;
3386
3391
  };
3387
3392
  /**
3388
3393
  * When it runs; null runs at any hour.
@@ -3403,7 +3408,7 @@ export type Workflow = {
3403
3408
  */
3404
3409
  entry: string;
3405
3410
  /**
3406
- * One step. `close_conversation`, `end`, `answer_call` and `decline_call` finish the flow; every other step continues at its target.
3411
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
3407
3412
  */
3408
3413
  steps: Array<{
3409
3414
  /**
@@ -3590,6 +3595,30 @@ export type Workflow = {
3590
3595
  * In a `call_received` workflow: Ricky rejects the call and sends this text to the caller's WhatsApp chat.
3591
3596
  */
3592
3597
  text: string;
3598
+ } | {
3599
+ /**
3600
+ * Step ID: letters, digits, `_` or `-`, up to 64.
3601
+ */
3602
+ id: string;
3603
+ /**
3604
+ * Step to run next; null ends the flow.
3605
+ */
3606
+ next: string | null;
3607
+ kind: 'turn_on_ai';
3608
+ /**
3609
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
3610
+ */
3611
+ agent_id: string;
3612
+ } | {
3613
+ /**
3614
+ * Step ID: letters, digits, `_` or `-`, up to 64.
3615
+ */
3616
+ id: string;
3617
+ /**
3618
+ * Step to run next; null ends the flow.
3619
+ */
3620
+ next: string | null;
3621
+ kind: 'turn_off_ai';
3593
3622
  }>;
3594
3623
  };
3595
3624
  } | {
@@ -4991,9 +5020,9 @@ export type CreateWorkflow = {
4991
5020
  */
4992
5021
  definition: {
4993
5022
  /**
4994
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers the conversations of its channels (only those assigned to `coverage.assigned_user_ids` when given) and no assignee moves; when each period starts it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5023
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
4995
5024
  */
4996
- trigger: 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_away' | 'team_message_unanswered' | 'call_received';
5025
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
4997
5026
  /**
4998
5027
  * Channels it listens to. See `GET /channels`.
4999
5028
  */
@@ -5033,29 +5062,34 @@ export type CreateWorkflow = {
5033
5062
  text_contains?: string;
5034
5063
  };
5035
5064
  /**
5036
- * When a `team_away` workflow covers: one period, or every week outside the team's hours.
5065
+ * When an `at_time` workflow runs; required for it and only for it.
5037
5066
  */
5038
- coverage?: {
5067
+ at_time?: {
5039
5068
  /**
5040
- * When the team goes away, for one period; with `ends_at`.
5069
+ * Quarter hour it runs, `HH:MM`.
5041
5070
  */
5042
- starts_at?: string;
5071
+ time: string;
5043
5072
  /**
5044
- * When the team is back, for one period; with `starts_at`.
5073
+ * IANA time zone of `time` and `weekdays`.
5045
5074
  */
5046
- ends_at?: string;
5075
+ timezone: string;
5047
5076
  /**
5048
- * The team's hours, instead of `starts_at` and `ends_at`: the agent covers every week outside them, each closing starting a period.
5077
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
5049
5078
  */
5050
- team_hours?: BusinessHoursInput;
5079
+ weekdays: Array<number>;
5080
+ };
5081
+ /**
5082
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
5083
+ */
5084
+ conversation_filters?: {
5051
5085
  /**
5052
- * Covers only the conversations assigned to these members; omitted, every conversation of its channels. See `GET /members`.
5086
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
5053
5087
  */
5054
5088
  assigned_user_ids?: Array<string>;
5055
5089
  /**
5056
- * What the agent tells customers meanwhile.
5090
+ * Only open conversations.
5057
5091
  */
5058
- notice: string | null;
5092
+ only_open: boolean;
5059
5093
  };
5060
5094
  /**
5061
5095
  * When it runs; null runs at any hour.
@@ -5076,7 +5110,7 @@ export type CreateWorkflow = {
5076
5110
  */
5077
5111
  entry: string;
5078
5112
  /**
5079
- * One step. `close_conversation`, `end`, `answer_call` and `decline_call` finish the flow; every other step continues at its target.
5113
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
5080
5114
  */
5081
5115
  steps: Array<{
5082
5116
  /**
@@ -5263,6 +5297,30 @@ export type CreateWorkflow = {
5263
5297
  * In a `call_received` workflow: Ricky rejects the call and sends this text to the caller's WhatsApp chat.
5264
5298
  */
5265
5299
  text: string;
5300
+ } | {
5301
+ /**
5302
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5303
+ */
5304
+ id: string;
5305
+ /**
5306
+ * Step to run next; null ends the flow.
5307
+ */
5308
+ next: string | null;
5309
+ kind: 'turn_on_ai';
5310
+ /**
5311
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
5312
+ */
5313
+ agent_id: string;
5314
+ } | {
5315
+ /**
5316
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5317
+ */
5318
+ id: string;
5319
+ /**
5320
+ * Step to run next; null ends the flow.
5321
+ */
5322
+ next: string | null;
5323
+ kind: 'turn_off_ai';
5266
5324
  }>;
5267
5325
  };
5268
5326
  };
@@ -5280,9 +5338,9 @@ export type UpdateWorkflow = {
5280
5338
  */
5281
5339
  definition?: {
5282
5340
  /**
5283
- * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `team_away` runs nothing: during `coverage` the agent of its only `assign_agent` step answers the conversations of its channels (only those assigned to `coverage.assigned_user_ids` when given) and no assignee moves; when each period starts it answers those already waiting for a reply. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5341
+ * `conversation_opened` runs when a conversation opens; `first_message_received` when the contact writes first in a conversation, before any message from the business; `message_received` on every incoming message; `message_sent` within 15 minutes of an outgoing message that passes `sent_message_filters`, unless the contact replied first. `at_time` runs once a day at `at_time.time`, on its weekdays, on each conversation of its channels assigned then to one of `conversation_filters.assigned_user_ids` (open ones only with `conversation_filters.only_open`); it has no `condition`. `conversation_assigned` runs when a conversation of its channels is assigned to a member (any member, or one of `conversation_filters.assigned_user_ids`) while its `condition` holds; the assignment an AI handoff makes does not run it. Both take only `turn_on_ai` and `turn_off_ai` steps, which only they take. `call_received` decides who answers a WhatsApp call on its channels (WhatsApp numbers with AI calls on): its flow takes only `answer_call`, `decline_call` and a `branch` on `business_hours`, and the first active one that reaches a call step decides, over whoever holds the conversation.
5284
5342
  */
5285
- trigger: 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_away' | 'team_message_unanswered' | 'call_received';
5343
+ trigger: 'at_time' | 'conversation_assigned' | 'conversation_inactive' | 'conversation_opened' | 'first_message_received' | 'message_received' | 'message_sent' | 'team_message_unanswered' | 'call_received';
5286
5344
  /**
5287
5345
  * Channels it listens to. See `GET /channels`.
5288
5346
  */
@@ -5322,29 +5380,34 @@ export type UpdateWorkflow = {
5322
5380
  text_contains?: string;
5323
5381
  };
5324
5382
  /**
5325
- * When a `team_away` workflow covers: one period, or every week outside the team's hours.
5383
+ * When an `at_time` workflow runs; required for it and only for it.
5326
5384
  */
5327
- coverage?: {
5385
+ at_time?: {
5328
5386
  /**
5329
- * When the team goes away, for one period; with `ends_at`.
5387
+ * Quarter hour it runs, `HH:MM`.
5330
5388
  */
5331
- starts_at?: string;
5389
+ time: string;
5332
5390
  /**
5333
- * When the team is back, for one period; with `starts_at`.
5391
+ * IANA time zone of `time` and `weekdays`.
5334
5392
  */
5335
- ends_at?: string;
5393
+ timezone: string;
5336
5394
  /**
5337
- * The team's hours, instead of `starts_at` and `ends_at`: the agent covers every week outside them, each closing starting a period.
5395
+ * Days it runs, 0 for Sunday to 6 for Saturday. Each at most once.
5338
5396
  */
5339
- team_hours?: BusinessHoursInput;
5397
+ weekdays: Array<number>;
5398
+ };
5399
+ /**
5400
+ * Which conversations `at_time` and `conversation_assigned` reach; only for them.
5401
+ */
5402
+ conversation_filters?: {
5340
5403
  /**
5341
- * Covers only the conversations assigned to these members; omitted, every conversation of its channels. See `GET /members`.
5404
+ * Members the conversation is assigned to. Required for `at_time`; omitted on `conversation_assigned`, any member. See `GET /members`.
5342
5405
  */
5343
5406
  assigned_user_ids?: Array<string>;
5344
5407
  /**
5345
- * What the agent tells customers meanwhile.
5408
+ * Only open conversations.
5346
5409
  */
5347
- notice: string | null;
5410
+ only_open: boolean;
5348
5411
  };
5349
5412
  /**
5350
5413
  * When it runs; null runs at any hour.
@@ -5365,7 +5428,7 @@ export type UpdateWorkflow = {
5365
5428
  */
5366
5429
  entry: string;
5367
5430
  /**
5368
- * One step. `close_conversation`, `end`, `answer_call` and `decline_call` finish the flow; every other step continues at its target.
5431
+ * One step. `close_conversation`, `end`, `answer_call`, `decline_call`, `turn_on_ai` and `turn_off_ai` finish the flow; every other step continues at its target.
5369
5432
  */
5370
5433
  steps: Array<{
5371
5434
  /**
@@ -5552,6 +5615,30 @@ export type UpdateWorkflow = {
5552
5615
  * In a `call_received` workflow: Ricky rejects the call and sends this text to the caller's WhatsApp chat.
5553
5616
  */
5554
5617
  text: string;
5618
+ } | {
5619
+ /**
5620
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5621
+ */
5622
+ id: string;
5623
+ /**
5624
+ * Step to run next; null ends the flow.
5625
+ */
5626
+ next: string | null;
5627
+ kind: 'turn_on_ai';
5628
+ /**
5629
+ * Turns the AI on in the conversation with this AI agent; the conversation stays assigned to its member. If the contact wrote last, the agent answers at once. It turns off when a member writes in the conversation.
5630
+ */
5631
+ agent_id: string;
5632
+ } | {
5633
+ /**
5634
+ * Step ID: letters, digits, `_` or `-`, up to 64.
5635
+ */
5636
+ id: string;
5637
+ /**
5638
+ * Step to run next; null ends the flow.
5639
+ */
5640
+ next: string | null;
5641
+ kind: 'turn_off_ai';
5555
5642
  }>;
5556
5643
  };
5557
5644
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "getricky",
3
- "version": "0.1.39",
3
+ "version": "0.1.41",
4
4
  "description": "Official TypeScript SDK for the Ricky REST API",
5
5
  "keywords": [
6
6
  "api",