pinecall 0.11.35 → 0.11.37

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: ed7816d8d33dc324ee1cee04cd1e6f81bf819238b9b168fd532dc93c50bc28cd
4
- data.tar.gz: 776ce53456be1aee45913e86fb09e4fcce3b536a66ae9d677ab9a15603f66503
3
+ metadata.gz: af6e085fb2086346c8fb4b98ca67a51e1b22a5d7f763e09b97d09fea2622e08c
4
+ data.tar.gz: ddd794b98669f894ab8cdc2c6d76e0a13a85f71722477eb3bae0f0a8c04edab9
5
5
  SHA512:
6
- metadata.gz: 99a15aa6e2d75e19822ebe7366e6b3f57627e6b943bad9df5384e8f5a7e10434eac08ff39c62143f4458e9381ba94d4e450e7a60cb75e5a1e24e02e531603aa2
7
- data.tar.gz: ce9df177a18b21ac97c03743d9c9e7be923ade0541ed91292ae3c5fee451cf24df59691b903a1ea8234a57e66510b6a0b5188b54accb73c6a5e35c9bbd4e8f68
6
+ metadata.gz: 40c8d8aed8561a8e5f4b78a9328afe12d56e2c21cb6e98309d397087114e015ff5a43557b3a39117f01a130e8aaf4a728902182b50d3d76932f3067821fbd585
7
+ data.tar.gz: ca9d42659f5571d0ce33656a74012e261c16ae6368a6ed7d6765b4922911bf3f4db8f19408a72a5476bfddecee9d5540c48eb28439580be6245691099a602736
data/CHANGELOG.md CHANGED
@@ -4,6 +4,23 @@ 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.37] — an app's own page dictates, the widget's header is a menu, and a page going away ends its call (2026-11-13)
8
+
9
+ - **An app's page dictates on this machine too.** `pinecall start` answers `POST /pinecall/dictation` beside the
10
+ page's ticket and its code, with your key and no captcha: the gateway's socket whole, as the deployed
11
+ page's door answers it.
12
+
13
+ ## [0.11.36] — a Python app names its agents by slug, and Brightside Dental is an example in every language (2026-11-13)
14
+
15
+ - **A class is served as its folder's slug, whatever it is called.** `pinecall start` served a class
16
+ under its folder's name while the class went on naming itself by its own: `class FrontDesk` in
17
+ `agents/clinic-front-desk/` looked for `views/front-desk.erb`, found none, and answered every call
18
+ with no view and no word of it. The loader gives the class its folder's slug, as the Python one
19
+ does, so its view is `views/<slug>.erb` beside it.
20
+ - **Brightside Dental, the voice app on pinecall.io's editor, is an example**
21
+ (`examples/ruby/brightside_dental`): two agents, a team, a rule, a flow, and the clinic they
22
+ share, the same app as the TypeScript and Python ones.
23
+
7
24
  ## [0.11.35] — a judge reads what the platform said as the platform's (2026-11-13)
8
25
 
9
26
  - Released with the runtime: nothing of this package changed.
@@ -48,7 +48,7 @@ module Pinecall
48
48
  raise CannotServe, "--state #{field}: its value is not JSON"
49
49
  end
50
50
 
51
- # The class the file defines, refused when its own `slug` says another than the one it is served as.
51
+ # The class the file defines, served as its folder's slug; refused when its own `slug` says another.
52
52
  def load_served(served)
53
53
  klass = load_agent(served.file)
54
54
  declared = klass.declared_slug
@@ -56,6 +56,10 @@ module Pinecall
56
56
  raise CannotServe, "#{served.file} says its slug is #{declared}, and it is served as #{served.slug}: the slug is its folder's name"
57
57
  end
58
58
 
59
+ # The folder names it: its view is `views/<slug>.erb` beside it, whatever the class is called.
60
+ # Until 0.11.36 a class named otherwise than its folder looked for a view by its own name,
61
+ # found none and answered every call with no view.
62
+ klass.slug(served.slug)
59
63
  klass
60
64
  end
61
65
 
@@ -44,7 +44,7 @@ module Pinecall
44
44
  file_of(path)
45
45
  end
46
46
 
47
- # A POST: a visitor's ticket or code, asked of the gateway with the key.
47
+ # A POST: a visitor's ticket, code or dictation, asked of the gateway with the key.
48
48
  def posted(path, body)
49
49
  asked = begin
50
50
  JSON.parse(body.to_s.empty? ? "{}" : body, symbolize_names: true)
@@ -55,10 +55,29 @@ module Pinecall
55
55
  when "/pinecall/token"
56
56
  passed("/v1/tokens", { agent: @agent, scope: asked[:scope] == "chat" ? "chat" : "talk", resume: asked[:resume] }.compact)
57
57
  when "/pinecall/code" then passed("/v1/codes", { agent: @agent })
58
+ when "/pinecall/dictation"
59
+ language = asked[:language]
60
+ asked_in = language.is_a?(String) ? "?language=#{URI.encode_www_form_component(language)}" : ""
61
+ dictating(passed("/v1/transcriptions/token#{asked_in}", {}))
58
62
  else Said.new(405, JSON.generate({ detail: "a page is read" }), "application/json")
59
63
  end
60
64
  end
61
65
 
66
+ # The gateway answers a token and the path of its socket; a page's door answers the socket whole,
67
+ # at the gateway's own name, and the words to expect, of which a page served here has none.
68
+ def dictating(minted)
69
+ return minted if minted.status >= 300
70
+
71
+ path = begin
72
+ JSON.parse(minted.body)["path"]
73
+ rescue JSON::ParserError
74
+ nil
75
+ end
76
+ return Said.new(502, JSON.generate({ detail: "the gateway answered no dictation" }), "application/json") unless path.is_a?(String)
77
+
78
+ Said.new(200, JSON.generate({ url: "#{@url.chomp("/").sub(/\Ahttp/, "ws")}#{path}", hear: [] }), "application/json")
79
+ end
80
+
62
81
  # A path that names no file is the page itself, so its own router reads it.
63
82
  def file_of(path)
64
83
  asked = File.expand_path(File.join(@folder, URI.decode_www_form_component(path)))
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Pinecall
4
4
  # Set by the maintainer at release time.
5
- VERSION = "0.11.35"
5
+ VERSION = "0.11.37"
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.35
4
+ version: 0.11.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pinecall