@simonpeacocks/peacockery-voice-client 0.1.0 → 0.1.3

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.
package/README.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  The request and response types in `src/schema.ts` are generated from the service's checked-in `openapi.json`. The small runtime wrapper uses `openapi-fetch` and accepts either the `lab` or `production` environment.
4
4
 
5
- Install it from the private repository:
5
+ Install it from npm:
6
6
 
7
7
  ```bash
8
- pnpm add '@chikingsley/peacockery-voice-client@github:chikingsley/peacockery-voice#main&path:/clients/typescript'
8
+ pnpm add @simonpeacocks/peacockery-voice-client
9
9
  ```
10
10
 
11
11
  ```ts
12
- import { createPeacockeryVoiceClient } from "@chikingsley/peacockery-voice-client";
12
+ import { createPeacockeryVoiceClient } from "@simonpeacocks/peacockery-voice-client";
13
13
 
14
14
  const voice = createPeacockeryVoiceClient({
15
15
  apiKey: process.env.PEACOCKERY_VOICE_API_KEY!,
@@ -23,4 +23,22 @@ For a device-bound child, pass `authorizationScheme: "DPoP"` and a platform proo
23
23
 
24
24
  Private-key creation and signing stay in platform code. On Apple hardware the intended provider uses a non-exportable Secure Enclave P-256 key; the generated client never serializes or persists that key.
25
25
 
26
- Run `pnpm run generate:sdk` from the repository root whenever the OpenAPI contract changes. Compiled JavaScript and declarations are checked in so a private Git installation does not need to execute package lifecycle scripts. Realtime WebSockets still use the protocol documented by `/v1/realtime`; `openapi-fetch` covers the HTTP surface.
26
+ Run `pnpm run generate:sdk` from the repository root whenever the OpenAPI contract changes. Compiled JavaScript and declarations are checked in, and private Git installations consume them directly. Realtime WebSockets still use the protocol documented by `/v1/realtime`; `openapi-fetch` covers the HTTP surface.
27
+
28
+ ## Release
29
+
30
+ Run one guarded command from a clean, synchronized `main` branch:
31
+
32
+ ```bash
33
+ pnpm release:voice-client patch
34
+ ```
35
+
36
+ The command regenerates the SDK, validates the TypeScript client and Swift package when Swift is available, increments the requested semantic version, commits only generated client release files, creates the matching `voice-client-vX.Y.Z` tag, atomically pushes `main` and the tag, watches the GitHub Actions publication, and verifies the new npm version.
37
+
38
+ Use `minor`, `major`, or an explicit stable version in place of `patch`. Run the complete preflight while keeping the repository unchanged with:
39
+
40
+ ```bash
41
+ pnpm release:voice-client patch --check
42
+ ```
43
+
44
+ If GitHub Actions reports a provider-side failure after the atomic push, repair the publisher configuration and rerun that workflow. The existing version commit and release tag remain the canonical release identity.
package/dist/schema.d.ts CHANGED
@@ -1977,8 +1977,7 @@ export interface components {
1977
1977
  /** @enum {string} */
1978
1978
  kind: "language" | "transcription";
1979
1979
  provider: string;
1980
- /** @enum {string} */
1981
- reasoning_profile?: "low" | "medium" | "minimal" | "none";
1980
+ reasoning?: components["schemas"]["LanguageModelReasoningSpec"];
1982
1981
  routes?: {
1983
1982
  batch?: components["schemas"]["AsrRouteSpec"];
1984
1983
  realtime?: components["schemas"]["AsrRouteSpec"];
@@ -2003,6 +2002,11 @@ export interface components {
2003
2002
  source: "artificial-analysis";
2004
2003
  source_version: string;
2005
2004
  };
2005
+ LanguageModelReasoningSpec: {
2006
+ /** @enum {string} */
2007
+ default_effort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2008
+ supported_efforts: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh")[];
2009
+ };
2006
2010
  AsrRouteSpec: {
2007
2011
  model: string;
2008
2012
  provider: string;
@@ -2025,6 +2029,7 @@ export interface components {
2025
2029
  completed_at: string | null;
2026
2030
  created_at: string;
2027
2031
  error: string | null;
2032
+ error_details: components["schemas"]["ProviderFailureDiagnostic"];
2028
2033
  job_id: string;
2029
2034
  /** @enum {string} */
2030
2035
  kind: "transcription";
@@ -2036,6 +2041,17 @@ export interface components {
2036
2041
  status: "pending" | "queued" | "running" | "succeeded" | "failed";
2037
2042
  updated_at: string;
2038
2043
  };
2044
+ ProviderFailureDiagnostic: {
2045
+ /** @enum {string} */
2046
+ category: "authentication" | "empty_output" | "invalid_request" | "network" | "rate_limited" | "timeout" | "unavailable" | "unknown";
2047
+ message: string;
2048
+ provider?: string;
2049
+ providerCode?: string;
2050
+ requestId?: string;
2051
+ retryAfterMs?: number;
2052
+ retryable: boolean;
2053
+ statusCode?: number;
2054
+ } | null;
2039
2055
  TranscriptionArtifact: {
2040
2056
  content: {
2041
2057
  audio_events: {
@@ -2193,17 +2209,28 @@ export interface components {
2193
2209
  [key: string]: unknown;
2194
2210
  };
2195
2211
  };
2212
+ /**
2213
+ * @deprecated
2214
+ * @description Accepted for client compatibility. Transcription jobs are always queued and returned immediately.
2215
+ */
2196
2216
  sync?: boolean;
2197
2217
  };
2198
2218
  TextResponse: {
2219
+ cache: components["schemas"]["TextCacheStatuses"];
2220
+ context: components["schemas"]["TextExecutionContext"];
2199
2221
  finishReason: string;
2200
2222
  model: string;
2201
2223
  provider: string;
2202
2224
  providerLatencyMs: number;
2203
2225
  upstreamModel: string;
2204
2226
  usage: {
2227
+ cacheReadTokens?: number;
2228
+ cacheWriteTokens?: number;
2205
2229
  inputTokens?: number;
2206
2230
  outputTokens?: number;
2231
+ providerCostUsd?: number;
2232
+ reasoningTokens?: number;
2233
+ textTokens?: number;
2207
2234
  totalTokens?: number;
2208
2235
  };
2209
2236
  warnings?: unknown[];
@@ -2213,14 +2240,21 @@ export interface components {
2213
2240
  /** @enum {string} */
2214
2241
  outputType: "object";
2215
2242
  } | {
2243
+ cache: components["schemas"]["TextCacheStatuses"];
2244
+ context: components["schemas"]["TextExecutionContext"];
2216
2245
  finishReason: string;
2217
2246
  model: string;
2218
2247
  provider: string;
2219
2248
  providerLatencyMs: number;
2220
2249
  upstreamModel: string;
2221
2250
  usage: {
2251
+ cacheReadTokens?: number;
2252
+ cacheWriteTokens?: number;
2222
2253
  inputTokens?: number;
2223
2254
  outputTokens?: number;
2255
+ providerCostUsd?: number;
2256
+ reasoningTokens?: number;
2257
+ textTokens?: number;
2224
2258
  totalTokens?: number;
2225
2259
  };
2226
2260
  warnings?: unknown[];
@@ -2228,7 +2262,17 @@ export interface components {
2228
2262
  outputType: "text";
2229
2263
  text: string;
2230
2264
  };
2265
+ TextCacheStatuses: {
2266
+ cloudflare?: string;
2267
+ openRouter?: string;
2268
+ };
2269
+ TextExecutionContext: {
2270
+ conversationId?: string;
2271
+ requestId: string;
2272
+ turnId: string;
2273
+ };
2231
2274
  TextRequest: {
2275
+ context?: components["schemas"]["TextRequestContext"];
2232
2276
  maxOutputTokens?: number;
2233
2277
  messages: components["schemas"]["TextMessage"][];
2234
2278
  model: string;
@@ -2244,20 +2288,39 @@ export interface components {
2244
2288
  providerOptions?: {
2245
2289
  [key: string]: unknown;
2246
2290
  };
2291
+ reasoning?: components["schemas"]["TextReasoningRequest"];
2292
+ routing?: components["schemas"]["TextRoutingRequest"];
2247
2293
  temperature?: number;
2248
2294
  };
2295
+ TextRequestContext: {
2296
+ conversationId?: string;
2297
+ turnId?: string;
2298
+ };
2249
2299
  TextMessage: {
2250
2300
  content: string;
2251
2301
  /** @enum {string} */
2252
2302
  role: "assistant" | "system" | "user";
2253
2303
  };
2304
+ TextReasoningRequest: {
2305
+ /** @enum {string} */
2306
+ effort: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2307
+ };
2308
+ TextRoutingRequest: {
2309
+ attemptTimeoutMs?: number;
2310
+ fallbackModels?: string[];
2311
+ /** @enum {string} */
2312
+ transport?: "gateway" | "direct";
2313
+ };
2254
2314
  TextStreamRequest: {
2315
+ context?: components["schemas"]["TextRequestContext"];
2255
2316
  maxOutputTokens?: number;
2256
2317
  messages: components["schemas"]["TextMessage"][];
2257
2318
  model: string;
2258
2319
  providerOptions?: {
2259
2320
  [key: string]: unknown;
2260
2321
  };
2322
+ reasoning?: components["schemas"]["TextReasoningRequest"];
2323
+ routing?: components["schemas"]["TextRoutingRequest"];
2261
2324
  temperature?: number;
2262
2325
  };
2263
2326
  RealtimeSessionResult: {
@@ -2294,6 +2357,8 @@ export interface components {
2294
2357
  UsageDailyRow: {
2295
2358
  account_key: string;
2296
2359
  asr_seconds: number;
2360
+ cache_read_tokens: number;
2361
+ cache_write_tokens: number;
2297
2362
  day: string;
2298
2363
  estimated_cost_complete: boolean;
2299
2364
  /** @description Estimated provider cost in millionths of one US dollar. This is not an invoice amount. */
@@ -2306,6 +2371,9 @@ export interface components {
2306
2371
  model: string;
2307
2372
  output_tokens: number;
2308
2373
  provider: string;
2374
+ provider_cost_micro_usd: number;
2375
+ provider_cost_request_count: number;
2376
+ provider_cost_usd: number;
2309
2377
  provider_latency_ms: number;
2310
2378
  request_count: number;
2311
2379
  total_tokens: number;
@@ -2315,6 +2383,8 @@ export interface components {
2315
2383
  };
2316
2384
  UsageTotals: {
2317
2385
  asr_seconds: number;
2386
+ cache_read_tokens: number;
2387
+ cache_write_tokens: number;
2318
2388
  /** @description True only when every included request has both measured usage and a matching price. */
2319
2389
  estimated_cost_complete: boolean;
2320
2390
  /** @description Estimated provider cost in millionths of one US dollar. This is not an invoice amount. */
@@ -2324,6 +2394,9 @@ export interface components {
2324
2394
  estimated_cost_usd: number;
2325
2395
  input_tokens: number;
2326
2396
  output_tokens: number;
2397
+ provider_cost_micro_usd: number;
2398
+ provider_cost_request_count: number;
2399
+ provider_cost_usd: number;
2327
2400
  provider_latency_ms: number;
2328
2401
  request_count: number;
2329
2402
  total_tokens: number;
@@ -2334,6 +2407,10 @@ export interface components {
2334
2407
  recent_request_logs: {
2335
2408
  account_key: string;
2336
2409
  asr_seconds: number | null;
2410
+ cache_read_tokens: number | null;
2411
+ cache_write_tokens: number | null;
2412
+ cloudflare_cache_status: string | null;
2413
+ conversation_id: string | null;
2337
2414
  created_at: string;
2338
2415
  error: string | null;
2339
2416
  /** @description Estimated provider cost in millionths of one US dollar. This is not an invoice amount. */
@@ -2347,6 +2424,7 @@ export interface components {
2347
2424
  /** @enum {string} */
2348
2425
  kind: "asr" | "llm" | "realtime_asr";
2349
2426
  model: string;
2427
+ openrouter_cache_status: string | null;
2350
2428
  output_tokens: number | null;
2351
2429
  price_basis: string | null;
2352
2430
  price_effective_at: string | null;
@@ -2356,10 +2434,13 @@ export interface components {
2356
2434
  /** @enum {string|null} */
2357
2435
  price_unit: "audio_second" | "token" | null;
2358
2436
  provider: string;
2437
+ provider_cost_micro_usd: number | null;
2438
+ provider_cost_usd: number | null;
2359
2439
  provider_latency_ms: number | null;
2360
2440
  route: string | null;
2361
2441
  status: number | null;
2362
2442
  total_tokens: number | null;
2443
+ turn_id: string | null;
2363
2444
  upstream_model: string | null;
2364
2445
  }[];
2365
2446
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonpeacocks/peacockery-voice-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "Generated TypeScript client for the Peacockery Voice API",
5
5
  "type": "module",
6
6
  "license": "MIT",