@agimon-ai/po-voice 0.0.0-alpha.7 → 0.0.0-alpha.71

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 (54) hide show
  1. package/LICENSE +149 -21
  2. package/NOTICE +2 -3
  3. package/README.md +9 -3
  4. package/dist/apiContracts.cjs +38 -1
  5. package/dist/apiContracts.cjs.map +1 -1
  6. package/dist/apiContracts.d.mts.map +1 -1
  7. package/dist/apiContracts.mjs +38 -1
  8. package/dist/apiContracts.mjs.map +1 -1
  9. package/dist/clientMedia-DMBtzBH2.cjs.map +1 -1
  10. package/dist/clientMedia-DZ_-WG5x.mjs.map +1 -1
  11. package/dist/{clientMedia-BlbwPLxx.d.mts → clientMedia-ELMrwZY9.d.mts} +10 -1
  12. package/dist/clientMedia-ELMrwZY9.d.mts.map +1 -0
  13. package/dist/clientMedia.cjs +155 -11
  14. package/dist/clientMedia.cjs.map +1 -1
  15. package/dist/clientMedia.d.mts +29 -7
  16. package/dist/clientMedia.d.mts.map +1 -1
  17. package/dist/clientMedia.mjs +155 -11
  18. package/dist/clientMedia.mjs.map +1 -1
  19. package/dist/extensions/native.mjs +1990 -251
  20. package/dist/extensions/native.mjs.map +1 -1
  21. package/dist/extensions/server.cjs +2024 -322
  22. package/dist/extensions/server.cjs.map +1 -1
  23. package/dist/extensions/server.d.mts +2 -2
  24. package/dist/extensions/server.d.mts.map +1 -1
  25. package/dist/extensions/server.mjs +2023 -321
  26. package/dist/extensions/server.mjs.map +1 -1
  27. package/dist/extensions/web.mjs +335 -60
  28. package/dist/extensions/web.mjs.map +1 -1
  29. package/dist/{index-CR3rHYRR.d.mts → index-BE6xs-EZ.d.mts} +2 -2
  30. package/dist/{index-CR3rHYRR.d.mts.map → index-BE6xs-EZ.d.mts.map} +1 -1
  31. package/dist/index.cjs +27 -62
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.mts +2 -2
  34. package/dist/index.d.mts.map +1 -1
  35. package/dist/index.mjs +2 -37
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/{realtime-DwExEu8q.cjs → realtime-CaxX6cX6.cjs} +19 -1
  38. package/dist/realtime-CaxX6cX6.cjs.map +1 -0
  39. package/dist/{realtime-CdAlhPoo.mjs → realtime-DkseyE21.mjs} +14 -2
  40. package/dist/realtime-DkseyE21.mjs.map +1 -0
  41. package/dist/voiceWorker.d.mts +1 -1
  42. package/dist/{voiceWorkerSessionController-B2dKTPL0.mjs → voiceWorkerSessionController-BYEF6W5j.mjs} +57 -5
  43. package/dist/voiceWorkerSessionController-BYEF6W5j.mjs.map +1 -0
  44. package/dist/{voiceWorkerSessionController-Biv94jNo.cjs → voiceWorkerSessionController-HWB7xQRs.cjs} +165 -5
  45. package/dist/voiceWorkerSessionController-HWB7xQRs.cjs.map +1 -0
  46. package/package.json +28 -23
  47. package/src/prompts/po-use-voice/SKILL.md +7 -0
  48. package/src/types/clientMedia.ts +2 -0
  49. package/src/types/realtime.ts +18 -2
  50. package/dist/clientMedia-BlbwPLxx.d.mts.map +0 -1
  51. package/dist/realtime-CdAlhPoo.mjs.map +0 -1
  52. package/dist/realtime-DwExEu8q.cjs.map +0 -1
  53. package/dist/voiceWorkerSessionController-B2dKTPL0.mjs.map +0 -1
  54. package/dist/voiceWorkerSessionController-Biv94jNo.cjs.map +0 -1
package/LICENSE CHANGED
@@ -1,21 +1,149 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Vuong Ngo
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
2
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
3
+
4
+ Parameters
5
+
6
+ Licensor: Agimon Pty Ltd
7
+ Licensed Work: Po, the software in the Po source repository and the
8
+ packages released from it, in each version released by
9
+ the Licensor.
10
+ The Licensed Work is (c) 2026 Agimon Pty Ltd.
11
+ Material identified as third-party in the "Third-party
12
+ components" section at the end of this file or in a
13
+ NOTICE file, and any package or directory whose own
14
+ license file grants a different license, is not part of
15
+ the Licensed Work and remains under its own license.
16
+ Additional Use Grant: You may make production use of the Licensed Work if
17
+ your use is Eligible Use. "Eligible Use" is production use that falls
18
+ within at least one of the following:
19
+
20
+ (a) Personal Use. Use by an individual for their own personal purposes,
21
+ and not on behalf of, or for the benefit of, an employer, client, or
22
+ other Organization. Use by an individual in the course of employment
23
+ or engagement by an Organization is use by that Organization.
24
+
25
+ (b) Small Organization Use. Use by or on behalf of an Organization whose
26
+ Annual Revenue is less than USD 1,000,000.
27
+
28
+ (c) Non-profit, Education and Research Use. Use, regardless of Annual
29
+ Revenue, by (i) an Organization registered or recognized as a
30
+ non-profit or charitable organization under the laws of its
31
+ jurisdiction, for its non-profit purposes; (ii) an accredited school,
32
+ college, or university, for teaching, learning, or academic research;
33
+ or (iii) a publicly funded research institution, for its research.
34
+
35
+ (d) Service Provider Use. Use by a consultant, contractor, agency, or other
36
+ service provider, regardless of its own Annual Revenue, solely to
37
+ build, deploy, host, operate, or support the Licensed Work for a client
38
+ whose own use would be Eligible Use under (a), (b), or (c). A service
39
+ provider's use for its own purposes is Eligible Use only if the service
40
+ provider itself qualifies under (b) or (c).
41
+
42
+
43
+ Hosted services. Offering the Licensed Work to third parties as a hosted
44
+ or managed service whose primary value is the Licensed Work is Eligible
45
+ Use only if each such third party's own use would be Eligible Use.
46
+
47
+ Definitions. "Organization" means any company, partnership, sole
48
+ proprietorship, trust, association, government body, or other entity, and
49
+ includes an individual acting in a business or professional capacity.
50
+ "Affiliate" means any entity that directly or indirectly controls, is
51
+ controlled by, or is under common control with an Organization, where
52
+ "control" means ownership of more than 50% of the voting interests of an
53
+ entity or the power to direct its management and policies by contract or
54
+ otherwise. "Annual Revenue" means the total gross revenue of an
55
+ Organization and all of its Affiliates combined, from all sources and
56
+ whether or not related to the Licensed Work, for its most recently
57
+ completed fiscal year, or, if it has not completed a fiscal year, for the
58
+ twelve months before the use (or since its formation, if shorter),
59
+ converted into US dollars at the average exchange rate for that period.
60
+ Proceeds of equity or debt financing are not revenue.
61
+
62
+ Threshold. If an Organization stops qualifying under (b), its existing
63
+ production use remains Eligible Use for 90 days after it stops
64
+ qualifying, after which it must obtain a commercial license or stop
65
+ production use. Use that was Eligible Use when it occurred never requires
66
+ a commercial license after the fact.
67
+ Change Date: Four years from the date a version of the Licensed Work
68
+ is first publicly released by the Licensor.
69
+ Change License: Apache License, Version 2.0
70
+
71
+ For information about alternative licensing arrangements for the Licensed
72
+ Work, please visit: https://agimon.ai/licensing
73
+
74
+ Notice
75
+
76
+ The Business Source License (this document, or the "License") is not an Open
77
+ Source license. However, the Licensed Work will eventually be made available
78
+ under an Open Source License, as stated in this License.
79
+
80
+ -----------------------------------------------------------------------------
81
+
82
+ Business Source License 1.1
83
+
84
+ Terms
85
+
86
+ The Licensor hereby grants you the right to copy, modify, create derivative
87
+ works, redistribute, and make non-production use of the Licensed Work. The
88
+ Licensor may make an Additional Use Grant, above, permitting limited
89
+ production use.
90
+
91
+ Effective on the Change Date, or the fourth anniversary of the first publicly
92
+ available distribution of a specific version of the Licensed Work under this
93
+ License, whichever comes first, the Licensor hereby grants you rights under
94
+ the terms of the Change License, and the rights granted in the paragraph
95
+ above terminate.
96
+
97
+ If your use of the Licensed Work does not comply with the requirements
98
+ currently in effect as described in this License, you must purchase a
99
+ commercial license from the Licensor, its affiliated entities, or authorized
100
+ resellers, or you must refrain from using the Licensed Work.
101
+
102
+ All copies of the original and modified Licensed Work, and derivative works
103
+ of the Licensed Work, are subject to this License. This License applies
104
+ separately for each version of the Licensed Work and the Change Date may vary
105
+ for each version of the Licensed Work released by Licensor.
106
+
107
+ You must conspicuously display this License on each original or modified copy
108
+ of the Licensed Work. If you receive the Licensed Work in original or
109
+ modified form from a third party, the terms and conditions set forth in this
110
+ License apply to your use of that work.
111
+
112
+ Any use of the Licensed Work in violation of this License will automatically
113
+ terminate your rights under this License for the current and all other
114
+ versions of the Licensed Work.
115
+
116
+ This License does not grant you any right in any trademark or logo of
117
+ Licensor or its affiliates (provided that you may use a trademark or logo of
118
+ Licensor as expressly required by this License).
119
+
120
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
121
+ AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
122
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
123
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
124
+ TITLE.
125
+
126
+ MariaDB hereby grants you permission to use this License’s text to license
127
+ your works, and to refer to it using the trademark “Business Source License”,
128
+ as long as you comply with the Covenants of Licensor below.
129
+
130
+ Covenants of Licensor
131
+
132
+ In consideration of the right to use this License’s text and the “Business
133
+ Source License” name and trademark, Licensor covenants to MariaDB, and to all
134
+ other recipients of the licensed work to be provided by Licensor:
135
+
136
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
137
+ or a license that is compatible with GPL Version 2.0 or a later version,
138
+ where “compatible” means that software provided under the Change License can
139
+ be included in a program with software provided under GPL Version 2.0 or a
140
+ later version. Licensor may specify additional Change Licenses without
141
+ limitation.
142
+
143
+ 2. To either: (a) specify an additional grant of rights to use that does not
144
+ impose any additional restriction on the right granted in this License, as
145
+ the Additional Use Grant; or (b) insert the text “None”.
146
+
147
+ 3. To specify a Change Date.
148
+
149
+ 4. Not to modify this License in any other way.
package/NOTICE CHANGED
@@ -4,10 +4,9 @@ https://github.com/openai/codex
4
4
  Source revision: 5ecb3afd1b
5
5
 
6
6
  Adapted files:
7
- - src/services/codexAuth/index.ts, src/services/codexLogin/index.ts, and src/services/codexAuthStorage/index.ts: subscription login, credential storage, and refresh
8
7
  - src/services/codexRealtime/index.ts: realtime call creation
9
- - src/services/realtimeProtocol.ts: Frameless realtime events and context messages
8
+ - src/services/realtimeProtocol/index.ts: Frameless realtime events and context messages
10
9
 
11
10
  These portions were modified for Po and are licensed under Apache-2.0.
12
11
  A copy is included in licenses/Codex-Apache-2.0.txt.
13
- The package's MIT license continues to apply to its original code.
12
+ The rest of this package is licensed under the Business Source License 1.1 in LICENSE.
package/README.md CHANGED
@@ -83,8 +83,14 @@ cannot summarize contents it did not transmit. Thinking and raw tool output are
83
83
 
84
84
  Interruption suppresses output for the remainder of that activation; explicitly end and
85
85
  reactivate Voice to hear replies again. It does not cancel main-agent work. Exact primary-agent
86
- `narrate` and its TTS fallback are not enabled in live mode. Voice-only approval answers remain
87
- unavailable. Reconnect and reload do not resume microphone transmission.
86
+ `narrate` and its TTS fallback are not enabled in live mode. Live can answer a session's
87
+ only pending `ask` approval once, within 30 seconds of reading it, only from the person's next
88
+ message containing exactly `approve` or `deny` after trimming and lowercasing. `human`
89
+ approvals stay in the app. Autonomous `voice-auto` approvals also stay in the app:
90
+ its capture path does not establish that an approval has been read aloud.
91
+ Live readback may be paraphrased, and an echo or another speaker may be transcribed.
92
+ A whole-utterance match reduces that risk, but does not remove it. `ask` is a courtesy,
93
+ not a security boundary. Reconnect and reload do not resume microphone transmission.
88
94
 
89
95
  Omit `voice.mode` or select the compatibility value `legacy` for the existing half-duplex
90
96
  Voice path. It remains a supported interaction choice. Live capture does not require local
@@ -259,4 +265,4 @@ Maintained by [Agimon](https://agimon.ai/about).
259
265
 
260
266
  ## License
261
267
 
262
- MIT
268
+ Business Source License 1.1: free for personal use, organisations under USD 1M revenue, non-profits and education. See [LICENSE](LICENSE) and https://agimon.ai/licensing.
@@ -24,6 +24,16 @@ const voiceControlMethod = (0, require("@agimon-ai/po-core/pluginProtocol").defi
24
24
  ].map((value) => typebox.Type.Literal(value))),
25
25
  /** The voice to start (`activate`) or move to (`switch`). `switch` requires it. */
26
26
  mode: typebox.Type.Optional(typebox.Type.Union([typebox.Type.Literal("legacy"), typebox.Type.Literal("live")])),
27
+ browser: typebox.Type.Optional(typebox.Type.Object({
28
+ clientId: typebox.Type.String({
29
+ minLength: 1,
30
+ maxLength: 200
31
+ }),
32
+ connectionId: typebox.Type.String({
33
+ minLength: 1,
34
+ maxLength: 200
35
+ })
36
+ }, { additionalProperties: false })),
27
37
  target: typebox.Type.Optional(typebox.Type.Integer({ minimum: 1 })),
28
38
  revision: typebox.Type.Optional(typebox.Type.String({
29
39
  minLength: 1,
@@ -127,6 +137,12 @@ const VoiceMediaEventSchema = typebox.Type.Union([
127
137
  type: typebox.Type.Literal("realtime-send"),
128
138
  activationId: S,
129
139
  messages: typebox.Type.Array(S)
140
+ }),
141
+ typebox.Type.Object({
142
+ ...Sequence,
143
+ type: typebox.Type.Literal("open-session"),
144
+ activationId: S,
145
+ sessionId: S
130
146
  })
131
147
  ]);
132
148
  const RealtimeEvent = typebox.Type.Union([
@@ -176,6 +192,16 @@ const GlobalLiveStatus = typebox.Type.Object({
176
192
  "shuttingDown"
177
193
  ]),
178
194
  activeSessionId: typebox.Type.Union([S, typebox.Type.Null()]),
195
+ selectedSessionId: O(S),
196
+ orchestrator: O(typebox.Type.Object({
197
+ state: values([
198
+ "ready",
199
+ "opening",
200
+ "unavailable"
201
+ ]),
202
+ sessionId: O(S),
203
+ error: O(S)
204
+ })),
179
205
  muted: B,
180
206
  error: O(S),
181
207
  media: typebox.Type.Object({
@@ -370,6 +396,7 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
370
396
  clientKind: values(["browser", "native"]),
371
397
  controlLocation: values(["local", "remote"]),
372
398
  acceptStandby: O(B),
399
+ claimForActivation: O(B),
373
400
  capabilities: typebox.Type.Object({
374
401
  capture: B,
375
402
  playback: B,
@@ -518,6 +545,16 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
518
545
  "/live/agent",
519
546
  "GET"
520
547
  ],
548
+ [
549
+ "feedback",
550
+ "/live/agent/feedback",
551
+ "GET"
552
+ ],
553
+ [
554
+ "outcome",
555
+ "/live/agent/outcome",
556
+ "GET"
557
+ ],
521
558
  [
522
559
  "prepare",
523
560
  "/live/agent/prepare",
@@ -757,7 +794,7 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
757
794
  "end"
758
795
  ]),
759
796
  sessionId: O(S),
760
- expectedSourceSessionId: O(S)
797
+ browser: O(typebox.Type.Object(Client))
761
798
  })
762
799
  },
763
800
  responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(GlobalLiveStatus)
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.cjs","names":["definePoPluginMethod","Type","Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/voiceControl.ts","../src/schemas/apiContracts.ts"],"sourcesContent":["import { definePoPluginMethod } from '@agimon-ai/po-core/pluginProtocol';\nimport { Type } from 'typebox';\n\nexport const voiceControlMethod = definePoPluginMethod({\n service: 'voice',\n method: 'control',\n scope: 'session',\n direction: 'client-to-server',\n input: Type.Object(\n {\n action: Type.Union(\n ['status', 'manual', 'activate', 'deactivate', 'switch', 'mute', 'unmute', 'interrupt', 'transfer'].map(\n (value) => Type.Literal(value),\n ),\n ),\n /** The voice to start (`activate`) or move to (`switch`). `switch` requires it. */\n mode: Type.Optional(Type.Union([Type.Literal('legacy'), Type.Literal('live')])),\n target: Type.Optional(Type.Integer({ minimum: 1 })),\n revision: Type.Optional(Type.String({ minLength: 1, maxLength: 128 })),\n },\n { additionalProperties: false },\n ),\n output: Type.Object(\n {\n state: Type.String(),\n mode: Type.String(),\n manual: Type.String(),\n muted: Type.Boolean(),\n error: Type.Optional(Type.String()),\n },\n { additionalProperties: false },\n ),\n});\n","import { defineApiContract, jsonApiResponses, type PoHttpContract } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nimport { voiceControlMethod } from './voiceControl';\n\nconst S = Type.String();\nconst N = Type.Number();\nconst B = Type.Boolean();\nconst O = Type.Optional;\nconst values = <T extends string>(items: T[]) => Type.Union(items.map((item) => Type.Literal(item)));\nconst Client = { clientId: S, connectionId: S };\nconst Configuration = Type.Object({\n mode: values(['manual', 'autonomous']),\n activityControl: values(['host', 'client']),\n endpointSilenceMs: O(Type.Integer({ minimum: 250 })),\n});\nconst Playback = { playbackId: S, outcome: values(['completed', 'stopped', 'aborted', 'failed']), error: O(S) };\nconst Sequence = { sequence: N };\nconst Control = values(['mute', 'unmute', 'interrupt']);\nconst Browser = Type.Object({\n connection: values(['connecting', 'connected', 'closed', 'failed']),\n listening: B,\n speaking: B,\n muted: B,\n error: O(S),\n});\nexport const VoiceMediaEventSchema = Type.Union([\n Type.Object({\n ...Sequence,\n type: Type.Literal('capture-start'),\n captureId: S,\n sampleRate: Type.Literal(16000),\n channels: Type.Literal(1),\n bitsPerSample: Type.Literal(16),\n configuration: Configuration,\n }),\n Type.Object({ ...Sequence, type: values(['capture-stop', 'capture-abort']), captureId: S }),\n Type.Object({\n ...Sequence,\n type: Type.Literal('playback-start'),\n playbackId: S,\n text: S,\n delivery: O(values(['client', 'streamed'])),\n voice: O(S),\n rate: O(N),\n }),\n Type.Object({ ...Sequence, type: values(['playback-stop', 'playback-abort']), playbackId: S }),\n Type.Object({ ...Sequence, type: values(['realtime-start', 'realtime-stop']), activationId: S }),\n Type.Object({ ...Sequence, type: Type.Literal('realtime-control'), activationId: S, action: Control }),\n Type.Object({ ...Sequence, type: Type.Literal('realtime-send'), activationId: S, messages: Type.Array(S) }),\n]);\nconst RealtimeEvent = Type.Union([\n Type.Object({ type: Type.Literal('ready') }),\n Type.Object({ type: Type.Literal('transcript'), role: values(['user', 'assistant']), text: S, complete: B }),\n Type.Object({ type: Type.Literal('request'), requestId: S, text: S }),\n Type.Object({ type: Type.Literal('error'), code: S }),\n]);\nconst RealtimeSnapshot = Type.Object({\n activationId: S,\n state: values(['connecting', 'active', 'closed', 'failed']),\n cursor: N,\n events: Type.Array(Type.Object({ sequence: N, event: RealtimeEvent })),\n browser: O(Browser),\n});\nconst Wake = Type.Object({ eventEpoch: S, sequence: N });\nconst GlobalLiveStatus = Type.Object({\n version: Type.Literal(1),\n state: values(['disabled', 'starting', 'active', 'draining', 'shuttingDown']),\n activeSessionId: Type.Union([S, Type.Null()]),\n muted: B,\n error: O(S),\n media: Type.Object({ client: B, realtime: B }),\n signedIn: O(B),\n});\nconst Version = { version: Type.Literal(3) };\nconst Targets = Type.Array(Type.Object({ handle: S, label: S, order: N }), { maxItems: 32 });\nconst OwnershipAction = values(['catalog', 'prepare', 'activate', 'deactivate', 'readiness', 'fence']);\nconst Acknowledgement = Type.Object({\n ...Version,\n commandId: S,\n action: OwnershipAction,\n ok: B,\n active: B,\n error: O(S),\n});\nconst Command = Type.Object({\n ...Version,\n commandId: S,\n action: OwnershipAction,\n targets: O(Targets),\n catalogRevision: O(S),\n handoffId: O(S),\n controllerId: O(S),\n leaseId: O(S),\n revision: O(N),\n});\nconst Snapshot = Type.Object({\n registration: O(Type.Object({ ...Version, leaseId: S, revision: N, label: S, eligible: B, active: B })),\n targets: Targets,\n catalogRevision: O(S),\n activation: O(Type.Object({ ...Version, requestId: S })),\n handoff: O(Type.Object({ ...Version, requestId: S, handle: S, catalogRevision: S })),\n acknowledgement: O(Acknowledgement),\n});\nconst Errors = Object.fromEntries(\n [400, 404, 409, 410, 413, 415, 429, 500, 502, 503, 504].map((status) => [\n status,\n { description: 'Voice request failed.', schema: Type.Object({ error: S, code: O(S) }) },\n ]),\n);\nconst route = (\n path: string,\n method: 'GET' | 'POST',\n output?: object,\n input?: object,\n query: string[] = [],\n status = 200,\n): PoHttpContract => ({\n id: `voice.${path.slice(1).replaceAll('/', '.')}`,\n scope: 'session',\n basePath: 'voice-media',\n path,\n method,\n authentication: 'owner',\n description: `Voice media ${path}.`,\n ...(path.startsWith('/host/') || path.startsWith('/hub/')\n ? { availability: 'Internal broker route; requires the host-issued bearer token for this route namespace.' }\n : {}),\n parameters: [\n ...query.map((name) => ({ name, in: 'query' as const, required: !['after', 'wait'].includes(name), schema: S })),\n ...(path.startsWith('/host/') || path.startsWith('/hub/')\n ? [\n {\n name: 'Authorization',\n in: 'header' as const,\n required: true,\n schema: Type.String({ pattern: '^Bearer .+' }),\n },\n ]\n : []),\n ],\n ...(input ? { body: { required: true, contentType: 'application/json', schema: input } } : {}),\n responses: {\n ...Errors,\n [output ? status : 204]: {\n description: output ? 'Voice response.' : 'Accepted with no response body.',\n ...(output ? { schema: output } : {}),\n },\n },\n});\nconst pcm = (path: string, method: 'GET' | 'POST', query: string[]): PoHttpContract => {\n const result = route(path, method, undefined, undefined, query);\n result.description =\n 'PCM signed 16-bit little-endian, 16000 Hz, mono. Chunks contain complete samples. Activity headers carry state, level, elapsed time, epoch and speech duration. A 204 response carries x-po-capture-state or x-po-playback-state when applicable.';\n if (method === 'POST') result.body = { required: true, contentType: 'application/vnd.po.pcm-s16le', schema: S };\n else result.responses['200'] = { description: 'PCM bytes.', contentType: 'application/vnd.po.pcm-s16le', schema: S };\n return result;\n};\nexport const apiContracts = defineApiContract({\n version: 1,\n protocols: { 'voice-media': '6', 'voice-ownership': '3' },\n dynamic: ['Realtime event strings and SDP are provider-defined protocol documents passed through the media broker.'],\n http: [\n {\n id: 'voice.status',\n scope: 'session',\n basePath: 'voice',\n path: '/status',\n method: 'GET',\n authentication: 'owner',\n description: 'Voice session status and media readiness.',\n responses: jsonApiResponses(\n Type.Object({\n ...voiceControlMethod.output.properties,\n media: Type.Object({ closed: B, capture: B, playback: B, realtime: B }),\n readiness: Type.Object({\n configured: B,\n transcription: B,\n error: O(S),\n engine: O(S),\n mode: O(S),\n correctionModel: O(S),\n }),\n }),\n ),\n },\n {\n id: 'voice.control.http',\n scope: 'session',\n basePath: 'voice',\n path: '/control',\n method: 'POST',\n authentication: 'owner',\n description: 'Control the voice session.',\n body: { required: true, contentType: 'application/json', schema: voiceControlMethod.input },\n responses: jsonApiResponses(voiceControlMethod.output),\n },\n route(\n '/client/connect',\n 'POST',\n Type.Union([\n Type.Object({ version: Type.Literal(6), cursor: N, eventEpoch: O(S), heartbeatMs: O(N) }),\n Type.Object({ version: Type.Literal(6), standby: Type.Literal(true) }),\n ]),\n Type.Object({\n version: Type.Literal(6),\n ...Client,\n clientKind: values(['browser', 'native']),\n controlLocation: values(['local', 'remote']),\n acceptStandby: O(B),\n capabilities: Type.Object({\n capture: B,\n playback: B,\n captureActivity: B,\n autonomousOrchestration: B,\n playbackDucking: O(B),\n realtime: O(B),\n }),\n }),\n ),\n route('/client/disconnect', 'POST', undefined, Type.Object(Client)),\n route('/client/heartbeat', 'POST', Wake, Type.Object(Client)),\n {\n ...route('/client/events', 'GET', VoiceMediaEventSchema, undefined, [\n 'clientId',\n 'connectionId',\n 'after',\n 'wait',\n ]),\n responses: {\n ...Errors,\n '200': { description: 'Next event.', schema: VoiceMediaEventSchema },\n '204': { description: 'No pending event.' },\n },\n },\n pcm('/client/audio', 'POST', ['clientId', 'connectionId', 'captureId']),\n route('/client/capture-stopped', 'POST', undefined, Type.Object({ ...Client, captureId: S, error: O(S) })),\n pcm('/client/playback-audio', 'GET', ['clientId', 'connectionId', 'playbackId']),\n route('/client/playback-result', 'POST', undefined, Type.Object({ ...Client, ...Playback })),\n route(\n '/host/capture/start',\n 'POST',\n Type.Object({ configuration: Configuration }),\n Type.Object({ captureId: S, configuration: O(Configuration) }),\n [],\n 201,\n ),\n pcm('/host/capture/audio', 'GET', ['captureId']),\n ...['stop', 'abort'].map((action) =>\n route(`/host/capture/${action}`, 'POST', undefined, Type.Object({ captureId: S })),\n ),\n route(\n '/host/playback/start',\n 'POST',\n Type.Object({ delivery: values(['client', 'streamed']) }),\n Type.Object({ playbackId: S, text: S, voice: O(S), rate: O(N) }),\n [],\n 201,\n ),\n pcm('/host/playback/audio', 'POST', ['playbackId']),\n route('/host/playback/audio-end', 'POST', undefined, Type.Object({ playbackId: S, error: O(S) })),\n {\n ...route('/host/playback/result', 'GET', Type.Object(Playback), undefined, ['playbackId']),\n responses: {\n ...Errors,\n '200': { description: 'Playback outcome.', schema: Type.Object(Playback) },\n '204': { description: 'Playback is pending.' },\n },\n },\n ...['stop', 'abort'].map((action) =>\n route(`/host/playback/${action}`, 'POST', undefined, Type.Object({ playbackId: S })),\n ),\n route('/hub/ownership/state', 'GET', Snapshot),\n route('/hub/ownership/command', 'POST', Acknowledgement, Command),\n route('/host/ownership/sync', 'POST', Type.Object({ command: O(Command) }), Snapshot),\n route(\n '/host/realtime/start',\n 'POST',\n Type.Object({}),\n Type.Object({ activationId: S, instructions: Type.String({ maxLength: 16384 }) }),\n [],\n 201,\n ),\n route('/host/realtime/stop', 'POST', undefined, Type.Object({ activationId: S })),\n route('/host/realtime/poll', 'GET', RealtimeSnapshot, undefined, ['activationId', 'after']),\n route(\n '/host/realtime/send',\n 'POST',\n undefined,\n Type.Object({ activationId: S, messages: Type.Array(S, { maxItems: 64 }) }),\n ),\n route('/host/realtime/control', 'POST', undefined, Type.Object({ activationId: S, action: Control })),\n route(\n '/client/realtime/negotiate',\n 'POST',\n Type.Object({ sdp: S }),\n Type.Object({ ...Client, activationId: S, sdp: S }),\n ),\n route('/client/realtime/event', 'POST', undefined, Type.Object({ ...Client, activationId: S, event: S })),\n route('/client/realtime/state', 'POST', undefined, Type.Object({ ...Client, activationId: S, state: Browser })),\n {\n id: 'voice.manual',\n scope: 'session',\n basePath: 'voice-media',\n path: '/manual/transcribe',\n method: 'POST',\n authentication: 'owner',\n description: 'Transcribe at most 4 MiB of WebM/Opus, MP4/AAC, or WAV audio, at most 300000 milliseconds.',\n parameters: [\n {\n name: 'x-po-audio-duration-ms',\n in: 'header',\n required: true,\n schema: Type.Integer({ minimum: 0, maximum: 300000 }),\n },\n ],\n body: {\n required: true,\n contentType: 'audio/webm',\n contentTypes: ['audio/webm', 'audio/mp4', 'audio/wav'],\n schema: S,\n },\n responses: { ...Errors, '200': { description: 'Transcript.', schema: Type.Object({ transcript: S }) } },\n },\n ...(\n [\n ['readiness', '/live/agent', 'GET'],\n ['prepare', '/live/agent/prepare', 'POST'],\n ['admit', '/live/agent/admit', 'POST'],\n ['results', '/live/agent/results', 'GET'],\n ['ack', '/live/agent/results/ack', 'POST'],\n ['fence', '/live/agent/fence', 'POST'],\n ['select', '/live/agent/select', 'POST'],\n ['revoke', '/live/agent/revoke', 'POST'],\n ] as const\n ).map(([name, path, method]): PoHttpContract => ({\n id: `voice.agent.${name}`,\n scope: 'session',\n basePath: 'voice',\n path,\n method,\n authentication: 'owner',\n description: `Native Voice agent ${name}. Only the host-issued hub bearer can access this route.`,\n parameters: [\n { name: 'Authorization', in: 'header', required: true, schema: Type.String({ pattern: '^Bearer .+' }) },\n ...(name === 'results'\n ? ['activationId', 'routeGeneration', 'sessionIncarnation', 'after'].map((key) => ({\n name: key,\n in: 'query' as const,\n required: key !== 'after',\n schema: S,\n }))\n : []),\n ],\n ...(method === 'POST'\n ? {\n body: {\n required: true,\n contentType: 'application/json',\n schema:\n name === 'select'\n ? Type.Object({\n activationId: S,\n routeGeneration: Type.Integer({ minimum: 1 }),\n transactionId: S,\n sessionIncarnation: S,\n nativeTransferAllowed: B,\n catalog: Type.Object({\n revision: S,\n targets: Type.Array(Type.Object({ order: Type.Integer({ minimum: 1 }), label: S }), {\n maxItems: 256,\n }),\n }),\n })\n : name === 'revoke'\n ? Type.Object({\n activationId: S,\n routeGeneration: Type.Integer({ minimum: 1 }),\n transactionId: S,\n sessionIncarnation: S,\n })\n : Type.Unknown(),\n },\n }\n : {}),\n responses: {\n ...jsonApiResponses(Type.Unknown()),\n '204': { description: 'Agent result acknowledged or route fenced.' },\n },\n })),\n {\n id: 'voice.peer',\n scope: 'global',\n basePath: 'voice',\n path: '/peer',\n method: 'POST',\n authentication: 'none',\n description: 'Accept an HMAC-authenticated bounded Voice media relay request from a configured peer.',\n body: { required: true, contentType: 'application/json', schema: Type.Unknown() },\n responses: jsonApiResponses(Type.Unknown()),\n },\n {\n id: 'voice.peerOwnership',\n scope: 'global',\n basePath: 'voice',\n path: '/peer-ownership',\n method: 'POST',\n authentication: 'none',\n description: 'Discover and stage Voice ownership through an HMAC-authenticated paired host.',\n body: { required: true, contentType: 'application/json', schema: Type.Unknown() },\n responses: jsonApiResponses(Type.Unknown()),\n },\n {\n id: 'voice.peerAgent',\n scope: 'global',\n basePath: 'voice',\n path: '/peer-agent',\n method: 'POST',\n authentication: 'none',\n description: 'Accept a signed, replay-guarded, grant-scoped native Voice agent request from a configured peer.',\n body: { required: true, contentType: 'application/json', schema: Type.Unknown() },\n responses: jsonApiResponses(Type.Unknown()),\n },\n {\n id: 'voice.relayBinding',\n scope: 'global',\n basePath: 'voice',\n path: '/relay-binding',\n method: 'POST',\n authentication: 'owner',\n description: 'Issue an expiring controller-bound handle for a granted paired Voice session.',\n body: { required: true, contentType: 'application/json', schema: Type.Object({ target: S, connectionId: S }) },\n responses: jsonApiResponses(Type.Object({ binding: S, expiresAt: N })),\n },\n {\n id: 'voice.relay',\n scope: 'global',\n basePath: 'voice',\n path: '/relay',\n method: 'POST',\n authentication: 'owner',\n description: 'Relay a browser Voice media operation through an expiring controller-bound handle.',\n parameters: [{ name: 'binding', in: 'query', required: true, schema: S }],\n body: { required: true, contentType: 'application/json', schema: Type.Unknown() },\n responses: jsonApiResponses(Type.Unknown()),\n },\n {\n id: 'voice.nativeTransfer',\n scope: 'global',\n basePath: 'voice',\n path: '/live/native-transfer',\n method: 'POST',\n authentication: 'owner',\n description: 'Host-only revision-bound native Live transfer. Requires the host hub bearer.',\n parameters: [\n { name: 'Authorization', in: 'header', required: true, schema: Type.String({ pattern: '^Bearer .+' }) },\n ],\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Object({\n sourceSessionId: S,\n activationId: S,\n routeGeneration: Type.Integer({ minimum: 0 }),\n sessionIncarnation: S,\n ordinal: Type.Integer({ minimum: 1 }),\n catalogRevision: S,\n }),\n },\n responses: {\n ...Errors,\n '202': {\n description: 'Transfer requested; source work drains before commit.',\n schema: Type.Object({ requested: Type.Literal(true) }),\n },\n },\n },\n {\n id: 'voice.liveStatus',\n scope: 'global',\n basePath: 'voice',\n path: '/live/status',\n method: 'GET',\n authentication: 'owner',\n description: 'Read the host-global live companion state without activating media.',\n responses: jsonApiResponses(GlobalLiveStatus),\n },\n {\n id: 'voice.liveControl',\n scope: 'global',\n basePath: 'voice',\n path: '/live/control',\n method: 'POST',\n authentication: 'owner',\n description: 'Explicitly activate, transfer, mute, interrupt or end the host-global live companion.',\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Object({\n action: values(['activate', 'transfer', 'mute', 'unmute', 'interrupt', 'end']),\n sessionId: O(S),\n expectedSourceSessionId: O(S),\n }),\n },\n responses: jsonApiResponses(GlobalLiveStatus),\n },\n {\n id: 'voice.readiness',\n scope: 'global',\n basePath: 'voice',\n path: '/readiness',\n method: 'GET',\n authentication: 'owner',\n description: 'Read configured voice readiness.',\n responses: jsonApiResponses(\n Type.Object({\n configured: B,\n transcription: B,\n error: O(S),\n engine: O(S),\n mode: O(S),\n correctionModel: O(S),\n }),\n ),\n },\n ],\n sockets: [\n {\n id: 'voice.control',\n scope: 'session',\n service: voiceControlMethod.service,\n member: voiceControlMethod.method,\n kind: 'method',\n direction: 'client-to-server',\n description: 'Voice session control through the scoped plugin service.',\n input: voiceControlMethod.input,\n output: voiceControlMethod.output,\n },\n ...(['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'voice.wake',\n scope,\n service: 'po.hub',\n member: 'voice_media_wake',\n kind: 'channel' as const,\n direction: 'server-to-client' as const,\n description: 'Voice media wake channel payload.',\n input: Wake,\n },\n {\n id: 'voice.ownership',\n scope,\n service: 'po.hub',\n member: 'voice_ownership',\n kind: 'channel' as const,\n direction: 'server-to-client' as const,\n description: 'Browser media ownership channel payload.',\n input: Type.Object({\n type: Type.Literal('browser-media-session'),\n ...Version,\n activeSessionId: Type.Union([S, Type.Null()]),\n }),\n },\n ]),\n ],\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;AAGA,MAAa,sBAAA,8CAAqBA,CAAAA,CAAAA,qBAAAA,CAAqB;CACrD,SAAS;CACT,QAAQ;CACR,OAAO;CACP,WAAW;CACX,OAAOC,QAAAA,KAAK,OACV;EACE,QAAQA,QAAAA,KAAK,MACX;GAAC;GAAU;GAAU;GAAY;GAAc;GAAU;GAAQ;GAAU;GAAa;EAAU,CAAC,CAAC,KACjG,UAAUA,QAAAA,KAAK,QAAQ,KAAK,CAC/B,CACF;;EAEA,MAAMA,QAAAA,KAAK,SAASA,QAAAA,KAAK,MAAM,CAACA,QAAAA,KAAK,QAAQ,QAAQ,GAAGA,QAAAA,KAAK,QAAQ,MAAM,CAAC,CAAC,CAAC;EAC9E,QAAQA,QAAAA,KAAK,SAASA,QAAAA,KAAK,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;EAClD,UAAUA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO;GAAE,WAAW;GAAG,WAAW;EAAI,CAAC,CAAC;CACvE,GACA,EAAE,sBAAsB,MAAM,CAChC;CACA,QAAQA,QAAAA,KAAK,OACX;EACE,OAAOA,QAAAA,KAAK,OAAO;EACnB,MAAMA,QAAAA,KAAK,OAAO;EAClB,QAAQA,QAAAA,KAAK,OAAO;EACpB,OAAOA,QAAAA,KAAK,QAAQ;EACpB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SAAS,mBAAmB;EAC5B,QAAQ,mBAAmB;EAC3B,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAO,mBAAmB;EAC1B,QAAQ,mBAAmB;CAC7B,GACA,GAAI,CAAC,UAAU,WAAW,CAAC,CAAW,SAAS,UAAU,CACvD;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAO;CACT,GACA;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAOA,QAAAA,KAAK,OAAO;GACjB,MAAMA,QAAAA,KAAK,QAAQ,uBAAuB;GAC1C,GAAG;GACH,iBAAiBA,QAAAA,KAAK,MAAM,CAAC,GAAGA,QAAAA,KAAK,KAAK,CAAC,CAAC;EAC9C,CAAC;CACH,CACF,CAAC,CACH;AACF,CAAC"}
1
+ {"version":3,"file":"apiContracts.cjs","names":["definePoPluginMethod","Type","Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/voiceControl.ts","../src/schemas/apiContracts.ts"],"sourcesContent":["import { definePoPluginMethod } from '@agimon-ai/po-core/pluginProtocol';\nimport { Type } from 'typebox';\n\nexport const voiceControlMethod = definePoPluginMethod({\n service: 'voice',\n method: 'control',\n scope: 'session',\n direction: 'client-to-server',\n input: Type.Object(\n {\n action: Type.Union(\n ['status', 'manual', 'activate', 'deactivate', 'switch', 'mute', 'unmute', 'interrupt', 'transfer'].map(\n (value) => Type.Literal(value),\n ),\n ),\n /** The voice to start (`activate`) or move to (`switch`). `switch` requires it. */\n mode: Type.Optional(Type.Union([Type.Literal('legacy'), Type.Literal('live')])),\n browser: Type.Optional(\n Type.Object(\n {\n clientId: Type.String({ minLength: 1, maxLength: 200 }),\n connectionId: Type.String({ minLength: 1, maxLength: 200 }),\n },\n { additionalProperties: false },\n ),\n ),\n target: Type.Optional(Type.Integer({ minimum: 1 })),\n revision: Type.Optional(Type.String({ minLength: 1, maxLength: 128 })),\n },\n { additionalProperties: false },\n ),\n output: Type.Object(\n {\n state: Type.String(),\n mode: Type.String(),\n manual: Type.String(),\n muted: Type.Boolean(),\n error: Type.Optional(Type.String()),\n },\n { additionalProperties: false },\n ),\n});\n","import { defineApiContract, jsonApiResponses, type PoHttpContract } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nimport { voiceControlMethod } from './voiceControl';\n\nconst S = Type.String();\nconst N = Type.Number();\nconst B = Type.Boolean();\nconst O = Type.Optional;\nconst values = <T extends string>(items: T[]) => Type.Union(items.map((item) => Type.Literal(item)));\nconst Client = { clientId: S, connectionId: S };\nconst Configuration = Type.Object({\n mode: values(['manual', 'autonomous']),\n activityControl: values(['host', 'client']),\n endpointSilenceMs: O(Type.Integer({ minimum: 250 })),\n});\nconst Playback = { playbackId: S, outcome: values(['completed', 'stopped', 'aborted', 'failed']), error: O(S) };\nconst Sequence = { sequence: N };\nconst Control = values(['mute', 'unmute', 'interrupt']);\nconst Browser = Type.Object({\n connection: values(['connecting', 'connected', 'closed', 'failed']),\n listening: B,\n speaking: B,\n muted: B,\n error: O(S),\n});\nexport const VoiceMediaEventSchema = Type.Union([\n Type.Object({\n ...Sequence,\n type: Type.Literal('capture-start'),\n captureId: S,\n sampleRate: Type.Literal(16000),\n channels: Type.Literal(1),\n bitsPerSample: Type.Literal(16),\n configuration: Configuration,\n }),\n Type.Object({ ...Sequence, type: values(['capture-stop', 'capture-abort']), captureId: S }),\n Type.Object({\n ...Sequence,\n type: Type.Literal('playback-start'),\n playbackId: S,\n text: S,\n delivery: O(values(['client', 'streamed'])),\n voice: O(S),\n rate: O(N),\n }),\n Type.Object({ ...Sequence, type: values(['playback-stop', 'playback-abort']), playbackId: S }),\n Type.Object({ ...Sequence, type: values(['realtime-start', 'realtime-stop']), activationId: S }),\n Type.Object({ ...Sequence, type: Type.Literal('realtime-control'), activationId: S, action: Control }),\n Type.Object({ ...Sequence, type: Type.Literal('realtime-send'), activationId: S, messages: Type.Array(S) }),\n Type.Object({ ...Sequence, type: Type.Literal('open-session'), activationId: S, sessionId: S }),\n]);\nconst RealtimeEvent = Type.Union([\n Type.Object({ type: Type.Literal('ready') }),\n Type.Object({ type: Type.Literal('transcript'), role: values(['user', 'assistant']), text: S, complete: B }),\n Type.Object({ type: Type.Literal('request'), requestId: S, text: S }),\n Type.Object({ type: Type.Literal('error'), code: S }),\n]);\nconst RealtimeSnapshot = Type.Object({\n activationId: S,\n state: values(['connecting', 'active', 'closed', 'failed']),\n cursor: N,\n events: Type.Array(Type.Object({ sequence: N, event: RealtimeEvent })),\n browser: O(Browser),\n});\nconst Wake = Type.Object({ eventEpoch: S, sequence: N });\nconst GlobalLiveStatus = Type.Object({\n version: Type.Literal(1),\n state: values(['disabled', 'starting', 'active', 'draining', 'shuttingDown']),\n activeSessionId: Type.Union([S, Type.Null()]),\n selectedSessionId: O(S),\n orchestrator: O(Type.Object({ state: values(['ready', 'opening', 'unavailable']), sessionId: O(S), error: O(S) })),\n muted: B,\n error: O(S),\n media: Type.Object({ client: B, realtime: B }),\n signedIn: O(B),\n});\nconst Version = { version: Type.Literal(3) };\nconst Targets = Type.Array(Type.Object({ handle: S, label: S, order: N }), { maxItems: 32 });\nconst OwnershipAction = values(['catalog', 'prepare', 'activate', 'deactivate', 'readiness', 'fence']);\nconst Acknowledgement = Type.Object({\n ...Version,\n commandId: S,\n action: OwnershipAction,\n ok: B,\n active: B,\n error: O(S),\n});\nconst Command = Type.Object({\n ...Version,\n commandId: S,\n action: OwnershipAction,\n targets: O(Targets),\n catalogRevision: O(S),\n handoffId: O(S),\n controllerId: O(S),\n leaseId: O(S),\n revision: O(N),\n});\nconst Snapshot = Type.Object({\n registration: O(Type.Object({ ...Version, leaseId: S, revision: N, label: S, eligible: B, active: B })),\n targets: Targets,\n catalogRevision: O(S),\n activation: O(Type.Object({ ...Version, requestId: S })),\n handoff: O(Type.Object({ ...Version, requestId: S, handle: S, catalogRevision: S })),\n acknowledgement: O(Acknowledgement),\n});\nconst Errors = Object.fromEntries(\n [400, 404, 409, 410, 413, 415, 429, 500, 502, 503, 504].map((status) => [\n status,\n { description: 'Voice request failed.', schema: Type.Object({ error: S, code: O(S) }) },\n ]),\n);\nconst route = (\n path: string,\n method: 'GET' | 'POST',\n output?: object,\n input?: object,\n query: string[] = [],\n status = 200,\n): PoHttpContract => ({\n id: `voice.${path.slice(1).replaceAll('/', '.')}`,\n scope: 'session',\n basePath: 'voice-media',\n path,\n method,\n authentication: 'owner',\n description: `Voice media ${path}.`,\n ...(path.startsWith('/host/') || path.startsWith('/hub/')\n ? { availability: 'Internal broker route; requires the host-issued bearer token for this route namespace.' }\n : {}),\n parameters: [\n ...query.map((name) => ({ name, in: 'query' as const, required: !['after', 'wait'].includes(name), schema: S })),\n ...(path.startsWith('/host/') || path.startsWith('/hub/')\n ? [\n {\n name: 'Authorization',\n in: 'header' as const,\n required: true,\n schema: Type.String({ pattern: '^Bearer .+' }),\n },\n ]\n : []),\n ],\n ...(input ? { body: { required: true, contentType: 'application/json', schema: input } } : {}),\n responses: {\n ...Errors,\n [output ? status : 204]: {\n description: output ? 'Voice response.' : 'Accepted with no response body.',\n ...(output ? { schema: output } : {}),\n },\n },\n});\nconst pcm = (path: string, method: 'GET' | 'POST', query: string[]): PoHttpContract => {\n const result = route(path, method, undefined, undefined, query);\n result.description =\n 'PCM signed 16-bit little-endian, 16000 Hz, mono. Chunks contain complete samples. Activity headers carry state, level, elapsed time, epoch and speech duration. A 204 response carries x-po-capture-state or x-po-playback-state when applicable.';\n if (method === 'POST') result.body = { required: true, contentType: 'application/vnd.po.pcm-s16le', schema: S };\n else result.responses['200'] = { description: 'PCM bytes.', contentType: 'application/vnd.po.pcm-s16le', schema: S };\n return result;\n};\nexport const apiContracts = defineApiContract({\n version: 1,\n protocols: { 'voice-media': '6', 'voice-ownership': '3' },\n dynamic: ['Realtime event strings and SDP are provider-defined protocol documents passed through the media broker.'],\n http: [\n {\n id: 'voice.status',\n scope: 'session',\n basePath: 'voice',\n path: '/status',\n method: 'GET',\n authentication: 'owner',\n description: 'Voice session status and media readiness.',\n responses: jsonApiResponses(\n Type.Object({\n ...voiceControlMethod.output.properties,\n media: Type.Object({ closed: B, capture: B, playback: B, realtime: B }),\n readiness: Type.Object({\n configured: B,\n transcription: B,\n error: O(S),\n engine: O(S),\n mode: O(S),\n correctionModel: O(S),\n }),\n }),\n ),\n },\n {\n id: 'voice.control.http',\n scope: 'session',\n basePath: 'voice',\n path: '/control',\n method: 'POST',\n authentication: 'owner',\n description: 'Control the voice session.',\n body: { required: true, contentType: 'application/json', schema: voiceControlMethod.input },\n responses: jsonApiResponses(voiceControlMethod.output),\n },\n route(\n '/client/connect',\n 'POST',\n Type.Union([\n Type.Object({ version: Type.Literal(6), cursor: N, eventEpoch: O(S), heartbeatMs: O(N) }),\n Type.Object({ version: Type.Literal(6), standby: Type.Literal(true) }),\n ]),\n Type.Object({\n version: Type.Literal(6),\n ...Client,\n clientKind: values(['browser', 'native']),\n controlLocation: values(['local', 'remote']),\n acceptStandby: O(B),\n claimForActivation: O(B),\n capabilities: Type.Object({\n capture: B,\n playback: B,\n captureActivity: B,\n autonomousOrchestration: B,\n playbackDucking: O(B),\n realtime: O(B),\n }),\n }),\n ),\n route('/client/disconnect', 'POST', undefined, Type.Object(Client)),\n route('/client/heartbeat', 'POST', Wake, Type.Object(Client)),\n {\n ...route('/client/events', 'GET', VoiceMediaEventSchema, undefined, [\n 'clientId',\n 'connectionId',\n 'after',\n 'wait',\n ]),\n responses: {\n ...Errors,\n '200': { description: 'Next event.', schema: VoiceMediaEventSchema },\n '204': { description: 'No pending event.' },\n },\n },\n pcm('/client/audio', 'POST', ['clientId', 'connectionId', 'captureId']),\n route('/client/capture-stopped', 'POST', undefined, Type.Object({ ...Client, captureId: S, error: O(S) })),\n pcm('/client/playback-audio', 'GET', ['clientId', 'connectionId', 'playbackId']),\n route('/client/playback-result', 'POST', undefined, Type.Object({ ...Client, ...Playback })),\n route(\n '/host/capture/start',\n 'POST',\n Type.Object({ configuration: Configuration }),\n Type.Object({ captureId: S, configuration: O(Configuration) }),\n [],\n 201,\n ),\n pcm('/host/capture/audio', 'GET', ['captureId']),\n ...['stop', 'abort'].map((action) =>\n route(`/host/capture/${action}`, 'POST', undefined, Type.Object({ captureId: S })),\n ),\n route(\n '/host/playback/start',\n 'POST',\n Type.Object({ delivery: values(['client', 'streamed']) }),\n Type.Object({ playbackId: S, text: S, voice: O(S), rate: O(N) }),\n [],\n 201,\n ),\n pcm('/host/playback/audio', 'POST', ['playbackId']),\n route('/host/playback/audio-end', 'POST', undefined, Type.Object({ playbackId: S, error: O(S) })),\n {\n ...route('/host/playback/result', 'GET', Type.Object(Playback), undefined, ['playbackId']),\n responses: {\n ...Errors,\n '200': { description: 'Playback outcome.', schema: Type.Object(Playback) },\n '204': { description: 'Playback is pending.' },\n },\n },\n ...['stop', 'abort'].map((action) =>\n route(`/host/playback/${action}`, 'POST', undefined, Type.Object({ playbackId: S })),\n ),\n route('/hub/ownership/state', 'GET', Snapshot),\n route('/hub/ownership/command', 'POST', Acknowledgement, Command),\n route('/host/ownership/sync', 'POST', Type.Object({ command: O(Command) }), Snapshot),\n route(\n '/host/realtime/start',\n 'POST',\n Type.Object({}),\n Type.Object({ activationId: S, instructions: Type.String({ maxLength: 16384 }) }),\n [],\n 201,\n ),\n route('/host/realtime/stop', 'POST', undefined, Type.Object({ activationId: S })),\n route('/host/realtime/poll', 'GET', RealtimeSnapshot, undefined, ['activationId', 'after']),\n route(\n '/host/realtime/send',\n 'POST',\n undefined,\n Type.Object({ activationId: S, messages: Type.Array(S, { maxItems: 64 }) }),\n ),\n route('/host/realtime/control', 'POST', undefined, Type.Object({ activationId: S, action: Control })),\n route(\n '/client/realtime/negotiate',\n 'POST',\n Type.Object({ sdp: S }),\n Type.Object({ ...Client, activationId: S, sdp: S }),\n ),\n route('/client/realtime/event', 'POST', undefined, Type.Object({ ...Client, activationId: S, event: S })),\n route('/client/realtime/state', 'POST', undefined, Type.Object({ ...Client, activationId: S, state: Browser })),\n {\n id: 'voice.manual',\n scope: 'session',\n basePath: 'voice-media',\n path: '/manual/transcribe',\n method: 'POST',\n authentication: 'owner',\n description: 'Transcribe at most 4 MiB of WebM/Opus, MP4/AAC, or WAV audio, at most 300000 milliseconds.',\n parameters: [\n {\n name: 'x-po-audio-duration-ms',\n in: 'header',\n required: true,\n schema: Type.Integer({ minimum: 0, maximum: 300000 }),\n },\n ],\n body: {\n required: true,\n contentType: 'audio/webm',\n contentTypes: ['audio/webm', 'audio/mp4', 'audio/wav'],\n schema: S,\n },\n responses: { ...Errors, '200': { description: 'Transcript.', schema: Type.Object({ transcript: S }) } },\n },\n ...(\n [\n ['readiness', '/live/agent', 'GET'],\n ['feedback', '/live/agent/feedback', 'GET'],\n ['outcome', '/live/agent/outcome', 'GET'],\n ['prepare', '/live/agent/prepare', 'POST'],\n ['admit', '/live/agent/admit', 'POST'],\n ['results', '/live/agent/results', 'GET'],\n ['ack', '/live/agent/results/ack', 'POST'],\n ['fence', '/live/agent/fence', 'POST'],\n ['select', '/live/agent/select', 'POST'],\n ['revoke', '/live/agent/revoke', 'POST'],\n ] as const\n ).map(([name, path, method]): PoHttpContract => ({\n id: `voice.agent.${name}`,\n scope: 'session',\n basePath: 'voice',\n path,\n method,\n authentication: 'owner',\n description: `Native Voice agent ${name}. Only the host-issued hub bearer can access this route.`,\n parameters: [\n { name: 'Authorization', in: 'header', required: true, schema: Type.String({ pattern: '^Bearer .+' }) },\n ...(name === 'results'\n ? ['activationId', 'routeGeneration', 'sessionIncarnation', 'after'].map((key) => ({\n name: key,\n in: 'query' as const,\n required: key !== 'after',\n schema: S,\n }))\n : []),\n ],\n ...(method === 'POST'\n ? {\n body: {\n required: true,\n contentType: 'application/json',\n schema:\n name === 'select'\n ? Type.Object({\n activationId: S,\n routeGeneration: Type.Integer({ minimum: 1 }),\n transactionId: S,\n sessionIncarnation: S,\n nativeTransferAllowed: B,\n catalog: Type.Object({\n revision: S,\n targets: Type.Array(Type.Object({ order: Type.Integer({ minimum: 1 }), label: S }), {\n maxItems: 256,\n }),\n }),\n })\n : name === 'revoke'\n ? Type.Object({\n activationId: S,\n routeGeneration: Type.Integer({ minimum: 1 }),\n transactionId: S,\n sessionIncarnation: S,\n })\n : Type.Unknown(),\n },\n }\n : {}),\n responses: {\n ...jsonApiResponses(Type.Unknown()),\n '204': { description: 'Agent result acknowledged or route fenced.' },\n },\n })),\n {\n id: 'voice.peer',\n scope: 'global',\n basePath: 'voice',\n path: '/peer',\n method: 'POST',\n authentication: 'none',\n description: 'Accept an HMAC-authenticated bounded Voice media relay request from a configured peer.',\n body: { required: true, contentType: 'application/json', schema: Type.Unknown() },\n responses: jsonApiResponses(Type.Unknown()),\n },\n {\n id: 'voice.peerOwnership',\n scope: 'global',\n basePath: 'voice',\n path: '/peer-ownership',\n method: 'POST',\n authentication: 'none',\n description: 'Discover and stage Voice ownership through an HMAC-authenticated paired host.',\n body: { required: true, contentType: 'application/json', schema: Type.Unknown() },\n responses: jsonApiResponses(Type.Unknown()),\n },\n {\n id: 'voice.peerAgent',\n scope: 'global',\n basePath: 'voice',\n path: '/peer-agent',\n method: 'POST',\n authentication: 'none',\n description: 'Accept a signed, replay-guarded, grant-scoped native Voice agent request from a configured peer.',\n body: { required: true, contentType: 'application/json', schema: Type.Unknown() },\n responses: jsonApiResponses(Type.Unknown()),\n },\n {\n id: 'voice.relayBinding',\n scope: 'global',\n basePath: 'voice',\n path: '/relay-binding',\n method: 'POST',\n authentication: 'owner',\n description: 'Issue an expiring controller-bound handle for a granted paired Voice session.',\n body: { required: true, contentType: 'application/json', schema: Type.Object({ target: S, connectionId: S }) },\n responses: jsonApiResponses(Type.Object({ binding: S, expiresAt: N })),\n },\n {\n id: 'voice.relay',\n scope: 'global',\n basePath: 'voice',\n path: '/relay',\n method: 'POST',\n authentication: 'owner',\n description: 'Relay a browser Voice media operation through an expiring controller-bound handle.',\n parameters: [{ name: 'binding', in: 'query', required: true, schema: S }],\n body: { required: true, contentType: 'application/json', schema: Type.Unknown() },\n responses: jsonApiResponses(Type.Unknown()),\n },\n {\n id: 'voice.nativeTransfer',\n scope: 'global',\n basePath: 'voice',\n path: '/live/native-transfer',\n method: 'POST',\n authentication: 'owner',\n description: 'Host-only revision-bound native Live transfer. Requires the host hub bearer.',\n parameters: [\n { name: 'Authorization', in: 'header', required: true, schema: Type.String({ pattern: '^Bearer .+' }) },\n ],\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Object({\n sourceSessionId: S,\n activationId: S,\n routeGeneration: Type.Integer({ minimum: 0 }),\n sessionIncarnation: S,\n ordinal: Type.Integer({ minimum: 1 }),\n catalogRevision: S,\n }),\n },\n responses: {\n ...Errors,\n '202': {\n description: 'Transfer requested; source work drains before commit.',\n schema: Type.Object({ requested: Type.Literal(true) }),\n },\n },\n },\n {\n id: 'voice.liveStatus',\n scope: 'global',\n basePath: 'voice',\n path: '/live/status',\n method: 'GET',\n authentication: 'owner',\n description: 'Read the host-global live companion state without activating media.',\n responses: jsonApiResponses(GlobalLiveStatus),\n },\n {\n id: 'voice.liveControl',\n scope: 'global',\n basePath: 'voice',\n path: '/live/control',\n method: 'POST',\n authentication: 'owner',\n description: 'Explicitly activate, transfer, mute, interrupt or end the host-global live companion.',\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Object({\n action: values(['activate', 'transfer', 'mute', 'unmute', 'interrupt', 'end']),\n sessionId: O(S),\n browser: O(Type.Object(Client)),\n }),\n },\n responses: jsonApiResponses(GlobalLiveStatus),\n },\n {\n id: 'voice.readiness',\n scope: 'global',\n basePath: 'voice',\n path: '/readiness',\n method: 'GET',\n authentication: 'owner',\n description: 'Read configured voice readiness.',\n responses: jsonApiResponses(\n Type.Object({\n configured: B,\n transcription: B,\n error: O(S),\n engine: O(S),\n mode: O(S),\n correctionModel: O(S),\n }),\n ),\n },\n ],\n sockets: [\n {\n id: 'voice.control',\n scope: 'session',\n service: voiceControlMethod.service,\n member: voiceControlMethod.method,\n kind: 'method',\n direction: 'client-to-server',\n description: 'Voice session control through the scoped plugin service.',\n input: voiceControlMethod.input,\n output: voiceControlMethod.output,\n },\n ...(['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'voice.wake',\n scope,\n service: 'po.hub',\n member: 'voice_media_wake',\n kind: 'channel' as const,\n direction: 'server-to-client' as const,\n description: 'Voice media wake channel payload.',\n input: Wake,\n },\n {\n id: 'voice.ownership',\n scope,\n service: 'po.hub',\n member: 'voice_ownership',\n kind: 'channel' as const,\n direction: 'server-to-client' as const,\n description: 'Browser media ownership channel payload.',\n input: Type.Object({\n type: Type.Literal('browser-media-session'),\n ...Version,\n activeSessionId: Type.Union([S, Type.Null()]),\n }),\n },\n ]),\n ],\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;AAGA,MAAa,sBAAA,8CAAqBA,CAAAA,CAAAA,qBAAAA,CAAqB;CACrD,SAAS;CACT,QAAQ;CACR,OAAO;CACP,WAAW;CACX,OAAOC,QAAAA,KAAK,OACV;EACE,QAAQA,QAAAA,KAAK,MACX;GAAC;GAAU;GAAU;GAAY;GAAc;GAAU;GAAQ;GAAU;GAAa;EAAU,CAAC,CAAC,KACjG,UAAUA,QAAAA,KAAK,QAAQ,KAAK,CAC/B,CACF;;EAEA,MAAMA,QAAAA,KAAK,SAASA,QAAAA,KAAK,MAAM,CAACA,QAAAA,KAAK,QAAQ,QAAQ,GAAGA,QAAAA,KAAK,QAAQ,MAAM,CAAC,CAAC,CAAC;EAC9E,SAASA,QAAAA,KAAK,SACZA,QAAAA,KAAK,OACH;GACE,UAAUA,QAAAA,KAAK,OAAO;IAAE,WAAW;IAAG,WAAW;GAAI,CAAC;GACtD,cAAcA,QAAAA,KAAK,OAAO;IAAE,WAAW;IAAG,WAAW;GAAI,CAAC;EAC5D,GACA,EAAE,sBAAsB,MAAM,CAChC,CACF;EACA,QAAQA,QAAAA,KAAK,SAASA,QAAAA,KAAK,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;EAClD,U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C,CACH;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBA8Ja"}
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAiKa"}
@@ -21,6 +21,16 @@ const voiceControlMethod = definePoPluginMethod({
21
21
  ].map((value) => Type.Literal(value))),
22
22
  /** The voice to start (`activate`) or move to (`switch`). `switch` requires it. */
23
23
  mode: Type.Optional(Type.Union([Type.Literal("legacy"), Type.Literal("live")])),
24
+ browser: Type.Optional(Type.Object({
25
+ clientId: Type.String({
26
+ minLength: 1,
27
+ maxLength: 200
28
+ }),
29
+ connectionId: Type.String({
30
+ minLength: 1,
31
+ maxLength: 200
32
+ })
33
+ }, { additionalProperties: false })),
24
34
  target: Type.Optional(Type.Integer({ minimum: 1 })),
25
35
  revision: Type.Optional(Type.String({
26
36
  minLength: 1,
@@ -124,6 +134,12 @@ const VoiceMediaEventSchema = Type.Union([
124
134
  type: Type.Literal("realtime-send"),
125
135
  activationId: S,
126
136
  messages: Type.Array(S)
137
+ }),
138
+ Type.Object({
139
+ ...Sequence,
140
+ type: Type.Literal("open-session"),
141
+ activationId: S,
142
+ sessionId: S
127
143
  })
128
144
  ]);
129
145
  const RealtimeEvent = Type.Union([
@@ -173,6 +189,16 @@ const GlobalLiveStatus = Type.Object({
173
189
  "shuttingDown"
174
190
  ]),
175
191
  activeSessionId: Type.Union([S, Type.Null()]),
192
+ selectedSessionId: O(S),
193
+ orchestrator: O(Type.Object({
194
+ state: values([
195
+ "ready",
196
+ "opening",
197
+ "unavailable"
198
+ ]),
199
+ sessionId: O(S),
200
+ error: O(S)
201
+ })),
176
202
  muted: B,
177
203
  error: O(S),
178
204
  media: Type.Object({
@@ -367,6 +393,7 @@ const apiContracts = defineApiContract({
367
393
  clientKind: values(["browser", "native"]),
368
394
  controlLocation: values(["local", "remote"]),
369
395
  acceptStandby: O(B),
396
+ claimForActivation: O(B),
370
397
  capabilities: Type.Object({
371
398
  capture: B,
372
399
  playback: B,
@@ -515,6 +542,16 @@ const apiContracts = defineApiContract({
515
542
  "/live/agent",
516
543
  "GET"
517
544
  ],
545
+ [
546
+ "feedback",
547
+ "/live/agent/feedback",
548
+ "GET"
549
+ ],
550
+ [
551
+ "outcome",
552
+ "/live/agent/outcome",
553
+ "GET"
554
+ ],
518
555
  [
519
556
  "prepare",
520
557
  "/live/agent/prepare",
@@ -754,7 +791,7 @@ const apiContracts = defineApiContract({
754
791
  "end"
755
792
  ]),
756
793
  sessionId: O(S),
757
- expectedSourceSessionId: O(S)
794
+ browser: O(Type.Object(Client))
758
795
  })
759
796
  },
760
797
  responses: jsonApiResponses(GlobalLiveStatus)