@alia.onl/sdk 22.4.0 → 22.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @alia.onl/sdk
2
2
 
3
+ ## 22.6.0
4
+
5
+ - **`@alia.onl/sdk/dictation`: dictation's request on its own.** `requestTranscription`,
6
+ `DictationError`, `dictationFailureCode`, `normalizeAudioMediaType` and `MAX_DICTATION_MS`, the
7
+ same functions `useDictation` and `AliaComposer` use, from an entry that reaches no React, no
8
+ native module, no recorder and no Oxy client (`check:entries` holds it). An app that records
9
+ its own audio (Astro's browser shell) sends its clips from here instead of keeping a copy of
10
+ the request. Nothing changes for the root entry, which still exports `requestTranscription`
11
+ and `DictationError`.
12
+
13
+ ## 22.5.0
14
+
15
+ - **`AliaApi.put`.** The REST API (`useAliaApi`, `createAliaApi`) sends PUT like PATCH: the
16
+ linked Oxy client's authentication and 401 replay, the app assertion and a JSON body. Alia's
17
+ memory profile takes its sections by PUT (`/memory/context`, `/memory/preferences`,
18
+ `/memory/settings`), so a host's personalization settings can save them without its own client.
19
+
3
20
  ## 22.4.0
4
21
 
5
22
  - **A shared conversation shows its artifacts.** `readSharedConversation` keeps an assistant
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alia.onl/sdk",
3
- "version": "22.4.0",
3
+ "version": "22.6.0",
4
4
  "description": "Alia AI chat SDK — the conversation runtime, chat UI, voice calls and dictation for Oxy apps",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -13,6 +13,7 @@
13
13
  "./avatar": "./src/avatar.ts",
14
14
  "./content": "./src/lib/content-utils.ts",
15
15
  "./csp": "./src/csp.ts",
16
+ "./dictation": "./src/dictation.ts",
16
17
  "./model": "./src/runtime/model.ts",
17
18
  "./runtime": "./src/runtime/index.ts",
18
19
  "./text": "./src/text.ts",
@@ -0,0 +1,20 @@
1
+ // @alia.onl/sdk/dictation — dictation's request, without a component, a hook or a recorder
2
+ // `POST /v1/audio/transcriptions` (ADR 0017 §7) as plain functions: an app that records audio its
3
+ // own way (Astro's browser shell) sends its clips from here and reaches no React, no native module
4
+ // and no Oxy client. `useDictation` and `AliaComposer` use the same request.
5
+
6
+ export {
7
+ DictationError,
8
+ dictationFailureCode,
9
+ MAX_DICTATION_MS,
10
+ normalizeAudioMediaType,
11
+ requestTranscription,
12
+ } from './lib/dictation';
13
+ export type {
14
+ DictationClip,
15
+ DictationErrorCode,
16
+ TranscriptionRequest,
17
+ TranscriptionResult,
18
+ } from './lib/dictation';
19
+ export type { AudioRequestAuthentication } from './lib/audio-request-auth';
20
+ export type { VoiceErrorCode } from './lib/speech-messages';
@@ -44,6 +44,8 @@ export interface AliaApi {
44
44
  get<T>(path: string, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
45
45
  post<T>(path: string, body?: unknown, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
46
46
  patch<T>(path: string, body?: unknown, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
47
+ /** Replaces a resource whole, for the routes that take PUT (the memory profile's sections). */
48
+ put<T>(path: string, body?: unknown, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
47
49
  delete<T>(path: string, request?: AliaApiRequest): Promise<AliaApiResult<T>>;
48
50
  }
49
51
 
@@ -95,7 +97,7 @@ export function createAliaApi(
95
97
  appAssertionHeaders: AppAssertionHeaders = NO_APP_ASSERTION,
96
98
  ): AliaApi {
97
99
  async function send<T>(
98
- method: 'GET' | 'POST' | 'PATCH' | 'DELETE',
100
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',
99
101
  path: string,
100
102
  request: AliaApiRequest = {},
101
103
  ): Promise<AliaApiResult<T>> {
@@ -125,6 +127,7 @@ export function createAliaApi(
125
127
  get: (path, request) => send('GET', path, request),
126
128
  post: (path, body, request) => send('POST', path, { ...request, body: body ?? {} }),
127
129
  patch: (path, body, request) => send('PATCH', path, { ...request, body: body ?? {} }),
130
+ put: (path, body, request) => send('PUT', path, { ...request, body: body ?? {} }),
128
131
  delete: (path, request) => send('DELETE', path, request),
129
132
  };
130
133
  }