pinecall 0.11.37 → 0.11.38
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/app.rb +3 -0
- data/lib/pinecall/version.rb +1 -1
- data/lib/pinecall/voice_app.rb +10 -4
- 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: 1c4e8cda5fdb84cf6de8ba3ab29b837f7074160549881a4d43fcadd358805390
|
|
4
|
+
data.tar.gz: 3dfb6fbeb1f817b5e2aa7016c46b612267afc8d8ceb0058a30e3343b53b3d517
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7aeaeb85ef36d15d41312523d712904399c09cc3be1194d1799af9cfee3dd17da0f8d03e2615ec3478d880f9c18eeed2a43b529f2d9c09ca5c2a19e44e1a3c1c
|
|
7
|
+
data.tar.gz: 6ef954f08827aff74be2d88c94eb8b0558418d4427d10096856d36158c90187550ad8c9eb10d3549606e8dad23f557c93b0318f21503bbae5fa3a35c7f305bd6
|
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.38] — a page's chat is written, a visitor keeps the conversation from page to page, and an app of one agent is one row (2026-11-13)
|
|
8
|
+
|
|
9
|
+
- **A page may be one environment's alone.** `APP.page("site", only: "sandbox")` keeps a guide or a
|
|
10
|
+
demo to the sandbox: a deploy to production sends the app alone. `pinecall start` follows the same
|
|
11
|
+
rule, and anything but `sandbox` or `production` is refused as the app is declared.
|
|
12
|
+
|
|
7
13
|
## [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
14
|
|
|
9
15
|
- **An app's page dictates on this machine too.** `pinecall start` answers `POST /pinecall/dictation` beside the
|
data/lib/pinecall/serve/app.rb
CHANGED
|
@@ -58,6 +58,7 @@ module Pinecall
|
|
|
58
58
|
raise CannotServe, "#{app.name}'s page reaches #{app.paged.answers}, which no agent is" if served.nil?
|
|
59
59
|
|
|
60
60
|
page = { dir: app.paged.dir, agent: served.slug }
|
|
61
|
+
page[:only] = app.paged.only unless app.paged.only.nil?
|
|
61
62
|
end
|
|
62
63
|
out.puts(JSON.generate({ name: app.name, page: }))
|
|
63
64
|
0
|
|
@@ -92,6 +93,8 @@ module Pinecall
|
|
|
92
93
|
paged = app.paged
|
|
93
94
|
agent = paged && slugs[paged.answers]
|
|
94
95
|
return nil if agent.nil? || !env["PINECALL_HOST"].to_s.empty?
|
|
96
|
+
# A page of one environment is not this one's: `pinecall start --prod` holds the app alone.
|
|
97
|
+
return nil if paged.only && client.env && paged.only != client.env.to_s
|
|
95
98
|
|
|
96
99
|
port = Integer(env["PINECALL_PAGE_PORT"] || Paged::PORT)
|
|
97
100
|
page = Paged.new(folder: File.join(File.dirname(File.expand_path(file)), paged.dir), agent:, url: client.url,
|
data/lib/pinecall/version.rb
CHANGED
data/lib/pinecall/voice_app.rb
CHANGED
|
@@ -18,7 +18,10 @@ module Pinecall
|
|
|
18
18
|
# One number of the app and who answers it.
|
|
19
19
|
Line = Data.define(:number, :answers, :team, :greeting, :chooses)
|
|
20
20
|
# The app's page: the built folder the platform serves, and the agent a visitor reaches.
|
|
21
|
-
|
|
21
|
+
# `only` is the one environment the page is served in ("sandbox" or "production"); both when nil.
|
|
22
|
+
Page = Data.define(:dir, :answers, :only)
|
|
23
|
+
WORLDS = %w[sandbox production].freeze
|
|
24
|
+
NOT_A_PAGE_ENV = "a page is served in both environments, or in one: app.page(dir, only: \"sandbox\") or only: \"production\""
|
|
22
25
|
# The call an entry belongs to, as a handler is told it; `id` is nil for an entry of no call.
|
|
23
26
|
Heard = Data.define(:id, :agent)
|
|
24
27
|
|
|
@@ -95,8 +98,9 @@ module Pinecall
|
|
|
95
98
|
self
|
|
96
99
|
end
|
|
97
100
|
|
|
98
|
-
# The app's page: `app.page("ui/dist")`, served by the platform at the app's own name
|
|
99
|
-
|
|
101
|
+
# The app's page: `app.page("ui/dist")`, served by the platform at the app's own name;
|
|
102
|
+
# `only: "sandbox"` keeps it out of production, whose deploy sends the app alone.
|
|
103
|
+
def page(dir, answers: nil, only: nil)
|
|
100
104
|
folder = dir.to_s.delete_prefix("./").chomp("/")
|
|
101
105
|
raise DeclarationRefused, NOT_A_PAGE if folder.empty? || folder.start_with?("/") || folder.split("/").include?("..")
|
|
102
106
|
raise DeclarationRefused, "#{@name} has its page already, #{@paged.dir}: an app has one" unless @paged.nil?
|
|
@@ -104,7 +108,9 @@ module Pinecall
|
|
|
104
108
|
reached = answers || @lines.first&.answers
|
|
105
109
|
raise DeclarationRefused, "a page's visitors reach an agent: write a line before the page, or name one with page(dir, answers: FrontDesk)" unless agent?(reached)
|
|
106
110
|
|
|
107
|
-
|
|
111
|
+
raise DeclarationRefused, NOT_A_PAGE_ENV unless only.nil? || WORLDS.include?(only.to_s)
|
|
112
|
+
|
|
113
|
+
@paged = Page.new(dir: folder, answers: reached, only: only&.to_s)
|
|
108
114
|
self
|
|
109
115
|
end
|
|
110
116
|
|