arcane-os 0.5.14 → 0.5.16

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
@@ -2,6 +2,32 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.5.16
6
+
7
+ - Add optional Markdown narration filtering before `AI.streamTTS()`
8
+ segmentation. Omit repeated same formatting marks across streamed chunks,
9
+ preserve single marks and ordinary punctuation, and clear formatting state
10
+ on terminal flush or cancellation. Keep plain speech, displayed and stored
11
+ text, language, voice, synthesis capacity, and audio scheduling unchanged.
12
+ - Select Markdown narration in shared chat and include focused filter test
13
+ source without adding a parser dependency.
14
+
15
+ ## 0.5.15
16
+
17
+ - Let `SpeechPlayback.prepare()` submit every complete segment immediately when
18
+ an `AI.fetchTTS` client advertises positive TTS execution capacity. The AI
19
+ provider queue retains bounded FIFO admission (four synthesis slots by
20
+ default), while indexed Blob URLs keep playback in exact input order even
21
+ when later segments finish first.
22
+ - Preserve the serialized one-segment-lookahead path for native and custom
23
+ speech clients that do not advertise provider execution capacity. Pause and
24
+ Resume keep the same audio element; Stop aborts all owned synthesis; Replay
25
+ retains completed and pending provider segments while retrying only failed
26
+ missing segments, including failures with falsy rejection values.
27
+ - Add basic copyable `SpeechPlayback` examples and synchronize the installed
28
+ reference, current release identities, generated documentation site, and
29
+ focused behavioral contract source for the new admission model.
30
+
5
31
  ## 0.5.14
6
32
 
7
33
  - Add the shared `arcane-os/logging` console owner using the existing
package/README.md CHANGED
@@ -19,7 +19,7 @@ version-locked SDK runtime, while an integrated Arcane checkout uses its live
19
19
  `arcane/` runtime. Both profiles preserve the same app URLs, theme, packaging,
20
20
  event, cancellation, and browser run contracts.
21
21
 
22
- This checkout defines the `0.5.12` SDK contract. Applications pin one exact npm
22
+ This checkout defines the `0.5.16` SDK contract. Applications pin one exact npm
23
23
  version and lockfile; registry state is deliberately not baked into application
24
24
  artifacts.
25
25
 
@@ -35,7 +35,7 @@ Create one browser application, install its pinned SDK, and start its source
35
35
  server:
36
36
 
37
37
  ```bash
38
- npx arcane-os@0.5.12 new hello-speech --path ./hello-speech --target browser
38
+ npx arcane-os@0.5.16 new hello-speech --path ./hello-speech --target browser
39
39
  cd hello-speech
40
40
  npm install
41
41
  npm run dev
@@ -51,6 +51,10 @@ For a first spoken sentence, copy the application-owned
51
51
  beside `App.js`, then use this module. That one configuration file defines the
52
52
  upstream runtime, model, dtype, and voice. This module creates the application's
53
53
  DBOPFS store; the SDK creates and manages its speech providers and Workers.
54
+ The linked automatic/WebGPU-first selection uses `fp32` because
55
+ [Kokoro.js recommends `fp32` when using WebGPU](https://github.com/hexgrad/kokoro/tree/main/kokoro.js#usage).
56
+ Its `selectedDevice` status reports the loaded route, not speech correctness or
57
+ audio quality.
54
58
 
55
59
  ```javascript
56
60
  import arcaneThemeReady from 'arcane/ThemeBootstrap';
@@ -103,6 +107,31 @@ order, but playback waits for earlier segments and plays exact input order.
103
107
  Each slot owns a Worker/model session, so raising capacity trades memory for
104
108
  latency.
105
109
 
110
+ If your app already has complete segments in an array, let the shared
111
+ `SpeechPlayback` owner submit them as soon as they are available:
112
+
113
+ ```javascript
114
+ import SpeechPlayback from 'arcane/SpeechPlayback';
115
+
116
+ const audio = document.body.appendChild(document.createElement('audio'));
117
+ audio.controls = true;
118
+ const narration = new SpeechPlayback({audio, speech: ai});
119
+ const speakAll = document.body.appendChild(document.createElement('button'));
120
+ speakAll.textContent = 'Speak all segments';
121
+ speakAll.addEventListener('click', async function speakAllSegments() {
122
+ await ai.setSpeechMuted(false);
123
+ await narration.prepare({
124
+ parts: ['First segment.', 'Second segment.', 'Third segment.'],
125
+ autoplay: true
126
+ });
127
+ });
128
+ ```
129
+
130
+ With browser speech's default `auto` / 4 configuration, all three complete
131
+ segments enter the provider queue immediately, up to four synthesize at once,
132
+ and the audio still plays first, second, third. Native or custom speech without
133
+ advertised provider execution capacity stays serialized with one lookahead.
134
+
106
135
  Continue with [streaming chunks, device selection, cancellation, status, and cleanup](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/ai/browser-speech.md),
107
136
  the [tiny TWiN Cloud request and saved-preference migration](https://github.com/TheWizardNexus/arcane-os-sdk/blob/main/docs/reference/ai/twin-cloud.md),
108
137
  or the [maintained WASM voice-chat example](https://github.com/TheWizardNexus/arcane-os-sdk/tree/main/examples/wasm-ai-demo).
@@ -276,6 +305,14 @@ keeping apostrophes, commas, and hyphens that join Unicode letters or numbers
276
305
  inside the same segment.
277
306
  Mute, stop, provider transition, and cancellation still govern the whole queue.
278
307
 
308
+ For raw Markdown narration, use
309
+ `ai.streamTTS(text,false,{textFormat:'markdown'})`. The SDK removes repeated
310
+ same formatting marks (`*`, `#`, `_`, backtick, `~`) before segmentation,
311
+ including runs split across chunks. Single punctuation and ordinary repeated
312
+ punctuation remain literal. The format lasts through `finishTTS()`; new
313
+ streams default to exact plain text. Shared chat selects Markdown mode while
314
+ preserving original messages for display and storage.
315
+
279
316
  The SDK runtime also owns `DBOPFSDocumentLibrary`,
280
317
  `DocumentLexicalSearch`, and `PersistentAIChatSession`. Document bootstrap is
281
318
  schema-driven and explicit; chat never searches a corpus unless the app wires
@@ -297,7 +334,7 @@ uses the same controller for automatic memory extraction.
297
334
  Create a new repository-shaped Arcane application with the exact stable SDK:
298
335
 
299
336
  ```bash
300
- npx arcane-os@0.5.12 new my-app --path ./my-app --target portable --git
337
+ npx arcane-os@0.5.16 new my-app --path ./my-app --target portable --git
301
338
  cd my-app
302
339
  npm install
303
340
  npm run dev
@@ -307,7 +344,7 @@ To enroll an existing repository, install the exact SDK and initialize only
307
344
  missing Arcane files:
308
345
 
309
346
  ```bash
310
- npm install --save-dev --save-exact arcane-os@0.5.12
347
+ npm install --save-dev --save-exact arcane-os@0.5.16
311
348
  npm exec -- arcane init my-app --target portable
312
349
  ```
313
350
 
@@ -323,7 +360,7 @@ npm exec -- arcane-os targets
323
360
  No global SDK install or standalone Arcane CLI is required. The application
324
361
  repository's exact npm dependency and lockfile own the CLI and toolchain version.
325
362
 
326
- Use `npx arcane-os@0.5.12` for the initial bootstrap because it names this npm
363
+ Use `npx arcane-os@0.5.16` for the initial bootstrap because it names this npm
327
364
  package explicitly; bare `npx arcane` outside an installed project could resolve
328
365
  a different package. Both installed commands invoke the same headless toolchain.
329
366
  Project-local npm scripts use the SDK pinned by that app's `package-lock.json`,
@@ -343,7 +380,7 @@ node ./bin/arcane.mjs new local-app --path ../local-app --target portable --git
343
380
 
344
381
  # From the generated app repository
345
382
  cd ../local-app
346
- npm install --save-dev --save-exact ../arcane-os-sdk/arcane-os-0.5.12.tgz
383
+ npm install --save-dev --save-exact ../arcane-os-sdk/arcane-os-0.5.16.tgz
347
384
  npm ci
348
385
  ```
349
386
 
@@ -352,7 +389,7 @@ same location. The lockfile retains the selected package dependency while
352
389
  Arcane uses the installed package name and version. Local directory `file:` dependencies are not
353
390
  accepted because npm may install them as links; use a packed `.tgz`. A GitHub
354
391
  runner also needs that tarball at the locked path. After publication, replace
355
- the local declaration with the exact `arcane-os@0.5.12` registry package and
392
+ the local declaration with the exact `arcane-os@0.5.16` registry package and
356
393
  commit the regenerated lock.
357
394
 
358
395
  Generated repositories use `npm ci --ignore-scripts` in CI. Run dependency
@@ -491,7 +528,7 @@ package installation, or assertions.
491
528
 
492
529
  ## Current target support
493
530
 
494
- Version `0.5.12` exposes one browser target and five explicitly paired
531
+ Version `0.5.16` exposes one browser target and five explicitly paired
495
532
  native development targets: a non-runnable portable directory, a
496
533
  Windows x64 unsigned-local-test EXE bundle, Linux x64 and Linux ARM64
497
534
  unsigned-local-test DEBs, and an Android development-signed APK. The
@@ -279,7 +279,7 @@ paths are withheld from the native provider. The provider copies the complete
279
279
  selected release rather than accepting an unrelated source path. Verification
280
280
  is a separate explicit operation for a selected release artifact.
281
281
 
282
- The SDK `0.5.12` runtime requires Arcane `0.8.12` or newer. Compatibility
282
+ The SDK `0.5.16` runtime requires Arcane `0.8.12` or newer. Compatibility
283
283
  is contractual rather than exact-version pinning: the prepared Core must meet
284
284
  the highest minimum declared by the runtime, selected app, and bundled app
285
285
  dependencies; keep each app's Arcane protocol generation; and provide every
@@ -17,7 +17,7 @@ high-level page links to the relevant deep section instead of repeating it.
17
17
  Install the SDK in your application:
18
18
 
19
19
  ```sh
20
- npm install --save-exact arcane-os@0.5.14
20
+ npm install --save-exact arcane-os@0.5.16
21
21
  ```
22
22
 
23
23
  For your first AI call, follow the [TWiN Cloud quick start](ai/twin-cloud.md).
@@ -41,6 +41,7 @@ alone does not make bare module names resolve in a browser.
41
41
  | Import a shipped renderer module | [Runtime module catalog](runtime-modules.md) |
42
42
  | Use a shared entity | [Runtime entity modules](runtime-entities.md) and [exact export contracts](core/arcane-entities.md) |
43
43
  | Load a reusable HTML component | [Runtime component catalog](runtime-components.md) |
44
+ | Submit complete speech parts immediately and play them in order | [`SpeechPlayback`](runtime-modules.md#speechplaybackjs) and the [basic browser example](ai/browser-speech.md#play-a-complete-array-with-speechplayback) |
44
45
  | Call `globalThis.Arcane` | [Arcane Core API](core/arcane-api.md) |
45
46
  | Subscribe to native events | [Arcane event reference](core/arcane-events.md) |
46
47
  | Use provider-neutral AI lifecycle, chat, speech, persistence, or document context | [Normalized AI](#normalized-ai) |
@@ -57,9 +58,9 @@ This repository contains explicitly versioned surfaces with different owners:
57
58
 
58
59
  | Surface | Source identity | Meaning |
59
60
  | --- | --- | --- |
60
- | SDK and CLI | `arcane-os` `0.5.14` | The Node.js toolchain, portable `arcane-os/event-manager`, `arcane-os/logging`, `arcane-os/mail`, `arcane-os/preference-store`, and `arcane-os/speech-playback` entrypoints, plus the browser-only `arcane-os/ai/browser-wasm` and `arcane-os/ai/browser-speech` entrypoints in this checkout. |
61
- | Browser runtime | SDK `0.5.14`, protocol `arcane/1`, `runtime/` | The SDK-canonical runtime tree. `listRuntimeFiles()`, `readRuntimeFile()`, and `loadRuntimeRelease()` derive its current inventory directly from the selected directory. |
62
- | Browser SDK runtime | SDK `0.5.14`, `browser-runtime/` | The browser closure for events, shared logging, Wllama, and Browser Speech mechanisms. `listSdkBrowserRuntimeFiles()`, `readSdkBrowserRuntimeFile()`, and `loadSdkBrowserRuntimeRelease()` derive its current inventory directly from the selected directory. |
61
+ | SDK and CLI | `arcane-os` `0.5.16` | The Node.js toolchain, portable `arcane-os/event-manager`, `arcane-os/logging`, `arcane-os/mail`, `arcane-os/preference-store`, and `arcane-os/speech-playback` entrypoints, plus the browser-only `arcane-os/ai/browser-wasm` and `arcane-os/ai/browser-speech` entrypoints in this checkout. |
62
+ | Browser runtime | SDK `0.5.16`, protocol `arcane/1`, `runtime/` | The SDK-canonical runtime tree. `listRuntimeFiles()`, `readRuntimeFile()`, and `loadRuntimeRelease()` derive its current inventory directly from the selected directory. |
63
+ | Browser SDK runtime | SDK `0.5.16`, `browser-runtime/` | The browser closure for events, shared logging, Wllama, and Browser Speech mechanisms. `listSdkBrowserRuntimeFiles()`, `readSdkBrowserRuntimeFile()`, and `loadSdkBrowserRuntimeRelease()` derive its current inventory directly from the selected directory. |
63
64
  | Core reference snapshot | Arcane OS commit `567ad110bf57a1c2d4a3daa22ae93716cc5f4d7e`, protocol `arcane/1` | The application-facing Core contract imported into `docs/reference/core/`, with SDK-local links and package-boundary notes added explicitly. |
64
65
 
65
66
  The SDK runtime source and Core reference have different owners. A browser
@@ -74,7 +75,7 @@ and the distinction between a documentation snapshot and the selected runtime.
74
75
 
75
76
  ## Installed documentation and release identity
76
77
 
77
- This reference accompanies `arcane-os@0.5.14`. The installed package includes
78
+ This reference accompanies `arcane-os@0.5.16`. The installed package includes
78
79
  the maintained `docs/` tree and `examples/wasm-ai-demo/` source alongside
79
80
  README and CHANGELOG. Open `node_modules/arcane-os/docs/reference/README.md`
80
81
  for the matching local reference. The generated website and test suites remain
@@ -13,7 +13,7 @@ import map resolves `arcane/AI` and `arcane/DBOPFS`. These browser modules are
13
13
  not Node inference APIs. To create an application:
14
14
 
15
15
  ```bash
16
- npx arcane-os@0.5.14 new hello-speech --path ./hello-speech --target browser
16
+ npx arcane-os@0.5.16 new hello-speech --path ./hello-speech --target browser
17
17
  cd hello-speech
18
18
  npm install
19
19
  npm run dev
@@ -37,7 +37,7 @@ export const speechSelection = {
37
37
  id: 'onnx-community/Kokoro-82M-v1.0-ONNX',
38
38
  repository: 'onnx-community/Kokoro-82M-v1.0-ONNX',
39
39
  revision: '1939ad2a8e416c0acfeecc08a694d14ef25f2231',
40
- dtype: 'q8',
40
+ dtype: 'fp32',
41
41
  defaultVoice: 'af_heart'
42
42
  },
43
43
  runtime: {
@@ -55,6 +55,15 @@ export const speechSelection = {
55
55
  };
56
56
  ```
57
57
 
58
+ The omitted execution record below uses the SDK's WebGPU-first automatic
59
+ selection, so this basic configuration uses `fp32` because
60
+ [Kokoro.js recommends `fp32` when using WebGPU](https://github.com/hexgrad/kokoro/tree/main/kokoro.js#usage).
61
+ Automatic fallback carries this same selected model and dtype to WASM; the SDK
62
+ does not rewrite the application selection. If you intentionally choose
63
+ another dtype, evaluate that exact model, browser, and execution route.
64
+ `selectedDevice` reports routing after load, not pronunciation, text fidelity,
65
+ or audio quality.
66
+
58
67
  Then use this **`App.js`**. The application creates and owns the DBOPFS
59
68
  instance. Configuration selects the provider without loading it; the button
60
69
  explicitly loads and unmutes TTS before requesting speech.
@@ -180,6 +189,52 @@ Ready adjacent audio buffers use contiguous AudioContext scheduling. Browser
180
189
  audio scheduling and selected WebGPU status do not prove physical GPU kernel
181
190
  overlap or audio quality. LLM and Whisper/STT capacity remains one.
182
191
 
192
+ ## Play a complete array with `SpeechPlayback`
193
+
194
+ Use this when your application already has complete segments in an array. The
195
+ configured `ai` below is the same instance created in the quick start.
196
+
197
+ ```javascript
198
+ import SpeechPlayback from 'arcane/SpeechPlayback';
199
+
200
+ const audio = document.body.appendChild(document.createElement('audio'));
201
+ audio.controls = true;
202
+ const narration = new SpeechPlayback({audio, speech: ai});
203
+ const speakAll = document.body.appendChild(document.createElement('button'));
204
+ speakAll.textContent = 'Speak all segments';
205
+ speakAll.addEventListener('click', async function speakAllSegments() {
206
+ await ai.setSpeechMuted(false);
207
+ await narration.prepare({
208
+ parts: [
209
+ 'First complete segment.',
210
+ 'Second complete segment.',
211
+ 'Third complete segment.'
212
+ ],
213
+ autoplay: true
214
+ });
215
+ });
216
+ ```
217
+
218
+ `prepare()` submits all three parts immediately because this `ai` exposes
219
+ `fetchTTS` and advertises TTS execution capacity. With the default configuration,
220
+ the provider admits up to four synthesis requests and keeps later requests in
221
+ its FIFO queue. Completed audio remains indexed, so playback is always first,
222
+ second, third even if the third synthesis finishes first.
223
+
224
+ This eager path is capability-driven. A native `Arcane.speech.synthesize`
225
+ client, or a custom client without a positive advertised TTS execution capacity,
226
+ retains serialized synthesis with one lookahead segment. `togglePause()` pauses
227
+ and resumes the same `audio` element. `stop()` cancels all requests owned by the
228
+ playback. `replay()` keeps completed and pending provider segments and retries
229
+ only failed missing segments.
230
+
231
+ The default `{device:'auto',maxConcurrentRequests:4}` attempts the full ONNX
232
+ Worker/session pool on WebGPU, then recreates that pool on WASM only if WebGPU
233
+ loading fails. The basic configuration above keeps `fp32` for this WebGPU-first
234
+ path and any automatic WASM fallback. Use the status example below to read
235
+ `selectedDevice`; console node-assignment warnings alone do not identify the
236
+ selected execution device or assess the generated audio.
237
+
183
238
  ## Queue complete passages and wait for playback
184
239
 
185
240
  These options are available in SDK `0.5.12`.
@@ -231,8 +286,9 @@ all speech owned by that AI instance and settles pending playback results
231
286
  The selected voice and speed are captured for segments extracted by that call.
232
287
  That includes any text left in the same AI instance's partial-stream buffer;
233
288
  finish the previous producer before starting a separate complete passage.
234
- Options are not retained with an unfinished `end:false` remainder. A later
235
- call supplies its own options, and `finishTTS()` uses defaults.
289
+ Voice, speed, pause, and playback options are not retained with an unfinished
290
+ `end:false` remainder. A later call supplies its own options, and `finishTTS()`
291
+ uses their defaults. The optional text format below lasts through that flush.
236
292
  A call extracting no segments returns `true` without waiting for earlier jobs.
237
293
  An already muted call returns `false`.
238
294
 
@@ -293,6 +349,30 @@ boundary; `finishTTS()` flushes any remaining text. It is not a playback-ended
293
349
  notification. Do not mute or dispose immediately after it if playback should
294
350
  continue.
295
351
 
352
+ ## Omit Markdown formatting marks from narration
353
+
354
+ Select `textFormat:'markdown'` for raw model text that contains formatting:
355
+
356
+ ```javascript
357
+ ai.streamTTS('## Heading\n**Hello', false, {textFormat:'markdown'});
358
+ ai.streamTTS('**. Next sentence.');
359
+ await ai.finishTTS();
360
+ ```
361
+
362
+ The SDK omits runs of two or more of the same `*`, `#`, `_`, backtick, or `~`
363
+ before speech segmentation. A candidate run split across chunks is still
364
+ recognized. Single marks, ellipses, quoted endings, and all other text are
365
+ preserved. This is a small narration filter, not a full Markdown parser.
366
+ Ordinary prose is forwarded immediately; only a trailing formatting candidate
367
+ waits for its next character or the final flush.
368
+
369
+ The format stays active until `end:true`, `finishTTS()`, or cancellation. New
370
+ streams default to `plain`, which preserves exact submitted text. The shared
371
+ chat component selects Markdown mode automatically. Applications already
372
+ speaking visible DOM text can keep plain mode. Displayed messages, saved
373
+ history, model input, language, voice, synthesis capacity, and playback timing
374
+ are not changed by the filter.
375
+
296
376
  ## Choose a device or reduce memory use
297
377
 
298
378
  Omitting `tts.execution` selects `{device:'auto',maxConcurrentRequests:4}`.
@@ -357,6 +437,8 @@ until a pool is selected and returns to `null` on unload. Providers without an
357
437
  execution report omit `execution`; do not infer a device from `navigator.gpu`
358
438
  or a configured preference alone. An explicit inspection can throw a provider
359
439
  status error; handle it with the same `error.code` / `error.message` pattern.
440
+ Treat `selectedDevice` as route status only; evaluate actual speech output for
441
+ the model, dtype, browser, and device combinations your application supports.
360
442
 
361
443
  ## Stop, mute, cancel, and release
362
444
 
@@ -831,7 +913,8 @@ cache state, and warnings. Kokoro status also includes an `execution` record
831
913
  with requested and selected device, request limit, and active request count. A
832
914
  successful `selectedDevice:'webgpu'` reports the execution provider selected by
833
915
  the upstream model load; it does not claim that browser, driver, or GPU kernels
834
- overlap physically. A security field is absent in ordinary mode.
916
+ overlap physically or that generated audio has been quality-validated. A
917
+ security field is absent in ordinary mode.
835
918
 
836
919
  The provider/2 load context accepts an optional progress callback for interface
837
920
  compatibility, but the current browser-speech artifact and Worker transport
@@ -9,7 +9,7 @@ same managed browser imports as the [browser speech quick start](browser-speech.
9
9
  Create an application and start its source server:
10
10
 
11
11
  ```bash
12
- npx arcane-os@0.5.12 new hello-twin --path ./hello-twin --target browser
12
+ npx arcane-os@0.5.16 new hello-twin --path ./hello-twin --target browser
13
13
  cd hello-twin
14
14
  npm install
15
15
  npm run dev
@@ -214,7 +214,7 @@ portable runtime subpaths such as `arcane-os/preference-store` and
214
214
  modules. The result reports the complete map written to the selected
215
215
  application; no fixed entry count is a release contract.
216
216
 
217
- SDK `0.5.12` preserves the physical workspace route count and ordered include
217
+ SDK `0.5.16` preserves the physical workspace route count and ordered include
218
218
  list. External and modern integrated routes require `components`, `css`,
219
219
  `dependencies`, `entities`, `img`, `modules`, and `sdk`; a physical workspace
220
220
  may omit only an optional trailing `security` include. The external license
@@ -9,7 +9,7 @@ They are not TypeScript declarations.
9
9
 
10
10
  ## Portable SDK AI and Core AI
11
11
 
12
- The SDK `0.5.12` has two related but separate normalized boundaries:
12
+ The SDK `0.5.16` has two related but separate normalized boundaries:
13
13
 
14
14
  | Boundary | Use | Host |
15
15
  |---|---|---|
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "sdkVersion": "0.5.14",
3
+ "sdkVersion": "0.5.16",
4
4
  "environment": {
5
5
  "runtime": "Node.js for Node entrypoints; browser for browser-only entrypoints",
6
6
  "minimumVersion": "22.23.2 for Node entrypoints",
@@ -1392,10 +1392,10 @@
1392
1392
  "entrypoints": ["arcane-os/speech-playback"],
1393
1393
  "primaryImport": "arcane-os/speech-playback",
1394
1394
  "group": "Portable runtime modules",
1395
- "summary": "Default binding for the canonical SpeechPlayback runtime class in Node and managed browsers.",
1395
+ "summary": "Default binding for the canonical SpeechPlayback runtime class, with capability-gated eager provider submission and exact-order playback.",
1396
1396
  "availability": "Node with injected media adapters, or browser/native WebView media",
1397
1397
  "protocol": "SpeechPlayback runtime contract",
1398
- "normalization": "Binding identity and namespace come directly from the canonical runtime module"
1398
+ "normalization": "Binding identity and namespace come directly from the canonical runtime module; a fetchTTS client with positive advertised TTS execution capacity receives all complete segments immediately while its provider owns bounded admission and SpeechPlayback retains indexed order; other clients remain serialized"
1399
1399
  },
1400
1400
  {
1401
1401
  "id": "speech-playback:SPEECH_PLAYBACK_STATE_EVENT",
@@ -1420,10 +1420,10 @@
1420
1420
  "entrypoints": ["arcane-os/speech-playback"],
1421
1421
  "primaryImport": "arcane-os/speech-playback",
1422
1422
  "group": "Portable runtime modules",
1423
- "summary": "Named binding for the same canonical class exposed as the subpath default.",
1423
+ "summary": "Named binding for the same capability-aware, exact-order canonical class exposed as the subpath default.",
1424
1424
  "availability": "Node with injected media adapters, or browser/native WebView media",
1425
1425
  "protocol": "SpeechPlayback runtime contract",
1426
- "normalization": "Binding identity equals the default export; prepare preserves each nonblank part input exactly without trimming, splitting, or freezing it; provider and media availability remain host-owned"
1426
+ "normalization": "Binding identity equals the default export; prepare preserves each nonblank part input exactly without trimming, splitting, or freezing it; provider-advertised capacity enables eager submission while the provider owns its bound, native and custom clients remain serialized, and media availability remains host-owned"
1427
1427
  },
1428
1428
  {
1429
1429
  "id": "speech-playback:splitSpeechText",
@@ -5,7 +5,7 @@
5
5
  "repository": "https://github.com/TheWizardNexus/arcane-os-sdk.git",
6
6
  "branch": "main",
7
7
  "path": "runtime/arcane/components",
8
- "sdkVersion": "0.5.12"
8
+ "sdkVersion": "0.5.16"
9
9
  },
10
10
  "componentCount": 39,
11
11
  "loader": "/arcane/modules/HTMLImport.js",
@@ -5,12 +5,12 @@
5
5
  "repository": "https://github.com/TheWizardNexus/arcane-os-sdk.git",
6
6
  "branch": "main",
7
7
  "path": "runtime/arcane",
8
- "sdkVersion": "0.5.12",
8
+ "sdkVersion": "0.5.16",
9
9
  "protocol": "arcane/1"
10
10
  },
11
- "artifactCount": 84,
12
- "javascriptArtifactCount": 82,
13
- "esmExportCount": 353,
11
+ "artifactCount": 85,
12
+ "javascriptArtifactCount": 83,
13
+ "esmExportCount": 354,
14
14
  "artifacts": [
15
15
  {
16
16
  "file": "runtime/arcane/modules/AI.js",
@@ -30,7 +30,7 @@
30
30
  "availability": "Browser + native bridge + TWiN Cloud",
31
31
  "protocol": "arcane-ai-browser-speech-configuration/1, AIProviderRuntime arcane-ai-provider/2 routes, globalThis.arcaneEvents, TWiN Cloud HTTPS, Arcane.ollama, Arcane.speech, Android WebView bridge",
32
32
  "normalization": "Complete mutable caller-owned browser speech authority, SDK-owned provider registration/replacement/disposal, explicit STT/TTS activation, normalized Kokoro TTS execution with default capacity 4, explicit provider-neutral execution snapshots through status(role,{execution:true}), sticky readiness, canonical window.user readiness without compatibility-event object-identity admission or polling, exact ordered structural calls with required arguments.message, atomic nonblank all-ID tool-result sequencing, complete all-choice streaming/data validation, native Ollama structural adaptation, complete-response then all validated tool callbacks then completion ordering, observed async callbacks, Blob/File transcription, immediate exact-segment synthesis, per-call voice/speed capture, optional final-segment pause on the existing audio clock, optional per-call terminal playback completion, ordered audio-clock scheduling, playable audio, active-generation TTS operation-failure routing, mute, and cancellation are normalized; provider/model/runtime/voice policy remains caller-owned.",
33
- "surface": "Browser-speech protocol/event/error/reason constants; default `AI`; read-only `providerRuntime`, `browserSpeechConfiguration`, and `browserSpeechDescriptor`; explicit `providerRuntime.status(role,{execution:true})` snapshots; `streamTTS(text,end,options={})` with optional voice, speed, pauseAfterMs, and waitForPlayback (available in SDK 0.5.12); configure/dispose speech, route lifecycle, declaration-validated chat/stream requests with exact ordered calls, synthesis/transcription, and playback controls; initializes from current canonical user readiness, installs `window.ai`, and projects `ai-ready` plus active-generation `ai-tts-failure`."
33
+ "surface": "Browser-speech protocol/event/error/reason constants; default `AI`; read-only `providerRuntime`, `browserSpeechConfiguration`, and `browserSpeechDescriptor`; explicit `providerRuntime.status(role,{execution:true})` snapshots; `streamTTS(text,end,options={})` with optional voice, speed, pauseAfterMs, waitForPlayback, and speech-only textFormat plain/markdown; configure/dispose speech, route lifecycle, declaration-validated chat/stream requests with exact ordered calls, synthesis/transcription, and playback controls; initializes from current canonical user readiness, installs `window.ai`, and projects `ai-ready` plus active-generation `ai-tts-failure`."
34
34
  },
35
35
  {
36
36
  "file": "runtime/arcane/modules/AIPreferenceRuntime.js",
@@ -824,6 +824,19 @@
824
824
  "normalization": "Endpoint, timeout, cancellation, network, HTTP, and response-contract errors are normalized.",
825
825
  "surface": "`MailTransportError`, `normalizeMailEndpoint()`, `serializeMailReport()`, and `sendMailReport()`."
826
826
  },
827
+ {
828
+ "file": "runtime/arcane/modules/MarkdownSpeech.js",
829
+ "name": "MarkdownSpeech.js",
830
+ "kind": "esm",
831
+ "exports": [
832
+ "MarkdownSpeech"
833
+ ],
834
+ "summary": "Removes repeated same Markdown formatting marks from streamed narration before speech segmentation.",
835
+ "availability": "Cross-host",
836
+ "protocol": "In-process only",
837
+ "normalization": "Speech-only filtering of repeated *, #, _, backtick, and ~ runs across chunks; single marks and all other characters remain literal; terminal flush and reset clear pending formatting state.",
838
+ "surface": "`MarkdownSpeech`; `append(text='',end=false)`, `reset()`."
839
+ },
827
840
  {
828
841
  "file": "runtime/arcane/modules/Marked.min.js",
829
842
  "name": "Marked.min.js",
@@ -1153,10 +1166,10 @@
1153
1166
  "default",
1154
1167
  "splitSpeechText"
1155
1168
  ],
1156
- "summary": "Preserves exact nonblank text as one segment without trimming, splitting, or freezing it; queues latest-request synthesis and controls lookahead HTML audio playback.",
1169
+ "summary": "Preserves exact nonblank segment text without trimming, splitting, or freezing it; eagerly submits complete parts to a capacity-advertising fetchTTS provider while keeping playback indexed, and retains serialized one-segment lookahead for other clients.",
1157
1170
  "availability": "Browser + compatible AI/native bridge",
1158
- "protocol": "AI.fetchTTS or compatible Arcane.speech.synthesize, globalThis.arcaneEvents, Blob URLs, audio element",
1159
- "normalization": "Exact nonblank split/part input strings are preserved in mutable records while playback policy, cancellation, Blob results, and lifecycle state are normalized; provider failures remain external.",
1171
+ "protocol": "AI.fetchTTS plus providerRuntime TTS execution capacity, or compatible serialized Arcane.speech.synthesize; globalThis.arcaneEvents, Blob URLs, audio element",
1172
+ "normalization": "Exact nonblank split/part input strings are preserved in mutable records. A capable provider receives complete segments immediately and owns bounded FIFO admission; URLs and playback stay in exact input order. Native/custom clients remain serialized. Cancellation, Replay recovery, Blob results, and lifecycle state are normalized; provider failures remain external.",
1160
1173
  "surface": "SpeechPlayback class/default, `SPEECH_PLAYBACK_STATE_EVENT`, `splitSpeechText()`, canonical playback lifecycle events, cancellation, and destroy APIs."
1161
1174
  },
1162
1175
  {
@@ -159,7 +159,7 @@ imports such as:
159
159
  import ollama from 'arcane/Ollama';
160
160
  ```
161
161
 
162
- The physical-v1 tree lives entirely beneath `arcane/`. SDK `0.5.12` projects the
162
+ The physical-v1 tree lives entirely beneath `arcane/`. SDK `0.5.16` projects the
163
163
  complete canonical runtime and browser runtime selected by the installed SDK
164
164
  package. Runtime dependencies stay under
165
165
  `arcane/dependencies/`; the SDK event and browser-AI closure stays under
@@ -174,7 +174,7 @@ integrated physical route uses the same ordered include list in its one route.
174
174
  Omitting only that final optional entry is compatible. Removing, reordering, or
175
175
  renaming any preceding entry changes the physical contract.
176
176
 
177
- The `0.5.12` map derives its complete entries from the selected runtime graph;
177
+ The `0.5.16` map derives its complete entries from the selected runtime graph;
178
178
  application source imports do not select a fixed entry count. The operation
179
179
  result reports `imports`, `entryCount`, and `excludedModules`; reached-file
180
180
  traversal remains internal. The
@@ -239,8 +239,8 @@ exactly `dependencyName`, `packageSource`,
239
239
  `canonicalPackageRoot`, `packageName`, `packageVersion`, `runtimeRoot`,
240
240
  and `browserRuntimeRoot`. A
241
241
  workspace may use the canonical dependency name or one exact npm alias such as
242
- `npm:arcane-os@0.5.12`; the physical package manifest must still identify
243
- exactly as `arcane-os@0.5.12`. Canonical-plus-alias duplicates, multiple aliases,
242
+ `npm:arcane-os@0.5.16`; the physical package manifest must still identify
243
+ exactly as `arcane-os@0.5.16`. Canonical-plus-alias duplicates, multiple aliases,
244
244
  links/junctions, indirect package roots, or version drift are reported.
245
245
 
246
246
  For external workspaces, `arcane dev` serves the projected `arcane/` root,
@@ -351,7 +351,7 @@ does not silently delete the app-owned cache. A complete whole member supersedes
351
351
  its current resumable fragments. Cleanup failure is warned without hiding the
352
352
  usable model.
353
353
 
354
- SDK `0.5.12` requires WebGPU. Load requests full offload and waits for the runtime
354
+ SDK `0.5.16` requires WebGPU. Load requests full offload and waits for the runtime
355
355
  to report a loaded model. `navigator.gpu` presence alone is
356
356
  not readiness. There is no CPU fallback, partial-offload success mode, or
357
357
  silent switch to native/Core/cloud inference.
@@ -360,17 +360,20 @@ unload.
360
360
  Chat listens for the bound (or current global) AI runtime's `ai-tts-failure`
361
361
  event and forwards its complete Error and exact operation boundary to
362
362
  `speech.reportTTSError()`. Playback-start or playback-resume failures can occur
363
- after Chat's two-argument `streamTTS()` preparation promise has resolved.
363
+ after Chat's `streamTTS()` preparation promise has resolved.
364
364
  SDK `0.5.12` adds a `waitForPlayback:true` mode for the
365
365
  terminal result of the segments submitted by one invocation; Chat continues
366
366
  to feed chunks without waiting for playback. Runtime mute, cancellation,
367
367
  permission waiting, and stale generations remain non-errors.
368
368
 
369
- Each visible model chunk is still forwarded to `AI.streamTTS()` in arrival
370
- order. The AI owner preserves exact segmentation, admits completed segments to
371
- bounded synthesis immediately, and schedules the contiguous ready audio prefix
372
- on the audio clock. Chat neither creates a second queue nor reorders, combines,
373
- or rewrites speech text.
369
+ Each visible model chunk is forwarded to
370
+ `AI.streamTTS(text,false,{textFormat:'markdown'})` in arrival order. The AI
371
+ owner removes repeated Markdown formatting marks from narration before the
372
+ configured segmentation, admits completed segments to bounded synthesis
373
+ immediately, and schedules the contiguous ready audio prefix on the audio
374
+ clock. Chat retains the original Markdown for display and storage and owns no
375
+ second speech queue. Single punctuation, ordinary repeated punctuation,
376
+ language, and voice retain their existing behavior.
374
377
 
375
378
  Events: `chat-ready`, `chat-session-bound`, `chat-session-message`,
376
379
  `chat-session-error`, `chat-send-message`, `chat-send-error`,