arcane-os 0.2.3 → 0.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.
- package/CHANGELOG.md +17 -0
- package/README.md +8 -8
- package/browser-runtime/ARCANE_SDK_BROWSER_RELEASE.json +29 -22
- package/browser-runtime/ai/ARCANE_AI_BROWSER_SPEECH_COMPONENTS.json +203 -0
- package/browser-runtime/ai/browser-kokoro-worker.mjs +11 -2
- package/browser-runtime/ai/browser-speech-artifacts.mjs +3230 -397
- package/browser-runtime/ai/browser-speech-providers.mjs +1141 -157
- package/browser-runtime/ai/browser-speech.mjs +2 -0
- package/browser-runtime/ai/browser-whisper-worker.mjs +11 -2
- package/browser-runtime/ai/model-controller.mjs +285 -95
- package/browser-runtime/ai/speech-worker-client.mjs +247 -32
- package/browser-runtime/ai/speech-worker-runtime.mjs +2310 -167
- package/browser-runtime/event-manager.mjs +1097 -1
- package/docs/architecture.md +2 -2
- package/docs/event-manager.md +155 -27
- package/docs/reference/README.md +20 -20
- package/docs/reference/ai/browser-speech-package-authority.json +835 -0
- package/docs/reference/ai/browser-speech.md +1162 -246
- package/docs/reference/ai/browser-wasm.md +18 -7
- package/docs/reference/availability-and-normalization.md +2 -2
- package/docs/reference/behavioral-testing.md +28 -5
- package/docs/reference/cli.md +115 -7
- package/docs/reference/core/arcane-ai-contracts.md +1 -1
- package/docs/reference/event-manager.md +577 -32
- package/docs/reference/inventory/package-api.json +478 -2
- package/docs/reference/inventory/runtime-components.json +86 -37
- package/docs/reference/inventory/runtime-modules.json +126 -49
- package/docs/reference/mail.md +316 -0
- package/docs/reference/protocols.md +143 -33
- package/docs/reference/runtime-components.md +192 -80
- package/docs/reference/runtime-modules.md +584 -70
- package/docs/reference/sdk-api.md +1014 -25
- package/package.json +5 -4
- package/runtime/ARCANE_RUNTIME_RELEASE.json +145 -140
- package/runtime/arcane/components/app-bar.html +34 -13
- package/runtime/arcane/components/assistant-panel.html +110 -57
- package/runtime/arcane/components/calculator.html +7 -4
- package/runtime/arcane/components/chart.html +58 -17
- package/runtime/arcane/components/chat.html +606 -136
- package/runtime/arcane/components/conversation-view.html +13 -6
- package/runtime/arcane/components/dashboard-config.html +96 -59
- package/runtime/arcane/components/data-maintenance.html +69 -14
- package/runtime/arcane/components/data-view.html +53 -7
- package/runtime/arcane/components/directory-picker.html +118 -32
- package/runtime/arcane/components/document-inspector.html +47 -10
- package/runtime/arcane/components/file-drop.html +81 -35
- package/runtime/arcane/components/file-inspector.html +72 -22
- package/runtime/arcane/components/file-manager.html +374 -79
- package/runtime/arcane/components/integration-settings.html +12 -5
- package/runtime/arcane/components/local-ai-status.html +48 -19
- package/runtime/arcane/components/markdown-document.html +161 -68
- package/runtime/arcane/components/markdown-editor.html +110 -33
- package/runtime/arcane/components/media-embed.html +8 -5
- package/runtime/arcane/components/modal.html +15 -5
- package/runtime/arcane/components/output-panel.html +28 -23
- package/runtime/arcane/components/preferences-form.html +22 -4
- package/runtime/arcane/components/record-timeline.html +18 -2
- package/runtime/arcane/components/relationship-board.html +23 -3
- package/runtime/arcane/components/screen-capture.html +10 -4
- package/runtime/arcane/components/source-code-viewer.html +76 -9
- package/runtime/arcane/components/source-explanation.html +23 -3
- package/runtime/arcane/components/speech.html +453 -131
- package/runtime/arcane/components/summary-strip.html +22 -11
- package/runtime/arcane/components/table.html +39 -21
- package/runtime/arcane/components/task-progress.html +79 -21
- package/runtime/arcane/components/terminal-workspace.html +7 -4
- package/runtime/arcane/components/theme-editor.html +7 -3
- package/runtime/arcane/components/unified-inbox.html +9 -4
- package/runtime/arcane/components/voice-transcription.html +244 -72
- package/runtime/arcane/components/weather-widget.html +5 -3
- package/runtime/arcane/components/web-navigator.html +48 -8
- package/runtime/arcane/entities/Chat.js +1 -1
- package/runtime/arcane/entities/User.js +110 -23
- package/runtime/arcane/modules/AI.js +2109 -130
- package/runtime/arcane/modules/AIProviderRuntime.js +720 -13
- package/runtime/arcane/modules/AIRuntimeState.js +109 -52
- package/runtime/arcane/modules/ApiModelDatabase.js +390 -17
- package/runtime/arcane/modules/BrowserTestSuite.js +205 -28
- package/runtime/arcane/modules/CalculatorEngine.js +63 -3
- package/runtime/arcane/modules/CommunicationAppController.js +588 -28
- package/runtime/arcane/modules/CommunicationHub.js +590 -10
- package/runtime/arcane/modules/ComponentContracts.js +235 -37
- package/runtime/arcane/modules/ConversationTimebox.js +152 -33
- package/runtime/arcane/modules/DBLS.js +40 -7
- package/runtime/arcane/modules/DBOPFS.js +35 -11
- package/runtime/arcane/modules/DataMaintenance.js +12 -2
- package/runtime/arcane/modules/Errors.js +65 -7
- package/runtime/arcane/modules/HTMLImport.js +198 -14
- package/runtime/arcane/modules/LocalAIReadinessController.js +208 -29
- package/runtime/arcane/modules/Mail.js +738 -115
- package/runtime/arcane/modules/MailOutbox.mjs +1395 -0
- package/runtime/arcane/modules/MailTransport.mjs +197 -39
- package/runtime/arcane/modules/Ollama.js +36 -1
- package/runtime/arcane/modules/OpenMeteoWeatherProvider.js +583 -7
- package/runtime/arcane/modules/PreferenceStore.js +367 -33
- package/runtime/arcane/modules/RecordReviewStore.js +322 -23
- package/runtime/arcane/modules/ScreenCapture.js +1397 -15
- package/runtime/arcane/modules/SpeechPlayback.js +438 -41
- package/runtime/arcane/modules/TerminalClient.js +277 -12
- package/runtime/arcane/modules/ThemeBootstrap.js +80 -6
- package/runtime/arcane/modules/ThemeManager.js +39 -7
- package/runtime/arcane/modules/TimeGuard.js +131 -20
- package/runtime/arcane/modules/WaitForComponent.js +386 -33
- package/schemas/arcane-lock.schema.json +2 -2
- package/src/cli/main.mjs +435 -9
- package/src/event-manager.mjs +1097 -1
- package/src/import-map.mjs +21 -3
- package/src/index.mjs +13 -0
- package/src/installed-sdk-runtime.mjs +112 -0
- package/src/mail-api.mjs +22 -0
- package/src/mail-credentials.mjs +667 -0
- package/src/mail-server.mjs +1769 -0
- package/src/mail.mjs +261 -0
- package/src/sdk-browser-runtime.mjs +85 -41
- package/src/testing-loader.mjs +7 -0
- package/src/toolchain.mjs +3 -0
- package/src/workspace.mjs +1 -1
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import Is from '../../node_modules/strong-type/index.js';
|
|
2
2
|
import DBLS from '../modules/DBLS.js';
|
|
3
|
+
import {
|
|
4
|
+
arcaneEvents,
|
|
5
|
+
createArcaneEventSource,
|
|
6
|
+
projectArcaneDOMEvent
|
|
7
|
+
} from 'arcane-os/event-manager';
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* DBOPFS Module
|
|
@@ -47,6 +52,17 @@ const is = new Is(false);
|
|
|
47
52
|
const EMAIL_REGEX =
|
|
48
53
|
/^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
49
54
|
|
|
55
|
+
const USER_ENTITY_LOADED_EVENT='user-entity-loaded';
|
|
56
|
+
const USER_ENTITY_LOADED_REASON='user-data-loaded';
|
|
57
|
+
let singletonDBOPFSReadyUnsubscribe=null;
|
|
58
|
+
|
|
59
|
+
function userEntityLifecycleError(code,reason,message){
|
|
60
|
+
const error=new Error(message);
|
|
61
|
+
error.code=code;
|
|
62
|
+
error.reason=reason;
|
|
63
|
+
return error;
|
|
64
|
+
}
|
|
65
|
+
|
|
50
66
|
|
|
51
67
|
/**
|
|
52
68
|
* Canonical schema for a UserEntity record.
|
|
@@ -85,6 +101,16 @@ const EMAIL_REGEX =
|
|
|
85
101
|
|
|
86
102
|
class UserEntity {
|
|
87
103
|
|
|
104
|
+
#events;
|
|
105
|
+
|
|
106
|
+
#disposed = false;
|
|
107
|
+
|
|
108
|
+
#loadGeneration = 0;
|
|
109
|
+
|
|
110
|
+
#operationSequence = 0;
|
|
111
|
+
|
|
112
|
+
#stopDBOPFSReady = null;
|
|
113
|
+
|
|
88
114
|
/** @type {string} */
|
|
89
115
|
#tableName = 'users';
|
|
90
116
|
|
|
@@ -192,14 +218,22 @@ class UserEntity {
|
|
|
192
218
|
}
|
|
193
219
|
|
|
194
220
|
this.fileName = fileName;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
);
|
|
221
|
+
this.#events=createArcaneEventSource(this,{
|
|
222
|
+
source:'user-entity',
|
|
223
|
+
eventTypes:Object.freeze([USER_ENTITY_LOADED_EVENT])
|
|
224
|
+
});
|
|
200
225
|
|
|
201
226
|
if(window.dbopfs?.ready){
|
|
202
227
|
this.load();
|
|
228
|
+
}else{
|
|
229
|
+
this.#stopDBOPFSReady=arcaneEvents.subscribe(
|
|
230
|
+
'dbopfs-ready',
|
|
231
|
+
()=>{
|
|
232
|
+
this.#stopDBOPFSReady=null;
|
|
233
|
+
this.load();
|
|
234
|
+
},
|
|
235
|
+
{once:true}
|
|
236
|
+
);
|
|
203
237
|
}
|
|
204
238
|
|
|
205
239
|
return this;
|
|
@@ -912,6 +946,14 @@ class UserEntity {
|
|
|
912
946
|
* only await if you need to ensure data is loaded before proceeding
|
|
913
947
|
*/
|
|
914
948
|
async load(){
|
|
949
|
+
if(this.#disposed){
|
|
950
|
+
throw userEntityLifecycleError(
|
|
951
|
+
'ARCANE_USER_ENTITY_DISPOSED',
|
|
952
|
+
'user-entity-disposed',
|
|
953
|
+
'The user entity has been disposed.'
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
|
|
915
957
|
if(this.ready){
|
|
916
958
|
return this.explicit;
|
|
917
959
|
}
|
|
@@ -920,12 +962,17 @@ class UserEntity {
|
|
|
920
962
|
return this.#loadPromise;
|
|
921
963
|
}
|
|
922
964
|
|
|
923
|
-
this.#
|
|
965
|
+
const generation=++this.#loadGeneration;
|
|
966
|
+
const operationId=`${this.#events.instanceId}:load:${(++this.#operationSequence).toString(36)}`;
|
|
967
|
+
const loadPromise=this.#load(generation,operationId);
|
|
968
|
+
this.#loadPromise=loadPromise;
|
|
924
969
|
|
|
925
970
|
try{
|
|
926
|
-
return await
|
|
971
|
+
return await loadPromise;
|
|
927
972
|
}finally{
|
|
928
|
-
this.#loadPromise
|
|
973
|
+
if(this.#loadPromise===loadPromise){
|
|
974
|
+
this.#loadPromise=null;
|
|
975
|
+
}
|
|
929
976
|
}
|
|
930
977
|
}
|
|
931
978
|
|
|
@@ -956,12 +1003,26 @@ class UserEntity {
|
|
|
956
1003
|
return this.explicit;
|
|
957
1004
|
}
|
|
958
1005
|
|
|
959
|
-
async #load(){
|
|
1006
|
+
async #load(generation,operationId){
|
|
960
1007
|
const user=await dbopfs.get(
|
|
961
1008
|
this.#tableName,
|
|
962
1009
|
this.fileName
|
|
963
1010
|
);
|
|
964
1011
|
|
|
1012
|
+
if(this.#disposed||generation!==this.#loadGeneration){
|
|
1013
|
+
throw userEntityLifecycleError(
|
|
1014
|
+
this.#disposed
|
|
1015
|
+
?'ARCANE_USER_ENTITY_DISPOSED'
|
|
1016
|
+
:'ARCANE_USER_ENTITY_LOAD_SUPERSEDED',
|
|
1017
|
+
this.#disposed
|
|
1018
|
+
?'user-entity-disposed'
|
|
1019
|
+
:'user-entity-load-superseded',
|
|
1020
|
+
this.#disposed
|
|
1021
|
+
?'The user entity was disposed before its data load settled.'
|
|
1022
|
+
:'The user entity data load was superseded before settlement.'
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
|
|
965
1026
|
if(user){
|
|
966
1027
|
const persist=this.persist;
|
|
967
1028
|
this.persist=false;
|
|
@@ -975,16 +1036,21 @@ class UserEntity {
|
|
|
975
1036
|
|
|
976
1037
|
this.ready=true;
|
|
977
1038
|
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1039
|
+
const {occurrence}=this.#events.dispatch(
|
|
1040
|
+
USER_ENTITY_LOADED_EVENT,
|
|
1041
|
+
Object.freeze({
|
|
1042
|
+
reason:USER_ENTITY_LOADED_REASON,
|
|
1043
|
+
user:this
|
|
1044
|
+
}),
|
|
1045
|
+
{
|
|
1046
|
+
operationId,
|
|
1047
|
+
publicDetail:Object.freeze({
|
|
1048
|
+
ready:true,
|
|
1049
|
+
reason:USER_ENTITY_LOADED_REASON
|
|
1050
|
+
})
|
|
1051
|
+
}
|
|
987
1052
|
);
|
|
1053
|
+
projectArcaneDOMEvent(window,occurrence);
|
|
988
1054
|
|
|
989
1055
|
return this.explicit;
|
|
990
1056
|
}
|
|
@@ -1025,18 +1091,39 @@ class UserEntity {
|
|
|
1025
1091
|
|
|
1026
1092
|
return true;
|
|
1027
1093
|
}
|
|
1028
|
-
}
|
|
1029
1094
|
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1095
|
+
dispose(){
|
|
1096
|
+
if(this.#disposed)return false;
|
|
1097
|
+
this.#disposed=true;
|
|
1098
|
+
this.#loadGeneration+=1;
|
|
1099
|
+
this.ready=false;
|
|
1100
|
+
this.#stopDBOPFSReady?.();
|
|
1101
|
+
this.#stopDBOPFSReady=null;
|
|
1102
|
+
if(window.user===this){
|
|
1103
|
+
delete window.user;
|
|
1104
|
+
singletonDBOPFSReadyUnsubscribe?.();
|
|
1105
|
+
singletonDBOPFSReadyUnsubscribe=null;
|
|
1106
|
+
}
|
|
1107
|
+
return this.#events.dispose();
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
destroy(){
|
|
1111
|
+
return this.dispose();
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1034
1114
|
|
|
1035
1115
|
if(window.dbopfs?.ready){
|
|
1036
1116
|
initSingletonUserEntity();
|
|
1117
|
+
}else{
|
|
1118
|
+
singletonDBOPFSReadyUnsubscribe=arcaneEvents.subscribe(
|
|
1119
|
+
'dbopfs-ready',
|
|
1120
|
+
initSingletonUserEntity,
|
|
1121
|
+
{once:true}
|
|
1122
|
+
);
|
|
1037
1123
|
}
|
|
1038
1124
|
|
|
1039
1125
|
function initSingletonUserEntity(){
|
|
1126
|
+
singletonDBOPFSReadyUnsubscribe=null;
|
|
1040
1127
|
if(!window.user){
|
|
1041
1128
|
window.user = new UserEntity();
|
|
1042
1129
|
}
|