@jean-is/render 0.0.0-stage → 0.8.0-r83bf42d1b67e
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/LICENSE +21 -0
- package/README.md +2 -2
- package/caps/charts/charts.css +12 -0
- package/caps/charts/charts.js +154 -0
- package/caps/charts/option.js +141 -0
- package/caps/interactive/diagram.js +415 -0
- package/caps/interactive/interactive.css +21 -0
- package/caps/interactive/interactive.js +345 -0
- package/caps/interactive/map.js +183 -0
- package/caps/interactive/mode.js +54 -0
- package/caps/layouts/layouts.css +179 -0
- package/caps/layouts/layouts.js +147 -0
- package/caps/layouts/shapes.js +159 -0
- package/caps/math/latex.js +88 -0
- package/caps/math/math.css +24 -0
- package/caps/math/math.js +117 -0
- package/caps/scores/notes.js +30 -0
- package/caps/scores/scores.css +22 -0
- package/caps/scores/scores.js +287 -0
- package/caps/scores/sound-worker.js +12 -0
- package/caps/scores/sound.js +72 -0
- package/caps/share/seal.js +86 -0
- package/caps/share/view.js +153 -0
- package/caps/skills/directory.js +57 -0
- package/caps/skills/sources.js +281 -0
- package/caps/slides/deck.js +69 -0
- package/caps/slides/slides.css +38 -0
- package/caps/slides/slides.js +122 -0
- package/core/anthropic.js +253 -0
- package/core/deferred.js +48 -0
- package/core/events.js +166 -0
- package/core/files.js +277 -0
- package/core/fs.js +186 -0
- package/core/hooks.js +53 -0
- package/core/i18n.js +151 -0
- package/core/llm.js +400 -0
- package/core/loop.js +453 -0
- package/core/rules.js +52 -0
- package/core/search.js +158 -0
- package/core/settings.js +221 -0
- package/core/skills.js +90 -0
- package/core/sse.js +51 -0
- package/core/ulid.js +17 -0
- package/core/zip.js +165 -0
- package/fonts/OFL.txt +94 -0
- package/fonts/display.woff2 +0 -0
- package/locales/am.json +395 -0
- package/locales/ar.json +427 -0
- package/locales/ask/am.json +8 -0
- package/locales/ask/ar.json +8 -0
- package/locales/ask/bn.json +8 -0
- package/locales/ask/de.json +8 -0
- package/locales/ask/en.json +8 -0
- package/locales/ask/es.json +8 -0
- package/locales/ask/fa.json +8 -0
- package/locales/ask/fr.json +8 -0
- package/locales/ask/ha.json +8 -0
- package/locales/ask/he.json +8 -0
- package/locales/ask/hi.json +8 -0
- package/locales/ask/id.json +8 -0
- package/locales/ask/it.json +8 -0
- package/locales/ask/ja.json +8 -0
- package/locales/ask/ko.json +8 -0
- package/locales/ask/mr.json +8 -0
- package/locales/ask/ms.json +8 -0
- package/locales/ask/nl.json +8 -0
- package/locales/ask/pl.json +8 -0
- package/locales/ask/pt.json +8 -0
- package/locales/ask/ru.json +8 -0
- package/locales/ask/sw.json +8 -0
- package/locales/ask/ta.json +8 -0
- package/locales/ask/te.json +8 -0
- package/locales/ask/th.json +8 -0
- package/locales/ask/tl.json +8 -0
- package/locales/ask/tr.json +8 -0
- package/locales/ask/uk.json +8 -0
- package/locales/ask/ur.json +8 -0
- package/locales/ask/vi.json +8 -0
- package/locales/ask/yo.json +8 -0
- package/locales/ask/zh-Hans.json +8 -0
- package/locales/ask/zh-Hant.json +8 -0
- package/locales/backup/am.json +8 -0
- package/locales/backup/ar.json +12 -0
- package/locales/backup/bn.json +8 -0
- package/locales/backup/de.json +8 -0
- package/locales/backup/en.json +8 -0
- package/locales/backup/es.json +9 -0
- package/locales/backup/fa.json +8 -0
- package/locales/backup/fr.json +9 -0
- package/locales/backup/ha.json +8 -0
- package/locales/backup/he.json +10 -0
- package/locales/backup/hi.json +8 -0
- package/locales/backup/id.json +7 -0
- package/locales/backup/it.json +9 -0
- package/locales/backup/ja.json +7 -0
- package/locales/backup/ko.json +7 -0
- package/locales/backup/mr.json +8 -0
- package/locales/backup/ms.json +7 -0
- package/locales/backup/nl.json +8 -0
- package/locales/backup/pl.json +10 -0
- package/locales/backup/pt.json +9 -0
- package/locales/backup/ru.json +10 -0
- package/locales/backup/sw.json +8 -0
- package/locales/backup/ta.json +8 -0
- package/locales/backup/te.json +8 -0
- package/locales/backup/th.json +7 -0
- package/locales/backup/tl.json +8 -0
- package/locales/backup/tr.json +8 -0
- package/locales/backup/uk.json +10 -0
- package/locales/backup/ur.json +8 -0
- package/locales/backup/vi.json +7 -0
- package/locales/backup/yo.json +7 -0
- package/locales/backup/zh-Hans.json +7 -0
- package/locales/backup/zh-Hant.json +7 -0
- package/locales/bn.json +395 -0
- package/locales/brain-local/am.json +13 -0
- package/locales/brain-local/ar.json +13 -0
- package/locales/brain-local/bn.json +13 -0
- package/locales/brain-local/de.json +13 -0
- package/locales/brain-local/en.json +13 -0
- package/locales/brain-local/es.json +13 -0
- package/locales/brain-local/fa.json +13 -0
- package/locales/brain-local/fr.json +13 -0
- package/locales/brain-local/ha.json +13 -0
- package/locales/brain-local/he.json +13 -0
- package/locales/brain-local/hi.json +13 -0
- package/locales/brain-local/id.json +13 -0
- package/locales/brain-local/it.json +13 -0
- package/locales/brain-local/ja.json +13 -0
- package/locales/brain-local/ko.json +13 -0
- package/locales/brain-local/mr.json +13 -0
- package/locales/brain-local/ms.json +13 -0
- package/locales/brain-local/nl.json +13 -0
- package/locales/brain-local/pl.json +13 -0
- package/locales/brain-local/pt.json +13 -0
- package/locales/brain-local/ru.json +13 -0
- package/locales/brain-local/sw.json +13 -0
- package/locales/brain-local/ta.json +13 -0
- package/locales/brain-local/te.json +13 -0
- package/locales/brain-local/th.json +13 -0
- package/locales/brain-local/tl.json +13 -0
- package/locales/brain-local/tr.json +13 -0
- package/locales/brain-local/uk.json +13 -0
- package/locales/brain-local/ur.json +13 -0
- package/locales/brain-local/vi.json +13 -0
- package/locales/brain-local/yo.json +13 -0
- package/locales/brain-local/zh-Hans.json +13 -0
- package/locales/brain-local/zh-Hant.json +13 -0
- package/locales/browser/am.json +29 -0
- package/locales/browser/ar.json +29 -0
- package/locales/browser/bn.json +29 -0
- package/locales/browser/de.json +29 -0
- package/locales/browser/en.json +29 -0
- package/locales/browser/es.json +29 -0
- package/locales/browser/fa.json +29 -0
- package/locales/browser/fr.json +29 -0
- package/locales/browser/ha.json +29 -0
- package/locales/browser/he.json +29 -0
- package/locales/browser/hi.json +29 -0
- package/locales/browser/id.json +29 -0
- package/locales/browser/it.json +29 -0
- package/locales/browser/ja.json +29 -0
- package/locales/browser/ko.json +29 -0
- package/locales/browser/mr.json +29 -0
- package/locales/browser/ms.json +29 -0
- package/locales/browser/nl.json +29 -0
- package/locales/browser/pl.json +29 -0
- package/locales/browser/pt.json +29 -0
- package/locales/browser/ru.json +29 -0
- package/locales/browser/sw.json +29 -0
- package/locales/browser/ta.json +29 -0
- package/locales/browser/te.json +29 -0
- package/locales/browser/th.json +29 -0
- package/locales/browser/tl.json +29 -0
- package/locales/browser/tr.json +29 -0
- package/locales/browser/uk.json +29 -0
- package/locales/browser/ur.json +29 -0
- package/locales/browser/vi.json +29 -0
- package/locales/browser/yo.json +29 -0
- package/locales/browser/zh-Hans.json +29 -0
- package/locales/browser/zh-Hant.json +29 -0
- package/locales/certificates/am.json +58 -0
- package/locales/certificates/ar.json +58 -0
- package/locales/certificates/bn.json +58 -0
- package/locales/certificates/de.json +58 -0
- package/locales/certificates/en.json +58 -0
- package/locales/certificates/es.json +58 -0
- package/locales/certificates/fa.json +58 -0
- package/locales/certificates/fr.json +58 -0
- package/locales/certificates/ha.json +58 -0
- package/locales/certificates/he.json +58 -0
- package/locales/certificates/hi.json +58 -0
- package/locales/certificates/id.json +58 -0
- package/locales/certificates/it.json +58 -0
- package/locales/certificates/ja.json +58 -0
- package/locales/certificates/ko.json +58 -0
- package/locales/certificates/mr.json +58 -0
- package/locales/certificates/ms.json +58 -0
- package/locales/certificates/nl.json +58 -0
- package/locales/certificates/pl.json +58 -0
- package/locales/certificates/pt.json +58 -0
- package/locales/certificates/ru.json +58 -0
- package/locales/certificates/sw.json +58 -0
- package/locales/certificates/ta.json +58 -0
- package/locales/certificates/te.json +58 -0
- package/locales/certificates/th.json +58 -0
- package/locales/certificates/tl.json +58 -0
- package/locales/certificates/tr.json +58 -0
- package/locales/certificates/uk.json +58 -0
- package/locales/certificates/ur.json +58 -0
- package/locales/certificates/vi.json +58 -0
- package/locales/certificates/yo.json +58 -0
- package/locales/certificates/zh-Hans.json +58 -0
- package/locales/certificates/zh-Hant.json +58 -0
- package/locales/charts/am.json +5 -0
- package/locales/charts/ar.json +5 -0
- package/locales/charts/bn.json +5 -0
- package/locales/charts/de.json +5 -0
- package/locales/charts/en.json +5 -0
- package/locales/charts/es.json +5 -0
- package/locales/charts/fa.json +5 -0
- package/locales/charts/fr.json +5 -0
- package/locales/charts/ha.json +5 -0
- package/locales/charts/he.json +5 -0
- package/locales/charts/hi.json +5 -0
- package/locales/charts/id.json +5 -0
- package/locales/charts/it.json +5 -0
- package/locales/charts/ja.json +5 -0
- package/locales/charts/ko.json +5 -0
- package/locales/charts/mr.json +5 -0
- package/locales/charts/ms.json +5 -0
- package/locales/charts/nl.json +5 -0
- package/locales/charts/pl.json +5 -0
- package/locales/charts/pt.json +5 -0
- package/locales/charts/ru.json +5 -0
- package/locales/charts/sw.json +5 -0
- package/locales/charts/ta.json +5 -0
- package/locales/charts/te.json +5 -0
- package/locales/charts/th.json +5 -0
- package/locales/charts/tl.json +5 -0
- package/locales/charts/tr.json +5 -0
- package/locales/charts/uk.json +5 -0
- package/locales/charts/ur.json +5 -0
- package/locales/charts/vi.json +5 -0
- package/locales/charts/yo.json +5 -0
- package/locales/charts/zh-Hans.json +5 -0
- package/locales/charts/zh-Hant.json +5 -0
- package/locales/compact/am.json +7 -0
- package/locales/compact/ar.json +7 -0
- package/locales/compact/bn.json +7 -0
- package/locales/compact/de.json +7 -0
- package/locales/compact/en.json +7 -0
- package/locales/compact/es.json +7 -0
- package/locales/compact/fa.json +7 -0
- package/locales/compact/fr.json +7 -0
- package/locales/compact/ha.json +7 -0
- package/locales/compact/he.json +7 -0
- package/locales/compact/hi.json +7 -0
- package/locales/compact/id.json +7 -0
- package/locales/compact/it.json +7 -0
- package/locales/compact/ja.json +7 -0
- package/locales/compact/ko.json +7 -0
- package/locales/compact/mr.json +7 -0
- package/locales/compact/ms.json +7 -0
- package/locales/compact/nl.json +7 -0
- package/locales/compact/pl.json +7 -0
- package/locales/compact/pt.json +7 -0
- package/locales/compact/ru.json +7 -0
- package/locales/compact/sw.json +7 -0
- package/locales/compact/ta.json +7 -0
- package/locales/compact/te.json +7 -0
- package/locales/compact/th.json +7 -0
- package/locales/compact/tl.json +7 -0
- package/locales/compact/tr.json +7 -0
- package/locales/compact/uk.json +7 -0
- package/locales/compact/ur.json +7 -0
- package/locales/compact/vi.json +7 -0
- package/locales/compact/yo.json +7 -0
- package/locales/compact/zh-Hans.json +7 -0
- package/locales/compact/zh-Hant.json +7 -0
- package/locales/computer/am.json +61 -0
- package/locales/computer/ar.json +69 -0
- package/locales/computer/bn.json +61 -0
- package/locales/computer/de.json +61 -0
- package/locales/computer/en.json +61 -0
- package/locales/computer/es.json +63 -0
- package/locales/computer/fa.json +61 -0
- package/locales/computer/fr.json +63 -0
- package/locales/computer/ha.json +61 -0
- package/locales/computer/he.json +63 -0
- package/locales/computer/hi.json +61 -0
- package/locales/computer/id.json +59 -0
- package/locales/computer/it.json +63 -0
- package/locales/computer/ja.json +59 -0
- package/locales/computer/ko.json +59 -0
- package/locales/computer/mr.json +61 -0
- package/locales/computer/ms.json +59 -0
- package/locales/computer/nl.json +61 -0
- package/locales/computer/pl.json +65 -0
- package/locales/computer/pt.json +63 -0
- package/locales/computer/ru.json +65 -0
- package/locales/computer/sw.json +61 -0
- package/locales/computer/ta.json +61 -0
- package/locales/computer/te.json +61 -0
- package/locales/computer/th.json +59 -0
- package/locales/computer/tl.json +61 -0
- package/locales/computer/tr.json +61 -0
- package/locales/computer/uk.json +65 -0
- package/locales/computer/ur.json +61 -0
- package/locales/computer/vi.json +59 -0
- package/locales/computer/yo.json +59 -0
- package/locales/computer/zh-Hans.json +59 -0
- package/locales/computer/zh-Hant.json +59 -0
- package/locales/connections/am.json +15 -0
- package/locales/connections/ar.json +15 -0
- package/locales/connections/bn.json +15 -0
- package/locales/connections/de.json +15 -0
- package/locales/connections/en.json +15 -0
- package/locales/connections/es.json +15 -0
- package/locales/connections/fa.json +15 -0
- package/locales/connections/fr.json +15 -0
- package/locales/connections/ha.json +15 -0
- package/locales/connections/he.json +15 -0
- package/locales/connections/hi.json +15 -0
- package/locales/connections/id.json +15 -0
- package/locales/connections/it.json +15 -0
- package/locales/connections/ja.json +15 -0
- package/locales/connections/ko.json +15 -0
- package/locales/connections/mr.json +15 -0
- package/locales/connections/ms.json +15 -0
- package/locales/connections/nl.json +15 -0
- package/locales/connections/pl.json +15 -0
- package/locales/connections/pt.json +15 -0
- package/locales/connections/ru.json +15 -0
- package/locales/connections/sw.json +15 -0
- package/locales/connections/ta.json +15 -0
- package/locales/connections/te.json +15 -0
- package/locales/connections/th.json +15 -0
- package/locales/connections/tl.json +15 -0
- package/locales/connections/tr.json +15 -0
- package/locales/connections/uk.json +15 -0
- package/locales/connections/ur.json +15 -0
- package/locales/connections/vi.json +15 -0
- package/locales/connections/yo.json +15 -0
- package/locales/connections/zh-Hans.json +15 -0
- package/locales/connections/zh-Hant.json +15 -0
- package/locales/de.json +395 -0
- package/locales/dialogs/am.json +347 -0
- package/locales/dialogs/ar.json +359 -0
- package/locales/dialogs/bn.json +347 -0
- package/locales/dialogs/de.json +347 -0
- package/locales/dialogs/en.json +347 -0
- package/locales/dialogs/es.json +350 -0
- package/locales/dialogs/fa.json +347 -0
- package/locales/dialogs/fr.json +350 -0
- package/locales/dialogs/ha.json +347 -0
- package/locales/dialogs/he.json +352 -0
- package/locales/dialogs/hi.json +347 -0
- package/locales/dialogs/id.json +344 -0
- package/locales/dialogs/it.json +350 -0
- package/locales/dialogs/ja.json +344 -0
- package/locales/dialogs/ko.json +344 -0
- package/locales/dialogs/mr.json +347 -0
- package/locales/dialogs/ms.json +344 -0
- package/locales/dialogs/nl.json +347 -0
- package/locales/dialogs/pl.json +353 -0
- package/locales/dialogs/pt.json +350 -0
- package/locales/dialogs/ru.json +353 -0
- package/locales/dialogs/sw.json +347 -0
- package/locales/dialogs/ta.json +347 -0
- package/locales/dialogs/te.json +347 -0
- package/locales/dialogs/th.json +344 -0
- package/locales/dialogs/tl.json +347 -0
- package/locales/dialogs/tr.json +347 -0
- package/locales/dialogs/uk.json +353 -0
- package/locales/dialogs/ur.json +347 -0
- package/locales/dialogs/vi.json +344 -0
- package/locales/dialogs/yo.json +344 -0
- package/locales/dialogs/zh-Hans.json +344 -0
- package/locales/dialogs/zh-Hant.json +344 -0
- package/locales/en.json +395 -0
- package/locales/enterprise/am.json +21 -0
- package/locales/enterprise/ar.json +21 -0
- package/locales/enterprise/bn.json +21 -0
- package/locales/enterprise/de.json +21 -0
- package/locales/enterprise/en.json +21 -0
- package/locales/enterprise/es.json +21 -0
- package/locales/enterprise/fa.json +21 -0
- package/locales/enterprise/fr.json +21 -0
- package/locales/enterprise/ha.json +21 -0
- package/locales/enterprise/he.json +21 -0
- package/locales/enterprise/hi.json +21 -0
- package/locales/enterprise/id.json +21 -0
- package/locales/enterprise/it.json +21 -0
- package/locales/enterprise/ja.json +21 -0
- package/locales/enterprise/ko.json +21 -0
- package/locales/enterprise/mr.json +21 -0
- package/locales/enterprise/ms.json +21 -0
- package/locales/enterprise/nl.json +21 -0
- package/locales/enterprise/pl.json +21 -0
- package/locales/enterprise/pt.json +21 -0
- package/locales/enterprise/ru.json +21 -0
- package/locales/enterprise/sw.json +21 -0
- package/locales/enterprise/ta.json +21 -0
- package/locales/enterprise/te.json +21 -0
- package/locales/enterprise/th.json +21 -0
- package/locales/enterprise/tl.json +21 -0
- package/locales/enterprise/tr.json +21 -0
- package/locales/enterprise/uk.json +21 -0
- package/locales/enterprise/ur.json +21 -0
- package/locales/enterprise/vi.json +21 -0
- package/locales/enterprise/yo.json +21 -0
- package/locales/enterprise/zh-Hans.json +21 -0
- package/locales/enterprise/zh-Hant.json +21 -0
- package/locales/es.json +403 -0
- package/locales/fa.json +395 -0
- package/locales/first/am.json +26 -0
- package/locales/first/ar.json +26 -0
- package/locales/first/bn.json +26 -0
- package/locales/first/de.json +26 -0
- package/locales/first/en.json +26 -0
- package/locales/first/es.json +26 -0
- package/locales/first/fa.json +26 -0
- package/locales/first/fr.json +26 -0
- package/locales/first/ha.json +26 -0
- package/locales/first/he.json +26 -0
- package/locales/first/hi.json +26 -0
- package/locales/first/id.json +26 -0
- package/locales/first/it.json +26 -0
- package/locales/first/ja.json +26 -0
- package/locales/first/ko.json +26 -0
- package/locales/first/mr.json +26 -0
- package/locales/first/ms.json +26 -0
- package/locales/first/nl.json +26 -0
- package/locales/first/pl.json +26 -0
- package/locales/first/pt.json +26 -0
- package/locales/first/ru.json +26 -0
- package/locales/first/sw.json +26 -0
- package/locales/first/ta.json +26 -0
- package/locales/first/te.json +26 -0
- package/locales/first/th.json +26 -0
- package/locales/first/tl.json +26 -0
- package/locales/first/tr.json +26 -0
- package/locales/first/uk.json +26 -0
- package/locales/first/ur.json +26 -0
- package/locales/first/vi.json +26 -0
- package/locales/first/yo.json +26 -0
- package/locales/first/zh-Hans.json +26 -0
- package/locales/first/zh-Hant.json +26 -0
- package/locales/flows/am.json +51 -0
- package/locales/flows/ar.json +51 -0
- package/locales/flows/bn.json +51 -0
- package/locales/flows/de.json +51 -0
- package/locales/flows/en.json +51 -0
- package/locales/flows/es.json +51 -0
- package/locales/flows/fa.json +51 -0
- package/locales/flows/fr.json +51 -0
- package/locales/flows/ha.json +51 -0
- package/locales/flows/he.json +51 -0
- package/locales/flows/hi.json +51 -0
- package/locales/flows/id.json +51 -0
- package/locales/flows/it.json +51 -0
- package/locales/flows/ja.json +51 -0
- package/locales/flows/ko.json +51 -0
- package/locales/flows/mr.json +51 -0
- package/locales/flows/ms.json +51 -0
- package/locales/flows/nl.json +51 -0
- package/locales/flows/pl.json +51 -0
- package/locales/flows/pt.json +51 -0
- package/locales/flows/ru.json +51 -0
- package/locales/flows/sw.json +51 -0
- package/locales/flows/ta.json +51 -0
- package/locales/flows/te.json +51 -0
- package/locales/flows/th.json +51 -0
- package/locales/flows/tl.json +51 -0
- package/locales/flows/tr.json +51 -0
- package/locales/flows/uk.json +51 -0
- package/locales/flows/ur.json +51 -0
- package/locales/flows/vi.json +51 -0
- package/locales/flows/yo.json +51 -0
- package/locales/flows/zh-Hans.json +51 -0
- package/locales/flows/zh-Hant.json +51 -0
- package/locales/folders/am.json +40 -0
- package/locales/folders/ar.json +44 -0
- package/locales/folders/bn.json +40 -0
- package/locales/folders/de.json +40 -0
- package/locales/folders/en.json +40 -0
- package/locales/folders/es.json +41 -0
- package/locales/folders/fa.json +40 -0
- package/locales/folders/fr.json +41 -0
- package/locales/folders/ha.json +40 -0
- package/locales/folders/he.json +41 -0
- package/locales/folders/hi.json +40 -0
- package/locales/folders/id.json +39 -0
- package/locales/folders/it.json +41 -0
- package/locales/folders/ja.json +39 -0
- package/locales/folders/ko.json +39 -0
- package/locales/folders/mr.json +40 -0
- package/locales/folders/ms.json +39 -0
- package/locales/folders/nl.json +40 -0
- package/locales/folders/pl.json +42 -0
- package/locales/folders/pt.json +41 -0
- package/locales/folders/ru.json +42 -0
- package/locales/folders/sw.json +40 -0
- package/locales/folders/ta.json +40 -0
- package/locales/folders/te.json +40 -0
- package/locales/folders/th.json +39 -0
- package/locales/folders/tl.json +40 -0
- package/locales/folders/tr.json +40 -0
- package/locales/folders/uk.json +42 -0
- package/locales/folders/ur.json +40 -0
- package/locales/folders/vi.json +39 -0
- package/locales/folders/yo.json +39 -0
- package/locales/folders/zh-Hans.json +39 -0
- package/locales/folders/zh-Hant.json +39 -0
- package/locales/fr.json +403 -0
- package/locales/ha.json +395 -0
- package/locales/he.json +410 -0
- package/locales/hi.json +395 -0
- package/locales/id.json +387 -0
- package/locales/interactive/am.json +7 -0
- package/locales/interactive/ar.json +7 -0
- package/locales/interactive/bn.json +7 -0
- package/locales/interactive/de.json +7 -0
- package/locales/interactive/en.json +7 -0
- package/locales/interactive/es.json +7 -0
- package/locales/interactive/fa.json +7 -0
- package/locales/interactive/fr.json +7 -0
- package/locales/interactive/ha.json +7 -0
- package/locales/interactive/he.json +7 -0
- package/locales/interactive/hi.json +7 -0
- package/locales/interactive/id.json +7 -0
- package/locales/interactive/it.json +7 -0
- package/locales/interactive/ja.json +7 -0
- package/locales/interactive/ko.json +7 -0
- package/locales/interactive/mr.json +7 -0
- package/locales/interactive/ms.json +7 -0
- package/locales/interactive/nl.json +7 -0
- package/locales/interactive/pl.json +7 -0
- package/locales/interactive/pt.json +7 -0
- package/locales/interactive/ru.json +7 -0
- package/locales/interactive/sw.json +7 -0
- package/locales/interactive/ta.json +7 -0
- package/locales/interactive/te.json +7 -0
- package/locales/interactive/th.json +7 -0
- package/locales/interactive/tl.json +7 -0
- package/locales/interactive/tr.json +7 -0
- package/locales/interactive/uk.json +7 -0
- package/locales/interactive/ur.json +7 -0
- package/locales/interactive/vi.json +7 -0
- package/locales/interactive/yo.json +7 -0
- package/locales/interactive/zh-Hans.json +7 -0
- package/locales/interactive/zh-Hant.json +7 -0
- package/locales/it.json +403 -0
- package/locales/ja.json +387 -0
- package/locales/ko.json +387 -0
- package/locales/layouts/am.json +9 -0
- package/locales/layouts/ar.json +9 -0
- package/locales/layouts/bn.json +9 -0
- package/locales/layouts/de.json +9 -0
- package/locales/layouts/en.json +9 -0
- package/locales/layouts/es.json +9 -0
- package/locales/layouts/fa.json +9 -0
- package/locales/layouts/fr.json +9 -0
- package/locales/layouts/ha.json +9 -0
- package/locales/layouts/he.json +9 -0
- package/locales/layouts/hi.json +9 -0
- package/locales/layouts/id.json +9 -0
- package/locales/layouts/it.json +9 -0
- package/locales/layouts/ja.json +9 -0
- package/locales/layouts/ko.json +9 -0
- package/locales/layouts/mr.json +9 -0
- package/locales/layouts/ms.json +9 -0
- package/locales/layouts/nl.json +9 -0
- package/locales/layouts/pl.json +9 -0
- package/locales/layouts/pt.json +9 -0
- package/locales/layouts/ru.json +9 -0
- package/locales/layouts/sw.json +9 -0
- package/locales/layouts/ta.json +9 -0
- package/locales/layouts/te.json +9 -0
- package/locales/layouts/th.json +9 -0
- package/locales/layouts/tl.json +9 -0
- package/locales/layouts/tr.json +9 -0
- package/locales/layouts/uk.json +9 -0
- package/locales/layouts/ur.json +9 -0
- package/locales/layouts/vi.json +9 -0
- package/locales/layouts/yo.json +9 -0
- package/locales/layouts/zh-Hans.json +9 -0
- package/locales/layouts/zh-Hant.json +9 -0
- package/locales/lock/am.json +32 -0
- package/locales/lock/ar.json +32 -0
- package/locales/lock/bn.json +32 -0
- package/locales/lock/de.json +32 -0
- package/locales/lock/en.json +32 -0
- package/locales/lock/es.json +32 -0
- package/locales/lock/fa.json +32 -0
- package/locales/lock/fr.json +32 -0
- package/locales/lock/ha.json +32 -0
- package/locales/lock/he.json +32 -0
- package/locales/lock/hi.json +32 -0
- package/locales/lock/id.json +32 -0
- package/locales/lock/it.json +32 -0
- package/locales/lock/ja.json +32 -0
- package/locales/lock/ko.json +32 -0
- package/locales/lock/mr.json +32 -0
- package/locales/lock/ms.json +32 -0
- package/locales/lock/nl.json +32 -0
- package/locales/lock/pl.json +32 -0
- package/locales/lock/pt.json +32 -0
- package/locales/lock/ru.json +32 -0
- package/locales/lock/sw.json +32 -0
- package/locales/lock/ta.json +32 -0
- package/locales/lock/te.json +32 -0
- package/locales/lock/th.json +32 -0
- package/locales/lock/tl.json +32 -0
- package/locales/lock/tr.json +32 -0
- package/locales/lock/uk.json +32 -0
- package/locales/lock/ur.json +32 -0
- package/locales/lock/vi.json +32 -0
- package/locales/lock/yo.json +32 -0
- package/locales/lock/zh-Hans.json +32 -0
- package/locales/lock/zh-Hant.json +32 -0
- package/locales/machine/am.json +19 -0
- package/locales/machine/ar.json +19 -0
- package/locales/machine/bn.json +19 -0
- package/locales/machine/de.json +19 -0
- package/locales/machine/en.json +19 -0
- package/locales/machine/es.json +19 -0
- package/locales/machine/fa.json +19 -0
- package/locales/machine/fr.json +19 -0
- package/locales/machine/ha.json +19 -0
- package/locales/machine/he.json +19 -0
- package/locales/machine/hi.json +19 -0
- package/locales/machine/id.json +19 -0
- package/locales/machine/it.json +19 -0
- package/locales/machine/ja.json +19 -0
- package/locales/machine/ko.json +19 -0
- package/locales/machine/mr.json +19 -0
- package/locales/machine/ms.json +19 -0
- package/locales/machine/nl.json +19 -0
- package/locales/machine/pl.json +19 -0
- package/locales/machine/pt.json +19 -0
- package/locales/machine/ru.json +19 -0
- package/locales/machine/sw.json +19 -0
- package/locales/machine/ta.json +19 -0
- package/locales/machine/te.json +19 -0
- package/locales/machine/th.json +19 -0
- package/locales/machine/tl.json +19 -0
- package/locales/machine/tr.json +19 -0
- package/locales/machine/uk.json +19 -0
- package/locales/machine/ur.json +19 -0
- package/locales/machine/vi.json +19 -0
- package/locales/machine/yo.json +19 -0
- package/locales/machine/zh-Hans.json +19 -0
- package/locales/machine/zh-Hant.json +19 -0
- package/locales/made/am.json +16 -0
- package/locales/made/ar.json +16 -0
- package/locales/made/bn.json +16 -0
- package/locales/made/de.json +16 -0
- package/locales/made/en.json +16 -0
- package/locales/made/es.json +16 -0
- package/locales/made/fa.json +16 -0
- package/locales/made/fr.json +16 -0
- package/locales/made/ha.json +16 -0
- package/locales/made/he.json +16 -0
- package/locales/made/hi.json +16 -0
- package/locales/made/id.json +16 -0
- package/locales/made/it.json +16 -0
- package/locales/made/ja.json +16 -0
- package/locales/made/ko.json +16 -0
- package/locales/made/mr.json +16 -0
- package/locales/made/ms.json +16 -0
- package/locales/made/nl.json +16 -0
- package/locales/made/pl.json +16 -0
- package/locales/made/pt.json +16 -0
- package/locales/made/ru.json +16 -0
- package/locales/made/sw.json +16 -0
- package/locales/made/ta.json +16 -0
- package/locales/made/te.json +16 -0
- package/locales/made/th.json +16 -0
- package/locales/made/tl.json +16 -0
- package/locales/made/tr.json +16 -0
- package/locales/made/uk.json +16 -0
- package/locales/made/ur.json +16 -0
- package/locales/made/vi.json +16 -0
- package/locales/made/yo.json +16 -0
- package/locales/made/zh-Hans.json +16 -0
- package/locales/made/zh-Hant.json +16 -0
- package/locales/mr.json +395 -0
- package/locales/ms.json +387 -0
- package/locales/nl.json +395 -0
- package/locales/notifications/am.json +6 -0
- package/locales/notifications/ar.json +6 -0
- package/locales/notifications/bn.json +6 -0
- package/locales/notifications/de.json +6 -0
- package/locales/notifications/en.json +6 -0
- package/locales/notifications/es.json +6 -0
- package/locales/notifications/fa.json +6 -0
- package/locales/notifications/fr.json +6 -0
- package/locales/notifications/ha.json +6 -0
- package/locales/notifications/he.json +6 -0
- package/locales/notifications/hi.json +6 -0
- package/locales/notifications/id.json +6 -0
- package/locales/notifications/it.json +6 -0
- package/locales/notifications/ja.json +6 -0
- package/locales/notifications/ko.json +6 -0
- package/locales/notifications/mr.json +6 -0
- package/locales/notifications/ms.json +6 -0
- package/locales/notifications/nl.json +6 -0
- package/locales/notifications/pl.json +6 -0
- package/locales/notifications/pt.json +6 -0
- package/locales/notifications/ru.json +6 -0
- package/locales/notifications/sw.json +6 -0
- package/locales/notifications/ta.json +6 -0
- package/locales/notifications/te.json +6 -0
- package/locales/notifications/th.json +6 -0
- package/locales/notifications/tl.json +6 -0
- package/locales/notifications/tr.json +6 -0
- package/locales/notifications/uk.json +6 -0
- package/locales/notifications/ur.json +6 -0
- package/locales/notifications/vi.json +6 -0
- package/locales/notifications/yo.json +6 -0
- package/locales/notifications/zh-Hans.json +6 -0
- package/locales/notifications/zh-Hant.json +6 -0
- package/locales/pictures/am.json +36 -0
- package/locales/pictures/ar.json +36 -0
- package/locales/pictures/bn.json +36 -0
- package/locales/pictures/de.json +36 -0
- package/locales/pictures/en.json +36 -0
- package/locales/pictures/es.json +36 -0
- package/locales/pictures/fa.json +36 -0
- package/locales/pictures/fr.json +36 -0
- package/locales/pictures/ha.json +36 -0
- package/locales/pictures/he.json +36 -0
- package/locales/pictures/hi.json +36 -0
- package/locales/pictures/id.json +36 -0
- package/locales/pictures/it.json +36 -0
- package/locales/pictures/ja.json +36 -0
- package/locales/pictures/ko.json +36 -0
- package/locales/pictures/mr.json +36 -0
- package/locales/pictures/ms.json +36 -0
- package/locales/pictures/nl.json +36 -0
- package/locales/pictures/pl.json +36 -0
- package/locales/pictures/pt.json +36 -0
- package/locales/pictures/ru.json +36 -0
- package/locales/pictures/sw.json +36 -0
- package/locales/pictures/ta.json +36 -0
- package/locales/pictures/te.json +36 -0
- package/locales/pictures/th.json +36 -0
- package/locales/pictures/tl.json +36 -0
- package/locales/pictures/tr.json +36 -0
- package/locales/pictures/uk.json +36 -0
- package/locales/pictures/ur.json +36 -0
- package/locales/pictures/vi.json +36 -0
- package/locales/pictures/yo.json +36 -0
- package/locales/pictures/zh-Hans.json +36 -0
- package/locales/pictures/zh-Hant.json +36 -0
- package/locales/pl.json +411 -0
- package/locales/plan/am.json +13 -0
- package/locales/plan/ar.json +13 -0
- package/locales/plan/bn.json +13 -0
- package/locales/plan/de.json +13 -0
- package/locales/plan/en.json +13 -0
- package/locales/plan/es.json +13 -0
- package/locales/plan/fa.json +13 -0
- package/locales/plan/fr.json +13 -0
- package/locales/plan/ha.json +13 -0
- package/locales/plan/he.json +13 -0
- package/locales/plan/hi.json +13 -0
- package/locales/plan/id.json +13 -0
- package/locales/plan/it.json +13 -0
- package/locales/plan/ja.json +13 -0
- package/locales/plan/ko.json +13 -0
- package/locales/plan/mr.json +13 -0
- package/locales/plan/ms.json +13 -0
- package/locales/plan/nl.json +13 -0
- package/locales/plan/pl.json +13 -0
- package/locales/plan/pt.json +13 -0
- package/locales/plan/ru.json +13 -0
- package/locales/plan/sw.json +13 -0
- package/locales/plan/ta.json +13 -0
- package/locales/plan/te.json +13 -0
- package/locales/plan/th.json +13 -0
- package/locales/plan/tl.json +13 -0
- package/locales/plan/tr.json +13 -0
- package/locales/plan/uk.json +13 -0
- package/locales/plan/ur.json +13 -0
- package/locales/plan/vi.json +13 -0
- package/locales/plan/yo.json +13 -0
- package/locales/plan/zh-Hans.json +13 -0
- package/locales/plan/zh-Hant.json +13 -0
- package/locales/plugins/am.json +40 -0
- package/locales/plugins/ar.json +40 -0
- package/locales/plugins/bn.json +40 -0
- package/locales/plugins/de.json +40 -0
- package/locales/plugins/en.json +40 -0
- package/locales/plugins/es.json +40 -0
- package/locales/plugins/fa.json +40 -0
- package/locales/plugins/fr.json +40 -0
- package/locales/plugins/ha.json +40 -0
- package/locales/plugins/he.json +40 -0
- package/locales/plugins/hi.json +40 -0
- package/locales/plugins/id.json +40 -0
- package/locales/plugins/it.json +40 -0
- package/locales/plugins/ja.json +40 -0
- package/locales/plugins/ko.json +40 -0
- package/locales/plugins/mr.json +40 -0
- package/locales/plugins/ms.json +40 -0
- package/locales/plugins/nl.json +40 -0
- package/locales/plugins/pl.json +40 -0
- package/locales/plugins/pt.json +40 -0
- package/locales/plugins/ru.json +40 -0
- package/locales/plugins/sw.json +40 -0
- package/locales/plugins/ta.json +40 -0
- package/locales/plugins/te.json +40 -0
- package/locales/plugins/th.json +40 -0
- package/locales/plugins/tl.json +40 -0
- package/locales/plugins/tr.json +40 -0
- package/locales/plugins/uk.json +40 -0
- package/locales/plugins/ur.json +40 -0
- package/locales/plugins/vi.json +40 -0
- package/locales/plugins/yo.json +40 -0
- package/locales/plugins/zh-Hans.json +40 -0
- package/locales/plugins/zh-Hant.json +40 -0
- package/locales/policy/am.json +39 -0
- package/locales/policy/ar.json +39 -0
- package/locales/policy/bn.json +39 -0
- package/locales/policy/de.json +39 -0
- package/locales/policy/en.json +39 -0
- package/locales/policy/es.json +39 -0
- package/locales/policy/fa.json +39 -0
- package/locales/policy/fr.json +39 -0
- package/locales/policy/ha.json +39 -0
- package/locales/policy/he.json +39 -0
- package/locales/policy/hi.json +39 -0
- package/locales/policy/id.json +39 -0
- package/locales/policy/it.json +39 -0
- package/locales/policy/ja.json +39 -0
- package/locales/policy/ko.json +39 -0
- package/locales/policy/mr.json +39 -0
- package/locales/policy/ms.json +39 -0
- package/locales/policy/nl.json +39 -0
- package/locales/policy/pl.json +39 -0
- package/locales/policy/pt.json +39 -0
- package/locales/policy/ru.json +39 -0
- package/locales/policy/sw.json +39 -0
- package/locales/policy/ta.json +39 -0
- package/locales/policy/te.json +39 -0
- package/locales/policy/th.json +39 -0
- package/locales/policy/tl.json +39 -0
- package/locales/policy/tr.json +39 -0
- package/locales/policy/uk.json +39 -0
- package/locales/policy/ur.json +39 -0
- package/locales/policy/vi.json +39 -0
- package/locales/policy/yo.json +39 -0
- package/locales/policy/zh-Hans.json +39 -0
- package/locales/policy/zh-Hant.json +39 -0
- package/locales/profiles/am.json +59 -0
- package/locales/profiles/ar.json +59 -0
- package/locales/profiles/bn.json +59 -0
- package/locales/profiles/de.json +59 -0
- package/locales/profiles/en.json +59 -0
- package/locales/profiles/es.json +59 -0
- package/locales/profiles/fa.json +59 -0
- package/locales/profiles/fr.json +59 -0
- package/locales/profiles/ha.json +59 -0
- package/locales/profiles/he.json +59 -0
- package/locales/profiles/hi.json +59 -0
- package/locales/profiles/id.json +59 -0
- package/locales/profiles/it.json +59 -0
- package/locales/profiles/ja.json +59 -0
- package/locales/profiles/ko.json +59 -0
- package/locales/profiles/mr.json +59 -0
- package/locales/profiles/ms.json +59 -0
- package/locales/profiles/nl.json +59 -0
- package/locales/profiles/pl.json +59 -0
- package/locales/profiles/pt.json +59 -0
- package/locales/profiles/ru.json +59 -0
- package/locales/profiles/sw.json +59 -0
- package/locales/profiles/ta.json +59 -0
- package/locales/profiles/te.json +59 -0
- package/locales/profiles/th.json +59 -0
- package/locales/profiles/tl.json +59 -0
- package/locales/profiles/tr.json +59 -0
- package/locales/profiles/uk.json +59 -0
- package/locales/profiles/ur.json +59 -0
- package/locales/profiles/vi.json +59 -0
- package/locales/profiles/yo.json +59 -0
- package/locales/profiles/zh-Hans.json +59 -0
- package/locales/profiles/zh-Hant.json +59 -0
- package/locales/pt.json +403 -0
- package/locales/receipt/am.json +39 -0
- package/locales/receipt/ar.json +39 -0
- package/locales/receipt/bn.json +39 -0
- package/locales/receipt/de.json +39 -0
- package/locales/receipt/en.json +39 -0
- package/locales/receipt/es.json +39 -0
- package/locales/receipt/fa.json +39 -0
- package/locales/receipt/fr.json +39 -0
- package/locales/receipt/ha.json +39 -0
- package/locales/receipt/he.json +39 -0
- package/locales/receipt/hi.json +39 -0
- package/locales/receipt/id.json +39 -0
- package/locales/receipt/it.json +39 -0
- package/locales/receipt/ja.json +39 -0
- package/locales/receipt/ko.json +39 -0
- package/locales/receipt/mr.json +39 -0
- package/locales/receipt/ms.json +39 -0
- package/locales/receipt/nl.json +39 -0
- package/locales/receipt/pl.json +39 -0
- package/locales/receipt/pt.json +39 -0
- package/locales/receipt/ru.json +39 -0
- package/locales/receipt/sw.json +39 -0
- package/locales/receipt/ta.json +39 -0
- package/locales/receipt/te.json +39 -0
- package/locales/receipt/th.json +39 -0
- package/locales/receipt/tl.json +39 -0
- package/locales/receipt/tr.json +39 -0
- package/locales/receipt/uk.json +39 -0
- package/locales/receipt/ur.json +39 -0
- package/locales/receipt/vi.json +39 -0
- package/locales/receipt/yo.json +39 -0
- package/locales/receipt/zh-Hans.json +39 -0
- package/locales/receipt/zh-Hant.json +39 -0
- package/locales/ru.json +411 -0
- package/locales/scores/am.json +8 -0
- package/locales/scores/ar.json +8 -0
- package/locales/scores/bn.json +8 -0
- package/locales/scores/de.json +8 -0
- package/locales/scores/en.json +8 -0
- package/locales/scores/es.json +8 -0
- package/locales/scores/fa.json +8 -0
- package/locales/scores/fr.json +8 -0
- package/locales/scores/ha.json +8 -0
- package/locales/scores/he.json +8 -0
- package/locales/scores/hi.json +8 -0
- package/locales/scores/id.json +8 -0
- package/locales/scores/it.json +8 -0
- package/locales/scores/ja.json +8 -0
- package/locales/scores/ko.json +8 -0
- package/locales/scores/mr.json +8 -0
- package/locales/scores/ms.json +8 -0
- package/locales/scores/nl.json +8 -0
- package/locales/scores/pl.json +8 -0
- package/locales/scores/pt.json +8 -0
- package/locales/scores/ru.json +8 -0
- package/locales/scores/sw.json +8 -0
- package/locales/scores/ta.json +8 -0
- package/locales/scores/te.json +8 -0
- package/locales/scores/th.json +8 -0
- package/locales/scores/tl.json +8 -0
- package/locales/scores/tr.json +8 -0
- package/locales/scores/uk.json +8 -0
- package/locales/scores/ur.json +8 -0
- package/locales/scores/vi.json +8 -0
- package/locales/scores/yo.json +8 -0
- package/locales/scores/zh-Hans.json +8 -0
- package/locales/scores/zh-Hant.json +8 -0
- package/locales/search/am.json +26 -0
- package/locales/search/ar.json +34 -0
- package/locales/search/bn.json +26 -0
- package/locales/search/de.json +26 -0
- package/locales/search/en.json +26 -0
- package/locales/search/es.json +28 -0
- package/locales/search/fa.json +26 -0
- package/locales/search/fr.json +28 -0
- package/locales/search/ha.json +26 -0
- package/locales/search/he.json +30 -0
- package/locales/search/hi.json +26 -0
- package/locales/search/id.json +24 -0
- package/locales/search/it.json +28 -0
- package/locales/search/ja.json +24 -0
- package/locales/search/ko.json +24 -0
- package/locales/search/mr.json +26 -0
- package/locales/search/ms.json +24 -0
- package/locales/search/nl.json +26 -0
- package/locales/search/pl.json +30 -0
- package/locales/search/pt.json +28 -0
- package/locales/search/ru.json +30 -0
- package/locales/search/sw.json +26 -0
- package/locales/search/ta.json +26 -0
- package/locales/search/te.json +26 -0
- package/locales/search/th.json +24 -0
- package/locales/search/tl.json +26 -0
- package/locales/search/tr.json +26 -0
- package/locales/search/uk.json +30 -0
- package/locales/search/ur.json +26 -0
- package/locales/search/vi.json +24 -0
- package/locales/search/yo.json +24 -0
- package/locales/search/zh-Hans.json +24 -0
- package/locales/search/zh-Hant.json +24 -0
- package/locales/share/am.json +61 -0
- package/locales/share/ar.json +65 -0
- package/locales/share/bn.json +61 -0
- package/locales/share/de.json +61 -0
- package/locales/share/en.json +61 -0
- package/locales/share/es.json +62 -0
- package/locales/share/fa.json +61 -0
- package/locales/share/fr.json +62 -0
- package/locales/share/ha.json +61 -0
- package/locales/share/he.json +62 -0
- package/locales/share/hi.json +61 -0
- package/locales/share/id.json +60 -0
- package/locales/share/it.json +62 -0
- package/locales/share/ja.json +60 -0
- package/locales/share/ko.json +60 -0
- package/locales/share/mr.json +61 -0
- package/locales/share/ms.json +60 -0
- package/locales/share/nl.json +61 -0
- package/locales/share/pl.json +63 -0
- package/locales/share/pt.json +62 -0
- package/locales/share/ru.json +63 -0
- package/locales/share/sw.json +61 -0
- package/locales/share/ta.json +61 -0
- package/locales/share/te.json +61 -0
- package/locales/share/th.json +60 -0
- package/locales/share/tl.json +61 -0
- package/locales/share/tr.json +61 -0
- package/locales/share/uk.json +63 -0
- package/locales/share/ur.json +61 -0
- package/locales/share/vi.json +60 -0
- package/locales/share/yo.json +60 -0
- package/locales/share/zh-Hans.json +60 -0
- package/locales/share/zh-Hant.json +60 -0
- package/locales/signin/am.json +6 -0
- package/locales/signin/ar.json +6 -0
- package/locales/signin/bn.json +6 -0
- package/locales/signin/de.json +6 -0
- package/locales/signin/en.json +6 -0
- package/locales/signin/es.json +6 -0
- package/locales/signin/fa.json +6 -0
- package/locales/signin/fr.json +6 -0
- package/locales/signin/ha.json +6 -0
- package/locales/signin/he.json +6 -0
- package/locales/signin/hi.json +6 -0
- package/locales/signin/id.json +6 -0
- package/locales/signin/it.json +6 -0
- package/locales/signin/ja.json +6 -0
- package/locales/signin/ko.json +6 -0
- package/locales/signin/mr.json +6 -0
- package/locales/signin/ms.json +6 -0
- package/locales/signin/nl.json +6 -0
- package/locales/signin/pl.json +6 -0
- package/locales/signin/pt.json +6 -0
- package/locales/signin/ru.json +6 -0
- package/locales/signin/sw.json +6 -0
- package/locales/signin/ta.json +6 -0
- package/locales/signin/te.json +6 -0
- package/locales/signin/th.json +6 -0
- package/locales/signin/tl.json +6 -0
- package/locales/signin/tr.json +6 -0
- package/locales/signin/uk.json +6 -0
- package/locales/signin/ur.json +6 -0
- package/locales/signin/vi.json +6 -0
- package/locales/signin/yo.json +6 -0
- package/locales/signin/zh-Hans.json +6 -0
- package/locales/signin/zh-Hant.json +6 -0
- package/locales/slides/am.json +10 -0
- package/locales/slides/ar.json +10 -0
- package/locales/slides/bn.json +10 -0
- package/locales/slides/de.json +10 -0
- package/locales/slides/en.json +10 -0
- package/locales/slides/es.json +10 -0
- package/locales/slides/fa.json +10 -0
- package/locales/slides/fr.json +10 -0
- package/locales/slides/ha.json +10 -0
- package/locales/slides/he.json +10 -0
- package/locales/slides/hi.json +10 -0
- package/locales/slides/id.json +10 -0
- package/locales/slides/it.json +10 -0
- package/locales/slides/ja.json +10 -0
- package/locales/slides/ko.json +10 -0
- package/locales/slides/mr.json +10 -0
- package/locales/slides/ms.json +10 -0
- package/locales/slides/nl.json +10 -0
- package/locales/slides/pl.json +10 -0
- package/locales/slides/pt.json +10 -0
- package/locales/slides/ru.json +10 -0
- package/locales/slides/sw.json +10 -0
- package/locales/slides/ta.json +10 -0
- package/locales/slides/te.json +10 -0
- package/locales/slides/th.json +10 -0
- package/locales/slides/tl.json +10 -0
- package/locales/slides/tr.json +10 -0
- package/locales/slides/uk.json +10 -0
- package/locales/slides/ur.json +10 -0
- package/locales/slides/vi.json +10 -0
- package/locales/slides/yo.json +10 -0
- package/locales/slides/zh-Hans.json +10 -0
- package/locales/slides/zh-Hant.json +10 -0
- package/locales/sw.json +395 -0
- package/locales/sync/am.json +13 -0
- package/locales/sync/ar.json +13 -0
- package/locales/sync/bn.json +13 -0
- package/locales/sync/de.json +13 -0
- package/locales/sync/en.json +13 -0
- package/locales/sync/es.json +13 -0
- package/locales/sync/fa.json +13 -0
- package/locales/sync/fr.json +13 -0
- package/locales/sync/ha.json +13 -0
- package/locales/sync/he.json +13 -0
- package/locales/sync/hi.json +13 -0
- package/locales/sync/id.json +13 -0
- package/locales/sync/it.json +13 -0
- package/locales/sync/ja.json +13 -0
- package/locales/sync/ko.json +13 -0
- package/locales/sync/mr.json +13 -0
- package/locales/sync/ms.json +13 -0
- package/locales/sync/nl.json +13 -0
- package/locales/sync/pl.json +13 -0
- package/locales/sync/pt.json +13 -0
- package/locales/sync/ru.json +13 -0
- package/locales/sync/sw.json +13 -0
- package/locales/sync/ta.json +13 -0
- package/locales/sync/te.json +13 -0
- package/locales/sync/th.json +13 -0
- package/locales/sync/tl.json +13 -0
- package/locales/sync/tr.json +13 -0
- package/locales/sync/uk.json +13 -0
- package/locales/sync/ur.json +13 -0
- package/locales/sync/vi.json +13 -0
- package/locales/sync/yo.json +13 -0
- package/locales/sync/zh-Hans.json +13 -0
- package/locales/sync/zh-Hant.json +13 -0
- package/locales/ta.json +395 -0
- package/locales/te.json +395 -0
- package/locales/th.json +387 -0
- package/locales/tl.json +395 -0
- package/locales/tr.json +395 -0
- package/locales/uk.json +411 -0
- package/locales/ur.json +395 -0
- package/locales/vi.json +387 -0
- package/locales/yo.json +387 -0
- package/locales/zh-Hans.json +387 -0
- package/locales/zh-Hant.json +387 -0
- package/package.json +9 -4
- package/preview.html +75 -0
- package/ui/caps.js +148 -0
- package/ui/csp.js +82 -0
- package/ui/export.js +214 -0
- package/ui/icons.js +31 -0
- package/ui/looks/blueprint.css +72 -0
- package/ui/looks/classic.css +105 -0
- package/ui/looks/fjord.css +56 -0
- package/ui/looks/human.css +232 -0
- package/ui/looks/mail.css +61 -0
- package/ui/looks/minimal.css +62 -0
- package/ui/looks/mondrian.css +90 -0
- package/ui/looks/neon.css +100 -0
- package/ui/looks/notebook.css +82 -0
- package/ui/looks/paper.css +51 -0
- package/ui/looks/swiss.css +64 -0
- package/ui/looks/terminal.css +84 -0
- package/ui/looks/tilde.css +61 -0
- package/ui/looks/velvet.css +61 -0
- package/ui/markdown.js +188 -0
- package/ui/menu-icons.js +66 -0
- package/ui/model.js +74 -0
- package/ui/reader-state.js +38 -0
- package/ui/reader.js +68 -0
- package/ui/save.js +53 -0
- package/ui/sheet.js +13 -0
- package/ui/style.css +814 -0
- package/ui/trusted.js +13 -0
- package/ui/weights.js +37 -0
- package/vendor/LICENSES/abcjs.txt +21 -0
- package/vendor/LICENSES/base64-js.txt +21 -0
- package/vendor/LICENSES/buffer.txt +21 -0
- package/vendor/LICENSES/diff.txt +29 -0
- package/vendor/LICENSES/echarts.txt +229 -0
- package/vendor/LICENSES/fflate.txt +21 -0
- package/vendor/LICENSES/huggingface-transformers.txt +202 -0
- package/vendor/LICENSES/ieee754.txt +11 -0
- package/vendor/LICENSES/jean-is-sounds.txt +92 -0
- package/vendor/LICENSES/jitl-quickjs-ffi-types.txt +21 -0
- package/vendor/LICENSES/jitl-quickjs-wasmfile-release-sync.txt +47 -0
- package/vendor/LICENSES/just-bash.txt +201 -0
- package/vendor/LICENSES/lit-html.txt +28 -0
- package/vendor/LICENSES/maplibre-gl.txt +2 -0
- package/vendor/LICENSES/marked.txt +44 -0
- package/vendor/LICENSES/onnxruntime-web.txt +2 -0
- package/vendor/LICENSES/pdfjs-dist.txt +177 -0
- package/vendor/LICENSES/preact-signals-core.txt +21 -0
- package/vendor/LICENSES/pyodide.txt +2 -0
- package/vendor/LICENSES/quickjs-emscripten-core.txt +21 -0
- package/vendor/LICENSES/silurus-ooxml.txt +21 -0
- package/vendor/LICENSES/spessasynth_core.txt +202 -0
- package/vendor/LICENSES/sprintf-js.txt +24 -0
- package/vendor/LICENSES/stb-vorbis.txt +202 -0
- package/vendor/LICENSES/temml.txt +21 -0
- package/vendor/LICENSES/turndown.txt +21 -0
- package/vendor/LICENSES/zrender.txt +29 -0
- package/vendor/abcjs/abcjs.mjs +6 -0
- package/vendor/echarts/echarts.mjs +45 -0
- package/vendor/lit-html/async-directive.js +6 -0
- package/vendor/lit-html/directive-helpers.js +6 -0
- package/vendor/lit-html/directive.js +6 -0
- package/vendor/lit-html/directives/ref.js +6 -0
- package/vendor/lit-html/lit-html.js +6 -0
- package/vendor/maplibre/maplibre-gl-worker.js +9 -0
- package/vendor/maplibre/maplibre-gl.css +1 -0
- package/vendor/maplibre/maplibre-gl.mjs +818 -0
- package/vendor/marked.esm.js +79 -0
- package/vendor/signals-core.mjs +1 -0
- package/vendor/spessasynth/spessasynth.mjs +20764 -0
- package/vendor/spessasynth/stb-vorbis.mjs +1 -0
- package/vendor/temml/Temml.woff2 +0 -0
- package/vendor/temml/temml.css +372 -0
- package/vendor/temml/temml.mjs +2 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// Slides (D200): a ```marp block in an answer, read as Marp writes a deck (./deck.js) and shown a
|
|
2
|
+
// slide at a time, in the room's colours, its type sized with its width: paged with its buttons or
|
|
3
|
+
// the arrow keys, presented full screen, printed one slide under another, and copied as its source
|
|
4
|
+
// and the slide's picture at once.
|
|
5
|
+
// While the answer writes it, the slide being written shows; once written, the first, unless the
|
|
6
|
+
// user has paged. Loaded by the first deck an answer holds; until then it shows as code.
|
|
7
|
+
import { html, render, nothing } from 'lit-html'
|
|
8
|
+
import { notify } from '../../ui/state.js'
|
|
9
|
+
import { copyDrawing, pictureOf } from '../../ui/save.js'
|
|
10
|
+
import { drawn } from '../../ui/markdown.js'
|
|
11
|
+
import { drawnActions } from '../../ui/caps.js'
|
|
12
|
+
import { icons } from '../../ui/menu-icons.js'
|
|
13
|
+
import { styleSheet } from '../../ui/sheet.js'
|
|
14
|
+
import { lex, blocks, inline } from '../../ui/markdown.js'
|
|
15
|
+
import { t, locale, useStrings } from '../../core/i18n.js'
|
|
16
|
+
import { readDeck } from './deck.js'
|
|
17
|
+
|
|
18
|
+
await Promise.all([useStrings('slides'), styleSheet(new URL('slides.css', import.meta.url))])
|
|
19
|
+
|
|
20
|
+
/** Marp's classes the room's look draws: a title in the middle, and the colours swapped. */
|
|
21
|
+
const CLASSES = ['lead', 'invert']
|
|
22
|
+
|
|
23
|
+
/** A slide's own colours, as the properties its style reads, when they are colours. @param {Record<string, string>} settings */
|
|
24
|
+
const colours = (settings) => [['--slide-paper', settings.backgroundColor], ['--slide-ink', settings.color]]
|
|
25
|
+
.filter(([, colour]) => colour && CSS.supports('color', colour)).map(([name, colour]) => `${name}: ${colour}`).join('; ')
|
|
26
|
+
|
|
27
|
+
/** @param {any} token */
|
|
28
|
+
const shown = (token) => token.type === 'heading'
|
|
29
|
+
? html`<p class="heading h${token.depth}" role="heading" aria-level=${Math.min(6, token.depth + 2)}>${inline(token.tokens)}</p>`
|
|
30
|
+
: blocks([token])
|
|
31
|
+
|
|
32
|
+
class AppSlides extends HTMLElement {
|
|
33
|
+
static observedAttributes = ['source', 'open']
|
|
34
|
+
/** @type {import('./deck.js').Slide[]} */
|
|
35
|
+
slides = []
|
|
36
|
+
at = 0
|
|
37
|
+
/** Once the user pages, the deck stays where they are. */
|
|
38
|
+
paged = false
|
|
39
|
+
|
|
40
|
+
attributeChangedCallback() {
|
|
41
|
+
this.slides = readDeck(this.getAttribute('source') ?? '', lex)
|
|
42
|
+
this.at = this.paged ? Math.min(this.at, this.slides.length - 1) : this.hasAttribute('open') ? this.slides.length - 1 : 0
|
|
43
|
+
this.paint()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
paint() {
|
|
47
|
+
const source = this.getAttribute('source') ?? ''
|
|
48
|
+
const { slides, at } = this
|
|
49
|
+
if (!slides.some((slide) => slide.tokens.length)) {
|
|
50
|
+
return render(html`<p class="drawn-status muted small" role="status"><span class="while">${t('slides.drawing')}</span><span class="failed">${t('slides.failed')}</span></p>
|
|
51
|
+
<pre dir="ltr"><code>${source}</code></pre>`, this)
|
|
52
|
+
}
|
|
53
|
+
const number = new Intl.NumberFormat(locale.value).format
|
|
54
|
+
// Every slide is laid out, the others hidden behind the one shown: a chart on one is drawn at its size, and all of them print.
|
|
55
|
+
render(html`<div class="slides-stage" tabindex="0" role="region" aria-label=${t('slides.deck')} @keydown=${this.key} @click=${this.clicked}>
|
|
56
|
+
${slides.map(({ tokens, settings }, i) => html`<section class=${['slide', ...CLASSES.filter((name) => settings.class?.split(/\s+/).includes(name)), ...(i === at ? ['is-shown'] : [])].join(' ')}
|
|
57
|
+
.style=${colours(settings)} role="group" aria-roledescription=${t('slides.slide')} aria-label=${t('slides.where', { n: i + 1, count: slides.length })} dir="auto">
|
|
58
|
+
${settings.header ? html`<header>${blocks(lex(settings.header))}</header>` : nothing}
|
|
59
|
+
<div class="slide-body">${tokens.map(shown)}</div>
|
|
60
|
+
${settings.footer ? html`<footer>${blocks(lex(settings.footer))}</footer>` : nothing}
|
|
61
|
+
${settings.paginate === 'true' ? html`<span class="slide-number">${number(i + 1)}</span>` : nothing}
|
|
62
|
+
</section>`)}
|
|
63
|
+
</div>
|
|
64
|
+
<div class="slides-bar">
|
|
65
|
+
<button class="icon-button subtle back" aria-label=${t('slides.previous')} ?disabled=${at === 0} @click=${() => this.go(at - 1)}>${icons.back}</button>
|
|
66
|
+
<span class="slides-where">${number(at + 1)} / ${number(slides.length)}</span>
|
|
67
|
+
<button class="icon-button subtle" aria-label=${t('slides.next')} ?disabled=${at >= slides.length - 1} @click=${() => this.go(at + 1)}>${icons.arrow}</button>
|
|
68
|
+
${document.fullscreenEnabled ? html`<button class="icon-button subtle end" aria-label=${t('slides.present')} @click=${() => this.present()}>${icons.fullscreen}</button>` : nothing}
|
|
69
|
+
<button class="icon-button subtle end" aria-label=${t('action.copy')}
|
|
70
|
+
@click=${() => copyDrawing(source, this.picture()).then(() => notify(t('toast.copied')), () => notify(t('made.copyFailed')))}>${icons.copy}</button>
|
|
71
|
+
${drawnActions('marp', source)}
|
|
72
|
+
</div>`, this)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** @param {number} slide */
|
|
76
|
+
go(slide) {
|
|
77
|
+
this.paged = true
|
|
78
|
+
this.at = Math.max(0, Math.min(this.slides.length - 1, slide))
|
|
79
|
+
this.paint()
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
present() {
|
|
83
|
+
const stage = /** @type {HTMLElement} */ (this.querySelector('.slides-stage'))
|
|
84
|
+
stage.requestFullscreen().then(() => stage.focus(), () => {})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** The arrow keys, Page Up and Down, Home and End, and the space bar, as a presenter's clicker sends them. @param {KeyboardEvent} event */
|
|
88
|
+
key = (event) => {
|
|
89
|
+
const forward = getComputedStyle(this).direction === 'rtl' ? 'ArrowLeft' : 'ArrowRight'
|
|
90
|
+
const back = forward === 'ArrowLeft' ? 'ArrowRight' : 'ArrowLeft'
|
|
91
|
+
const to = { [forward]: this.at + 1, PageDown: this.at + 1, ' ': this.at + 1, [back]: this.at - 1, PageUp: this.at - 1, Home: 0, End: this.slides.length - 1 }[event.key]
|
|
92
|
+
if (to === undefined || event.altKey || event.ctrlKey || event.metaKey) return
|
|
93
|
+
event.preventDefault()
|
|
94
|
+
this.go(to)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Presented, a click anywhere but on a link moves on. @param {MouseEvent} event */
|
|
98
|
+
clicked = (event) => {
|
|
99
|
+
if (document.fullscreenElement && !(/** @type {Element} */ (event.target).closest('a, button'))) this.go(this.at + 1)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The slide shown as a picture to put in a document: a copy of it with each element's style as
|
|
104
|
+
* it is drawn now, in an SVG's foreignObject; a chart's canvas as its picture. @returns {Promise<Blob>}
|
|
105
|
+
*/
|
|
106
|
+
async picture() {
|
|
107
|
+
const slide = /** @type {HTMLElement} */ (this.querySelector('.slide.is-shown'))
|
|
108
|
+
const copy = /** @type {HTMLElement} */ (slide.cloneNode(true))
|
|
109
|
+
const copies = [copy, ...copy.querySelectorAll('*')]
|
|
110
|
+
for (const [i, element] of [slide, ...slide.querySelectorAll('*')].entries()) {
|
|
111
|
+
const style = getComputedStyle(element)
|
|
112
|
+
const into = /** @type {HTMLElement} */ (copies[i])
|
|
113
|
+
for (const name of style) into.style?.setProperty(name, style.getPropertyValue(name))
|
|
114
|
+
if (element instanceof HTMLCanvasElement) into.replaceWith(Object.assign(new Image(element.clientWidth), { src: element.toDataURL() }))
|
|
115
|
+
}
|
|
116
|
+
const { width, height } = slide.getBoundingClientRect()
|
|
117
|
+
return pictureOf(`<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}"><foreignObject width="100%" height="100%">${new XMLSerializer().serializeToString(copy)}</foreignObject></svg>`, width, height)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
customElements.define('app-slides', AppSlides)
|
|
122
|
+
drawn.value = { ...drawn.peek(), marp: (source, open) => html`<app-slides source=${source} ?open=${open}></app-slides>` }
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// Anthropic Messages, imported by llm.js the first time an Anthropic brain is used.
|
|
2
|
+
import { LLMError, headersFor, post, endpoint, sseEvents, parseData, parseArgs, doneEvent, streamError, noteBlock, documentBlock } from './llm.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @import { ChatMessage, SystemNote, StreamEvent, StopReason, Usage, Connection, Prompt, WireRequest } from './types.js'
|
|
6
|
+
* @import { SSEEvent } from './sse.js'
|
|
7
|
+
* @typedef {{ role: 'user'|'assistant', content: any[] }} AnthropicMessage
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Adaptive thinking exists from Claude 4.6 on, except Haiku; older models reject it.
|
|
11
|
+
const ADAPTIVE_THINKING = /^claude-(fable|mythos|opus|sonnet)-(5|4-[6-9])/
|
|
12
|
+
// Models that accept role "system" messages mid-conversation; others get a tagged block.
|
|
13
|
+
const MID_SYSTEM = /^claude-(opus-5|opus-4-8|fable-5|mythos-5|sonnet-5-5)/
|
|
14
|
+
// Models that take how much to think (D414); Claude Code's and Copilot's names for them are their own.
|
|
15
|
+
const EFFORT = /^claude-(fable|mythos|opus|sonnet|haiku)-(5|4-[6-9])/
|
|
16
|
+
// Models that accept server-side refusal fallbacks routed by refusal category.
|
|
17
|
+
const FALLBACK_MODELS = new Set(['claude-fable-5-1', 'claude-opus-5-5', 'claude-opus-5', 'claude-sonnet-5-5'])
|
|
18
|
+
const FALLBACK_BETA = 'server-side-fallback-2026-07-01'
|
|
19
|
+
|
|
20
|
+
/** @type {Map<string, StopReason>} */
|
|
21
|
+
const STOP = new Map([['end_turn', 'end'], ['tool_use', 'tool_use'], ['max_tokens', 'max_tokens'], ['model_context_window_exceeded', 'max_tokens'], ['refusal', 'refusal'], ['pause_turn', 'pause']])
|
|
22
|
+
// The provider's own tools and their results: echoed back whole in later requests.
|
|
23
|
+
const SERVER_BLOCK = /^server_tool_use$|_tool_result$/
|
|
24
|
+
// Set when the organisation turned web search off (a 400 says so): Jean's own search from then on.
|
|
25
|
+
let searchOff = false
|
|
26
|
+
|
|
27
|
+
/** streamChat() for Anthropic brains. @param {Connection & Prompt} options @returns {AsyncGenerator<StreamEvent, void, undefined>} */
|
|
28
|
+
export async function* streamAnthropic({ signal, fetch = globalThis.fetch, ...options }) {
|
|
29
|
+
const send = (/** @type {ChatMessage[]} */ messages) => post(fetch, anthropicRequest({ ...options, messages }), signal)
|
|
30
|
+
let res
|
|
31
|
+
try {
|
|
32
|
+
res = await send(options.messages)
|
|
33
|
+
} catch (error) {
|
|
34
|
+
const off = !searchOff && error instanceof LLMError && error.code === 'bad_request' && /web.?search/i.test(error.message)
|
|
35
|
+
// A replayed thinking block whose signature no longer matches (the conversation was
|
|
36
|
+
// edited elsewhere): answer this once without the earlier reasoning.
|
|
37
|
+
if (!off && !(isStaleThinking(error) && options.messages.some((m) => m.role === 'assistant' && m.raw))) throw error
|
|
38
|
+
searchOff ||= off
|
|
39
|
+
res = await send(off ? options.messages : options.messages.map((m) => (m.role === 'assistant' ? { ...m, raw: undefined } : m)))
|
|
40
|
+
}
|
|
41
|
+
yield* readAnthropic(sseEvents(res, signal))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** @param {unknown} error */
|
|
45
|
+
const isStaleThinking = (error) => error instanceof LLMError && error.code === 'bad_request' && /signature|thinking/i.test(error.message)
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* warmCache() for Anthropic brains. `messages` ends with the user message being written
|
|
49
|
+
* (its text may still be empty). Returns null when warming isn't worth it.
|
|
50
|
+
* @param {Connection & Prompt} options @returns {Promise<Usage | null>}
|
|
51
|
+
*/
|
|
52
|
+
export async function warmCache({ signal, fetch = globalThis.fetch, ...options }) {
|
|
53
|
+
const request = anthropicRequest(options)
|
|
54
|
+
const { body } = request
|
|
55
|
+
delete body.cache_control
|
|
56
|
+
delete body.stream
|
|
57
|
+
delete body.fallbacks
|
|
58
|
+
body.max_tokens = 0
|
|
59
|
+
// The breakpoint goes on the last block the real request will share: never on the placeholder.
|
|
60
|
+
while (body.messages.at(-1)?.role === 'system') body.messages.pop()
|
|
61
|
+
const last = body.messages.at(-1)
|
|
62
|
+
if (last?.role === 'user' && last.content.at(-1)?.type === 'text' && !last.content.at(-1).text) last.content.pop()
|
|
63
|
+
const block = last?.content.at(-1)
|
|
64
|
+
if (!block || JSON.stringify(body).length / 4 < minimumCacheable(options.brain.model)) return null
|
|
65
|
+
last.content[last.content.length - 1] = { ...block, cache_control: { type: 'ephemeral' } }
|
|
66
|
+
if (last.role === 'user') last.content.push({ type: 'text', text: '…' })
|
|
67
|
+
else body.messages.push({ role: 'user', content: [{ type: 'text', text: '…' }] })
|
|
68
|
+
const res = await post(fetch, request, signal)
|
|
69
|
+
const json = await res.json().catch(() => null)
|
|
70
|
+
return json?.usage ? anthropicUsage(json.usage) : null
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Smallest prefix Anthropic caches, in tokens; shorter ones silently aren't. @param {string} model */
|
|
74
|
+
export function minimumCacheable(model) {
|
|
75
|
+
if (/^claude-(opus-5|fable-5|mythos-5|sonnet-5-5)/.test(model)) return 512
|
|
76
|
+
if (/^claude-(opus-4-7|mythos-preview|3-5-haiku|haiku-3-5)/.test(model)) return 2048
|
|
77
|
+
if (/^claude-(opus-4-[56]|haiku-4-5)/.test(model)) return 4096
|
|
78
|
+
return 1024
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** @param {Connection & Prompt} options @returns {WireRequest} */
|
|
82
|
+
function anthropicRequest({ brain, apiKey, system, messages, tools = [], maxTokens, effort }) {
|
|
83
|
+
const headers = headersFor(brain, apiKey)
|
|
84
|
+
/** @type {Record<string, any>} */
|
|
85
|
+
const body = { model: brain.model, max_tokens: maxTokens ?? 64000, stream: true }
|
|
86
|
+
// One breakpoint at the end of the frozen system prompt (tools come before it), and
|
|
87
|
+
// automatic caching for the growing conversation (D49).
|
|
88
|
+
if (system) body.system = [{ type: 'text', text: system, cache_control: { type: 'ephemeral' } }]
|
|
89
|
+
body.cache_control = { type: 'ephemeral' }
|
|
90
|
+
// Summaries are shown to the user. budget_tokens and {type:'disabled'} are rejected by current models.
|
|
91
|
+
if (ADAPTIVE_THINKING.test(brain.model)) body.thinking = { type: 'adaptive', display: 'summarized' }
|
|
92
|
+
if (effort && EFFORT.test(brain.model)) body.output_config = { effort }
|
|
93
|
+
if (FALLBACK_MODELS.has(brain.model)) {
|
|
94
|
+
// On a safety refusal, the API continues on a fallback model inside the same stream.
|
|
95
|
+
body.fallbacks = 'default'
|
|
96
|
+
headers['anthropic-beta'] = [headers['anthropic-beta'], FALLBACK_BETA].filter(Boolean).join(',')
|
|
97
|
+
}
|
|
98
|
+
body.messages = toAnthropic(messages, brain.model)
|
|
99
|
+
// The brain's own web search runs on Anthropic's side: with dynamic filtering from Claude 4.6 on.
|
|
100
|
+
const search = { type: ADAPTIVE_THINKING.test(brain.model) ? 'web_search_20260209' : 'web_search_20250305', name: 'web_search', max_uses: 5 }
|
|
101
|
+
if (tools.length) {
|
|
102
|
+
body.tools = tools.map((t) => (t.native === 'web_search' && !searchOff ? search
|
|
103
|
+
: { name: t.name, description: t.description, input_schema: t.parameters, eager_input_streaming: true }))
|
|
104
|
+
}
|
|
105
|
+
return { url: endpoint(brain, '/messages'), headers, body }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* System notes become role "system" messages right after the next user message (the API
|
|
110
|
+
* wants one there) on models that take them, and a tagged block at its top elsewhere.
|
|
111
|
+
* @param {ChatMessage[]} messages @param {string} model
|
|
112
|
+
*/
|
|
113
|
+
function toAnthropic(messages, model) {
|
|
114
|
+
const native = MID_SYSTEM.test(model)
|
|
115
|
+
/** @type {(AnthropicMessage | SystemNote)[]} */
|
|
116
|
+
const out = []
|
|
117
|
+
/** @type {string[]} */
|
|
118
|
+
let notes = []
|
|
119
|
+
for (const message of messages) {
|
|
120
|
+
if (message.role === 'system') {
|
|
121
|
+
notes.push(message.content)
|
|
122
|
+
continue
|
|
123
|
+
}
|
|
124
|
+
const next = toAnthropicMessage(message, model)
|
|
125
|
+
if (message.role === 'user' && notes.length && !native) next.content.unshift(...notes.map((text) => ({ type: 'text', text: noteBlock(text) })))
|
|
126
|
+
if (!next.content.length) continue
|
|
127
|
+
const prev = out.at(-1)
|
|
128
|
+
// Roles must alternate: consecutive tool results become one user message.
|
|
129
|
+
if (prev?.role === next.role) /** @type {AnthropicMessage} */ (prev).content = [.../** @type {any[]} */ (prev.content), ...next.content]
|
|
130
|
+
else out.push(next)
|
|
131
|
+
if (message.role === 'user' && notes.length) {
|
|
132
|
+
if (native) for (const text of notes) out.push({ role: 'system', content: text })
|
|
133
|
+
notes = []
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return out
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** @param {Exclude<ChatMessage, SystemNote>} m @param {string} model @returns {AnthropicMessage} */
|
|
140
|
+
function toAnthropicMessage(m, model) {
|
|
141
|
+
if (m.role === 'user') {
|
|
142
|
+
const documents = (m.documents ?? []).flatMap((doc) => [{ type: 'text', text: documentBlock(doc) },
|
|
143
|
+
...(doc.image ? [{ type: 'image', source: { type: 'base64', media_type: doc.image.mimeType, data: doc.image.data } }] : [])])
|
|
144
|
+
return { role: 'user', content: m.content ? [...documents, { type: 'text', text: m.content }] : documents }
|
|
145
|
+
}
|
|
146
|
+
if (m.role === 'tool') {
|
|
147
|
+
const result = { type: 'tool_result', tool_use_id: m.toolCallId, content: m.content }
|
|
148
|
+
return { role: 'user', content: [m.isError ? { ...result, is_error: true } : result] }
|
|
149
|
+
}
|
|
150
|
+
// Thinking blocks must come back exactly as they were received, to the model that made them.
|
|
151
|
+
if (Array.isArray(m.raw) && (!m.rawModel || m.rawModel === model)) return { role: 'assistant', content: m.raw }
|
|
152
|
+
/** @type {any[]} */
|
|
153
|
+
const content = m.content ? [{ type: 'text', text: m.content }] : []
|
|
154
|
+
for (const c of m.toolCalls ?? []) content.push({ type: 'tool_use', id: c.id, name: c.name, input: c.args ?? {} })
|
|
155
|
+
return { role: 'assistant', content }
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** @param {AsyncIterable<SSEEvent>} events @returns {AsyncGenerator<StreamEvent, void, undefined>} */
|
|
159
|
+
async function* readAnthropic(events) {
|
|
160
|
+
/** @type {any[]} */
|
|
161
|
+
const blocks = []
|
|
162
|
+
/** @type {Record<string, number>} */
|
|
163
|
+
let usage = {}
|
|
164
|
+
let stop = ''
|
|
165
|
+
let finished = false
|
|
166
|
+
for await (const { event, data } of events) {
|
|
167
|
+
const d = parseData(data)
|
|
168
|
+
const type = d.type ?? event
|
|
169
|
+
if (type === 'error') throw streamError(d.error)
|
|
170
|
+
if (type === 'message_start') usage = { ...d.message?.usage }
|
|
171
|
+
if (type === 'content_block_start') blocks[d.index] = startBlock(d.content_block)
|
|
172
|
+
if (type === 'content_block_delta') {
|
|
173
|
+
const out = applyDelta(blocks[d.index], d.delta)
|
|
174
|
+
if (out) yield out
|
|
175
|
+
}
|
|
176
|
+
// Text that cites web pages: the sources follow it, as [n] once numbered.
|
|
177
|
+
const cited = type === 'content_block_stop' ? blocks[d.index]?.citations?.filter((/** @type {any} */ c) => c.url) : null
|
|
178
|
+
if (cited?.length) yield { type: 'cite', sources: cited.map((/** @type {any} */ c) => ({ title: c.title || c.url, url: c.url, quote: c.cited_text })) }
|
|
179
|
+
if (type === 'message_delta') {
|
|
180
|
+
stop = d.delta?.stop_reason ?? stop
|
|
181
|
+
// Later counts are cumulative and may restate earlier ones.
|
|
182
|
+
for (const [key, value] of Object.entries(d.usage ?? {})) if (typeof value === 'number') usage[key] = value
|
|
183
|
+
}
|
|
184
|
+
if (type === 'message_stop') finished = true
|
|
185
|
+
}
|
|
186
|
+
if (!finished) throw new LLMError('The response stream ended early', { code: 'network' })
|
|
187
|
+
// Tool calls are emitted only now, so a refusal fallback can't leave one the final message lacks.
|
|
188
|
+
const raw = keepAfterFallback(blocks.filter(Boolean)).map(finishBlock).filter(Boolean)
|
|
189
|
+
const toolCalls = raw.filter((b) => b.type === 'tool_use').map((b) => ({ id: b.id, name: b.name, args: b.input }))
|
|
190
|
+
for (const call of toolCalls) yield { type: 'tool_call', call }
|
|
191
|
+
const text = raw.filter((b) => b.type === 'text').map((b) => b.text).join('')
|
|
192
|
+
yield doneEvent(STOP.get(stop) ?? 'other', anthropicUsage(usage), text, toolCalls, raw)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** @param {any} block */
|
|
196
|
+
function startBlock(block = {}) {
|
|
197
|
+
switch (block.type) {
|
|
198
|
+
case 'text': return { type: 'text', text: block.text ?? '' }
|
|
199
|
+
case 'thinking': return { type: 'thinking', thinking: block.thinking ?? '', signature: block.signature ?? '' }
|
|
200
|
+
case 'redacted_thinking': return { type: 'redacted_thinking', data: block.data }
|
|
201
|
+
case 'tool_use': return { type: 'tool_use', id: block.id, name: block.name, json: '' }
|
|
202
|
+
// Server tools (the brain's own search) and their results; 'fallback' is a marker, never echoed back.
|
|
203
|
+
default: return SERVER_BLOCK.test(block.type) ? { ...block, json: '' } : { type: block.type }
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** @param {any} block @param {any} delta @returns {StreamEvent|null} */
|
|
208
|
+
function applyDelta(block, delta) {
|
|
209
|
+
if (!block || !delta) return null
|
|
210
|
+
if (delta.type === 'signature_delta') block.signature += delta.signature
|
|
211
|
+
if (delta.type === 'input_json_delta') block.json += delta.partial_json
|
|
212
|
+
if (delta.type === 'citations_delta') (block.citations ??= []).push(delta.citation)
|
|
213
|
+
// text_delta carries `text` and thinking_delta carries `thinking`, like the blocks they extend.
|
|
214
|
+
const kind = delta.type === 'text_delta' ? 'text' : delta.type === 'thinking_delta' ? 'thinking' : null
|
|
215
|
+
if (!kind || !delta[kind]) return null
|
|
216
|
+
block[kind] += delta[kind]
|
|
217
|
+
return { type: kind, delta: delta[kind] }
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* After a mid-output refusal, the API keeps the declined partial and marks the switch with a
|
|
222
|
+
* 'fallback' block. Only its text may be echoed back; thinking and tool calls before it are dropped.
|
|
223
|
+
* @param {any[]} blocks
|
|
224
|
+
*/
|
|
225
|
+
function keepAfterFallback(blocks) {
|
|
226
|
+
const cut = blocks.map((b) => b.type).lastIndexOf('fallback')
|
|
227
|
+
return blocks.filter((b, i) => i > cut || b.type === 'text')
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** @param {any} block */
|
|
231
|
+
function finishBlock(block) {
|
|
232
|
+
switch (block.type) {
|
|
233
|
+
case 'text': case 'thinking': case 'redacted_thinking': return block
|
|
234
|
+
case 'tool_use': return { type: 'tool_use', id: block.id, name: block.name, input: parseArgs(block.json) }
|
|
235
|
+
default: {
|
|
236
|
+
if (!SERVER_BLOCK.test(block.type)) return null
|
|
237
|
+
const { json, ...rest } = block
|
|
238
|
+
return json ? { ...rest, input: parseArgs(json) } : rest
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** Anthropic counts cached input apart; Usage.inputTokens counts all of it. @param {any} u @returns {Usage} */
|
|
244
|
+
function anthropicUsage(u) {
|
|
245
|
+
const read = u.cache_read_input_tokens ?? 0
|
|
246
|
+
const write = u.cache_creation_input_tokens ?? 0
|
|
247
|
+
/** @type {Usage} */
|
|
248
|
+
const usage = { inputTokens: (u.input_tokens ?? 0) + read + write }
|
|
249
|
+
if (u.output_tokens != null) usage.outputTokens = u.output_tokens
|
|
250
|
+
if (read) usage.cacheReadTokens = read
|
|
251
|
+
if (write) usage.cacheWriteTokens = write
|
|
252
|
+
return usage
|
|
253
|
+
}
|
package/core/deferred.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Deferred tools (D47): the conversation declares only the tools it started with; the
|
|
2
|
+
// rest are found with find_tools. With codemode declared, they are called from a script;
|
|
3
|
+
// otherwise the tools found are declared from the next request on (one cache miss).
|
|
4
|
+
import { bm25 } from './search.js'
|
|
5
|
+
|
|
6
|
+
/** @typedef {import('./loop.js').Tool} Tool */
|
|
7
|
+
|
|
8
|
+
/** A tool name a script can write as `tools.<name>`: `notion-search` would read as a subtraction (D106). @param {string} name */
|
|
9
|
+
export const identifier = (name) => name.replace(/\W/g, '_').replace(/^\d/, '_$&')
|
|
10
|
+
|
|
11
|
+
/** One line a brain can call from:`name({ file: string, pages?: string }): what it does`. @param {Tool} tool */
|
|
12
|
+
export function signature({ spec }) {
|
|
13
|
+
const { properties = {}, required = [] } = /** @type {any} */ (spec.parameters)
|
|
14
|
+
const args = Object.entries(properties).map(([name, schema]) => `${name}${required.includes(name) ? '' : '?'}: ${/** @type {any} */ (schema).type ?? 'any'}`)
|
|
15
|
+
return `${spec.name}({ ${args.join(', ')} }): ${spec.description}`
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Tools the brain can't call directly yet, reached by a shared step: `reach` declares them
|
|
20
|
+
* when there is no `run` to call them from, and says how to call them either way.
|
|
21
|
+
* @param {string[]} names @param {import('./loop.js').ToolContext} ctx
|
|
22
|
+
*/
|
|
23
|
+
export function reach(names, ctx) {
|
|
24
|
+
const script = ['javascript', 'run'].find((name) => ctx.declared.includes(name))
|
|
25
|
+
if (script) return `Call them inside ${script}, e.g. \`await tools.name({ … })\`.`
|
|
26
|
+
ctx.declare(names)
|
|
27
|
+
return 'You can call them directly from your next step.'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** @param {{ tools: () => Tool[] }} options @returns {Tool} */
|
|
31
|
+
export function findTools({ tools }) {
|
|
32
|
+
return {
|
|
33
|
+
spec: {
|
|
34
|
+
name: 'find_tools',
|
|
35
|
+
description: 'Find tools that are not listed yet, by what they do, and learn how to call them.',
|
|
36
|
+
parameters: { type: 'object', properties: { query: { type: 'string', description: 'What the tool should do, in English' } }, required: ['query'] },
|
|
37
|
+
},
|
|
38
|
+
kind: 'search',
|
|
39
|
+
title: (args) => `Find tools: ${args?.query ?? ''}`,
|
|
40
|
+
run: async (args, ctx) => {
|
|
41
|
+
const deferred = tools().filter((tool) => !tool.hidden && !tool.off && !ctx.declared.includes(tool.spec.name))
|
|
42
|
+
if (!deferred.length) return 'There are no other tools.'
|
|
43
|
+
const hits = bm25(deferred.map((tool) => `${tool.spec.name.replace(/_/g, ' ')} ${tool.spec.description}`), String(args?.query ?? ''))
|
|
44
|
+
const found = (hits.length ? hits.map((hit) => deferred[hit.index]) : deferred).slice(0, 5)
|
|
45
|
+
return `${found.map(signature).join('\n')}\n\n${reach(found.map((tool) => tool.spec.name), ctx)}`
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
}
|
package/core/events.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// ACP records: building them and folding them for display. The brain reads the same log, as
|
|
2
|
+
// core/prompt.js's toChatMessages() derives it. One log, two readers.
|
|
3
|
+
/** @import { Envelope, AcpUpdate, ToolCall, ToolCallInfo, PlanEntry, ResourceLink, SystemNoteData, CompactionUpdate } from './types.js' */
|
|
4
|
+
|
|
5
|
+
/** @param {string} by @param {AcpUpdate} update @param {number} [step] @returns {Envelope} */
|
|
6
|
+
export const envelope = (by, update, step) => ({ at: new Date().toISOString(), by, ...(step !== undefined && { step }), update })
|
|
7
|
+
|
|
8
|
+
/** @param {string} text @param {string} by */
|
|
9
|
+
export const userRecord = (text, by) => envelope(by, { sessionUpdate: 'user_message_chunk', content: { type: 'text', text } })
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* One user message: a chunk per shared file, then the text, which ends it.
|
|
13
|
+
* @param {string} text @param {ResourceLink[]} files @param {string} by
|
|
14
|
+
*/
|
|
15
|
+
export function userRecords(text, files, by) {
|
|
16
|
+
const links = files.map((link) => envelope(by, { sessionUpdate: 'user_message_chunk', content: link }))
|
|
17
|
+
return text || !links.length ? [...links, userRecord(text, by)] : links
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** A system note (D46): what changed, in English for the brain, plus data for the UI. @param {string} text @param {SystemNoteData} data */
|
|
21
|
+
export const noteRecord = (text, data) => envelope('jean', { sessionUpdate: '_system_note', text, data })
|
|
22
|
+
|
|
23
|
+
/** @param {string} by @param {Record<string, any>} meta @returns {Envelope} */
|
|
24
|
+
export const metaRecord = (by, meta) => ({ at: new Date().toISOString(), by, meta })
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {{ index: number, text: string, thought: string, tools: ToolCallInfo[], compaction?: CompactionUpdate }} Step compaction: a summary read on from (D359)
|
|
28
|
+
* @typedef {{ text: string, data: SystemNoteData }} Note
|
|
29
|
+
* @typedef {{ text: string, files: ResourceLink[], at: string, upTo: number, steer?: boolean }} UserTurn upTo: how many records lead up to its end; steer: D365
|
|
30
|
+
* @typedef {{ user: UserTurn | null, notes: Note[], steps: Step[], plan?: PlanEntry[], at: string, end?: string }} Turn
|
|
31
|
+
* notes are the system notes recorded just before this turn's user message; end is when its answer was last written.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/** Fold records into turns for display. @param {Envelope[]} records @returns {Turn[]} */
|
|
35
|
+
export function foldTurns(records) {
|
|
36
|
+
/** @type {Turn[]} */
|
|
37
|
+
const turns = []
|
|
38
|
+
/** @type {Turn | null} */
|
|
39
|
+
let turn = null
|
|
40
|
+
/** @type {Note[]} */
|
|
41
|
+
let notes = []
|
|
42
|
+
let previous = ''
|
|
43
|
+
for (const [index, record] of records.entries()) {
|
|
44
|
+
const update = record.update
|
|
45
|
+
if (!update) continue
|
|
46
|
+
const kind = update.sessionUpdate
|
|
47
|
+
if (kind === '_system_note') notes.push({ text: update.text, data: update.data })
|
|
48
|
+
else if (kind === 'user_message_chunk') {
|
|
49
|
+
// Words end a message.
|
|
50
|
+
if (previous !== kind || !turn?.user || turn.user.text) {
|
|
51
|
+
turn = { user: { text: '', files: [], at: record.at, upTo: 0 }, notes, steps: [], at: record.at }
|
|
52
|
+
turns.push(turn)
|
|
53
|
+
notes = []
|
|
54
|
+
}
|
|
55
|
+
const user = /** @type {UserTurn} */ (turn.user)
|
|
56
|
+
user.upTo = index + 1
|
|
57
|
+
if (update._meta?.steer) user.steer = true
|
|
58
|
+
if (update.content.type === 'resource_link') user.files.push(update.content)
|
|
59
|
+
else user.text += update.content.text
|
|
60
|
+
} else {
|
|
61
|
+
if (!turn) turns.push((turn = { user: null, notes: [], steps: [], at: record.at }))
|
|
62
|
+
applyUpdate(turn, update, record.step ?? 0)
|
|
63
|
+
turn.end = record.at
|
|
64
|
+
}
|
|
65
|
+
previous = kind
|
|
66
|
+
}
|
|
67
|
+
return turns
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Every file linked from the conversation, in order. @param {Envelope[]} records @returns {ResourceLink[]} */
|
|
71
|
+
export const linkedFiles = (records) => records.flatMap(({ update }) => (update?.sessionUpdate === 'user_message_chunk' && update.content.type === 'resource_link' ? [update.content] : []))
|
|
72
|
+
|
|
73
|
+
/** A picture brains that can see take as it is: PNG, JPEG, WebP or GIF. @param {ResourceLink} link */
|
|
74
|
+
export const isPicture = (link) => /^image\/(png|jpeg|webp|gif)$/.test(link.mimeType ?? '')
|
|
75
|
+
|
|
76
|
+
/** @param {Turn} turn @param {AcpUpdate} update @param {number} index */
|
|
77
|
+
export function applyUpdate(turn, update, index) {
|
|
78
|
+
if (update.sessionUpdate === 'plan') {
|
|
79
|
+
turn.plan = update.entries
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
let step = turn.steps.find((candidate) => candidate.index === index)
|
|
83
|
+
if (!step) turn.steps.push((step = { index, text: '', thought: '', tools: [] }))
|
|
84
|
+
if (update.sessionUpdate === 'agent_message_chunk') step.text += update.content.text
|
|
85
|
+
else if (update.sessionUpdate === 'agent_thought_chunk') step.thought += update.content.text
|
|
86
|
+
else if (update.sessionUpdate === 'compaction_update') step.compaction = update
|
|
87
|
+
else if (update.sessionUpdate === 'user_message_chunk' || update.sessionUpdate === '_system_note') return
|
|
88
|
+
else if (update.sessionUpdate === 'tool_call' || update.sessionUpdate === 'tool_call_update') {
|
|
89
|
+
const { sessionUpdate, ...info } = update
|
|
90
|
+
const existing = step.tools.find((tool) => tool.toolCallId === info.toolCallId)
|
|
91
|
+
if (existing) Object.assign(existing, info)
|
|
92
|
+
else step.tools.push(/** @type {ToolCallInfo} */ ({ ...info }))
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** What a page closed on while the last turn waited for the user: its last step's unended calls, to run again (D212). @param {Envelope[]} records @returns {{ step: number, calls: ToolCall[] } | null} */
|
|
97
|
+
export function unanswered(records) {
|
|
98
|
+
const step = foldTurns(records).at(-1)?.steps.at(-1)
|
|
99
|
+
const calls = step?.tools.filter((tool) => tool.name && !tool._meta?.parent && tool.status === 'pending') ?? []
|
|
100
|
+
return step && calls[0]?._meta?.waiting ? { step: step.index, calls: calls.map((tool) => ({ id: tool.toolCallId, name: String(tool.name), args: tool.rawInput ?? {} })) } : null
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* A reply's text without the follow-ups the brain suggested in a trailing <suggestions>
|
|
105
|
+
* block, which is hidden from its opening tag on (even mid-stream), and those follow-ups.
|
|
106
|
+
* @param {string} text
|
|
107
|
+
*/
|
|
108
|
+
export function splitSuggestions(text) {
|
|
109
|
+
const at = text.search(/<suggestions>|<s(u(g(g(e(s(t(i(o(n(s)?)?)?)?)?)?)?)?)?)?$/i)
|
|
110
|
+
if (at < 0) return { text, suggestions: [] }
|
|
111
|
+
const lines = text.slice(at).replace(/<\/?suggestions>?/gi, '').split('\n')
|
|
112
|
+
const suggestions = lines.map((line) => line.replace(/^\s*(?:[-*•]|\d+[.)])?\s*/, '').trim()).filter((line) => line && !line.startsWith('<'))
|
|
113
|
+
return { text: text.slice(0, at).trimEnd(), suggestions: suggestions.slice(0, 3) }
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Latest title from meta records. @param {Envelope[]} records @returns {string} */
|
|
117
|
+
export const titleOf = (records) => records.findLast((record) => record.meta?.title)?.meta?.title ?? ''
|
|
118
|
+
|
|
119
|
+
/** The words of each request, in order. @param {Envelope[]} records @returns {string[]} */
|
|
120
|
+
export const requestsOf = (records) => records.flatMap(({ update }) => (update?.sessionUpdate === 'user_message_chunk' && update.content.type === 'text' && update.content.text ? [update.content.text] : []))
|
|
121
|
+
|
|
122
|
+
/** The words of the request that opened the conversation. @param {Envelope[]} records */
|
|
123
|
+
export const openingOf = (records) => requestsOf(records)[0] ?? ''
|
|
124
|
+
|
|
125
|
+
/** The routine a conversation is a run of, from the note it opens with (D122). @param {Envelope[]} records */
|
|
126
|
+
export const routineOf = (records) => records.flatMap(({ update }) => (update?.sessionUpdate === '_system_note' && update.data.kind === 'routine' ? [update.data] : []))[0]
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* A file Jean made or changed: Things Jean made's (`_meta.file`), a picture or a film (`_meta.picture`,
|
|
130
|
+
* D251), or one the computer kept (`_meta.files`), with its version in the conversation (D164).
|
|
131
|
+
* @typedef {{ uri: string, name: string, mimeType: string, size: number, version?: number }} MadeFile
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The tool calls of a conversation, in order: those its records hold, then those of the answer
|
|
136
|
+
* being written. @param {Envelope[]} records @param {{ tools: ToolCallInfo[] }[]} [steps]
|
|
137
|
+
* @returns {ToolCallInfo[]}
|
|
138
|
+
*/
|
|
139
|
+
export const callsIn = (records, steps = []) => [
|
|
140
|
+
...records.flatMap(({ update }) => (update?.sessionUpdate === 'tool_call' ? [/** @type {ToolCallInfo} */ (update)] : [])),
|
|
141
|
+
...steps.flatMap((step) => step.tools),
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
/** Where a file of the conversation is as it is now: the copy the user last changed it into in the preview, else itself (D229). @param {Envelope[]} records @param {string} uri */
|
|
145
|
+
export const latestOf = (records, uri) => records.flatMap(({ update }) => (update?.sessionUpdate === '_system_note' && update.data.kind === 'cells' && update.data.was === uri ? [update.data.uri] : [])).at(-1) ?? uri
|
|
146
|
+
|
|
147
|
+
/** Every file the calls made, in order. @param {ToolCallInfo[]} calls @returns {MadeFile[]} */
|
|
148
|
+
export const filesMade = (calls) => calls.flatMap((call) => [call._meta?.file, call._meta?.picture, ...(call._meta?.files ?? [])].filter(Boolean))
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* A file's versions in a conversation, oldest first, by its name, numbered: each one made, a
|
|
152
|
+
* version made again just after itself counted once (D164).
|
|
153
|
+
* @param {MadeFile[]} made @param {string} name @returns {Required<MadeFile>[]}
|
|
154
|
+
*/
|
|
155
|
+
export function versionsOf(made, name) {
|
|
156
|
+
/** @type {Required<MadeFile>[]} */
|
|
157
|
+
const versions = []
|
|
158
|
+
for (const file of made) if (file.name === name && versions.at(-1)?.uri !== file.uri) versions.push({ ...file, version: versions.length + 1 })
|
|
159
|
+
return versions
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** The version a file just made will be: the next, unless it is the last one again. @param {MadeFile[]} made @param {string} name @param {string} uri */
|
|
163
|
+
export function nextVersion(made, name, uri) {
|
|
164
|
+
const versions = versionsOf(made, name)
|
|
165
|
+
return versions.at(-1)?.uri === uri ? versions.length : versions.length + 1
|
|
166
|
+
}
|