Skip to content

Commit ce3284d

Browse files
committed
update sdk
1 parent 0cb59d2 commit ce3284d

32 files changed

Lines changed: 3107 additions & 72 deletions

SDK/README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ The TypeScript runtime is the canonical implementation. The JavaScript runtime i
2525

2626
Compiled TPS output is meant to be portable. The active runtimes treat the compiled state machine as the shared transport format for `compile -> json -> restore -> play` flows.
2727

28+
The root [README.md](/Users/ksemenenko/Developer/TPS/README.md) is the canonical format specification. This SDK README documents the runtime contract that is implemented today.
29+
2830
## Workspace Layout
2931

3032
- `ts/`: canonical TypeScript implementation
@@ -48,6 +50,33 @@ Compiled TPS output is meant to be portable. The active runtimes treat the compi
4850
| `SDK/swift` | Swift runtime package | changing Apple-platform runtime behavior or tests | `cd SDK/swift && ./coverage.sh` |
4951
| `SDK/java` | Java runtime package | changing Java behavior or tests | `cd SDK/java && ./coverage.sh` |
5052

53+
## Source Input Conventions
54+
55+
The format spec allows these file naming conventions:
56+
57+
- `.tps`
58+
- `.tps.md`
59+
- `.md.tps`
60+
61+
The runtimes themselves compile TPS source text, not a specific extension. If a host already has the script content in memory, it can compile it directly without depending on the original file name.
62+
63+
## Current Runtime Contract
64+
65+
Across the active runtimes, the shared contract today includes:
66+
67+
- spec constants for metadata keys, keywords, emotions, archetypes, tags, and playback defaults
68+
- actionable TPS diagnostics for malformed structure, invalid ranges, unknown tags, and unknown archetypes
69+
- parsing into a document model with segment, block, phrase, and word scopes
70+
- compilation into a normalized JSON-friendly state machine
71+
- restore from compiled JSON or compiled object graphs
72+
- deterministic playback via `TpsPlayer`
73+
- timed playback via `TpsPlaybackSession`
74+
- compile-and-play embedding via `TpsStandalonePlayer`
75+
76+
Archetype parsing, inheritance, and recommended-WPM defaults are part of the current parity contract.
77+
78+
The advisory archetype-profile mismatch warnings and rhythm-analysis warnings described in the root spec are format-level guidance and are not yet enforced uniformly across every runtime.
79+
5180
## Compiled Model
5281

5382
The compiled TPS state machine is organized as:
@@ -58,7 +87,7 @@ The compiled TPS state machine is organized as:
5887
4. phrases
5988
5. words
6089

61-
Each compiled word carries timing and authoring-derived metadata such as emphasis, emotion, speed override, pronunciation, volume, delivery mode, and edit-point markers.
90+
Each compiled word carries timing and authoring-derived metadata such as emphasis, pause timing, highlight, breath, edit-point markers, emotion hints, articulation, energy, melody, volume, speed override or multiplier, pronunciation or phonetic guides, stress guides, speaker, and head-cue data.
6291

6392
## Playback Model
6493

@@ -91,7 +120,7 @@ Each snapshot exposes:
91120
- tempo state: base WPM, global offset, effective base WPM, playback rate
92121
- control availability for enabling or disabling host buttons
93122

94-
The root [README.md](/Users/ksemenenko/Developer/TPS/README.md) is the canonical human-readable format spec. Keep it aligned with `examples/*.tps`, `SDK/fixtures/invalid/*.tps`, and the shared example snapshots whenever TPS syntax or playback semantics change.
123+
Keep the root [README.md](/Users/ksemenenko/Developer/TPS/README.md) aligned with `examples/*.tps`, `SDK/fixtures/invalid/*.tps`, and the shared example snapshots whenever TPS syntax or playback semantics change.
95124

96125
On .NET, prefer wiring playback through `TpsPlaybackSessionOptions.TimeProvider` when a host needs deterministic or externally controlled time.
97126
On .NET UI hosts, also wire `TpsPlaybackSessionOptions.EventSynchronizationContext` so snapshot and state events land on the dispatcher the host actually renders from.

0 commit comments

Comments
 (0)