pinecall 0.11.36 → 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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/pinecall/serve/paged.rb +20 -1
- data/lib/pinecall/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af6e085fb2086346c8fb4b98ca67a51e1b22a5d7f763e09b97d09fea2622e08c
|
|
4
|
+
data.tar.gz: ddd794b98669f894ab8cdc2c6d76e0a13a85f71722477eb3bae0f0a8c04edab9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 40c8d8aed8561a8e5f4b78a9328afe12d56e2c21cb6e98309d397087114e015ff5a43557b3a39117f01a130e8aaf4a728902182b50d3d76932f3067821fbd585
|
|
7
|
+
data.tar.gz: ca9d42659f5571d0ce33656a74012e261c16ae6368a6ed7d6765b4922911bf3f4db8f19408a72a5476bfddecee9d5540c48eb28439580be6245691099a602736
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ 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
|
+
|
|
7
13
|
## [0.11.36] — a Python app names its agents by slug, and Brightside Dental is an example in every language (2026-11-13)
|
|
8
14
|
|
|
9
15
|
- **A class is served as its folder's slug, whatever it is called.** `pinecall start` served a class
|
data/lib/pinecall/serve/paged.rb
CHANGED
|
@@ -44,7 +44,7 @@ module Pinecall
|
|
|
44
44
|
file_of(path)
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
# A POST: a visitor's ticket or
|
|
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)))
|
data/lib/pinecall/version.rb
CHANGED