aimeat 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-stamp.json +4 -4
- package/dist/locales/en.json +9103 -9101
- package/dist/locales/es.json +9095 -0
- package/dist/locales/fi.json +9103 -9101
- package/dist/public/cortex-bundled/aimeat-input.js +611 -0
- package/dist/public/cortex-bundled/aimeat-input.yaml +149 -0
- package/dist/public/css/views/agents-detail.css +11 -0
- package/dist/public/js/utils.js +12 -7
- package/dist/public/spa.html +5 -2
- package/dist/public/views/admin/email-tab.js +459 -458
- package/dist/public/views/profile/agents/agent-card.js +25 -0
- package/dist/public/views/profile/agents/scope-model.js +296 -288
- package/dist/public/views/profile/agents-tab.js +26 -3
- package/dist/scripts/check-ai-disclosure.d.ts.map +1 -1
- package/dist/scripts/check-ai-disclosure.js +33 -18
- package/dist/scripts/check-ai-disclosure.js.map +1 -1
- package/dist/scripts/check-locales.d.ts +2 -0
- package/dist/scripts/check-locales.d.ts.map +1 -0
- package/dist/scripts/check-locales.js +46 -0
- package/dist/scripts/check-locales.js.map +1 -0
- package/dist/scripts/lib/locale-files.d.ts +40 -0
- package/dist/scripts/lib/locale-files.d.ts.map +1 -0
- package/dist/scripts/lib/locale-files.js +181 -0
- package/dist/scripts/lib/locale-files.js.map +1 -0
- package/dist/scripts/locale-extract.d.ts +2 -0
- package/dist/scripts/locale-extract.d.ts.map +1 -0
- package/dist/scripts/locale-extract.js +99 -0
- package/dist/scripts/locale-extract.js.map +1 -0
- package/dist/scripts/locale-merge.d.ts +2 -0
- package/dist/scripts/locale-merge.d.ts.map +1 -0
- package/dist/scripts/locale-merge.js +114 -0
- package/dist/scripts/locale-merge.js.map +1 -0
- package/dist/src/auth/middleware.d.ts +6 -0
- package/dist/src/auth/middleware.d.ts.map +1 -1
- package/dist/src/auth/middleware.js +24 -4
- package/dist/src/auth/middleware.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-management.d.ts +1 -0
- package/dist/src/cli/connect/mcp/tools/agent-management.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-management.js +9 -0
- package/dist/src/cli/connect/mcp/tools/agent-management.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/schedules.d.ts +3 -0
- package/dist/src/cli/connect/mcp/tools/schedules.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/schedules.js +5 -0
- package/dist/src/cli/connect/mcp/tools/schedules.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-agent.d.ts +2 -0
- package/dist/src/cli/connect/tool-call-defs-agent.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-agent.js +16 -0
- package/dist/src/cli/connect/tool-call-defs-agent.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-organism.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-organism.js +6 -0
- package/dist/src/cli/connect/tool-call-defs-organism.js.map +1 -1
- package/dist/src/config-operator.d.ts +4 -1
- package/dist/src/config-operator.d.ts.map +1 -1
- package/dist/src/config-operator.js +4 -4
- package/dist/src/config-operator.js.map +1 -1
- package/dist/src/data/library-packs/cortex.d.ts +3 -0
- package/dist/src/data/library-packs/cortex.d.ts.map +1 -1
- package/dist/src/data/library-packs/cortex.js +58 -0
- package/dist/src/data/library-packs/cortex.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +90 -2
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/i18n.d.ts +1 -1
- package/dist/src/i18n.d.ts.map +1 -1
- package/dist/src/i18n.js +13 -6
- package/dist/src/i18n.js.map +1 -1
- package/dist/src/mcp/agent-management.d.ts +6 -2
- package/dist/src/mcp/agent-management.d.ts.map +1 -1
- package/dist/src/mcp/agent-management.js +34 -3
- package/dist/src/mcp/agent-management.js.map +1 -1
- package/dist/src/mcp/agent-schedules.d.ts +6 -2
- package/dist/src/mcp/agent-schedules.d.ts.map +1 -1
- package/dist/src/mcp/agent-schedules.js +22 -1
- package/dist/src/mcp/agent-schedules.js.map +1 -1
- package/dist/src/mcp/annotations.d.ts +1 -0
- package/dist/src/mcp/annotations.d.ts.map +1 -1
- package/dist/src/mcp/annotations.js +5 -0
- package/dist/src/mcp/annotations.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/agent-messaging.d.ts +2 -0
- package/dist/src/mcp/catalog/definitions/agent-messaging.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/agent-messaging.js +12 -0
- package/dist/src/mcp/catalog/definitions/agent-messaging.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js +7 -0
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
- package/dist/src/mcp/catalog/scopes.js +5 -0
- package/dist/src/mcp/catalog/scopes.js.map +1 -1
- package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
- package/dist/src/mcp/catalog/surfaces.js +4 -2
- package/dist/src/mcp/catalog/surfaces.js.map +1 -1
- package/dist/src/routes/admin-features.d.ts.map +1 -1
- package/dist/src/routes/admin-features.js +5 -4
- package/dist/src/routes/admin-features.js.map +1 -1
- package/dist/src/routes/agents/constants.d.ts +18 -2
- package/dist/src/routes/agents/constants.d.ts.map +1 -1
- package/dist/src/routes/agents/constants.js +18 -2
- package/dist/src/routes/agents/constants.js.map +1 -1
- package/dist/src/routes/agents/device-auth.d.ts +2 -0
- package/dist/src/routes/agents/device-auth.d.ts.map +1 -1
- package/dist/src/routes/agents/device-auth.js +22 -2
- package/dist/src/routes/agents/device-auth.js.map +1 -1
- package/dist/src/routes/agents/management.d.ts +7 -0
- package/dist/src/routes/agents/management.d.ts.map +1 -1
- package/dist/src/routes/agents/management.js +59 -4
- package/dist/src/routes/agents/management.js.map +1 -1
- package/dist/src/routes/agents/profile-metadata.d.ts +4 -0
- package/dist/src/routes/agents/profile-metadata.d.ts.map +1 -1
- package/dist/src/routes/agents/profile-metadata.js +31 -2
- package/dist/src/routes/agents/profile-metadata.js.map +1 -1
- package/dist/src/routes/agents/registration.d.ts +2 -0
- package/dist/src/routes/agents/registration.d.ts.map +1 -1
- package/dist/src/routes/agents/registration.js +3 -0
- package/dist/src/routes/agents/registration.js.map +1 -1
- package/dist/src/routes/ai-transparency.d.ts.map +1 -1
- package/dist/src/routes/ai-transparency.js +5 -1
- package/dist/src/routes/ai-transparency.js.map +1 -1
- package/dist/src/routes/auth.d.ts +3 -0
- package/dist/src/routes/auth.d.ts.map +1 -1
- package/dist/src/routes/auth.js +22 -5
- package/dist/src/routes/auth.js.map +1 -1
- package/dist/src/routes/portal.d.ts +3 -0
- package/dist/src/routes/portal.d.ts.map +1 -1
- package/dist/src/routes/portal.js +39 -17
- package/dist/src/routes/portal.js.map +1 -1
- package/dist/src/routes/schedules.d.ts +3 -0
- package/dist/src/routes/schedules.d.ts.map +1 -1
- package/dist/src/routes/schedules.js +16 -29
- package/dist/src/routes/schedules.js.map +1 -1
- package/dist/src/services/agent-profile-write.d.ts +13 -1
- package/dist/src/services/agent-profile-write.d.ts.map +1 -1
- package/dist/src/services/agent-profile-write.js +55 -0
- package/dist/src/services/agent-profile-write.js.map +1 -1
- package/dist/src/services/build-app-prompt.d.ts.map +1 -1
- package/dist/src/services/build-app-prompt.js +22 -0
- package/dist/src/services/build-app-prompt.js.map +1 -1
- package/dist/src/services/email-templates.d.ts.map +1 -1
- package/dist/src/services/email-templates.js +79 -3
- package/dist/src/services/email-templates.js.map +1 -1
- package/dist/src/services/notification-templates.d.ts +5 -3
- package/dist/src/services/notification-templates.d.ts.map +1 -1
- package/dist/src/services/notification-templates.js +23 -3
- package/dist/src/services/notification-templates.js.map +1 -1
- package/dist/src/services/schedule-write.d.ts +25 -2
- package/dist/src/services/schedule-write.d.ts.map +1 -1
- package/dist/src/services/schedule-write.js +44 -0
- package/dist/src/services/schedule-write.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/db-types.d.ts +2 -0
- package/dist/src/storage/providers/postgres-kysely/db-types.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js +5 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/sessions.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/sessions.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/sessions.js +4 -0
- package/dist/src/storage/providers/postgres-kysely/methods/sessions.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/migrations/0034_agent_console_url.sql +16 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0035_agent_registered_by.sql +19 -0
- package/dist/src/storage/providers/sqlite/methods/extensions-notify.d.ts +2 -0
- package/dist/src/storage/providers/sqlite/methods/extensions-notify.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/extensions-notify.js +4 -0
- package/dist/src/storage/providers/sqlite/methods/extensions-notify.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts +5 -0
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.js +13 -4
- package/dist/src/storage/providers/sqlite/methods/owner.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/auth.d.ts +2 -0
- package/dist/src/storage/providers/sqlite/repos/auth.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/auth.js +4 -0
- package/dist/src/storage/providers/sqlite/repos/auth.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-1.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/schema-tables-1.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-1.js +4 -2
- package/dist/src/storage/providers/sqlite/schema-tables-1.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-2.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/schema-tables-2.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-2.js +4 -3
- package/dist/src/storage/providers/sqlite/schema-tables-2.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-3.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/schema-tables-3.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-3.js +6 -9
- package/dist/src/storage/providers/sqlite/schema-tables-3.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.d.ts +6 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +9 -0
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/session.repository.d.ts +14 -0
- package/dist/src/storage/repositories/session.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/session.repository.js +2 -0
- package/dist/src/storage/repositories/session.repository.js.map +1 -1
- package/dist/src/storage/storage-factory.d.ts +6 -0
- package/dist/src/storage/storage-factory.d.ts.map +1 -1
- package/dist/src/storage/storage-factory.js +38 -19
- package/dist/src/storage/storage-factory.js.map +1 -1
- package/dist/src/storage/types/identity.d.ts +31 -0
- package/dist/src/storage/types/identity.d.ts.map +1 -1
- package/dist/src/utils/gaii.d.ts +11 -0
- package/dist/src/utils/gaii.d.ts.map +1 -1
- package/dist/src/utils/gaii.js +16 -0
- package/dist/src/utils/gaii.js.map +1 -1
- package/dist/static/sdk-libs/ai/strings.js +5 -2
- package/dist/static/sdk-libs/auth/i18n.js +9 -4
- package/dist/static/sdk-libs/auth/modal.js +11 -3
- package/dist/static/sdk-libs/auth/pill-strings.js +52 -0
- package/dist/static/sdk-libs/auth/pill.js +16 -2
- package/dist/static/sdk-libs/dist/aimeat-ai.js +30 -1
- package/dist/static/sdk-libs/dist/aimeat-auth.js +61 -5
- package/dist/static/sdk-libs/dist/aimeat-game.js +32 -2
- package/dist/static/sdk-libs/dist/aimeat-header.js +9 -4
- package/dist/static/sdk-libs/game/i18n.js +38 -7
- package/dist/static/sdk-libs/header/index.js +11 -5
- package/package.json +4 -1
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
function main() {
|
|
11
11
|
var THEME_KEY = "aimeat-theme";
|
|
12
12
|
var LANG_KEY = "aimeat-lang";
|
|
13
|
+
var LANGS = ["en", "fi", "es"];
|
|
13
14
|
var NAV_FALLBACK = {
|
|
14
15
|
"nav.howItWorks": "How it works",
|
|
15
16
|
"nav.business": "For your business",
|
|
@@ -23,12 +24,13 @@
|
|
|
23
24
|
function readLang() {
|
|
24
25
|
try {
|
|
25
26
|
var u = new URLSearchParams(location.search).get("lang");
|
|
26
|
-
if (u
|
|
27
|
+
if (LANGS.indexOf(u) !== -1) return u;
|
|
27
28
|
var s = localStorage.getItem(LANG_KEY);
|
|
28
|
-
if (s
|
|
29
|
+
if (LANGS.indexOf(s) !== -1) return s;
|
|
29
30
|
} catch {
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
var nav = (navigator.language || "en").slice(0, 2).toLowerCase();
|
|
33
|
+
return LANGS.indexOf(nav) !== -1 ? nav : "en";
|
|
32
34
|
}
|
|
33
35
|
function readTheme() {
|
|
34
36
|
try {
|
|
@@ -178,7 +180,10 @@
|
|
|
178
180
|
}
|
|
179
181
|
var nav = document.createElement("nav");
|
|
180
182
|
nav.className = "topnav";
|
|
181
|
-
nav.innerHTML = '<div style="display:flex;align-items:center;gap:20px"><a href="' + nodeHref("/v1/portal") + '" class="topnav-brand">AIME<span class="heart">♥</span><span class="brand-at">AT</span></a><span class="brand-morsels" data-morsels style="display:none"></span></div><div class="topnav-right"><button class="topnav-burger" aria-label="Menu" data-burger>☰</button><div class="topnav-menu" data-menu><a href="' + nodeHref("/v1/how-it-works") + '" data-anon-only>' + label("nav.howItWorks") + '</a><a href="' + nodeHref("/v1/business") + '" data-anon-only>' + label("nav.business") + '</a><a href="' + nodeHref("/v1/help") + '">' + label("nav.help") + '</a><a href="' + nodeHref("/app-catalog.html") + '" target="_blank" data-auth-only style="display:none">' + label("nav.apps") + '</a><a href="' + nodeHref("/v1/profile") + '" class="profile-link visible" data-auth-only style="display:none">' + label("nav.profile") + '</a><a href="' + nodeHref("/v1/admin") + '" data-operator-only style="display:none">' + label("nav.admin") + '</a><div class="topnav-center"
|
|
183
|
+
nav.innerHTML = '<div style="display:flex;align-items:center;gap:20px"><a href="' + nodeHref("/v1/portal") + '" class="topnav-brand">AIME<span class="heart">♥</span><span class="brand-at">AT</span></a><span class="brand-morsels" data-morsels style="display:none"></span></div><div class="topnav-right"><button class="topnav-burger" aria-label="Menu" data-burger>☰</button><div class="topnav-menu" data-menu><a href="' + nodeHref("/v1/how-it-works") + '" data-anon-only>' + label("nav.howItWorks") + '</a><a href="' + nodeHref("/v1/business") + '" data-anon-only>' + label("nav.business") + '</a><a href="' + nodeHref("/v1/help") + '">' + label("nav.help") + '</a><a href="' + nodeHref("/app-catalog.html") + '" target="_blank" data-auth-only style="display:none">' + label("nav.apps") + '</a><a href="' + nodeHref("/v1/profile") + '" class="profile-link visible" data-auth-only style="display:none">' + label("nav.profile") + '</a><a href="' + nodeHref("/v1/admin") + '" data-operator-only style="display:none">' + label("nav.admin") + '</a><div class="topnav-center">' + // Theme toggle now lives inside the login pill (mountLoginButton) — see init().
|
|
184
|
+
LANGS.map(function(l) {
|
|
185
|
+
return '<button class="lang-btn" data-lang="' + l + '">' + l.toUpperCase() + "</button>";
|
|
186
|
+
}).join("") + '</div></div><span class="header-auth-slot" id="headerAuth"></span></div>';
|
|
182
187
|
return nav;
|
|
183
188
|
}
|
|
184
189
|
function wire(nav, t, lang) {
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file game/i18n.js
|
|
3
3
|
* @description Translation for the aimeat-game kit's OWN handful of strings, and the merge point
|
|
4
|
-
* for the host's. The kit ships English and
|
|
5
|
-
* (Close, Back, Locked, Coming soon, …); everything else — every label in your game —
|
|
6
|
-
* the host, because the kit has no idea what your entries are called.
|
|
4
|
+
* for the host's. The kit ships English, Finnish and Spanish for the words it puts on screen
|
|
5
|
+
* itself (Close, Back, Locked, Coming soon, …); everything else — every label in your game —
|
|
6
|
+
* comes from the host, because the kit has no idea what your entries are called.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Each language is written in that language, not as translated English.
|
|
9
9
|
*
|
|
10
10
|
* It follows the PLATFORM language choice rather than inventing a second one: the current
|
|
11
11
|
* language is read from AIMEAT.auth.getLang() when the auth library is present, else the
|
|
12
12
|
* `aimeat-lang` storage key, else the browser, and it re-renders on the platform's
|
|
13
13
|
* `aimeat-lang-change` event. There is no language switch in this kit — the login pill has one.
|
|
14
|
-
* @structure BASE (en/fi) · lang/setLang · use(dict) · t(key, vars) · onChange
|
|
14
|
+
* @structure BASE (en/fi/es) · lang/setLang · use(dict) · t(key, vars) · onChange
|
|
15
15
|
* @usage AIMEAT.game.i18n.use({ fi: { play: 'Pelaa' }, en: { play: 'Play' } });
|
|
16
16
|
* AIMEAT.game.i18n.t('play');
|
|
17
17
|
* @version-history
|
|
18
|
+
* v1.1.0 — 2026-08-12 — Spanish (es) added to BASE, HOST and langs.
|
|
18
19
|
* v1.0.0 — 2026-07-28 — Initial (NOSTE prompt 01).
|
|
19
20
|
*/
|
|
20
21
|
|
|
@@ -80,10 +81,40 @@ const BASE = {
|
|
|
80
81
|
target: 'Tavoite {n}',
|
|
81
82
|
fix: 'Korjaa tämä',
|
|
82
83
|
},
|
|
84
|
+
es: {
|
|
85
|
+
close: 'Cerrar',
|
|
86
|
+
back: 'Atrás',
|
|
87
|
+
cancel: 'Cancelar',
|
|
88
|
+
confirm: 'Confirmar',
|
|
89
|
+
menu: 'Menú',
|
|
90
|
+
locked: 'Bloqueado',
|
|
91
|
+
done: 'Listo',
|
|
92
|
+
open: 'Abierto',
|
|
93
|
+
now: 'Ahora',
|
|
94
|
+
later: 'Después',
|
|
95
|
+
comingSoon: 'Próximamente',
|
|
96
|
+
notifyMe: 'Avísame cuando abra',
|
|
97
|
+
notified: 'Te avisamos',
|
|
98
|
+
eta: 'Previsto {when}',
|
|
99
|
+
empty: 'Aquí todavía no hay nada',
|
|
100
|
+
nobodyYet: 'Todavía no hay nadie en la tabla: el primero pone la marca',
|
|
101
|
+
you: 'Tú',
|
|
102
|
+
total: 'Total',
|
|
103
|
+
points: '{a} / {b}',
|
|
104
|
+
earned: 'Conseguido',
|
|
105
|
+
notEarned: 'Todavía sin conseguir',
|
|
106
|
+
earnedOn: 'Conseguido {when}',
|
|
107
|
+
best: 'Mejor {n}',
|
|
108
|
+
inARow: '{n} seguidos',
|
|
109
|
+
sortBy: 'Ordenar por',
|
|
110
|
+
morsels: 'morsels',
|
|
111
|
+
target: 'Objetivo {n}',
|
|
112
|
+
fix: 'Corrige esto',
|
|
113
|
+
},
|
|
83
114
|
};
|
|
84
115
|
|
|
85
116
|
/** Host dictionaries merged in by `use()`, keyed by language. */
|
|
86
|
-
const HOST = { en: {}, fi: {} };
|
|
117
|
+
const HOST = { en: {}, fi: {}, es: {} };
|
|
87
118
|
|
|
88
119
|
/** @type {Array<(lang: string) => void>} */
|
|
89
120
|
const listeners = [];
|
|
@@ -123,7 +154,7 @@ if (typeof window !== 'undefined') {
|
|
|
123
154
|
|
|
124
155
|
export const i18n = {
|
|
125
156
|
/** The languages the kit itself ships. A host may add more via `use()`. */
|
|
126
|
-
langs: ['en', 'fi'],
|
|
157
|
+
langs: ['en', 'fi', 'es'],
|
|
127
158
|
|
|
128
159
|
/** The language in force right now. @returns {string} */
|
|
129
160
|
lang() { return current; },
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* modalI18n/buildMarkup/wire/refreshSession/init — runs init() on DOM ready.
|
|
14
14
|
* @usage <div id="aimeat-header"></div><script src="/v1/libs/aimeat-header.js"></script>
|
|
15
15
|
* @version-history
|
|
16
|
+
* v1.2.0 — 2026-08-12 — Spanish added. The language switch and readLang() come off one LANGS list
|
|
17
|
+
* instead of naming the languages in five places.
|
|
16
18
|
* v1.1.0 — 2026-08-09 — Same anon/auth split as the SPA header: "How it works" and "For your
|
|
17
19
|
* business" (data-anon-only) step aside for Apps/Profile/Admin once there is a session. Drops
|
|
18
20
|
* "Try it" (it pointed at /v1/classic, which the landing already leads to) and "For Developers"
|
|
@@ -28,6 +30,8 @@ if (!window.__AIMEAT_HEADER_MOUNTED__) {
|
|
|
28
30
|
function main() {
|
|
29
31
|
var THEME_KEY = 'aimeat-theme';
|
|
30
32
|
var LANG_KEY = 'aimeat-lang';
|
|
33
|
+
// The languages the node ships UI text in. Mirrors LOCALES in src/i18n.ts.
|
|
34
|
+
var LANGS = ['en', 'fi', 'es'];
|
|
31
35
|
var NAV_FALLBACK = {
|
|
32
36
|
'nav.howItWorks': 'How it works', 'nav.business': 'For your business', 'nav.help': 'Help',
|
|
33
37
|
'nav.apps': 'Apps', 'nav.profile': 'Profile', 'nav.admin': 'Admin',
|
|
@@ -37,11 +41,12 @@ function main() {
|
|
|
37
41
|
function readLang() {
|
|
38
42
|
try {
|
|
39
43
|
var u = new URLSearchParams(location.search).get('lang');
|
|
40
|
-
if (u
|
|
44
|
+
if (LANGS.indexOf(u) !== -1) return u;
|
|
41
45
|
var s = localStorage.getItem(LANG_KEY);
|
|
42
|
-
if (s
|
|
46
|
+
if (LANGS.indexOf(s) !== -1) return s;
|
|
43
47
|
} catch { /* storage blocked */ }
|
|
44
|
-
|
|
48
|
+
var nav = (navigator.language || 'en').slice(0, 2).toLowerCase();
|
|
49
|
+
return LANGS.indexOf(nav) !== -1 ? nav : 'en';
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
function readTheme() {
|
|
@@ -168,8 +173,9 @@ function main() {
|
|
|
168
173
|
'<a href="' + nodeHref('/v1/admin') + '" data-operator-only style="display:none">' + label('nav.admin') + '</a>' +
|
|
169
174
|
'<div class="topnav-center">' +
|
|
170
175
|
// Theme toggle now lives inside the login pill (mountLoginButton) — see init().
|
|
171
|
-
|
|
172
|
-
|
|
176
|
+
LANGS.map(function (l) {
|
|
177
|
+
return '<button class="lang-btn" data-lang="' + l + '">' + l.toUpperCase() + '</button>';
|
|
178
|
+
}).join('') +
|
|
173
179
|
'</div>' +
|
|
174
180
|
'</div>' +
|
|
175
181
|
'<span class="header-auth-slot" id="headerAuth"></span>' +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aimeat",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "AIME AT - AI Memory Exchange and Action Transfer - reference implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -192,6 +192,9 @@
|
|
|
192
192
|
"check:silent-catch": "tsx scripts/check-silent-catch.ts",
|
|
193
193
|
"check:js-syntax": "node --experimental-vm-modules --import tsx scripts/check-js-syntax.ts",
|
|
194
194
|
"check:ai-disclosure": "tsx scripts/check-ai-disclosure.ts",
|
|
195
|
+
"check:locales": "tsx scripts/check-locales.ts",
|
|
196
|
+
"locale:extract": "tsx scripts/locale-extract.ts",
|
|
197
|
+
"locale:merge": "tsx scripts/locale-merge.ts",
|
|
195
198
|
"screenshot:worker": "tsx scripts/screenshot-worker.ts",
|
|
196
199
|
"generate:types": "openapi-typescript ../openapi.yaml -o src/generated/api-types.ts",
|
|
197
200
|
"db:reset": "node --env-file=.env --import tsx scripts/db-reset.ts",
|