@fiodos/web-core 0.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/LICENSE +77 -0
- package/dist/cjs/adapters/webNavigationAdapter.d.ts +31 -0
- package/dist/cjs/adapters/webNavigationAdapter.js +45 -0
- package/dist/cjs/adapters/webStorageAdapter.d.ts +13 -0
- package/dist/cjs/adapters/webStorageAdapter.js +57 -0
- package/dist/cjs/adapters/webVoiceAdapter.d.ts +16 -0
- package/dist/cjs/adapters/webVoiceAdapter.js +477 -0
- package/dist/cjs/api/backendClient.d.ts +31 -0
- package/dist/cjs/api/backendClient.js +182 -0
- package/dist/cjs/api/backendTelemetry.d.ts +23 -0
- package/dist/cjs/api/backendTelemetry.js +80 -0
- package/dist/cjs/api/clientBootstrap.d.ts +44 -0
- package/dist/cjs/api/clientBootstrap.js +68 -0
- package/dist/cjs/api/errors.d.ts +11 -0
- package/dist/cjs/api/errors.js +16 -0
- package/dist/cjs/bridge/createBridge.d.ts +13 -0
- package/dist/cjs/bridge/createBridge.js +15 -0
- package/dist/cjs/config/types.d.ts +63 -0
- package/dist/cjs/config/types.js +9 -0
- package/dist/cjs/context/screenContextStore.d.ts +26 -0
- package/dist/cjs/context/screenContextStore.js +25 -0
- package/dist/cjs/controller/AgentController.d.ts +115 -0
- package/dist/cjs/controller/AgentController.js +594 -0
- package/dist/cjs/core/turnEngine.d.ts +70 -0
- package/dist/cjs/core/turnEngine.js +96 -0
- package/dist/cjs/dropin/createFiodosAgent.d.ts +60 -0
- package/dist/cjs/dropin/createFiodosAgent.js +143 -0
- package/dist/cjs/dropin/createFyodosAgent.d.ts +60 -0
- package/dist/cjs/dropin/createFyodosAgent.js +143 -0
- package/dist/cjs/index.d.ts +45 -0
- package/dist/cjs/index.js +67 -0
- package/dist/cjs/orb/mountOrb.d.ts +24 -0
- package/dist/cjs/orb/mountOrb.js +694 -0
- package/dist/cjs/orb/orbView.d.ts +56 -0
- package/dist/cjs/orb/orbView.js +426 -0
- package/dist/cjs/orb/publishedConfig.d.ts +32 -0
- package/dist/cjs/orb/publishedConfig.js +70 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/speech/speechSession.d.ts +35 -0
- package/dist/cjs/speech/speechSession.js +60 -0
- package/dist/cjs/ui/messages.d.ts +36 -0
- package/dist/cjs/ui/messages.js +41 -0
- package/dist/esm/adapters/webNavigationAdapter.d.ts +31 -0
- package/dist/esm/adapters/webNavigationAdapter.js +41 -0
- package/dist/esm/adapters/webStorageAdapter.d.ts +13 -0
- package/dist/esm/adapters/webStorageAdapter.js +54 -0
- package/dist/esm/adapters/webVoiceAdapter.d.ts +16 -0
- package/dist/esm/adapters/webVoiceAdapter.js +474 -0
- package/dist/esm/api/backendClient.d.ts +31 -0
- package/dist/esm/api/backendClient.js +178 -0
- package/dist/esm/api/backendTelemetry.d.ts +23 -0
- package/dist/esm/api/backendTelemetry.js +77 -0
- package/dist/esm/api/clientBootstrap.d.ts +44 -0
- package/dist/esm/api/clientBootstrap.js +63 -0
- package/dist/esm/api/errors.d.ts +11 -0
- package/dist/esm/api/errors.js +11 -0
- package/dist/esm/bridge/createBridge.d.ts +13 -0
- package/dist/esm/bridge/createBridge.js +12 -0
- package/dist/esm/config/types.d.ts +63 -0
- package/dist/esm/config/types.js +6 -0
- package/dist/esm/context/screenContextStore.d.ts +26 -0
- package/dist/esm/context/screenContextStore.js +22 -0
- package/dist/esm/controller/AgentController.d.ts +115 -0
- package/dist/esm/controller/AgentController.js +590 -0
- package/dist/esm/core/turnEngine.d.ts +70 -0
- package/dist/esm/core/turnEngine.js +92 -0
- package/dist/esm/dropin/createFiodosAgent.d.ts +60 -0
- package/dist/esm/dropin/createFiodosAgent.js +140 -0
- package/dist/esm/dropin/createFyodosAgent.d.ts +60 -0
- package/dist/esm/dropin/createFyodosAgent.js +140 -0
- package/dist/esm/index.d.ts +45 -0
- package/dist/esm/index.js +38 -0
- package/dist/esm/orb/mountOrb.d.ts +24 -0
- package/dist/esm/orb/mountOrb.js +691 -0
- package/dist/esm/orb/orbView.d.ts +56 -0
- package/dist/esm/orb/orbView.js +421 -0
- package/dist/esm/orb/publishedConfig.d.ts +32 -0
- package/dist/esm/orb/publishedConfig.js +67 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/speech/speechSession.d.ts +35 -0
- package/dist/esm/speech/speechSession.js +57 -0
- package/dist/esm/ui/messages.d.ts +36 -0
- package/dist/esm/ui/messages.js +38 -0
- package/package.json +38 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI strings for the web orb (buttons, modal titles, consent copy). Spoken
|
|
3
|
+
* agent messages come from @fiodos/core's AgentMessages; these are only the
|
|
4
|
+
* DOM-chrome labels the orb renders. English and Spanish ship built-in.
|
|
5
|
+
*/
|
|
6
|
+
export interface WebUiMessages {
|
|
7
|
+
/** Accessible label for the orb button. */
|
|
8
|
+
orbLabel: string;
|
|
9
|
+
/** Confirmation modal title. */
|
|
10
|
+
confirmTitle: string;
|
|
11
|
+
/** Confirm button label. */
|
|
12
|
+
confirmLabel: string;
|
|
13
|
+
/** Cancel button label. */
|
|
14
|
+
cancelLabel: string;
|
|
15
|
+
/** Consent modal title. */
|
|
16
|
+
consentTitle: string;
|
|
17
|
+
/** Consent body paragraph. */
|
|
18
|
+
consentBody: string;
|
|
19
|
+
/** Consent accept button. */
|
|
20
|
+
consentAccept: string;
|
|
21
|
+
/** Consent decline button. */
|
|
22
|
+
consentDecline: string;
|
|
23
|
+
/** Placeholder for the text input bubble. */
|
|
24
|
+
textPlaceholder: string;
|
|
25
|
+
/** Accessible label for the keyboard chip beside the orb. */
|
|
26
|
+
keyboardChipLabel: string;
|
|
27
|
+
/** Send button label for the text bubble. */
|
|
28
|
+
sendLabel: string;
|
|
29
|
+
/** Spoken/shown when the browser lacks speech recognition. */
|
|
30
|
+
voiceUnavailable: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ResolveUiMessagesOptions {
|
|
33
|
+
catalogs?: Record<string, WebUiMessages>;
|
|
34
|
+
overrides?: Partial<WebUiMessages>;
|
|
35
|
+
}
|
|
36
|
+
export declare function resolveUiMessages(locale: string, options?: ResolveUiMessagesOptions): WebUiMessages;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
orbLabel: 'Voice assistant',
|
|
3
|
+
confirmTitle: 'Confirm',
|
|
4
|
+
confirmLabel: 'Confirm',
|
|
5
|
+
cancelLabel: 'Cancel',
|
|
6
|
+
consentTitle: 'Voice assistant',
|
|
7
|
+
consentBody: 'This assistant uses your microphone to understand voice commands and may navigate or perform actions in this app on your behalf. Your speech is processed to answer you and is not stored as a transcript.',
|
|
8
|
+
consentAccept: 'Allow',
|
|
9
|
+
consentDecline: 'Not now',
|
|
10
|
+
textPlaceholder: 'Type a message…',
|
|
11
|
+
keyboardChipLabel: 'Type instead of talking',
|
|
12
|
+
sendLabel: 'Send',
|
|
13
|
+
voiceUnavailable: 'Voice input is not available in this browser. You can type instead.',
|
|
14
|
+
};
|
|
15
|
+
const es = {
|
|
16
|
+
orbLabel: 'Asistente de voz',
|
|
17
|
+
confirmTitle: 'Confirmar',
|
|
18
|
+
confirmLabel: 'Confirmar',
|
|
19
|
+
cancelLabel: 'Cancelar',
|
|
20
|
+
consentTitle: 'Asistente de voz',
|
|
21
|
+
consentBody: 'Este asistente usa tu micrófono para entender comandos de voz y puede navegar o realizar acciones en esta app en tu nombre. Tu voz se procesa para responderte y no se guarda como transcripción.',
|
|
22
|
+
consentAccept: 'Permitir',
|
|
23
|
+
consentDecline: 'Ahora no',
|
|
24
|
+
textPlaceholder: 'Escribe un mensaje…',
|
|
25
|
+
keyboardChipLabel: 'Escribir en lugar de hablar',
|
|
26
|
+
sendLabel: 'Enviar',
|
|
27
|
+
voiceUnavailable: 'La entrada por voz no está disponible en este navegador. Puedes escribir.',
|
|
28
|
+
};
|
|
29
|
+
const CATALOGS = { en, es };
|
|
30
|
+
function baseLanguage(locale) {
|
|
31
|
+
return locale.split(/[-_]/)[0]?.toLowerCase() ?? locale.toLowerCase();
|
|
32
|
+
}
|
|
33
|
+
export function resolveUiMessages(locale, options = {}) {
|
|
34
|
+
const externals = options.catalogs ?? {};
|
|
35
|
+
const base = baseLanguage(locale);
|
|
36
|
+
const resolved = externals[locale] ?? CATALOGS[locale] ?? externals[base] ?? CATALOGS[base] ?? en;
|
|
37
|
+
return options.overrides ? { ...resolved, ...options.overrides } : resolved;
|
|
38
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fiodos/web-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Framework-agnostic browser layer for the Fiodos agent: a vanilla AgentController (orchestrator), DOM adapters (navigation/voice/storage), HTTP client and decision engine over @fiodos/core. Shared base for @fiodos/vue, @fiodos/svelte and @fiodos/angular (no framework imports).",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/cjs/index.js",
|
|
10
|
+
"module": "./dist/esm/index.js",
|
|
11
|
+
"types": "./dist/esm/index.d.ts",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/esm/index.d.ts",
|
|
16
|
+
"import": "./dist/esm/index.js",
|
|
17
|
+
"require": "./dist/cjs/index.js",
|
|
18
|
+
"default": "./dist/esm/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && node ../../scripts/fix-esm-extensions.mjs dist/esm && node ../../scripts/mark-dual.mjs",
|
|
27
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
28
|
+
"test": "node --import tsx --test test/*.test.ts"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@fiodos/core": "0.1.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^22.0.0",
|
|
35
|
+
"tsx": "^4.19.0",
|
|
36
|
+
"typescript": "^5.6.0"
|
|
37
|
+
}
|
|
38
|
+
}
|