retiam 2.0.1 → 2.0.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/THIRD_PARTY_NOTICES.md +3 -3
- package/agent/AGENTS.md +70 -0
- package/agent/CLAUDE.md +2 -0
- package/agent/skill/SKILL.md +114 -0
- package/agent/skill/examples/AreaLesson.ts +48 -0
- package/agent/skill/examples/ExplainMotion.ts +32 -0
- package/agent/skill/examples/NarratedMotion.ts +50 -0
- package/agent/skill/examples/SecantToTangent.ts +142 -0
- package/agent/skill/references/api.md +111 -0
- package/agent/skill/references/explainers.md +123 -0
- package/agent/skill/references/quality.md +151 -0
- package/agent/skill/references/styles.md +58 -0
- package/agent/skill/references/tts.md +166 -0
- package/agent/templates/explainer/lesson.json +25 -0
- package/agent/templates/explainer/review.json +6 -0
- package/agent/templates/explainer/styles.json +92 -0
- package/bin/agent-kit.js +26 -0
- package/bin/cli.js +24 -4
- package/bin/context.js +57 -0
- package/bin/init.js +71 -12
- package/bin/lesson-project.js +30 -0
- package/bin/lesson.js +195 -0
- package/bin/lint.js +6 -6
- package/bin/snapshot-runtime.js +185 -0
- package/bin/snapshot.js +32 -225
- package/dist/THIRD_PARTY_NOTICES.md +3 -3
- package/dist/UTIF-D6vx2UEX.min.js +1 -0
- package/dist/{UTIF-2Ear_0Uo.js → UTIF-mkffT70R.js} +1 -1
- package/dist/decompress-D7LzbvPD.min.js +15 -0
- package/dist/{index-B2sJBy4c.js → index-CdBPrYbr.js} +3830 -3795
- package/dist/index-jgFyrc2D.min.js +10472 -0
- package/dist/libs/explainer/example.d.ts +3 -0
- package/dist/libs/explainer/index.d.ts +5 -0
- package/dist/libs/explainer/index.js +135 -0
- package/dist/libs/explainer/plan.d.ts +12 -0
- package/dist/libs/explainer/plan.js +219 -0
- package/dist/libs/explainer/runtime.d.ts +24 -0
- package/dist/libs/explainer/styles.d.ts +3 -0
- package/dist/libs/explainer/types.d.ts +124 -0
- package/dist/libs/explainer/visuals.d.ts +18 -0
- package/dist/libs/tts/animations/Speak.d.ts +13 -7
- package/dist/libs/tts/components/TTSNarrationComponent.d.ts +9 -7
- package/dist/libs/tts/core/TTSCache.d.ts +3 -3
- package/dist/libs/tts/core/TTSClient.d.ts +3 -3
- package/dist/libs/tts/core/types.d.ts +48 -6
- package/dist/libs/tts/index.d.ts +2 -1
- package/dist/libs/tts/index.js +203 -1333
- package/dist/libs/tts/node/index.d.ts +10 -0
- package/dist/libs/tts/node/index.js +791 -0
- package/dist/libs/tts/providers/ElevenLabsTTSProvider.d.ts +30 -0
- package/dist/libs/tts/providers/ITTSProvider.d.ts +2 -2
- package/dist/libs/vite/index.d.ts +28 -0
- package/dist/libs/vite/index.js +158 -0
- package/dist/main-Cc4QQbSK.min.js +5939 -0
- package/dist/{main-D_G4uIju.js → main-DMu_5Qy7.js} +1 -1
- package/dist/msEdgeV2-D3w4Xsn-.js +642 -0
- package/dist/opentype.module-B-1cYAb-.min.js +1 -0
- package/dist/retiam.es.js +1 -1
- package/dist/retiam.es.min.js +1 -0
- package/dist/src/engine/animation/Animation.d.ts +1 -0
- package/dist/src/engine/entities/composites/text/mathjaxInterop.d.ts +6 -0
- package/package.json +15 -8
- package/readme.md +27 -7
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vite reloads can leave MathML factories from a different MathJax module copy.
|
|
3
|
+
* MathJax's constructor-only check then passes a MathML node to the TeX stack as
|
|
4
|
+
* a stack item; its isKind('stop') throws because MathML has no 'stop' class.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ensureMathJaxNodeCompatibility(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "retiam",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "WebGPU powered animation engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/retiam.es.js",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"types": "./bin/third-party.d.ts",
|
|
17
17
|
"import": "./bin/third-party.js"
|
|
18
18
|
},
|
|
19
|
+
"./explainer/plan": {
|
|
20
|
+
"types": "./dist/libs/explainer/plan.d.ts",
|
|
21
|
+
"import": "./dist/libs/explainer/plan.js"
|
|
22
|
+
},
|
|
19
23
|
"./*": {
|
|
20
24
|
"types": "./dist/libs/*/index.d.ts",
|
|
21
25
|
"import": "./dist/libs/*/index.js"
|
|
@@ -31,6 +35,7 @@
|
|
|
31
35
|
"dist/libs/**/*.d.ts",
|
|
32
36
|
"dist/src/**/*.d.ts",
|
|
33
37
|
"bin",
|
|
38
|
+
"agent",
|
|
34
39
|
"LICENSE",
|
|
35
40
|
"COMMERCIAL_LICENSE.md",
|
|
36
41
|
"THIRD_PARTY_NOTICES.md",
|
|
@@ -42,9 +47,8 @@
|
|
|
42
47
|
],
|
|
43
48
|
"scripts": {
|
|
44
49
|
"dev": "vite",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"prepack": "npm run build",
|
|
50
|
+
"build": "tsc && vite build",
|
|
51
|
+
"prepack": "node tools/prepare-release.mjs && npm run build",
|
|
48
52
|
"build:watch": "vite build --watch",
|
|
49
53
|
"export": "node ./bin/cli.js export",
|
|
50
54
|
"render": "node ./bin/cli.js render",
|
|
@@ -56,13 +60,16 @@
|
|
|
56
60
|
"start": "npm run dev",
|
|
57
61
|
"resolve": "npm i",
|
|
58
62
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
59
|
-
"test:distribution": "node --import tsx --test test/library_portability_test.ts test/package_contents_test.mjs test/render_config_test.mjs",
|
|
63
|
+
"test:distribution": "node --import tsx --test test/library_portability_test.ts test/package_contents_test.mjs test/render_config_test.mjs test/cdn_build_test.ts test/mathjax_interop_test.ts",
|
|
60
64
|
"test:create": "node --test test/create_retiam_test.mjs",
|
|
65
|
+
"test:agent": "node --test test/agent_workflow_test.mjs test/snapshot_test.mjs test/tts_project_test.mjs",
|
|
66
|
+
"test:tts": "node --test test/elevenlabs_tts_test.mjs",
|
|
67
|
+
"test:tex": "node --import tsx --test test/mathjax_interop_test.ts",
|
|
68
|
+
"test:explainer": "node --import tsx --test test/explainer_plan_test.ts && node --test test/explainer_project_test.mjs",
|
|
61
69
|
"test:shading": "npm run build && node --test test/shading_test.mjs test/shading_browser.test.mjs",
|
|
62
70
|
"test:studio-layout": "node --test test/studio_layout.test.mjs",
|
|
63
71
|
"licenses:generate": "node tools/generate-third-party-notices.mjs",
|
|
64
|
-
"licenses
|
|
65
|
-
"test:licenses": "node --test test/third_party_notices_test.mjs test/release_metadata_test.mjs",
|
|
72
|
+
"test:licenses": "node --test test/third_party_notices_test.mjs",
|
|
66
73
|
"unit-test": "ts-node-esm test/test.ts",
|
|
67
74
|
"gen-context": "ts-node tools/context_gen/context_generator.ts ./src",
|
|
68
75
|
"gen-index": "node ./tools/index_generator/generate-index.cjs"
|
|
@@ -121,4 +128,4 @@
|
|
|
121
128
|
"woff2-encoder": "^2.0.0",
|
|
122
129
|
"ws": "^8.16.0"
|
|
123
130
|
}
|
|
124
|
-
}
|
|
131
|
+
}
|
package/readme.md
CHANGED
|
@@ -5,23 +5,24 @@ Retiam is a TypeScript animation engine built on WebGPU. Write scenes for mathem
|
|
|
5
5
|
**[Documentation](https://abhilasbiswas.github.io/retiam-docs/)** · [Getting started](https://abhilasbiswas.github.io/retiam-docs/getting-started/) · [Examples](https://abhilasbiswas.github.io/retiam-docs/examples-catalog/) · [API reference](https://abhilasbiswas.github.io/retiam-docs/api-core/)
|
|
6
6
|
|
|
7
7
|
Retiam is **free for noncommercial use** under the [Retiam Noncommercial
|
|
8
|
-
License](https://unpkg.com/retiam
|
|
8
|
+
License](https://unpkg.com/retiam/LICENSE). Commercial development,
|
|
9
9
|
internal business use, paid client work, and products, services or content that earn revenue directly or
|
|
10
10
|
indirectly require a separate paid written commercial license before use.
|
|
11
11
|
This includes advertising, sponsorships, subscriptions, and monetized videos
|
|
12
12
|
or courses, even when Retiam is only one part of a larger project.
|
|
13
13
|
Contact [abhilasbiswas@gmail.com](mailto:abhilasbiswas@gmail.com) for
|
|
14
|
-
[commercial licensing](https://unpkg.com/retiam
|
|
14
|
+
[commercial licensing](https://unpkg.com/retiam/COMMERCIAL_LICENSE.md).
|
|
15
15
|
|
|
16
16
|
The full terms are included in the npm package. After installation, read
|
|
17
17
|
`node_modules/retiam/LICENSE` and `node_modules/retiam/COMMERCIAL_LICENSE.md`.
|
|
18
|
-
The public links
|
|
19
|
-
|
|
18
|
+
The public links show the latest published terms without requiring access to
|
|
19
|
+
the private engine repository. The installed files contain the terms supplied
|
|
20
|
+
with your installed version.
|
|
20
21
|
|
|
21
22
|
Your independently authored code and original outputs remain your own.
|
|
22
23
|
Earlier ISC permissions and third-party licenses remain unaffected. Keep the
|
|
23
|
-
[third-party notices](https://unpkg.com/retiam
|
|
24
|
-
[license texts](https://unpkg.com/retiam
|
|
24
|
+
[third-party notices](https://unpkg.com/retiam/THIRD_PARTY_NOTICES.md) and
|
|
25
|
+
[license texts](https://unpkg.com/retiam/THIRD_PARTY_LICENSES.txt) with
|
|
25
26
|
redistributed Retiam code. These files are also installed in
|
|
26
27
|
`node_modules/retiam/`. Source maintainers can find provenance review limits
|
|
27
28
|
and notice-generation commands in `docs/LICENSING.md` in the engine checkout.
|
|
@@ -431,12 +432,31 @@ Import shared scene primitives from `retiam` and specialized functionality from
|
|
|
431
432
|
| `retiam/highlights` | Emphasis and attention animations |
|
|
432
433
|
| `retiam/physics` | 2D and 3D physics integrations |
|
|
433
434
|
| `retiam/rough` | RoughJS styling integration |
|
|
434
|
-
| `retiam/tts` |
|
|
435
|
+
| `retiam/tts` | Edge and ElevenLabs speech synthesis, expressive narration, and subtitles |
|
|
436
|
+
| `retiam/tts/node` | Speech preparation in Node without the WebGPU renderer |
|
|
435
437
|
|
|
436
438
|
See the [library guide](https://abhilasbiswas.github.io/retiam-docs/libraries/) for import boundaries and examples. `roughjs` is a required production dependency and is installed automatically.
|
|
437
439
|
|
|
438
440
|
Built-in fonts and imported engine assets are included in the library package. Application media is managed separately. Edge speech synthesis in the browser requires a compatible service. See [asset workflows](https://abhilasbiswas.github.io/retiam-docs/asset-workflows/) and [speech and subtitles](https://abhilasbiswas.github.io/retiam-docs/speech-subtitles/) for setup.
|
|
439
441
|
|
|
442
|
+
Initialize ElevenLabs directly on its provider; no ElevenLabs Vite plugin is needed:
|
|
443
|
+
|
|
444
|
+
```ts
|
|
445
|
+
import { ElevenLabsTTSProvider, TTS } from 'retiam/tts';
|
|
446
|
+
|
|
447
|
+
const provider = new ElevenLabsTTSProvider();
|
|
448
|
+
await provider.init({ apiKey, voiceId, modelId: 'eleven_v3' });
|
|
449
|
+
TTS.setProvider(provider);
|
|
450
|
+
const audio = await TTS.synthesize('[curious] What changes if we move this point?', {
|
|
451
|
+
displayText: 'What changes if we move this point?',
|
|
452
|
+
});
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
Supply credentials from the caller; browser-supplied keys are visible in that browser.
|
|
456
|
+
Node preparation scripts can use `retiam/tts/node` with the same provider API and
|
|
457
|
+
save `audio.rawBuffer` as MP3. The [narration guide](agent/skill/references/tts.md)
|
|
458
|
+
covers expressive delivery, caching, subtitles, and lesson preparation.
|
|
459
|
+
|
|
440
460
|
MSDF font generation runs in a browser worker using the WASM supplied by
|
|
441
461
|
`@zappar/msdf-generator`, a production dependency. The repository's font-baking
|
|
442
462
|
tools, including `msdf-bmfont-xml` and `msdf-atlas-gen`, remain development tools.
|