@skaile/forge-layer-core 1.1.0 → 1.3.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.
@@ -43,6 +43,30 @@ export const de: CoreMessages = {
43
43
  'core.login.accountGone': 'Dieses Konto gibt es nicht mehr',
44
44
  'core.login.passkeyUnknown': 'Diesen Passkey kennt die App nicht',
45
45
  'core.login.passkeyCheckFailed': 'Die Prüfung des Passkeys ist fehlgeschlagen',
46
+ 'core.login.emailModeHint': 'Wir schicken dir einen Code und einen Link zum Anmelden.',
47
+ 'core.login.sendCode': 'Code senden',
48
+ 'core.login.codeTitle': 'Code eingeben',
49
+ 'core.login.codeHint': 'Wir haben einen Code an {email} geschickt. Er gilt {minutes} Minuten.',
50
+ 'core.login.code': 'Code',
51
+ 'core.login.otherAddress': 'Andere Adresse',
52
+ 'core.login.resendCode': 'Code erneut senden',
53
+ 'core.login.resendCodeIn': 'Erneut senden in {time}',
54
+ 'core.login.codeSent': 'Wenn die Adresse bekannt ist, kommt gleich eine E-Mail.',
55
+ 'core.login.wrongCode': 'Der Code stimmt nicht.',
56
+ 'core.login.expiredCode': 'Der Code ist abgelaufen.',
57
+ 'core.login.tooManyAttempts': 'Zu viele Versuche. Fordere einen neuen Code an.',
58
+ 'core.login.tooManyCodes': 'Zu viele Codes angefordert. Versuch es in einer Stunde wieder.',
59
+ 'core.login.mailFailed': 'Die E-Mail konnte nicht gesendet werden. Versuch es später noch einmal.',
60
+ 'core.login.invalidLink': 'Der Anmeldelink ist nicht mehr gültig. Fordere einen neuen Code an.',
61
+ 'core.login.expiredLink': 'Der Anmeldelink ist abgelaufen. Fordere einen neuen Code an.',
62
+ 'core.login.tooManyLinks': 'Zu viele Anmeldelinks für diese Person. Versuch es in einer Stunde wieder.',
63
+ 'core.login.mailSubject': 'Dein Anmeldecode für {app}',
64
+ 'core.login.mailCode': 'Dein Anmeldecode für {app}: {code}',
65
+ 'core.login.mailCodeIntro': 'Dein Anmeldecode für {app}:',
66
+ 'core.login.mailValidity': 'Er gilt {minutes} Minuten und nur einmal. Oder melde dich mit diesem Link an:',
67
+ 'core.login.mailValidityOneClick': 'Er gilt {minutes} Minuten und nur einmal. Oder melde dich mit einem Klick an:',
68
+ 'core.login.mailLinkLabel': 'Bei {app} anmelden',
69
+ 'core.login.mailIgnore': 'Wenn du keinen Code angefordert hast, kannst du diese E-Mail ignorieren.',
46
70
 
47
71
  'core.appearance.system': 'System',
48
72
  'core.appearance.light': 'Hell',
@@ -84,6 +108,18 @@ export const de: CoreMessages = {
84
108
  'core.settings.app.timezone': 'IANA-Zeitzone für Datumsangaben und Übersichten, z. B. Europe/Berlin',
85
109
  'core.settings.app.appName.title': 'Name der App',
86
110
  'core.settings.app.timezone.title': 'Zeitzone',
111
+ 'core.settings.assistantPolicy.label': 'Assistent: Modelle und Engine',
112
+ 'core.settings.assistantPolicy.description':
113
+ 'Auf welchen Modellen Personen den Assistenten nutzen dürfen, worauf ein Gespräch läuft und was es erreicht',
114
+ 'core.settings.assistantPolicy.ownModels':
115
+ 'Personen können den Assistenten im Profil mit eigenem Anbieter, Modell und Schlüssel nutzen. Aus: alle nutzen das Modell der App.',
116
+ 'core.settings.assistantPolicy.ownModels.title': 'Eigene Modelle erlauben',
117
+ 'core.settings.assistantPolicy.engine':
118
+ 'Worauf ein neues Gespräch läuft, wenn beides geht: der Chat im App-Server (app) oder der SKAILE-Agent (skaile). Kann die gewählte Engine nicht laufen, springt die andere ein.',
119
+ 'core.settings.assistantPolicy.engine.title': 'Engine',
120
+ 'core.settings.assistantPolicy.chatAccess':
121
+ 'Was der Chat im App-Server erreicht. actions: jede Aktion, die ein Modell aufrufen darf, mit den Rechten der Person. document: nur den Datensatz der offenen Seite, Änderungen sind Vorschläge, die die Person anwendet.',
122
+ 'core.settings.assistantPolicy.chatAccess.title': 'Zugriff des Chats',
87
123
 
88
124
  'core.agents.title': 'Agenten',
89
125
  'core.agents.empty': 'Keine Agenten installiert',
@@ -153,14 +189,17 @@ export const de: CoreMessages = {
153
189
  'core.assistant.defaultName': 'Assistent',
154
190
  'core.assistant.description': 'Wie {name} für dich arbeitet. Nur du siehst diese Einstellungen.',
155
191
  'core.assistant.fallbackName': 'der Assistent',
156
- 'core.assistant.mode': 'Modus',
157
- 'core.assistant.mode.skaile': 'SKAILE',
192
+ 'core.assistant.mode': 'Modell',
193
+ 'core.assistant.mode.skaile': 'Modell der App',
158
194
  'core.assistant.mode.byok': 'Eigener Schlüssel',
159
195
  'core.assistant.modeHint.skaile':
160
- 'Voller Zugriff auf die App, mit deinen Rechten. Vor dem Löschen fragt er dich im Posteingang.',
196
+ 'Läuft auf dem Modell, das die App stellt, und handelt in der App mit deinen Rechten.',
161
197
  'core.assistant.modeHint.byok':
162
- 'Läuft mit deinem eigenen Anbieter-Schlüssel und sieht nur die Seite, die du offen hast.',
198
+ 'Derselbe Assistent läuft mit deinem eigenen Anbieter, Modell und Schlüssel: dieselben Werkzeuge, deine Rechte.',
199
+ 'core.assistant.modeHint.byokChat': 'Läuft mit deinem eigenen Anbieter, Modell und Schlüssel, mit deinen Rechten.',
163
200
  'core.assistant.notInstalled': 'In dieser App nicht installiert.',
201
+ 'core.assistant.appModelOnly': 'Der Assistent nutzt das Modell der App.',
202
+ 'core.assistant.ownModelsOff': 'Eigene Modelle sind in dieser App ausgeschaltet.',
164
203
  'core.assistant.provider': 'Anbieter',
165
204
  'core.assistant.providerRequired': 'Wähle einen Anbieter',
166
205
  'core.assistant.openaiCompatible': 'OpenAI-kompatibel',
@@ -45,6 +45,30 @@ export const en = {
45
45
  'core.login.accountGone': 'This account no longer exists',
46
46
  'core.login.passkeyUnknown': 'This passkey is not known here',
47
47
  'core.login.passkeyCheckFailed': 'The passkey check failed',
48
+ 'core.login.emailModeHint': 'We mail you a code and a link to sign in.',
49
+ 'core.login.sendCode': 'Send code',
50
+ 'core.login.codeTitle': 'Enter the code',
51
+ 'core.login.codeHint': 'We sent a code to {email}. It is valid for {minutes} minutes.',
52
+ 'core.login.code': 'Code',
53
+ 'core.login.otherAddress': 'Other address',
54
+ 'core.login.resendCode': 'Send the code again',
55
+ 'core.login.resendCodeIn': 'Send again in {time}',
56
+ 'core.login.codeSent': 'If the address is known, an email is on its way.',
57
+ 'core.login.wrongCode': 'The code is wrong.',
58
+ 'core.login.expiredCode': 'The code has expired.',
59
+ 'core.login.tooManyAttempts': 'Too many attempts. Ask for a new code.',
60
+ 'core.login.tooManyCodes': 'Too many codes requested. Try again in an hour.',
61
+ 'core.login.mailFailed': 'The email could not be sent. Try again later.',
62
+ 'core.login.invalidLink': 'The sign-in link is no longer valid. Ask for a new code.',
63
+ 'core.login.expiredLink': 'The sign-in link has expired. Ask for a new code.',
64
+ 'core.login.tooManyLinks': 'Too many sign-in links for this person. Try again in an hour.',
65
+ 'core.login.mailSubject': 'Your sign-in code for {app}',
66
+ 'core.login.mailCode': 'Your sign-in code for {app}: {code}',
67
+ 'core.login.mailCodeIntro': 'Your sign-in code for {app}:',
68
+ 'core.login.mailValidity': 'It is valid for {minutes} minutes and works once. Or sign in with this link:',
69
+ 'core.login.mailValidityOneClick': 'It is valid for {minutes} minutes and works once. Or sign in with one click:',
70
+ 'core.login.mailLinkLabel': 'Sign in to {app}',
71
+ 'core.login.mailIgnore': 'If you did not ask for a code, you can ignore this email.',
48
72
 
49
73
  'core.appearance.system': 'System',
50
74
  'core.appearance.light': 'Light',
@@ -86,6 +110,18 @@ export const en = {
86
110
  'core.settings.app.timezone': 'IANA time zone for dates and digests, e.g. Europe/Berlin',
87
111
  'core.settings.app.appName.title': 'App name',
88
112
  'core.settings.app.timezone.title': 'Time zone',
113
+ 'core.settings.assistantPolicy.label': 'Assistant: models and engine',
114
+ 'core.settings.assistantPolicy.description':
115
+ 'Which models people may run the assistant on, what a conversation runs on and what it reaches',
116
+ 'core.settings.assistantPolicy.ownModels':
117
+ "People can use the assistant with their own provider, model and key in their profile. Off: everyone uses the app's model.",
118
+ 'core.settings.assistantPolicy.ownModels.title': 'Allow own models',
119
+ 'core.settings.assistantPolicy.engine':
120
+ 'What a new conversation runs on when both can: the chat in the app server (app) or the SKAILE agent (skaile). The other one steps in when the chosen one cannot run.',
121
+ 'core.settings.assistantPolicy.engine.title': 'Engine',
122
+ 'core.settings.assistantPolicy.chatAccess':
123
+ 'What the chat in the app server reaches. actions: every action a model may call, with the rights of the person. document: only the record the page shows, and changes are proposals the person applies.',
124
+ 'core.settings.assistantPolicy.chatAccess.title': 'Access of the chat',
89
125
 
90
126
  'core.agents.title': 'Agents',
91
127
  'core.agents.empty': 'No agents installed',
@@ -154,12 +190,16 @@ export const en = {
154
190
  'core.assistant.defaultName': 'Assistant',
155
191
  'core.assistant.description': 'How {name} works for you. Only you see these settings.',
156
192
  'core.assistant.fallbackName': 'the assistant',
157
- 'core.assistant.mode': 'Mode',
158
- 'core.assistant.mode.skaile': 'SKAILE',
193
+ 'core.assistant.mode': 'Model',
194
+ 'core.assistant.mode.skaile': "App's model",
159
195
  'core.assistant.mode.byok': 'Own key',
160
- 'core.assistant.modeHint.skaile': 'Full access to the app, with your rights. Deleting asks you first in the Inbox.',
161
- 'core.assistant.modeHint.byok': 'Runs on your own provider key and sees only the page you have open.',
196
+ 'core.assistant.modeHint.skaile': 'Runs on the model the app provides and acts in the app with your rights.',
197
+ 'core.assistant.modeHint.byok':
198
+ 'Runs the same assistant on your own provider, model and key: the same tools, your rights.',
199
+ 'core.assistant.modeHint.byokChat': 'Runs on your own provider, model and key, with your rights.',
162
200
  'core.assistant.notInstalled': 'Not installed in this app.',
201
+ 'core.assistant.appModelOnly': "The assistant uses the app's model.",
202
+ 'core.assistant.ownModelsOff': 'Own models are switched off in this app.',
163
203
  'core.assistant.provider': 'Provider',
164
204
  'core.assistant.providerRequired': 'Pick a provider',
165
205
  'core.assistant.openaiCompatible': 'OpenAI-compatible',
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Sign-in by mail (`APP_AUTH_MODE=email`): the limits the server enforces and
3
+ * the login page shows. The texts are `core.login.*` in `shared/messages/`.
4
+ */
5
+
6
+ /** A code and its link are valid this long. */
7
+ export const LOGIN_CODE_TTL_MINUTES = 10
8
+ /** At most this many codes per address, and sign-in links per person, within an hour. */
9
+ export const MAX_CODES_PER_HOUR = 5
10
+ /** The fifth wrong entry kills the code. */
11
+ export const MAX_CODE_ATTEMPTS = 5
12
+ /** The login page offers "Send the code again" this long after each send. */
13
+ export const RESEND_AFTER_SECONDS = 60
14
+ export const LOGIN_CODE_LENGTH = 6
15
+
16
+ /**
17
+ * Where a sign-in may lead: an app-relative path (`/projects/42`), never
18
+ * another origin (`//evil.example`, `/\evil.example`, `https://…`). Anything
19
+ * else becomes `/`.
20
+ */
21
+ export function safeNextPath(next: unknown): string {
22
+ if (typeof next !== 'string' || !next.startsWith('/') || next.startsWith('//') || next.startsWith('/\\')) return '/'
23
+ for (let i = 0; i < next.length; i++) {
24
+ const code = next.charCodeAt(i)
25
+ if (code < 0x20 || code === 0x7f) return '/'
26
+ }
27
+ return next
28
+ }