pinecall 0.11.46 → 0.11.47

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3650e38c91241c32be57859dc9d83bbfbd2c534285ad89684d1074623a71af4
4
- data.tar.gz: b1e31d46952d9891f6c3759b4230eaee8cd44d1dafa6b6f20262d77d34eae952
3
+ metadata.gz: 924676052208013a0776150fa2e6c9aa938f160936ea56873df17181101081a9
4
+ data.tar.gz: 6c4264f366a24239e867638509462312cd808c3ec0fabc6bab41df09eeca308c
5
5
  SHA512:
6
- metadata.gz: c30807311fa8b59d82b768ac9b44253a6d3b67ca3889fbb9121d570596b81dc23873caee5a06ecbf891ab130bf09445e6fe09a3d6245f214ca6ed5f59c9c3be5
7
- data.tar.gz: 5ccbe69108e013bdf1759c0466a0f1bb66576a5f0f57b501d9bf2c33ed8530cba630ccf902b57de5665feb4ef5618b5eea3fc7fb0dc644c5afcaa62d778e68e9
6
+ metadata.gz: 3444c87d2ad2f7d4a74e3a490d4fa55bafa1f1f999c456244a149e470c4b01ee5913c42328933980049cac812231f214bebf4a1011a6b2a0465a8ab94c803852
7
+ data.tar.gz: 6682ca502f7daa330a29eda83d1aa4d13e95ecce313a524abdfdfd1e98231e1f12455438f4597459f22802b05ef24dd07da5fdea0fd8844a1ba5f5d34d843667
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ Every change a person using this gem would notice. The format is
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); version numbers and tags are the
5
5
  maintainer's call.
6
6
 
7
+ ## [0.11.47] — an agent says the languages its callers speak, a channel takes the agent's own words, and a stop word ends the conversation on any gateway (2026-11-18)
8
+
9
+ - **`channel_rules` takes the agent's own words for a channel.** `channel_rules whatsapp: "…"` says how the
10
+ agent writes there in place of the framework's own way, and every channel it leaves out keeps the
11
+ framework's (`voice`, `chat`, `whatsapp`, `sms`); `channel_rules false` still leaves the block out on every
12
+ channel. `Pinecall::Rules::CHANNEL_RULES` is the framework's own text by those names.
13
+
7
14
  ## [0.11.46] — a contact who texts STOP is written to no more, a written conversation opens on the one before, and the audio of an MMS is heard (2026-11-18)
8
15
 
9
16
  - **`optOut` on a WhatsApp or SMS conversation**, and `call.summary` says an SMS conversation's `sms_segments`.
@@ -9,7 +9,8 @@ module Pinecall
9
9
  # agent's settings for that field.
10
10
  module Config
11
11
  # `phone`, `whatsapp` and `web` are accepted for compatibility but ignored. `channel_rules
12
- # false` leaves the `<channel>` block out of the prompt.
12
+ # whatsapp: "…"` says the agent's own words for that channel, and `channel_rules false` leaves the
13
+ # `<channel>` block out of the prompt.
13
14
  AS_WRITTEN = %i[phone whatsapp web channel_rules].freeze
14
15
 
15
16
  # The settings a class may declare. Must match the TypeScript package's `ENVIRONMENT`.
@@ -92,10 +92,11 @@ module Pinecall
92
92
  # Static because a call never changes its channel or medium. With no call (an offline prompt), a
93
93
  # phone call's.
94
94
  def channel(agent)
95
- return nil if agent.class.channel_rules == false
95
+ own = agent.class.channel_rules
96
+ return nil if own == false
96
97
 
97
98
  call = agent.call? ? agent.call : nil
98
- tagged("channel", Rules.channel_rules_for(call&.channel || "phone", call&.medium || "voice"))
99
+ tagged("channel", Rules.channel_rules_for(call&.channel || "phone", call&.medium || "voice", own.is_a?(Hash) ? own : {}))
99
100
  end
100
101
 
101
102
  # Every declared tool's docstring, visible or not; schemas travel separately on the wire.
@@ -30,14 +30,24 @@ module Pinecall
30
30
  ON_SMS = "You are answering by SMS. Plain text only: no markdown, no lists, no emoji unless the person uses " \
31
31
  "them. One short message, a few sentences at most."
32
32
 
33
+ # The framework's own rules, by the name an agent writes its own under: a spoken call, a website's
34
+ # written chat, WhatsApp, SMS.
35
+ CHANNEL_RULES = { voice: SPOKEN, chat: ON_A_WEBSITE, whatsapp: ON_WHATSAPP, sms: ON_SMS }.freeze
36
+
33
37
  module_function
34
38
 
35
- # How to write on this channel and medium: WhatsApp's formatting, a website's Markdown, or speech.
36
- def channel_rules_for(channel, medium)
37
- return ON_WHATSAPP if channel.to_s == "whatsapp"
38
- return ON_SMS if channel.to_s == "sms"
39
+ # The name a channel's rules are written under: `whatsapp`, `sms`, a website's `chat`, else `voice`.
40
+ def channel_name_of(channel, medium)
41
+ return channel.to_sym if %w[whatsapp sms].include?(channel.to_s)
42
+
43
+ channel.to_s == "web" && medium.to_s == "text" ? :chat : :voice
44
+ end
39
45
 
40
- channel.to_s == "web" && medium.to_s == "text" ? ON_A_WEBSITE : SPOKEN
46
+ # How to write on this channel and medium: the agent's own words for it, else WhatsApp's formatting,
47
+ # a website's Markdown, or speech.
48
+ def channel_rules_for(channel, medium, own = {})
49
+ name = channel_name_of(channel, medium)
50
+ own.transform_keys(&:to_sym).fetch(name, CHANNEL_RULES.fetch(name))
41
51
  end
42
52
  end
43
53
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Pinecall
4
4
  # Set by the maintainer at release time.
5
- VERSION = "0.11.46"
5
+ VERSION = "0.11.47"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinecall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.46
4
+ version: 0.11.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pinecall