Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
feat(contracts): add voice provider key and worker reconcile operations
shoudi zheng7cbbbc401461
diff --git a/apps/teamhub/internal/app/routes_internal.go b/apps/teamhub/internal/app/routes_internal.goindex eed189fd..44f82800 100644--- a/apps/teamhub/internal/app/routes_internal.go+++ b/apps/teamhub/internal/app/routes_internal.go@@ -93,6 +93,7 @@ func (a *App) voiceRuntimeRoutes() []contractRoute {route(http.MethodPost, "/internal/v1/voice/live-tool-calls", nil, a.executeVoiceLiveToolCall),route(http.MethodPut, "/internal/v1/voice/media-objects", teamhubinternal.PutVoiceMediaObjectParams{}, a.putVoiceMediaObject),route(http.MethodPost, "/internal/v1/voice/observations", nil, a.reportVoiceObservationRoute),+ route(http.MethodGet, "/internal/v1/voice/provider-keys", nil, a.getVoiceProviderKeys),route(http.MethodPost, "/internal/v1/voice/recordings", nil, a.reportVoiceRecording),route(http.MethodGet, "/internal/v1/voice/sessions/:voiceSessionId/live-context", nil, a.getVoiceLiveContext),route(http.MethodGet, "/internal/v1/voice/sessions/:voiceSessionId/live-task-events", nil, a.streamVoiceLiveTaskEvents),diff --git a/apps/teamhub/internal/app/routes_public.go b/apps/teamhub/internal/app/routes_public.goindex 6153b3bb..13e43976 100644--- a/apps/teamhub/internal/app/routes_public.go+++ b/apps/teamhub/internal/app/routes_public.go@@ -213,6 +213,7 @@ func (a *App) publicRoutes() []contractRoute {route(http.MethodPost, "/v0/voice-captures/:captureSessionId/questions/:questionId/task", nil, session, a.sendVoiceCaptureQuestionTask),route(http.MethodPost, "/v0/voice-captures/:captureSessionId/stop", nil, session, a.stopVoiceCapture),route(http.MethodPost, "/v0/voice-captures/:captureSessionId/transcript-recovery/retry", nil, session, a.retryVoiceCaptureTranscript),+ route(http.MethodPut, "/v0/voice-provider-keys/:provider", nil, session, a.saveVoiceProviderKey),route(http.MethodDelete, "/v0/voice-sessions/:voiceSessionId", nil, session, a.closeVoiceSession),route(http.MethodGet, "/v0/voice-sessions/:voiceSessionId", nil, session, a.getVoiceSession),route(http.MethodPost, "/v0/voice-sessions/:voiceSessionId/captures", nil, session, a.startVoiceCapture),diff --git a/apps/teamhub/internal/app/voice_provider_keys.go b/apps/teamhub/internal/app/voice_provider_keys.gonew file mode 100644index 00000000..f7a259b6--- /dev/null+++ b/apps/teamhub/internal/app/voice_provider_keys.go@@ -0,0 +1,19 @@+package app++import (+ "net/http"++ "github.com/gin-gonic/gin"+)++// saveVoiceProviderKey stores the deployment's API key for one voice provider.+func (a *App) saveVoiceProviderKey(c *gin.Context) {+ // Replaced by the voice provider key store.+ a.writeError(c, http.StatusNotImplemented, "NOT_IMPLEMENTED", "Saving voice provider keys is not implemented")+}++// getVoiceProviderKeys returns the effective voice provider keys to the Voice Runtime.+func (a *App) getVoiceProviderKeys(c *gin.Context) {+ // Replaced by the voice provider key store.+ a.writeError(c, http.StatusNotImplemented, "NOT_IMPLEMENTED", "Reading voice provider keys is not implemented")+}diff --git a/contracts/generated/go/nodeservicesinternal/openapi.gen.go b/contracts/generated/go/nodeservicesinternal/openapi.gen.goindex f0330cc7..8ef66bdf 100644--- a/contracts/generated/go/nodeservicesinternal/openapi.gen.go+++ b/contracts/generated/go/nodeservicesinternal/openapi.gen.go@@ -3502,6 +3502,9 @@ type ClientInterface interface {ScanLocalComputerSkillsWithBody(ctx context.Context, tenantId TenantId, ownerActorId OwnerActorId, computerId ComputerId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)ScanLocalComputerSkills(ctx context.Context, tenantId TenantId, ownerActorId OwnerActorId, computerId ComputerId, body ScanLocalComputerSkillsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)++ // ReconcileVoiceWorkers request+ ReconcileVoiceWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)}func (c *Client) GetLlmWikiHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {@@ -4152,6 +4155,18 @@ func (c *Client) ScanLocalComputerSkills(ctx context.Context, tenantId TenantId,return c.Client.Do(req)}+func (c *Client) ReconcileVoiceWorkers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {+ req, err := NewReconcileVoiceWorkersRequest(c.Server)+ if err != nil {+ return nil, err+ }+ req = req.WithContext(ctx)+ if err := c.applyEditors(ctx, req, reqEditors); err != nil {+ return nil, err+ }+ return c.Client.Do(req)+}+// NewGetLlmWikiHealthRequest generates requests for GetLlmWikiHealthfunc NewGetLlmWikiHealthRequest(server string) (*http.Request, error) {var err error@@ -5677,6 +5692,33 @@ func NewScanLocalComputerSkillsRequestWithBody(server string, tenantId TenantId,return req, nil}+// NewReconcileVoiceWorkersRequest generates requests for ReconcileVoiceWorkers+func NewReconcileVoiceWorkersRequest(server string) (*http.Request, error) {+ var err error++ serverURL, err := url.Parse(server)+ if err != nil {+ return nil, err+ }++ operationPath := fmt.Sprintf("/v1/voice/workers:reconcile")+ if operationPath[0] == '/' {+ operationPath = "." + operationPath+ }++ queryURL, err := serverURL.Parse(operationPath)+ if err != nil {+ return nil, err+ }++ req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil)+ if err != nil {+ return nil, err+ }++ return req, nil+}+func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {for _, r := range c.RequestEditors {if err := r(ctx, req); err != nil {@@ -5860,6 +5902,9 @@ type ClientWithResponsesInterface interface {ScanLocalComputerSkillsWithBodyWithResponse(ctx context.Context, tenantId TenantId, ownerActorId OwnerActorId, computerId ComputerId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ScanLocalComputerSkillsResponse, error)ScanLocalComputerSkillsWithResponse(ctx context.Context, tenantId TenantId, ownerActorId OwnerActorId, computerId ComputerId, body ScanLocalComputerSkillsJSONRequestBody, reqEditors ...RequestEditorFn) (*ScanLocalComputerSkillsResponse, error)++ // ReconcileVoiceWorkersWithResponse request+ ReconcileVoiceWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ReconcileVoiceWorkersResponse, error)}type GetLlmWikiHealthResponse struct {@@ -6967,6 +7012,36 @@ func (r ScanLocalComputerSkillsResponse) ContentType() string {return ""}+type ReconcileVoiceWorkersResponse struct {+ Body []byte+ HTTPResponse *http.Response+ JSON401 *Unauthenticated+}++// Status returns HTTPResponse.Status+func (r ReconcileVoiceWorkersResponse) Status() string {+ if r.HTTPResponse != nil {+ return r.HTTPResponse.Status+ }+ return http.StatusText(0)+}++// StatusCode returns HTTPResponse.StatusCode+func (r ReconcileVoiceWorkersResponse) StatusCode() int {+ if r.HTTPResponse != nil {+ return r.HTTPResponse.StatusCode+ }+ return 0+}++// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers+func (r ReconcileVoiceWorkersResponse) ContentType() string {+ if r.HTTPResponse != nil {+ return r.HTTPResponse.Header.Get("Content-Type")+ }+ return ""+}+// GetLlmWikiHealthWithResponse request returning *GetLlmWikiHealthResponsefunc (c *ClientWithResponses) GetLlmWikiHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLlmWikiHealthResponse, error) {rsp, err := c.GetLlmWikiHealth(ctx, reqEditors...)@@ -7432,6 +7507,15 @@ func (c *ClientWithResponses) ScanLocalComputerSkillsWithResponse(ctx context.Coreturn ParseScanLocalComputerSkillsResponse(rsp)}+// ReconcileVoiceWorkersWithResponse request returning *ReconcileVoiceWorkersResponse+func (c *ClientWithResponses) ReconcileVoiceWorkersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ReconcileVoiceWorkersResponse, error) {+ rsp, err := c.ReconcileVoiceWorkers(ctx, reqEditors...)+ if err != nil {+ return nil, err+ }+ return ParseReconcileVoiceWorkersResponse(rsp)+}+// ParseGetLlmWikiHealthResponse parses an HTTP response from a GetLlmWikiHealthWithResponse callfunc ParseGetLlmWikiHealthResponse(rsp *http.Response) (*GetLlmWikiHealthResponse, error) {bodyBytes, err := io.ReadAll(rsp.Body)@@ -9055,3 +9139,29 @@ func ParseScanLocalComputerSkillsResponse(rsp *http.Response) (*ScanLocalComputereturn response, nil}++// ParseReconcileVoiceWorkersResponse parses an HTTP response from a ReconcileVoiceWorkersWithResponse call+func ParseReconcileVoiceWorkersResponse(rsp *http.Response) (*ReconcileVoiceWorkersResponse, error) {+ bodyBytes, err := io.ReadAll(rsp.Body)+ defer func() { _ = rsp.Body.Close() }()+ if err != nil {+ return nil, err+ }++ response := &ReconcileVoiceWorkersResponse{+ Body: bodyBytes,+ HTTPResponse: rsp,+ }++ switch {+ case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:+ var dest Unauthenticated+ if err := json.Unmarshal(bodyBytes, &dest); err != nil {+ return nil, err+ }+ response.JSON401 = &dest++ }++ return response, nil+}diff --git a/contracts/generated/go/teamhubinternal/openapi.gen.go b/contracts/generated/go/teamhubinternal/openapi.gen.goindex 1d33441c..18699922 100644--- a/contracts/generated/go/teamhubinternal/openapi.gen.go+++ b/contracts/generated/go/teamhubinternal/openapi.gen.go@@ -3745,6 +3745,12 @@ type VoiceRecordingReport struct {// VoiceRecordingReportState active once the first sample is archived; available after the sealed playlist is stored; failed when this recorder can no longer extend the epoch, including a handover.type VoiceRecordingReportState string+// VoiceRuntimeProviderKeys defines model for VoiceRuntimeProviderKeys.+type VoiceRuntimeProviderKeys struct {+ SonioxApiKey *string `json:"soniox_api_key,omitempty"`+ XaiApiKey *string `json:"xai_api_key,omitempty"`+}+// WorkItemCommentCreateRequest Concatenating segment content in order must equal body.type WorkItemCommentCreateRequest struct {Body string `json:"body"`diff --git a/contracts/generated/go/teamhubpublic/openapi.gen.go b/contracts/generated/go/teamhubpublic/openapi.gen.goindex 1111f522..81327411 100644--- a/contracts/generated/go/teamhubpublic/openapi.gen.go+++ b/contracts/generated/go/teamhubpublic/openapi.gen.go@@ -3149,6 +3149,45 @@ func (e VoiceEventKind) Valid() bool {}}+// Defines values for VoiceProvider.+const (+ Soniox VoiceProvider = "soniox"+ Xai VoiceProvider = "xai"+)++// Valid indicates whether the value is a known member of the VoiceProvider enum.+func (e VoiceProvider) Valid() bool {+ switch e {+ case Soniox:+ return true+ case Xai:+ return true+ default:+ return false+ }+}++// Defines values for VoiceProviderKeyStatusSource.+const (+ Environment VoiceProviderKeyStatusSource = "environment"+ None VoiceProviderKeyStatusSource = "none"+ Stored VoiceProviderKeyStatusSource = "stored"+)++// Valid indicates whether the value is a known member of the VoiceProviderKeyStatusSource enum.+func (e VoiceProviderKeyStatusSource) Valid() bool {+ switch e {+ case Environment:+ return true+ case None:+ return true+ case Stored:+ return true+ default:+ return false+ }+}+// Defines values for VoiceSessionPurpose.const (ChatDictation VoiceSessionPurpose = "chat_dictation"@@ -7070,6 +7109,11 @@ type SaveExternalProviderKeyRequest struct {ApiKey string `json:"api_key"`}+// SaveVoiceProviderKeyRequest defines model for SaveVoiceProviderKeyRequest.+type SaveVoiceProviderKeyRequest struct {+ ApiKey string `json:"api_key"`+}+// Session defines model for Session.type Session struct {// AccountId Opaque, case-sensitive identifier. Clients must not infer type or time from it.@@ -7730,12 +7774,32 @@ type VoiceMediaPolicy struct {LiveEnabled *bool `json:"live_enabled,omitempty"`// LiveSupported Whether the xAI live voice provider is configured; Live does not need Soniox.- LiveSupported *bool `json:"live_supported,omitempty"`+ LiveSupported *bool `json:"live_supported,omitempty"`+ SonioxKey *VoiceProviderKeyStatus `json:"soniox_key,omitempty"`++ // VoiceAvailable The deployment can run voice (TEAMHUB_VOICE_MEDIA=on); clients show voice entries only when true.+ VoiceAvailable *bool `json:"voice_available,omitempty"`// VoiceMediaSupported Soniox ASR is configured, so Recording, Pocket notes dictation and Voice Mode dictation are available.- VoiceMediaSupported bool `json:"voice_media_supported"`+ VoiceMediaSupported bool `json:"voice_media_supported"`+ XaiKey *VoiceProviderKeyStatus `json:"xai_key,omitempty"`+}++// VoiceProvider defines model for VoiceProvider.+type VoiceProvider string++// VoiceProviderKeyStatus defines model for VoiceProviderKeyStatus.+type VoiceProviderKeyStatus struct {+ // CanSave False when the provider's environment variable is set, no secret encryption key is configured, or voice media is off.+ CanSave bool `json:"can_save"`++ // Source Where the effective key comes from; the environment wins over a stored key.+ Source VoiceProviderKeyStatusSource `json:"source"`}+// VoiceProviderKeyStatusSource Where the effective key comes from; the environment wins over a stored key.+type VoiceProviderKeyStatusSource string+// VoiceSession defines model for VoiceSession.type VoiceSession struct {// ClosedAt UTC timestamp in RFC 3339 format with an explicit offset.@@ -8861,6 +8925,9 @@ type CreateWorkItemJSONRequestBody = WorkItemCreateRequest// AskVoiceCaptureQuestionJSONRequestBody defines body for AskVoiceCaptureQuestion for application/json ContentType.type AskVoiceCaptureQuestionJSONRequestBody = VoiceCaptureQuestionRequest+// SaveVoiceProviderKeyJSONRequestBody defines body for SaveVoiceProviderKey for application/json ContentType.+type SaveVoiceProviderKeyJSONRequestBody = SaveVoiceProviderKeyRequest+// StartVoiceCaptureJSONRequestBody defines body for StartVoiceCapture for application/json ContentType.type StartVoiceCaptureJSONRequestBody = VoiceCaptureStartRequestdiff --git a/contracts/generated/typescript/src/generated/node-services-internal/types.ts b/contracts/generated/typescript/src/generated/node-services-internal/types.tsindex 9a41a12e..b1b092cb 100644--- a/contracts/generated/typescript/src/generated/node-services-internal/types.ts+++ b/contracts/generated/typescript/src/generated/node-services-internal/types.ts@@ -547,6 +547,26 @@ export interface paths {patch?: never;trace?: never;};+ "/v1/voice/workers:reconcile": {+ parameters: {+ query?: never;+ header?: never;+ path?: never;+ cookie?: never;+ };+ get?: never;+ put?: never;+ /**+ * Schedule a reconcile of the voice workers against TeamHub's effective provider keys+ * @description It only schedules the reconcile and never carries keys; workers read keys from TeamHub.+ */+ post: operations["reconcileVoiceWorkers"];+ delete?: never;+ options?: never;+ head?: never;+ patch?: never;+ trace?: never;+ };"/v1/local-computer-tools:call": {parameters: {query?: never;@@ -2835,6 +2855,25 @@ export interface operations {default: components["responses"]["DocumentInternalError"];};};+ reconcileVoiceWorkers: {+ parameters: {+ query?: never;+ header?: never;+ path?: never;+ cookie?: never;+ };+ requestBody?: never;+ responses: {+ /** @description Reconcile scheduled. */+ 202: {+ headers: {+ [name: string]: unknown;+ };+ content?: never;+ };+ 401: components["responses"]["Unauthenticated"];+ };+ };callLocalComputerTool: {parameters: {query?: never;diff --git a/contracts/generated/typescript/src/generated/teamhub-internal/types.ts b/contracts/generated/typescript/src/generated/teamhub-internal/types.tsindex 7799faf4..afbb9448 100644--- a/contracts/generated/typescript/src/generated/teamhub-internal/types.ts+++ b/contracts/generated/typescript/src/generated/teamhub-internal/types.ts@@ -1180,6 +1180,26 @@ export interface paths {patch?: never;trace?: never;};+ "/internal/v1/voice/provider-keys": {+ parameters: {+ query?: never;+ header?: never;+ path?: never;+ cookie?: never;+ };+ /**+ * Read the effective voice provider API keys for the voice runtime.+ * @description An environment key wins over a stored key. Both keys are absent when voice media is off.+ */+ get: operations["getVoiceProviderKeys"];+ put?: never;+ post?: never;+ delete?: never;+ options?: never;+ head?: never;+ patch?: never;+ trace?: never;+ };"/internal/v1/voice/media-objects": {parameters: {query?: never;@@ -1348,6 +1368,10 @@ export interface components {/** @description Session-scoped anonymous speaker cluster. Omitted when the provider did not label this window. */speaker_id?: string;};+ VoiceRuntimeProviderKeys: {+ soniox_api_key?: string;+ xai_api_key?: string;+ };VoiceObservationReceipt: {event_id: components["schemas"]["VoiceId"];/** @enum {string} */@@ -5141,6 +5165,28 @@ export interface operations {409: components["responses"]["VoiceConflict"];};};+ getVoiceProviderKeys: {+ parameters: {+ query?: never;+ header?: never;+ path?: never;+ cookie?: never;+ };+ requestBody?: never;+ responses: {+ /** @description Effective provider keys. */+ 200: {+ headers: {+ "Cache-Control"?: "no-store";+ [name: string]: unknown;+ };+ content: {+ "application/json": components["schemas"]["VoiceRuntimeProviderKeys"];+ };+ };+ 401: components["responses"]["VoiceUnauthenticated"];+ };+ };putVoiceMediaObject: {parameters: {query: {diff --git a/contracts/generated/typescript/src/generated/teamhub-public/types.ts b/contracts/generated/typescript/src/generated/teamhub-public/types.tsindex 70583169..701c996e 100644--- a/contracts/generated/typescript/src/generated/teamhub-public/types.ts+++ b/contracts/generated/typescript/src/generated/teamhub-public/types.ts@@ -1429,6 +1429,28 @@ export interface paths {patch?: never;trace?: never;};+ "/v0/voice-provider-keys/{provider}": {+ parameters: {+ query?: never;+ header?: never;+ path: {+ provider: components["schemas"]["VoiceProvider"];+ };+ cookie?: never;+ };+ get?: never;+ /**+ * Save the deployment's API key for one voice provider.+ * @description For deployments without the provider's environment key. TeamHub checks the key with the provider, then stores it encrypted with TEAMHUB_SECRET_ENCRYPTION_KEY. Any signed-in Human may save it; the key is never returned. 400 carries INVALID_REQUEST or VOICE_KEY_REJECTED, 409 VOICE_KEY_FROM_ENVIRONMENT, and 503 VOICE_KEY_STORAGE_UNAVAILABLE, VOICE_PROVIDER_UNAVAILABLE or VOICE_MEDIA_OFF.+ */+ put: operations["saveVoiceProviderKey"];+ post?: never;+ delete?: never;+ options?: never;+ head?: never;+ patch?: never;+ trace?: never;+ };"/v0/voice-sessions/{voiceSessionId}": {parameters: {query?: never;@@ -5919,6 +5941,15 @@ export interface components {VoiceSessionCreateRequest: {purpose: components["schemas"]["VoiceSessionPurpose"];};+ VoiceProviderKeyStatus: {+ /**+ * @description Where the effective key comes from; the environment wins over a stored key.+ * @enum {string}+ */+ source: "none" | "environment" | "stored";+ /** @description False when the provider's environment variable is set, no secret encryption key is configured, or voice media is off. */+ can_save: boolean;+ };VoiceMediaPolicy: {/** @description Soniox ASR is configured, so Recording, Pocket notes dictation and Voice Mode dictation are available. */voice_media_supported: boolean;@@ -5927,6 +5958,15 @@ export interface components {live_supported?: boolean;/** @description Whether this tenant may enter live voice mode. */live_enabled?: boolean;+ /** @description The deployment can run voice (TEAMHUB_VOICE_MEDIA=on); clients show voice entries only when true. */+ voice_available?: boolean;+ soniox_key?: components["schemas"]["VoiceProviderKeyStatus"];+ xai_key?: components["schemas"]["VoiceProviderKeyStatus"];+ };+ /** @enum {string} */+ VoiceProvider: "soniox" | "xai";+ SaveVoiceProviderKeyRequest: {+ api_key: string;};VoiceConnectionCredential: {/** Format: uri */@@ -9988,6 +10028,36 @@ export interface operations {404: components["responses"]["NotFound"];};};+ saveVoiceProviderKey: {+ parameters: {+ query?: never;+ header?: never;+ path: {+ provider: components["schemas"]["VoiceProvider"];+ };+ cookie?: never;+ };+ requestBody: {+ content: {+ "application/json": components["schemas"]["SaveVoiceProviderKeyRequest"];+ };+ };+ responses: {+ /** @description Key status after saving. */+ 200: {+ headers: {+ [name: string]: unknown;+ };+ content: {+ "application/json": components["schemas"]["VoiceProviderKeyStatus"];+ };+ };+ 400: components["responses"]["BadRequest"];+ 401: components["responses"]["Unauthenticated"];+ 409: components["responses"]["Conflict"];+ 503: components["responses"]["ServiceUnavailable"];+ };+ };getVoiceSession: {parameters: {query?: never;diff --git a/contracts/openapi/components/voice-media.yaml b/contracts/openapi/components/voice-media.yamlindex 2cf96c68..c13f37b8 100644--- a/contracts/openapi/components/voice-media.yaml+++ b/contracts/openapi/components/voice-media.yaml@@ -16,6 +16,37 @@ components:live_enabled:type: booleandescription: Whether this tenant may enter live voice mode.+ voice_available:+ type: boolean+ description: The deployment can run voice (TEAMHUB_VOICE_MEDIA=on); clients show voice entries only when true.+ soniox_key:+ $ref: "#/components/schemas/VoiceProviderKeyStatus"+ xai_key:+ $ref: "#/components/schemas/VoiceProviderKeyStatus"+ VoiceProvider:+ type: string+ enum: [soniox, xai]+ SaveVoiceProviderKeyRequest:+ type: object+ additionalProperties: false+ required: [api_key]+ properties:+ api_key:+ type: string+ minLength: 1+ maxLength: 512+ VoiceProviderKeyStatus:+ type: object+ additionalProperties: false+ required: [source, can_save]+ properties:+ source:+ type: string+ enum: [none, environment, stored]+ description: Where the effective key comes from; the environment wins over a stored key.+ can_save:+ type: boolean+ description: False when the provider's environment variable is set, no secret encryption key is configured, or voice media is off.VoiceSessionStatus:type: stringenum: [provisioning, connected, reconnecting, closing, closed]diff --git a/contracts/openapi/node-services-internal/openapi.yaml b/contracts/openapi/node-services-internal/openapi.yamlindex ec68bb7f..42005340 100644--- a/contracts/openapi/node-services-internal/openapi.yaml+++ b/contracts/openapi/node-services-internal/openapi.yaml@@ -16,6 +16,8 @@ tags:description: Stateless Wiki candidate generation.- name: Document Normalizationdescription: Stateless conversion of one immutable source into compiler-ready Markdown.+ - name: Voice+ description: Voice worker supervision.paths:/v1/agent-debug/history:read:post:@@ -1118,6 +1120,19 @@ paths:$ref: ../components/document-errors.yaml#/components/responses/DocumentInternalErrorsecurity:- teamHubToRuntimeBearer: []+ /v1/voice/workers:reconcile:+ post:+ tags: [Voice]+ summary: Schedule a reconcile of the voice workers against TeamHub's effective provider keys+ description: It only schedules the reconcile and never carries keys; workers read keys from TeamHub.+ operationId: reconcileVoiceWorkers+ responses:+ "202":+ description: Reconcile scheduled.+ "401":+ $ref: ../components/common.yaml#/components/responses/Unauthenticated+ security:+ - agentManagementBearer: []/v1/local-computer-tools:call:post:operationId: callLocalComputerTooldiff --git a/contracts/openapi/paths/teamhub-public-voice-media.yaml b/contracts/openapi/paths/teamhub-public-voice-media.yamlindex d65c0c9a..e8630325 100644--- a/contracts/openapi/paths/teamhub-public-voice-media.yaml+++ b/contracts/openapi/paths/teamhub-public-voice-media.yaml@@ -384,6 +384,39 @@ tenantVoiceMediaPolicy:"404":$ref: "../components/common.yaml#/components/responses/NotFound"+voiceProviderKey:+ put:+ tags: [Capture]+ operationId: saveVoiceProviderKey+ summary: Save the deployment's API key for one voice provider.+ description: >-+ For deployments without the provider's environment key. TeamHub checks the key with the+ provider, then stores it encrypted with TEAMHUB_SECRET_ENCRYPTION_KEY. Any signed-in Human+ may save it; the key is never returned. 400 carries INVALID_REQUEST or VOICE_KEY_REJECTED,+ 409 VOICE_KEY_FROM_ENVIRONMENT, and 503 VOICE_KEY_STORAGE_UNAVAILABLE,+ VOICE_PROVIDER_UNAVAILABLE or VOICE_MEDIA_OFF.+ requestBody:+ required: true+ content:+ application/json:+ schema:+ $ref: "../components/voice-media.yaml#/components/schemas/SaveVoiceProviderKeyRequest"+ responses:+ "200":+ description: Key status after saving.+ content:+ application/json:+ schema:+ $ref: "../components/voice-media.yaml#/components/schemas/VoiceProviderKeyStatus"+ "400":+ $ref: "../components/common.yaml#/components/responses/BadRequest"+ "401":+ $ref: "../components/common.yaml#/components/responses/Unauthenticated"+ "409":+ $ref: "../components/common.yaml#/components/responses/Conflict"+ "503":+ $ref: "../components/common.yaml#/components/responses/ServiceUnavailable"+voiceSessionEvents:get:tags: [Capture]diff --git a/contracts/openapi/teamhub-internal/openapi.yaml b/contracts/openapi/teamhub-internal/openapi.yamlindex 529dcd02..77323190 100644--- a/contracts/openapi/teamhub-internal/openapi.yaml+++ b/contracts/openapi/teamhub-internal/openapi.yaml@@ -784,6 +784,27 @@ paths:$ref: "#/components/responses/VoiceConflict"security:- voiceRuntimeBearer: []+ /internal/v1/voice/provider-keys:+ get:+ operationId: getVoiceProviderKeys+ summary: Read the effective voice provider API keys for the voice runtime.+ description: An environment key wins over a stored key. Both keys are absent when voice media is off.+ responses:+ "200":+ description: Effective provider keys.+ headers:+ Cache-Control:+ schema:+ type: string+ const: no-store+ content:+ application/json:+ schema:+ $ref: "#/components/schemas/VoiceRuntimeProviderKeys"+ "401":+ $ref: "#/components/responses/VoiceUnauthenticated"+ security:+ - voiceRuntimeBearer: []/internal/v1/voice/media-objects:put:operationId: putVoiceMediaObject@@ -1138,6 +1159,16 @@ components:maxLength: 16pattern: ^spk_[1-9][0-9]*$description: Session-scoped anonymous speaker cluster. Omitted when the provider did not label this window.+ VoiceRuntimeProviderKeys:+ type: object+ additionalProperties: false+ properties:+ soniox_api_key:+ type: string+ minLength: 1+ xai_api_key:+ type: string+ minLength: 1VoiceObservationReceipt:type: objectadditionalProperties: falsediff --git a/contracts/openapi/teamhub-public/teamhub-api.openapi.yaml b/contracts/openapi/teamhub-public/teamhub-api.openapi.yamlindex 4fdde98a..b90aea69 100644--- a/contracts/openapi/teamhub-public/teamhub-api.openapi.yaml+++ b/contracts/openapi/teamhub-public/teamhub-api.openapi.yaml@@ -2027,6 +2027,14 @@ paths:parameters:- $ref: '#/components/parameters/TenantId'$ref: '../paths/teamhub-public-voice-media.yaml#/tenantVoiceMediaPolicy'+ /v0/voice-provider-keys/{provider}:+ parameters:+ - name: provider+ in: path+ required: true+ schema:+ $ref: '../components/voice-media.yaml#/components/schemas/VoiceProvider'+ $ref: '../paths/teamhub-public-voice-media.yaml#/voiceProviderKey'/v0/voice-sessions/{voiceSessionId}:parameters:- $ref: '#/components/parameters/VoiceSessionId'