@fonoster/common 0.27.0 → 0.31.0

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.
Files changed (209) hide show
  1. package/dist/{voice/PlayDtmf.d.ts → agents/index.d.ts} +3 -5
  2. package/dist/{assistants → agents}/index.js +2 -6
  3. package/dist/agents/sessionAgentSchema.d.ts +755 -0
  4. package/dist/agents/sessionAgentSchema.js +117 -0
  5. package/dist/{voice/Dial.d.ts → calls/index.d.ts} +16 -13
  6. package/dist/calls/index.js +44 -0
  7. package/dist/cellsecrets/index.d.ts +91 -0
  8. package/dist/cellsecrets/index.js +299 -0
  9. package/dist/config/cli/check.d.ts +6 -0
  10. package/dist/config/cli/check.js +202 -0
  11. package/dist/config/cli/envFile.d.ts +23 -0
  12. package/dist/config/cli/envFile.js +81 -0
  13. package/dist/config/cli/exposure.d.ts +10 -0
  14. package/dist/config/cli/exposure.js +93 -0
  15. package/dist/config/cli/index.d.ts +2 -0
  16. package/dist/{identity/tokenHasAccessKeyId.js → config/cli/index.js} +7 -8
  17. package/dist/config/cli/info.d.ts +6 -0
  18. package/dist/config/cli/info.js +62 -0
  19. package/dist/config/cli/init.d.ts +9 -0
  20. package/dist/config/cli/init.js +152 -0
  21. package/dist/config/cli/main.d.ts +11 -0
  22. package/dist/config/cli/main.js +155 -0
  23. package/dist/config/cli/render.d.ts +44 -0
  24. package/dist/config/cli/render.js +129 -0
  25. package/dist/config/cli/secrets.d.ts +21 -0
  26. package/dist/config/cli/secrets.js +117 -0
  27. package/dist/config/cli/types.d.ts +24 -0
  28. package/dist/config/cli/types.js +7 -0
  29. package/dist/{assistants/index.d.ts → config/configHints.d.ts} +8 -7
  30. package/dist/config/configHints.js +47 -0
  31. package/dist/{voice → config}/index.d.ts +11 -13
  32. package/dist/{voice → config}/index.js +11 -13
  33. package/dist/config/interpolateEnv.d.ts +34 -0
  34. package/dist/config/interpolateEnv.js +70 -0
  35. package/dist/config/loadServiceConfig.d.ts +28 -0
  36. package/dist/config/loadServiceConfig.js +112 -0
  37. package/dist/config/logsSchema.d.ts +76 -0
  38. package/dist/config/logsSchema.js +49 -0
  39. package/dist/config/natsConnection.d.ts +53 -0
  40. package/dist/config/natsConnection.js +58 -0
  41. package/dist/config/parseConfigFile.d.ts +7 -0
  42. package/dist/config/parseConfigFile.js +60 -0
  43. package/dist/config/resolveConfigFile.d.ts +17 -0
  44. package/dist/config/resolveConfigFile.js +54 -0
  45. package/dist/config/resolveSecretRefs.d.ts +35 -0
  46. package/dist/config/resolveSecretRefs.js +129 -0
  47. package/dist/{assistants/audioFiltersSchema.d.ts → config/strictDeep.d.ts} +9 -12
  48. package/dist/config/strictDeep.js +58 -0
  49. package/dist/config/telemetrySchema.d.ts +39 -0
  50. package/dist/config/telemetrySchema.js +44 -0
  51. package/dist/config/toJsonSchema.d.ts +30 -0
  52. package/dist/config/toJsonSchema.js +161 -0
  53. package/dist/constants.d.ts +1 -6
  54. package/dist/constants.js +4 -7
  55. package/dist/envs.d.ts +2 -1
  56. package/dist/envs.js +13 -11
  57. package/dist/errors/handleZodError.js +3 -1
  58. package/dist/filters/index.d.ts +70 -0
  59. package/dist/filters/index.js +101 -0
  60. package/dist/identity/createAuthInterceptor.d.ts +9 -2
  61. package/dist/identity/createAuthInterceptor.js +36 -30
  62. package/dist/identity/hasAccess.d.ts +9 -3
  63. package/dist/identity/hasAccess.js +32 -8
  64. package/dist/identity/index.d.ts +1 -0
  65. package/dist/identity/index.js +1 -0
  66. package/dist/identity/isValidToken.d.ts +12 -2
  67. package/dist/identity/isValidToken.js +25 -9
  68. package/dist/identity/roles.js +33 -7
  69. package/dist/identity/types.d.ts +6 -1
  70. package/dist/identity/types.js +1 -0
  71. package/dist/{assistants/LanguageModelProvider.js → identity/verifyAccessToken.d.ts} +10 -11
  72. package/dist/identity/verifyAccessToken.js +44 -0
  73. package/dist/index.d.ts +15 -2
  74. package/dist/index.js +18 -3
  75. package/dist/net/assertPublicDestination.d.ts +52 -0
  76. package/dist/net/assertPublicDestination.js +342 -0
  77. package/dist/{voice/StopSay.d.ts → net/index.d.ts} +1 -6
  78. package/dist/net/index.js +35 -0
  79. package/dist/notifications/createSendEmail.js +3 -1
  80. package/dist/protos/applications.proto +138 -3
  81. package/dist/protos/authz.proto +26 -4
  82. package/dist/protos/billing.proto +92 -0
  83. package/dist/protos/calls.proto +4 -0
  84. package/dist/protos/capabilities.proto +102 -0
  85. package/dist/protos/identity.proto +26 -1
  86. package/dist/protos/providers.proto +139 -0
  87. package/dist/protos/roomr.proto +146 -0
  88. package/dist/protos/session.proto +194 -0
  89. package/dist/protos/usage.proto +59 -0
  90. package/dist/protos/webhooks.proto +140 -0
  91. package/dist/{utils/types.d.ts → regions/hub/index.d.ts} +1 -5
  92. package/dist/regions/hub/index.js +35 -0
  93. package/dist/regions/hub/natsJwt.d.ts +63 -0
  94. package/dist/regions/hub/natsJwt.js +195 -0
  95. package/dist/registry/Registry.d.ts +87 -0
  96. package/dist/registry/Registry.js +432 -0
  97. package/dist/registry/cli.d.ts +20 -0
  98. package/dist/registry/cli.js +436 -0
  99. package/dist/registry/features.d.ts +31 -0
  100. package/dist/registry/features.js +38 -0
  101. package/dist/registry/index.d.ts +24 -0
  102. package/dist/registry/index.js +40 -0
  103. package/dist/registry/prisma.d.ts +67 -0
  104. package/dist/registry/prisma.js +399 -0
  105. package/dist/registry/stores.d.ts +21 -0
  106. package/dist/{assistants/languageModelConfigSchema.js → registry/stores.js} +55 -38
  107. package/dist/registry/types.d.ts +110 -0
  108. package/dist/{assistants/LanguageModelProvider.d.ts → registry/types.js} +6 -8
  109. package/dist/registry/workspaceKeys.d.ts +41 -0
  110. package/dist/registry/workspaceKeys.js +64 -0
  111. package/dist/roomr/health.d.ts +9 -0
  112. package/dist/{assistants/eventsHookSchema.js → roomr/health.js} +22 -18
  113. package/dist/roomr/index.d.ts +75 -0
  114. package/dist/roomr/index.js +146 -0
  115. package/dist/roomr/session.d.ts +133 -0
  116. package/dist/roomr/session.js +132 -0
  117. package/dist/session/index.d.ts +19 -0
  118. package/dist/session/index.js +35 -0
  119. package/dist/session/schema.d.ts +2140 -0
  120. package/dist/session/schema.js +448 -0
  121. package/dist/sessions/index.d.ts +96 -0
  122. package/dist/sessions/index.js +197 -0
  123. package/dist/telemetry.d.ts +76 -0
  124. package/dist/telemetry.js +360 -0
  125. package/dist/types.d.ts +3 -5
  126. package/dist/{voice/Gather.d.ts → usage/CallUsage.d.ts} +19 -18
  127. package/dist/usage/CallUsage.js +76 -0
  128. package/dist/usage/index.d.ts +22 -0
  129. package/dist/usage/index.js +38 -0
  130. package/dist/usage/meters.d.ts +113 -0
  131. package/dist/usage/meters.js +90 -0
  132. package/dist/usage/types.d.ts +159 -0
  133. package/dist/usage/types.js +84 -0
  134. package/dist/usage/usageId.d.ts +6 -0
  135. package/dist/usage/usageId.js +45 -0
  136. package/dist/utils/{findIntegrationsCredentials.js → WriteBehind.d.ts} +13 -10
  137. package/dist/utils/WriteBehind.js +64 -0
  138. package/dist/utils/index.d.ts +1 -3
  139. package/dist/utils/index.js +1 -3
  140. package/dist/utils/{createFetchSingleCallByCallId.d.ts → logUnhandledRejections.d.ts} +8 -4
  141. package/dist/{assistants/audioFiltersSchema.js → utils/logUnhandledRejections.js} +17 -12
  142. package/dist/utils/withErrorHandling.js +1 -1
  143. package/dist/validators/calls.d.ts +3 -0
  144. package/dist/validators/calls.js +12 -2
  145. package/dist/validators/identity.d.ts +37 -8
  146. package/dist/validators/identity.js +22 -3
  147. package/dist/validators/index.d.ts +1 -0
  148. package/dist/validators/index.js +1 -0
  149. package/dist/validators/sip.d.ts +40 -0
  150. package/dist/validators/sip.js +99 -0
  151. package/dist/validators/sipnet/credentials.d.ts +2 -2
  152. package/dist/validators/sipnet/domains.js +7 -7
  153. package/dist/validators/sipnet/trunks.d.ts +14 -14
  154. package/dist/validators/sipnet/trunks.js +4 -2
  155. package/dist/webhooks/Dispatcher.d.ts +87 -0
  156. package/dist/webhooks/Dispatcher.js +225 -0
  157. package/dist/webhooks/bus.d.ts +68 -0
  158. package/dist/webhooks/bus.js +178 -0
  159. package/dist/webhooks/events.d.ts +66 -0
  160. package/dist/webhooks/events.js +62 -0
  161. package/dist/webhooks/index.d.ts +23 -0
  162. package/dist/webhooks/index.js +39 -0
  163. package/dist/webhooks/prisma.d.ts +55 -0
  164. package/dist/webhooks/prisma.js +242 -0
  165. package/dist/webhooks/signing.d.ts +8 -0
  166. package/dist/webhooks/signing.js +53 -0
  167. package/package.json +25 -11
  168. package/schema/session.v1.json +871 -0
  169. package/dist/assistants/assistantSchema.d.ts +0 -739
  170. package/dist/assistants/assistantSchema.js +0 -37
  171. package/dist/assistants/conversationSettingsSchema.d.ts +0 -122
  172. package/dist/assistants/conversationSettingsSchema.js +0 -133
  173. package/dist/assistants/eventsHookSchema.d.ts +0 -38
  174. package/dist/assistants/languageModelConfigSchema.d.ts +0 -206
  175. package/dist/identity/tokenHasAccessKeyId.d.ts +0 -2
  176. package/dist/protos/voice.proto +0 -557
  177. package/dist/utils/createFetchSingleCallByCallId.js +0 -33
  178. package/dist/utils/findIntegrationsCredentials.d.ts +0 -23
  179. package/dist/utils/types.js +0 -2
  180. package/dist/voice/Dial.js +0 -20
  181. package/dist/voice/Gather.js +0 -9
  182. package/dist/voice/Mute.d.ts +0 -31
  183. package/dist/voice/Mute.js +0 -9
  184. package/dist/voice/Play.d.ts +0 -30
  185. package/dist/voice/Play.js +0 -2
  186. package/dist/voice/PlayDtmf.js +0 -2
  187. package/dist/voice/PlaybackControl.d.ts +0 -31
  188. package/dist/voice/PlaybackControl.js +0 -11
  189. package/dist/voice/Record.d.ts +0 -36
  190. package/dist/voice/Record.js +0 -7
  191. package/dist/voice/Say.d.ts +0 -28
  192. package/dist/voice/Say.js +0 -2
  193. package/dist/voice/StopSay.js +0 -2
  194. package/dist/voice/Stream.d.ts +0 -53
  195. package/dist/voice/Stream.js +0 -19
  196. package/dist/voice/StreamGather.d.ts +0 -34
  197. package/dist/voice/StreamGather.js +0 -9
  198. package/dist/voice/Verb.d.ts +0 -27
  199. package/dist/voice/Verb.js +0 -2
  200. package/dist/voice/voice.d.ts +0 -171
  201. package/dist/voice/voice.js +0 -65
  202. package/dist/{assistants → agents}/testCasesSchema.d.ts +4 -4
  203. /package/dist/{assistants → agents}/testCasesSchema.js +0 -0
  204. /package/dist/{assistants → agents}/tools/index.d.ts +0 -0
  205. /package/dist/{assistants → agents}/tools/index.js +0 -0
  206. /package/dist/{assistants → agents}/tools/propertySchema.d.ts +0 -0
  207. /package/dist/{assistants → agents}/tools/propertySchema.js +0 -0
  208. /package/dist/{assistants → agents}/tools/toolSchema.d.ts +0 -0
  209. /package/dist/{assistants → agents}/tools/toolSchema.js +0 -0
@@ -23,24 +23,46 @@ package fonoster.authz.v1beta2;
23
23
  import "google/protobuf/struct.proto";
24
24
  import "google/protobuf/empty.proto";
25
25
 
26
- import "voice.proto";
27
-
28
26
  // Authentication service definition
29
27
  service Authz {
30
28
  // Check if a user has permission to perform an action
31
- rpc CheckSessionAuthorized (fonoster.voice.v1beta2.CreateSessionRequest) returns (CheckSessionAuthorizedResponse) {}
29
+ rpc CheckSessionAuthorized (CheckSessionAuthorizedRequest) returns (CheckSessionAuthorizedResponse) {}
32
30
  // Check if a given accessKeyId has permission to access a method
33
31
  rpc CheckMethodAuthorized (CheckMethodAuthorizedRequest) returns (CheckMethodAuthorizedResponse) {}
34
32
  // Add billing meter event to an account
35
33
  rpc AddBillingMeterEvent (AddBillingMeterEventRequest) returns (google.protobuf.Empty) {}
36
34
  }
37
35
 
38
- // Response message for the CheckVoiceRequestAuthorized method
36
+ // The call a session would serve. Field numbers match the retired
37
+ // fonoster.voice.v1beta2.CreateSessionRequest, so existing authorization servers keep decoding it.
38
+ message CheckSessionAuthorizedRequest {
39
+ string access_key_id = 1;
40
+ string app_ref = 2;
41
+ string endpoint = 3;
42
+ string ingress_number = 4;
43
+ string caller_name = 5;
44
+ string caller_number = 6;
45
+ string media_session_ref = 7;
46
+ string session_token = 8;
47
+ enum CallDirection {
48
+ FROM_PSTN = 0;
49
+ TO_PSTN = 1;
50
+ INTRA_NETWORK = 2;
51
+ }
52
+ CallDirection call_direction = 9;
53
+ map<string, string> metadata = 10;
54
+ string call_ref = 11;
55
+ }
56
+
57
+ // Response message for the CheckSessionAuthorized method
39
58
  message CheckSessionAuthorizedResponse {
40
59
  // The authorization server will look for one or more parameters in the request
41
60
  // to determine if the request is authorized. If the request is authorized, the
42
61
  // response will have the value true.
43
62
  bool authorized = 1;
63
+ // Why the session was refused, when it was: insufficient_balance, concurrency_limit or
64
+ // trial_ended (add-billing-service D7). Empty when authorized.
65
+ string reason = 2;
44
66
  }
45
67
 
46
68
  // Request message for the CheckMethodAuthorized method
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ syntax = "proto3";
20
+
21
+ package fonoster.billing.v1beta2;
22
+
23
+ // Billing for Fonoster Cloud (add-billing-service): the owner's credits, plan, auto-recharge,
24
+ // top-ups and the Stripe Customer Portal. The billing service serves it with owner_ref set; the
25
+ // apiserver serves it to the dashboard for workspace owners and sets owner_ref from the caller.
26
+ service Billing {
27
+ // The balance by source, the plan and auto-recharge
28
+ rpc GetBilling (GetBillingRequest) returns (BillingSummary) {}
29
+ // Turns auto-recharge on or off, with its threshold and amount in credits
30
+ rpc UpdateAutoRecharge (UpdateAutoRechargeRequest) returns (BillingSummary) {}
31
+ // Buys top-up credits; they are added once the payment succeeds
32
+ rpc CreateTopUp (CreateTopUpRequest) returns (BillingSummary) {}
33
+ // Moves the owner to Pay-as-you-go (needs a payment method, added in the portal)
34
+ rpc Subscribe (SubscribeRequest) returns (BillingSummary) {}
35
+ // A Stripe Customer Portal link for payment methods and invoices
36
+ rpc CreatePortalSession (CreatePortalSessionRequest) returns (CreatePortalSessionResponse) {}
37
+ }
38
+
39
+ message GetBillingRequest {
40
+ string owner_ref = 1;
41
+ }
42
+
43
+ // Credits of one source: plan, top-up or trial
44
+ message CreditSource {
45
+ string kind = 1;
46
+ double credits = 2;
47
+ // ISO 8601; empty when it does not expire
48
+ string expires_at = 3;
49
+ }
50
+
51
+ message BillingSummary {
52
+ // trial or payg
53
+ string plan = 1;
54
+ // active, past_due, closed, or ended (a Trial past its 30 days; calls are refused until the
55
+ // owner subscribes)
56
+ string status = 2;
57
+ // Credits; negative while in the overdraft
58
+ double balance = 3;
59
+ // How far below zero the balance may go, in credits
60
+ double overdraft = 4;
61
+ repeated CreditSource sources = 5;
62
+ // ISO 8601; empty on the trial
63
+ string period_end = 6;
64
+ bool auto_recharge = 7;
65
+ double recharge_threshold = 8;
66
+ double recharge_amount = 9;
67
+ }
68
+
69
+ message UpdateAutoRechargeRequest {
70
+ string owner_ref = 1;
71
+ bool enabled = 2;
72
+ double threshold = 3;
73
+ double amount = 4;
74
+ }
75
+
76
+ message CreateTopUpRequest {
77
+ string owner_ref = 1;
78
+ int32 credits = 2;
79
+ }
80
+
81
+ message SubscribeRequest {
82
+ string owner_ref = 1;
83
+ }
84
+
85
+ message CreatePortalSessionRequest {
86
+ string owner_ref = 1;
87
+ string return_url = 2;
88
+ }
89
+
90
+ message CreatePortalSessionResponse {
91
+ string url = 1;
92
+ }
@@ -104,6 +104,8 @@ message CallDetailRecord {
104
104
  int32 amd_latency_ms = 14;
105
105
  // Detector-specific cause code (e.g. Asterisk's AMDCAUSE), useful for tuning
106
106
  string amd_cause = 15;
107
+ // The reference of the app that handled the call, empty when no app did
108
+ string app_ref = 16;
107
109
  }
108
110
 
109
111
  // The request message for Calls.Call
@@ -144,6 +146,8 @@ message ListCallsRequest {
144
146
  int32 page_size = 7;
145
147
  // The page token
146
148
  string page_token = 8;
149
+ // Optional app reference; lists only the calls that app handled
150
+ string app_ref = 9;
147
151
  }
148
152
 
149
153
  // The response message for Calls.ListCalls
@@ -0,0 +1,102 @@
1
+ /*
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ syntax = "proto3";
20
+
21
+ package fonoster.capabilities.v1beta2;
22
+
23
+ import "google/protobuf/empty.proto";
24
+
25
+ // What this deployment supports, from fonoster.yaml. Public (no credentials
26
+ // needed) so sign-in screens can render from it; it never returns secrets.
27
+ service Capabilities {
28
+ // Gets the deployment's capabilities
29
+ rpc GetCapabilities (google.protobuf.Empty) returns (GetCapabilitiesResponse) {}
30
+ }
31
+
32
+ message GitHubCapability {
33
+ string client_id = 1;
34
+ string authorize_url = 2;
35
+ }
36
+
37
+ message AuthCapabilities {
38
+ // Enabled sign-in methods: password | email_code | github
39
+ repeated string methods = 1;
40
+ // Who may create an account: invite | open
41
+ string signup = 2;
42
+ // Set when github is among the methods
43
+ GitHubCapability github = 3;
44
+ }
45
+
46
+ message BillingCapabilities {
47
+ bool enabled = 1;
48
+ }
49
+
50
+ message CostsCapabilities {
51
+ // none | usage | prices
52
+ string display = 1;
53
+ }
54
+
55
+ // Private regions (customer-run regions enrolled through the region hub).
56
+ // The local public region always exists and is not reported here.
57
+ message RegionsCapabilities {
58
+ // True when the operator configured the region hub and the region-signing
59
+ // key (regions.hub and regions.signingKey), so workspaces can enroll
60
+ // private regions. Never carries hub URLs or keys.
61
+ bool private = 1;
62
+ }
63
+
64
+ // How SIP names (trunk inbound URIs, domains) are checked (features.sip.names).
65
+ message SipCapabilities {
66
+ // "domain": one DNS label under sip.<domain> (the default). "any": any host
67
+ // or IP, for installs whose carriers and phones reach them by address.
68
+ string names = 1;
69
+ }
70
+
71
+ message SipEndpoint {
72
+ string host = 1;
73
+ int32 port = 2;
74
+ // udp | tcp | tls | ws | wss
75
+ string transport = 3;
76
+ }
77
+
78
+ message PortRange {
79
+ int32 min = 1;
80
+ int32 max = 2;
81
+ }
82
+
83
+ // Where carriers and softphones reach this deployment: the default public
84
+ // region's endpoints (regions.public in fonoster.yaml). Addresses and ports
85
+ // only, never credentials. Empty when the operator listed none.
86
+ message ConnectionCapabilities {
87
+ repeated SipEndpoint sip = 1;
88
+ repeated string signaling_addresses = 2;
89
+ repeated string media_addresses = 3;
90
+ PortRange rtp_ports = 4;
91
+ }
92
+
93
+ message GetCapabilitiesResponse {
94
+ AuthCapabilities auth = 1;
95
+ BillingCapabilities billing = 2;
96
+ CostsCapabilities costs = 3;
97
+ string domain = 4;
98
+ string app_url = 5;
99
+ RegionsCapabilities regions = 6;
100
+ ConnectionCapabilities connection = 7;
101
+ SipCapabilities sip = 8;
102
+ }
@@ -56,6 +56,8 @@ service Identity {
56
56
  rpc ExchangeApiKey (ExchangeApiKeyRequest) returns (ExchangeApiKeyResponse) {}
57
57
  rpc ExchangeOauth2Code (ExchangeOauth2CodeRequest) returns (ExchangeOauth2CodeResponse) {}
58
58
  rpc ExchangeRefreshToken (ExchangeRefreshTokenRequest) returns (ExchangeRefreshTokenResponse) {}
59
+ // Trade an emailed sign-in code for tokens (passwordless sign-in)
60
+ rpc ExchangeVerificationCode (ExchangeVerificationCodeRequest) returns (ExchangeVerificationCodeResponse) {}
59
61
  rpc RevokeToken (RevokeTokenRequest) returns (RevokeTokenResponse) {}
60
62
 
61
63
  // Get the public key for verifying JWTs
@@ -78,14 +80,22 @@ message Workspace {
78
80
  int32 created_at = 5;
79
81
  int32 updated_at = 6;
80
82
  Owner owner = 7;
83
+ // A public region id (default, us-east-1) or a private region ref (rg_...). Immutable.
84
+ string region = 8;
81
85
  }
82
86
 
83
87
  message CreateWorkspaceRequest {
84
88
  string name = 1;
89
+ // A public region id, or one of the caller's private regions (id or rg_ ref). Empty means "default".
90
+ string region = 2;
85
91
  }
86
92
 
87
93
  message CreateWorkspaceResponse {
88
94
  string ref = 1;
95
+ string region = 2;
96
+ // Unused since PR-15 (regions are created at the user level, POST /api/regions); kept reserved.
97
+ string enrollment_token = 3;
98
+ string expires_at = 4;
89
99
  }
90
100
 
91
101
  message DeleteWorkspaceRequest {
@@ -113,6 +123,8 @@ message ListWorkspacesResponse {
113
123
  message UpdateWorkspaceRequest {
114
124
  string ref = 1;
115
125
  string name = 2;
126
+ // Accepted only when unchanged (the region is immutable).
127
+ string region = 3;
116
128
  }
117
129
 
118
130
  message UpdateWorkspaceResponse {
@@ -204,10 +216,12 @@ message User {
204
216
 
205
217
  message UpdateUserRequest {
206
218
  string ref = 1;
219
+ // A new password; current_password must be the account's password.
207
220
  string password = 2;
208
221
  string name = 3;
209
222
  string avatar = 4;
210
223
  string phone = 5;
224
+ string current_password = 6;
211
225
  }
212
226
 
213
227
  message UpdateUserResponse {
@@ -356,4 +370,15 @@ message RevokeTokenResponse {
356
370
  // Message with response with the public key
357
371
  message GetPublicKeyResponse {
358
372
  string public_key = 1;
359
- }
373
+ }
374
+
375
+ message ExchangeVerificationCodeRequest {
376
+ string email = 1;
377
+ string code = 2;
378
+ }
379
+
380
+ message ExchangeVerificationCodeResponse {
381
+ string id_token = 1;
382
+ string access_token = 2;
383
+ string refresh_token = 3;
384
+ }
@@ -0,0 +1,139 @@
1
+ /*
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ syntax = "proto3";
20
+
21
+ package fonoster.providers.v1beta2;
22
+
23
+ // The provider catalog (read-only) and the workspace's own vendor keys (add-provider-registry)
24
+ service Providers {
25
+ // Catalog entries this workspace can use: providers, models and voices (not retired)
26
+ rpc ListCatalog(ListCatalogRequest) returns (ListCatalogResponse) {}
27
+ // Store or replace the workspace's key for a provider (kept in a write-only Secret)
28
+ rpc SetProviderKey(SetProviderKeyRequest) returns (ProviderKey) {}
29
+ // The workspace's provider keys (never the key itself)
30
+ rpc ListProviderKeys(ListProviderKeysRequest) returns (ListProviderKeysResponse) {}
31
+ // Remove the workspace's key for a provider (and its Secret)
32
+ rpc DeleteProviderKey(DeleteProviderKeyRequest) returns (DeleteProviderKeyResponse) {}
33
+ // Deprecated or retired items this workspace uses, with where they are used
34
+ rpc ListWarnings(ListWarningsRequest) returns (ListWarningsResponse) {}
35
+ }
36
+
37
+ message CatalogItem {
38
+ // Catalog id, e.g. deepgram/nova-3 or elevenlabs/rachel; a provider's id has no slash
39
+ string id = 1;
40
+ // provider, model or voice
41
+ string kind = 2;
42
+ // active or deprecated
43
+ string state = 3;
44
+ // The provider id (the item's own id for providers)
45
+ string provider_id = 4;
46
+ // Models: stt, tts or llm
47
+ string type = 5;
48
+ // Providers: capabilities (stt, tts, llm)
49
+ repeated string capabilities = 6;
50
+ // Models: languages; voices: their language
51
+ repeated string languages = 7;
52
+ // Models: features
53
+ repeated string features = 8;
54
+ // Voices: the models they work on
55
+ repeated string models = 9;
56
+ // Voices: gender, when known
57
+ string gender = 10;
58
+ // Deprecated items: the suggested replacement and the retirement date (YYYY-MM-DD)
59
+ string replacement = 11;
60
+ string retire_on = 12;
61
+ // Providers: the adapter needs no key (fake, local models); no vendor key to ask for
62
+ bool keyless = 13;
63
+ // A display name ("Aura 2 Thalia"); empty when the entry has none
64
+ string label = 14;
65
+ }
66
+
67
+ message ListCatalogRequest {
68
+ // Optional: provider, model or voice
69
+ string kind = 1;
70
+ // Optional: stt, tts, llm or nc (models by type; providers by capability)
71
+ string type = 2;
72
+ }
73
+
74
+ message ListCatalogResponse {
75
+ repeated CatalogItem items = 1;
76
+ }
77
+
78
+ message ProviderKey {
79
+ string ref = 1;
80
+ string provider_id = 2;
81
+ // The Secret holding the key
82
+ string secret_ref = 3;
83
+ int32 created_at = 4;
84
+ int32 updated_at = 5;
85
+ }
86
+
87
+ message SetProviderKeyRequest {
88
+ string provider_id = 1;
89
+ // The vendor key; write-only
90
+ string key = 2;
91
+ }
92
+
93
+ message ListProviderKeysRequest {}
94
+
95
+ message ListProviderKeysResponse {
96
+ repeated ProviderKey items = 1;
97
+ }
98
+
99
+ message DeleteProviderKeyRequest {
100
+ string provider_id = 1;
101
+ }
102
+
103
+ message DeleteProviderKeyResponse {
104
+ string provider_id = 1;
105
+ }
106
+
107
+ message WarningUse {
108
+ // app or agent
109
+ string kind = 1;
110
+ string ref = 2;
111
+ string name = 3;
112
+ // The config field naming the item: voice, ttsModel, sttModel or llm
113
+ string field = 4;
114
+ // For a TTS model: the voice the config uses with it (e.g. the workspace's cloned voice)
115
+ string voice = 5;
116
+ }
117
+
118
+ message Warning {
119
+ string id = 1;
120
+ // provider, model or voice
121
+ string kind = 2;
122
+ // deprecated or retired
123
+ string state = 3;
124
+ string replacement = 4;
125
+ string retire_on = 5;
126
+ // Saved configs that reference the item
127
+ repeated WarningUse used_by = 6;
128
+ // Apps whose sessions used it in the last days, including ids no saved config names
129
+ repeated string runtime_apps = 7;
130
+ int32 runtime_sessions = 8;
131
+ // ISO 8601; empty without recent runtime use
132
+ string last_used_at = 9;
133
+ }
134
+
135
+ message ListWarningsRequest {}
136
+
137
+ message ListWarningsResponse {
138
+ repeated Warning items = 1;
139
+ }
@@ -0,0 +1,146 @@
1
+ // Roomr: the Roomr node's control service for its controller.
2
+ // Spec: openspec/changes/redesign-roomr/specs/media-control ("Roomr is a gRPC service with
3
+ // three nouns"). Roomr is the SIP and media edge, not an app server: no play, record or DTMF RPCs
4
+ // (an app does those on its call's control stream; recording is a listener). Messages only grow: add fields, never renumber or reuse them, and receivers
5
+ // ignore fields they do not know.
6
+ //
7
+ // Regenerate the Go code with go/roomr/api/generate.sh.
8
+ syntax = "proto3";
9
+
10
+ package roomr.v1;
11
+
12
+ option go_package = "github.com/fonoster/roomr/api/roomr/v1;roomrv1";
13
+
14
+ service Roomr {
15
+ // Dial out. The room is created, or room_ref is joined (created when it does not exist yet).
16
+ rpc CreateCall(CreateCallRequest) returns (Call);
17
+ // End any call, inbound or outbound (CANCEL while ringing, BYE once answered).
18
+ rpc EndCall(EndCallRequest) returns (Empty);
19
+ // Rooms that do not start from a call.
20
+ rpc CreateRoom(CreateRoomRequest) returns (Room);
21
+ // End every call and participant in the room.
22
+ rpc EndRoom(EndRoomRequest) returns (Empty);
23
+ // Add an RTP participant, a listen-only participant or (not yet) a WebRTC participant.
24
+ rpc AddParticipant(AddParticipantRequest) returns (Participant);
25
+ // Remove a participant (cause "removed").
26
+ rpc RemoveParticipant(RemoveParticipantRequest) returns (Empty);
27
+ }
28
+
29
+ message Empty {}
30
+
31
+ // Digest credentials for the INVITE's 401/407 challenge.
32
+ message SipAuth {
33
+ string username = 1;
34
+ string password = 2;
35
+ }
36
+
37
+ // Where and how to dial.
38
+ message SipTarget {
39
+ // Request-URI, for example "sip:+15551234567@carrier".
40
+ string uri = 1;
41
+ // Where the INVITE is sent ("sip:proxy:5060", "sip:proxy:5061;transport=tls" or "proxy:5060");
42
+ // empty sends it to the Request-URI's host.
43
+ string proxy = 2;
44
+ // Added to the INVITE untouched. Core SIP headers (Via, From, To, Call-ID, CSeq, Contact, ...)
45
+ // cannot be set here.
46
+ map<string, string> headers = 3;
47
+ SipAuth auth = 4;
48
+ }
49
+
50
+ message CreateCallRequest {
51
+ // Chosen by the caller; repeating it returns the existing Call and sends no second INVITE.
52
+ string call_ref = 1;
53
+ SipTarget to = 2;
54
+ // The From user ("+15550001") or a full URI ("sip:+15550001@example.com").
55
+ string from = 3;
56
+ // Join this room, or create it with this ref; empty creates a new room.
57
+ string room_ref = 4;
58
+ // Session endpoint for the call's control stream (not implemented yet: UNIMPLEMENTED).
59
+ string session = 5;
60
+ // How long the callee may ring (default 60 s).
61
+ uint32 ring_timeout_s = 6;
62
+ // Passed through untouched in the events the node publishes for this call (opaque to the
63
+ // node; callers use it for their own references, e.g. app_ref).
64
+ map<string, string> metadata = 7;
65
+ // Lowers the node's maximum call duration for this call's room; higher values are ignored.
66
+ uint32 max_duration_s = 8;
67
+ }
68
+
69
+ message Call {
70
+ string call_ref = 1;
71
+ string room_ref = 2;
72
+ enum State {
73
+ RINGING = 0;
74
+ ANSWERED = 1;
75
+ ENDED = 2;
76
+ }
77
+ State state = 3;
78
+ // The call's participant in its room, once answered (inbound calls: always).
79
+ string participant_ref = 4;
80
+ }
81
+
82
+ message EndCallRequest {
83
+ string call_ref = 1;
84
+ }
85
+
86
+ message CreateRoomRequest {
87
+ // Empty: the node picks one. A ref already in use fails with ALREADY_EXISTS.
88
+ string room_ref = 1;
89
+ uint32 max_duration_s = 2;
90
+ // Overrides the node's emptyRoomTimeout for this room; 0 keeps the node's setting.
91
+ uint32 empty_room_timeout_s = 3;
92
+ // Overrides the node's maxParticipants for this room; 0 keeps the node's setting.
93
+ uint32 max_participants = 4;
94
+ }
95
+
96
+ message Room {
97
+ string room_ref = 1;
98
+ }
99
+
100
+ message EndRoomRequest {
101
+ string room_ref = 1;
102
+ }
103
+
104
+ // An RTP address. codec is an rtpmap name such as "L16/16000" or "PCMU/8000".
105
+ message MediaEndpoint {
106
+ string ip = 1;
107
+ uint32 port = 2;
108
+ string codec = 3;
109
+ // SDES key (AES_CM_128_HMAC_SHA1_80, 30 bytes of base64); empty for plain RTP.
110
+ string srtp_key = 4;
111
+ }
112
+
113
+ message WebRtcOffer {
114
+ string sdp = 1;
115
+ }
116
+
117
+ // One track forwarded, unmixed, to its own RTP destination.
118
+ message ListenTrack {
119
+ uint32 track_id = 1;
120
+ MediaEndpoint rtp = 2;
121
+ }
122
+
123
+ message AddParticipantRequest {
124
+ string room_ref = 1;
125
+ oneof endpoint {
126
+ MediaEndpoint rtp = 2;
127
+ WebRtcOffer webrtc = 3;
128
+ }
129
+ // Listen-only participant: one RTP destination per selected track. Set without an endpoint.
130
+ repeated ListenTrack listen = 4;
131
+ }
132
+
133
+ message Participant {
134
+ string participant_ref = 1;
135
+ string room_ref = 2;
136
+ // RTP participants: where the participant sends its audio (the node's side of the leg).
137
+ MediaEndpoint rtp = 3;
138
+ // WebRTC participants: the SDP answer.
139
+ string sdp_answer = 4;
140
+ uint32 track_id = 5;
141
+ }
142
+
143
+ message RemoveParticipantRequest {
144
+ string room_ref = 1;
145
+ string participant_ref = 2;
146
+ }